/* ═══════════════════════════════════════════════════════════
   Apollo Labs — apollolabs.lk
   Dark, warm black + brand gold. Fraunces display / Inter text.
   ═══════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/assets/fonts/fraunces-var.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url('/assets/fonts/fraunces-italic-var.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/assets/fonts/inter-var.woff2') format('woff2');
}

:root {
  --bg: #0D0B07;
  --bg-2: #14100A;
  --bg-3: #1A150C;
  --line: rgba(216, 192, 121, 0.14);
  --line-soft: rgba(216, 192, 121, 0.08);
  --cream: #F5F0E6;
  --muted: #B0A691;
  --faint: #837A67;
  --gold: #D8C079;
  --gold-deep: #A67A3D;
  --gold-hi: #E8D394;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 18px;
  --container: 1140px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Make the `hidden` attribute always win, even over display:grid/flex rules. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  background: var(--bg);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--gold); color: var(--bg); }

img, video { max-width: 100%; height: auto; display: block; }

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-hi); }

.container { max-width: var(--container); margin-inline: auto; padding-inline: clamp(20px, 4vw, 40px); }
.container.narrow { max-width: 800px; }
.center { text-align: center; margin-top: 3rem; }
.wide-only { display: none; }
@media (min-width: 900px) { .wide-only { display: block; } }

h1, h2, h3 { font-family: var(--serif); font-weight: 520; letter-spacing: -0.01em; }

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13, 11, 7, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--cream); }
.brand:hover { color: var(--cream); }
.brand-mark { width: 20px; height: 20px; color: var(--gold); flex: none; }
.brand-name { font-family: var(--serif); font-weight: 560; font-size: 1.28rem; letter-spacing: 0.005em; color: var(--gold); }
.nav-links { display: flex; align-items: center; gap: clamp(18px, 2.5vw, 34px); }
.nav-links > a:not(.btn) {
  color: var(--muted); font-size: 0.95rem; font-weight: 480;
  transition: color 0.2s;
}
.nav-links > a:not(.btn):hover { color: var(--cream); }
.nav-toggle { display: none; }

@media (max-width: 760px) {
  .nav-toggle {
    display: grid; place-content: center; gap: 6px;
    width: 44px; height: 44px;
    background: none; border: 0; cursor: pointer;
  }
  .nav-toggle span { width: 22px; height: 2px; background: var(--cream); transition: transform 0.25s, opacity 0.25s; }
  .nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .nav-links {
    position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg-2);
    border-bottom: 1px solid var(--line);
    padding: 10px 24px 20px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links > a:not(.btn) { padding: 13px 4px; font-size: 1.05rem; border-bottom: 1px solid var(--line-soft); }
  .btn-nav { margin-top: 16px; text-align: center; }
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 560; font-size: 0.98rem;
  letter-spacing: 0.01em;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s;
  will-change: transform;
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold-hi), var(--gold) 55%, #C0A055);
  color: #191204;
  box-shadow: 0 2px 18px rgba(216, 192, 121, 0.18);
}
.btn-gold:hover { color: #191204; transform: translateY(-2px); box-shadow: 0 6px 28px rgba(216, 192, 121, 0.3); }
.btn-ghost { border: 1px solid var(--line); color: var(--cream); }
.btn-ghost:hover { color: var(--cream); border-color: var(--gold); transform: translateY(-2px); }
.btn-nav { padding: 9px 20px; font-size: 0.92rem; }
.btn-soon {
  background: rgba(245, 240, 230, 0.04);
  border: 1px solid var(--line-soft);
  color: var(--muted);
  cursor: default;
}

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
  padding-top: clamp(64px, 10vh, 128px);
  padding-bottom: clamp(56px, 9vh, 110px);
}
.hero-headline {
  display: block;
  font-size: clamp(2.6rem, 6.2vw, 4.6rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
}
.hero-headline em { font-style: italic; font-weight: 480; color: var(--gold-hi); }
.hero-sub {
  max-width: 34em;
  margin-top: 1.6rem;
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--muted);
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 2.3rem; }
.hero-note {
  margin-top: 2.2rem;
  font-size: 0.9rem; color: var(--faint);
  display: flex; align-items: baseline; gap: 8px;
}
.hero-note .dot { width: 11px; height: 11px; color: var(--gold); flex: none; animation: twinkle 3.2s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.45; transform: scale(0.82); } }

.hero-art { position: relative; justify-self: end; }
.hero-art img {
  width: clamp(220px, 24vw, 330px);
  -webkit-mask-image: radial-gradient(120% 100% at 50% 38%, #000 55%, transparent 98%);
  mask-image: radial-gradient(120% 100% at 50% 38%, #000 55%, transparent 98%);
  opacity: 0.92;
}
.hero-art::before {
  content: '';
  position: absolute; inset: -18% -22%;
  background: radial-gradient(50% 42% at 55% 42%, rgba(216, 192, 121, 0.13), transparent 70%);
  pointer-events: none;
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 56px; }
  .hero-art { position: absolute; inset: 0; overflow: hidden; z-index: -1; }
  .hero-art img {
    position: absolute; right: -40px; top: 10px;
    width: 300px; opacity: 0.14;
  }
}

/* ── Sections ───────────────────────────────────────────── */
.section { padding-block: clamp(70px, 11vh, 130px); }
.section-panel {
  background: linear-gradient(180deg, var(--bg-2), var(--bg) 100%);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.section-head { max-width: 46em; margin-bottom: clamp(2.6rem, 5vh, 4rem); }
.kicker {
  font-size: 0.82rem; font-weight: 620;
  letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.1rem;
}
.kicker span { margin-right: 6px; }
.section-head h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  line-height: 1.2;
}

/* ── Cards ──────────────────────────────────────────────── */
.card-grid { display: grid; gap: 22px; }
.card-grid.three { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.card-grid.two { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.card {
  background: var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: clamp(24px, 3vw, 34px);
  transition: border-color 0.25s, transform 0.25s;
}
.card:hover { border-color: var(--line); transform: translateY(-3px); }
.card h3 { font-size: 1.22rem; margin-bottom: 0.55rem; }
.card p { color: var(--muted); font-size: 0.98rem; }

.product-card h3 { font-size: 1.55rem; color: var(--gold-hi); }
.product-tag {
  font-size: 0.85rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--faint) !important;
  margin: 0.4rem 0 1.1rem;
}
.product-card ul { list-style: none; }
.product-card li {
  position: relative;
  padding: 0.42rem 0 0.42rem 1.7rem;
  color: var(--muted); font-size: 0.99rem;
}
.product-card li::before {
  content: '✦';
  position: absolute; left: 2px; top: 0.42rem;
  color: var(--gold-deep); font-size: 0.8rem;
}

/* ── Demos ──────────────────────────────────────────────── */
.demos {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: clamp(40px, 6vh, 64px);
  margin-top: clamp(2.4rem, 5vh, 3.6rem);
}
.demo { width: min(100%, 660px); }
.demo { margin: 0; }
.demo-frame {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    radial-gradient(80% 80% at 50% 30%, rgba(216, 192, 121, 0.07), transparent),
    var(--bg-3);
}
.demo-frame video { width: 100%; height: 100%; object-fit: cover; }
.demo-play {
  position: absolute; inset: 0;
  background: transparent; border: 0; cursor: pointer;
}
.demo-play::after {
  content: '';
  position: absolute; left: 50%; top: 50%;
  width: 64px; height: 64px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(13, 11, 7, 0.62) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5.5v13l11-6.5z' fill='%23F5F0E6'/%3E%3C/svg%3E") center / 26px no-repeat;
  border: 1px solid rgba(245, 240, 230, 0.28);
  backdrop-filter: blur(4px);
  transition: transform 0.2s, background-color 0.2s;
}
.demo-play:hover::after { transform: translate(-50%, -50%) scale(1.07); }
.demo.playing .demo-play::after { opacity: 0; }
.demo.playing:hover .demo-play::after {
  opacity: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 5h3.5v14H7zM13.5 5H17v14h-3.5z' fill='%23F5F0E6'/%3E%3C/svg%3E");
}
.demo figcaption {
  margin-bottom: 1.5rem;
  font-size: 0.98rem; color: var(--muted);
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
}
.chip {
  font-size: 0.72rem; font-weight: 640;
  letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--gold);
  background: rgba(216, 192, 121, 0.1);
  border: 1px solid var(--line);
  padding: 3px 10px; border-radius: 999px;
  white-space: nowrap;
}
.chip-alt { color: var(--gold-hi); background: rgba(232, 211, 148, 0.08); }

/* ── Checklist (Why) ────────────────────────────────────── */
.checklist {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 0;
  border-top: 1px solid var(--line-soft);
}
.checklist li {
  padding: clamp(22px, 3vw, 32px) 8px;
  border-bottom: 1px solid var(--line-soft);
  position: relative;
  padding-left: 58px;
}
.checklist li::before {
  content: '';
  position: absolute; left: 8px; top: clamp(26px, 3vw, 36px);
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.2 4.2L19 7' stroke='%23D8C079' stroke-width='2.2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 15px no-repeat, rgba(216, 192, 121, 0.06);
}
.checklist h3 { font-size: 1.18rem; margin-bottom: 0.35rem; }
.checklist p { color: var(--muted); font-size: 0.97rem; }

/* ── FAQ ────────────────────────────────────────────────── */
.faq details {
  border-bottom: 1px solid var(--line-soft);
}
.faq details:first-child { border-top: 1px solid var(--line-soft); }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 1.25rem 2.4rem 1.25rem 4px;
  font-family: var(--serif);
  font-size: 1.18rem; font-weight: 520;
  position: relative;
  transition: color 0.2s;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%);
  font-family: var(--sans); font-weight: 300; font-size: 1.5rem;
  color: var(--gold);
  transition: transform 0.25s;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq summary:hover { color: var(--gold-hi); }
.faq details p { padding: 0 4px 1.4rem; color: var(--muted); max-width: 58em; }

/* ── Contact ────────────────────────────────────────────── */
.contact-panel {
  text-align: center;
  background:
    radial-gradient(60% 90% at 50% -10%, rgba(216, 192, 121, 0.1), transparent 70%),
    var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: calc(var(--radius) * 1.6);
  padding: clamp(48px, 8vw, 88px) clamp(24px, 6vw, 80px);
}
.contact-mark { width: 34px; height: 34px; color: var(--gold); margin-bottom: 1.6rem; animation: twinkle 3.2s ease-in-out infinite; }
.contact-panel h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); margin-bottom: 0.8rem; }
.contact-panel > p { color: var(--muted); margin-bottom: 2.2rem; }
.center-row { justify-content: center; }

/* ── Footer ─────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--line-soft); padding-top: clamp(48px, 7vh, 72px); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: clamp(28px, 5vw, 60px);
  padding-bottom: 3rem;
}
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand img { width: 185px; height: auto; margin-bottom: 1.1rem; }
.footer-brand p { color: var(--faint); font-size: 0.92rem; }
.footer-col h3 {
  font-family: var(--sans);
  font-size: 0.78rem; font-weight: 640;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 1rem;
}
.footer-col a { display: block; color: var(--muted); font-size: 0.95rem; padding: 0.3rem 0; }
.footer-col .soon { display: block; color: var(--muted); font-size: 0.95rem; padding: 0.3rem 0; cursor: default; }
.footer-col .soon em { font-style: normal; font-size: 0.78rem; color: var(--faint); margin-left: 6px; }
.footer-col a:hover { color: var(--gold-hi); }
.footer-legal { border-top: 1px solid var(--line-soft); padding-block: 1.6rem; }
.footer-legal p { font-size: 0.85rem; color: var(--faint); }

/* ── Careers ────────────────────────────────────────────── */
.page-title {
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
}
.page-title em { font-style: italic; font-weight: 480; color: var(--gold-hi); }
.page-sub {
  margin-top: 1.2rem;
  max-width: 38em;
  font-size: clamp(1.02rem, 1.3vw, 1.15rem);
  color: var(--muted);
}
.apply-note {
  margin: 1.6rem 0 2rem;
  max-width: 40em;
  padding: 0.85rem 1.1rem;
  border-left: 3px solid var(--gold);
  border-radius: 0 12px 12px 0;
  background: rgba(216, 192, 121, 0.06);
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
}
.apply-note strong { color: var(--cream); font-weight: 600; }

.apply-form { display: grid; gap: 20px; }
.apply-form:hover { transform: none; }
.form-row { display: grid; gap: 20px; }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }

.field label {
  display: block;
  font-size: 0.88rem; font-weight: 560;
  letter-spacing: 0.01em;
  margin-bottom: 0.45rem;
}
.field .optional { color: var(--faint); font-weight: 440; }
.field input,
.field select,
.field textarea {
  width: 100%;
  background: rgba(13, 11, 7, 0.6);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--cream);
  font: inherit;
  font-size: 0.98rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(216, 192, 121, 0.12);
}
.field ::placeholder { color: var(--faint); opacity: 1; }
.field textarea { min-height: 140px; resize: vertical; }
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9.5l6 6 6-6' stroke='%23D8C079' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  cursor: pointer;
}
.field select:invalid { color: var(--faint); }
.field select option { background: var(--bg-2); color: var(--cream); }
.field input[type="file"] { padding: 10px 12px; cursor: pointer; color: var(--muted); }
.field input[type="file"]::file-selector-button {
  font: inherit; font-size: 0.88rem; font-weight: 560;
  color: var(--cream);
  background: rgba(216, 192, 121, 0.08);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 16px;
  margin-right: 14px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.field input[type="file"]::file-selector-button:hover { border-color: var(--gold); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status { font-size: 0.92rem; color: var(--gold-hi); min-height: 0; }
.form-status:empty { display: none; }
.form-status.error { color: #E2937D; }
.form-actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.form-actions .btn { border: 0; cursor: pointer; font-family: var(--sans); }
.form-actions .btn:disabled { opacity: 0.55; cursor: default; transform: none; box-shadow: none; }
.form-fine { font-size: 0.82rem; color: var(--faint); max-width: 24em; line-height: 1.5; }

/* Upload progress + submit spinner */
.form-progress { display: flex; align-items: center; gap: 12px; margin-top: 2px; }
.form-progress-track { flex: 1; height: 7px; background: var(--line); border-radius: 999px; overflow: hidden; }
.form-progress-fill { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--gold), var(--gold-hi)); transition: width 0.15s ease; }
.form-progress-pct { font-size: 0.82rem; color: var(--muted); min-width: 3.5ch; text-align: right; font-variant-numeric: tabular-nums; }
.btn.is-loading { pointer-events: none; }
.btn.is-loading::before {
  content: ""; display: inline-block; width: 0.9em; height: 0.9em;
  margin-right: 0.55em; vertical-align: -0.08em;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: btn-spin 0.7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn.is-loading::before { animation-duration: 1.6s; } }

.apply-success {
  text-align: center;
  background:
    radial-gradient(60% 90% at 50% -10%, rgba(216, 192, 121, 0.1), transparent 70%),
    var(--bg-2);
  border: 1px solid var(--line-soft);
  border-radius: calc(var(--radius) * 1.6);
  padding: clamp(40px, 7vw, 72px) clamp(24px, 5vw, 64px);
}
.apply-success h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 0.7rem; }
.apply-success p { color: var(--muted); margin-bottom: 1.8rem; }

.steps {
  list-style: none;
  counter-reset: step;
  border-top: 1px solid var(--line-soft);
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: clamp(20px, 3vw, 28px) 8px clamp(20px, 3vw, 28px) 58px;
  border-bottom: 1px solid var(--line-soft);
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 8px; top: clamp(24px, 3vw, 32px);
  width: 30px; height: 30px;
  display: grid; place-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(216, 192, 121, 0.06);
  color: var(--gold);
  font-family: var(--serif); font-size: 0.95rem;
}
.steps h3 { font-size: 1.14rem; margin-bottom: 0.3rem; }
.steps p { color: var(--muted); font-size: 0.96rem; }
.process-note { margin-top: 2.2rem; font-size: 0.95rem; color: var(--faint); }

/* ── Reveal animation ───────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-note .dot, .contact-mark { animation: none; }
  .btn, .card { transition: none; }
}
