/* Codex Alliance — two screens: film + glass cards. Apple system fonts, no CDNs. */
:root {
  --ink: #0a121c;
  --ink-soft: #1a2736;
  --muted: #6a7a8c;
  --muted-2: #8a98a8;
  --line: rgba(20, 48, 72, .08);
  --paper: #f3f6fa;
  --cyan: #3ec8e8;
  --cyan-deep: #1aa8cc;
  --violet: #7b6cff;
  /* one glass recipe, shared by every surface (mirrors the app's glass cards) */
  --glass-bg: linear-gradient(160deg, rgba(255,255,255,.74), rgba(255,255,255,.46));
  --glass-border: 1px solid rgba(255,255,255,.82);
  --glass-blur: blur(24px) saturate(170%);
  --glass-shadow: inset 0 1px 0 rgba(255,255,255,.92), 0 24px 60px rgba(24,60,96,.10), 0 2px 6px rgba(24,60,96,.04);
  --radius-card: 28px;
  --radius-inner: 18px;
  --header-h: 64px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(62,200,232,.10), transparent 55%),
    radial-gradient(800px 480px at 92% 8%, rgba(155,123,255,.09), transparent 50%),
    radial-gradient(700px 420px at 70% 100%, rgba(232,160,208,.07), transparent 55%),
    var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  letter-spacing: -.01em;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, select { font: inherit; }
.shell { width: min(1140px, calc(100% - 48px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link {
  position: fixed; left: 16px; top: -100px; z-index: 999;
  padding: 12px 18px; border-radius: 999px; background: var(--ink); color: #fff;
}
.skip-link:focus { top: 12px; }

/* Ambient mist */
.mist { position: fixed; pointer-events: none; z-index: 0; border-radius: 50%; filter: blur(60px); opacity: .48; }
.mist-a { width: 520px; height: 520px; left: -180px; top: 120px; background: radial-gradient(circle, rgba(62,200,232,.22), transparent 70%); animation: drift 28s ease-in-out infinite alternate; }
.mist-b { width: 460px; height: 460px; right: -140px; top: 40%; background: radial-gradient(circle, rgba(123,108,255,.18), transparent 70%); animation: drift 34s ease-in-out infinite alternate-reverse; }
.mist-c { width: 380px; height: 380px; left: 40%; bottom: -80px; background: radial-gradient(circle, rgba(232,160,208,.14), transparent 70%); animation: drift 40s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translate(0,0) scale(1); } to { transform: translate(40px,-30px) scale(1.08); } }

/* Header */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  padding-top: env(safe-area-inset-top);
  background: rgba(243,246,250,.7);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--line);
}
.nav { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 16px; letter-spacing: -.02em; flex-shrink: 0; }
.brand img { border-radius: 9px; box-shadow: 0 8px 24px rgba(62,200,232,.16); }
.brand strong { font-weight: 700; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.lang-wrap { display: flex; }
.lang-select {
  appearance: none; -webkit-appearance: none;
  border: var(--glass-border); background-color: rgba(255,255,255,.6);
  border-radius: 999px; padding: 8px 28px 8px 13px;
  font-size: 12px; font-weight: 600; color: var(--ink-soft); cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%236a7a8c' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  max-width: 148px; box-shadow: 0 4px 14px rgba(24,60,96,.05);
}
.x-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px; border-radius: 999px;
  background: var(--ink); color: #fff;
  font-size: 13px; font-weight: 650;
  box-shadow: 0 10px 28px rgba(10,18,28,.16);
  transition: transform .2s, box-shadow .2s;
}
.x-link:hover { transform: translateY(-1px); box-shadow: 0 14px 32px rgba(10,18,28,.22); }
.x-link svg { width: 14px; height: 14px; fill: currentColor; flex-shrink: 0; }
.soon-pill svg { width: 18px; height: 18px; fill: #fff; flex-shrink: 0; }

.kicker { margin: 0 0 10px; font-size: 11px; letter-spacing: .22em; font-weight: 700; color: var(--muted); text-transform: uppercase; }

/* ===== Screen 1 · Film ===== */
.home-film {
  position: relative; z-index: 1;
  min-height: 100svh;
  padding: calc(var(--header-h) + 24px) 0 32px;
  display: flex; align-items: center;
}
.film-stage { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 4vw, 56px); align-items: center; }
.film-visual { display: flex; justify-content: center; }
/* Device — Pro Max form factor (77.6 × 163 mm ≈ 0.476), drawn in CSS; screen-only film inside */
.device {
  --dev-h: clamp(460px, calc(100svh - var(--header-h) - 92px), 840px);
  position: relative; height: var(--dev-h); aspect-ratio: 77.6 / 163; margin: 0 auto;
  container-type: inline-size;
  filter: drop-shadow(0 2px 2px rgba(15,25,45,.10));
}
.device::before {          /* soft contact + ambient shadow */
  content: ""; position: absolute; z-index: -1; left: 7%; right: 7%; bottom: -3.5%; height: 22%;
  border-radius: 50%; background: radial-gradient(closest-side, rgba(16,34,64,.30), rgba(16,34,64,0));
  filter: blur(18px);
}
.device-rim {
  position: absolute; inset: 0; border-radius: 15.8cqw; padding: 1.35cqw;
  background:
    linear-gradient(90deg, #6f7379 0%, #d9dce0 3.5%, #a7abb1 8%, #c4c7cc 30%, #b4b8be 50%, #c4c7cc 70%, #a7abb1 92%, #dfe1e4 96.5%, #6f7379 100%);
  box-shadow:
    inset 0 0 0 .35cqw rgba(255,255,255,.55),
    inset 0 0 0 .8cqw rgba(60,64,70,.18),
    0 60px 110px -40px rgba(14,30,58,.42),
    0 30px 50px -30px rgba(14,30,58,.32),
    0 0 0 .25cqw rgba(70,74,80,.55);
}
.device-bezel {
  position: relative; height: 100%; border-radius: 14.5cqw; padding: 2.25cqw; background: #050607;
  box-shadow: inset 0 0 0 .3cqw #16181b, inset 0 0 1.2cqw rgba(255,255,255,.06);
}
.device-screen {
  position: relative; height: 100%; border-radius: 12.3cqw; overflow: hidden; background: #f4f6f9;
  isolation: isolate; transform: translateZ(0);
}
.screen-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.device-island {
  position: absolute; z-index: 2; top: 2.4cqw; left: 50%; transform: translateX(-50%);
  width: 27.5cqw; height: 8cqw; border-radius: 99px; background: #000;
  box-shadow: inset 0 0 0 .2cqw #0b0c0e;
}
.device-island::after {    /* camera lens hint */
  content: ""; position: absolute; right: 18%; top: 50%; width: 2.6cqw; height: 2.6cqw; transform: translateY(-50%);
  border-radius: 50%; background: radial-gradient(circle at 40% 40%, #24324a 0, #0c111a 55%, #050608 100%);
}
.device-glare {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,.16) 0%, rgba(255,255,255,0) 28%, rgba(255,255,255,0) 72%, rgba(255,255,255,.06) 100%);
}
.device-btn {
  position: absolute; z-index: -1; width: 1.6cqw; border-radius: 1cqw;
  background: linear-gradient(90deg, #6c7076, #d3d6da 45%, #9fa3a9);
  box-shadow: 0 0 0 .15cqw rgba(60,64,70,.35);
}
.btn-action   { left: -.95cqw; top: 18.5%; height: 6.2%; }
.btn-vol-up   { left: -.95cqw; top: 27.5%; height: 10%; }
.btn-vol-down { left: -.95cqw; top: 39.5%; height: 10%; }
.btn-power    { right: -.95cqw; top: 29%; height: 15.5%; }
.btn-camera   {                  /* Camera Control: flush sapphire key in a metal surround */
  right: -.55cqw; top: 62%; height: 9%; width: 1.3cqw;
  background: linear-gradient(90deg, #2a2d33, #4a4f57 50%, #22252a);
  box-shadow: 0 0 0 .3cqw #b5b9bf, 0 0 0 .45cqw rgba(60,64,70,.35);
}
.film-copy { max-width: 600px; }
.film-copy h1 {
  margin: 0; font-size: clamp(36px, 3.7vw, 52px); line-height: 1.14;
  letter-spacing: -.04em; font-weight: 750; color: #0b1220;
}
.film-subtitle {
  margin: 16px 0 28px; font-size: 17px; line-height: 1.45;
  color: #6b7280; letter-spacing: -.01em;
}
.soon-pill {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 28px 0 0; padding: 10px 18px 10px 14px;
  border-radius: 10px;
  background: #000; border: 0; box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none;
  font-size: 13px; font-weight: 600; letter-spacing: -.01em;
  color: #fff; line-height: 1.15;
}
.soon-pill svg { width: 18px; height: 18px; fill: #fff; }
/* legacy unused */
.soon-dot { display: none; }

/* Footer */
.footer { position: relative; z-index: 1; padding: 24px 0 32px; border-top: 1px solid var(--line); background: rgba(255,255,255,.5); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 12px 28px; align-items: center; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand img { border-radius: 7px; }
.footer-brand strong { display: block; font-size: 14px; }
.footer-brand span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.footer-links { display: flex; gap: 18px; font-size: 13px; color: var(--muted); }
.footer-links a:hover { color: var(--ink); }
.footer-inner small { grid-column: 1 / -1; color: var(--muted-2); font-size: 11px; }

.reveal { opacity: 0; transform: translateY(16px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.8,.2,1); }
.reveal.is-visible { opacity: 1; transform: none; }

/* RTL */
html[dir="rtl"] .footer-links { flex-direction: row-reverse; }
html[dir="rtl"] .lang-select { background-position: left 12px center; padding: 8px 13px 8px 28px; }

/* Tablet */
@media (max-width: 960px) {
  .home-film { min-height: auto; }
  .home-film { padding-bottom: 24px; }
  .film-stage { grid-template-columns: 1fr; gap: 26px; text-align: center; }
  .film-copy { margin-inline: auto; }
  .film-subtitle { margin-inline: auto; }
  .device { --dev-h: clamp(440px, 64svh, 620px); }
}
/* Phone */
@media (max-width: 640px) {
  :root { --header-h: 58px; --radius-card: 24px; --radius-inner: 15px; }
  .shell { width: min(100% - 28px, 1140px); }
  .brand span { font-size: 15px; }
  .lang-select { max-width: 108px; font-size: 11px; }
  .x-link { padding: 9px 12px; }
  .x-link span { display: none; }
  .home-film { padding-top: calc(var(--header-h) + 18px); }
  .device { --dev-h: min(540px, 60svh, calc((100vw - 64px) / .476)); }
  .film-stage { gap: 22px; }
  .soon-pill { margin-top: 18px; }
  .film-subtitle { margin: 12px auto 0; }
  .film-copy h1 { font-size: 38px; }
  .footer-inner { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mist { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .x-link { transition: none; }
}
