/* PhonIQ website: the app's "PhonIQ Default" Sky theme, value for value (ui/theme/Theme.kt
   phoniqSkyLightScheme / phoniqSkyDarkScheme, PhonIQChrome.kt). The site follows the phone's light
   or dark setting until the visitor picks one with the header toggle (assets/js/theme.js), which
   sets data-theme on <html>. */
:root {
  --page: #F4F8FB;
  --card: #FFFFFF;
  --card-2: #EEF3F7;
  --band: #EEF3F7;
  --ink: #14212B;
  --muted: #4A5A66;
  --action: #026AA6;
  --on-action: #FFFFFF;
  --chip: #E0F2FE;
  --chip-ink: #0C3A5C;
  --danger: #BA1A1A;
  /* The brand gradient of the app icon and the in-app "IQ" (Sky, the same in light and dark). */
  --grad-start: #0496DF;
  --grad-mid: #14B6E7;
  --grad-end: #1ACFEC;
  /* Main button: the app's Sky primary into a slightly brighter Sky, so white text keeps 4.5:1. */
  --btn-start: #026AA6;
  --btn-end: #0379BD;
  --phone-edge: #14212B;
  --phone-shadow: 0 30px 60px rgba(4, 80, 130, 0.18);
  --ground: rgba(20, 33, 43, 0.38);
  --screen-glow: transparent;
  --phone-rim: rgba(255, 255, 255, 0.10);
  --line: rgba(20, 33, 43, 0.08);
  --shadow: 0 1px 2px rgba(20, 33, 43, 0.04), 0 8px 24px rgba(20, 33, 43, 0.06);
  --radius-card: 20px;
  --radius-pill: 999px;
  --max: 72rem;
  --font: "Plus Jakarta Sans", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #101416;
    --card: #1C2426;
    --card-2: #171D1F;
    --band: #0C1012;
    --ink: #E4ECEC;
    --muted: #B7C4C6;
    --action: #7DD3FC;
    --on-action: #082F49;
    --chip: #075985;
    --chip-ink: #E0F2FE;
    --danger: #FFB4AB;
    --phone-edge: #2A3335;
    --phone-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
    --ground: rgba(0, 0, 0, 0.85);
    --screen-glow: rgba(125, 211, 252, 0.16);
    --phone-rim: rgba(255, 255, 255, 0.16);
    --line: rgba(228, 236, 236, 0.08);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --page: #101416;
  --card: #1C2426;
  --card-2: #171D1F;
  --band: #0C1012;
  --ink: #E4ECEC;
  --muted: #B7C4C6;
  --action: #7DD3FC;
  --on-action: #082F49;
  --chip: #075985;
  --chip-ink: #E0F2FE;
  --danger: #FFB4AB;
  --phone-edge: #2A3335;
  --phone-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
  --ground: rgba(0, 0, 0, 0.85);
  --screen-glow: rgba(125, 211, 252, 0.16);
  --phone-rim: rgba(255, 255, 255, 0.16);
  --line: rgba(228, 236, 236, 0.08);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--page);
  overflow-x: hidden;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--action); text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--grad-start); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 0.6em; }
h1 { font-size: clamp(2rem, 1.4rem + 3vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

.skip { position: absolute; left: -999px; top: 0.5rem; z-index: 100; background: var(--card); padding: 0.5rem 1rem; border-radius: var(--radius-pill); }
.skip:focus { left: 0.5rem; }

.wrap { width: min(var(--max), calc(100% - 2rem)); margin-inline: auto; }
.section { padding-block: clamp(2.5rem, 2rem + 4vw, 5.5rem); }
.section-tight { padding-block: 1.5rem; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 38rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.center .lede { margin-inline: auto; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--page) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); }
.nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; padding-block: 0.75rem; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.iq { background: linear-gradient(90deg, var(--grad-start), var(--grad-mid), var(--grad-end)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* Pills, buttons, chips */
.pill { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.45rem 0.95rem; border-radius: var(--radius-pill); background: var(--card); color: var(--ink); text-decoration: none; font-size: 0.95rem; box-shadow: var(--shadow); }
.pill:hover { color: var(--action); }
.pill[aria-current="page"] { background: var(--action); color: var(--on-action); }
.theme-toggle { justify-content: center; width: 2.4rem; height: 2.4rem; padding: 0; border: 0; cursor: pointer; font: inherit; }
.theme-toggle[hidden] { display: none; }
.theme-toggle:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
/* The bulb (T305): lit in the light theme, an unlit outline in the dark one. */
.theme-toggle .bulb { overflow: visible; }
.bulb-glass { fill: transparent; stroke: currentColor; stroke-width: 1.6; transition: fill 0.35s ease, stroke 0.35s ease, filter 0.35s ease; }
.bulb-base { fill: none; stroke: currentColor; stroke-width: 1.6; }
.bulb-rays { stroke: #F5B400; stroke-width: 1.6; opacity: 0; transition: opacity 0.35s ease; }
.theme-toggle[data-current="light"] .bulb-glass { fill: #FFD54A; stroke: #C98F00; filter: drop-shadow(0 0 4px rgba(255, 200, 40, 0.85)); }
.theme-toggle[data-current="light"] .bulb-rays { opacity: 1; }
.theme-toggle[data-current="dark"]:hover .bulb-glass { fill: rgba(255, 213, 74, 0.25); }

/* Switching theme (assets/js/theme.js): light spreads out of the bulb as a growing circle, or
   shrinks back into it. A view transition snapshots the page before and after; the script animates
   the circle. Browsers without view transitions, or with reduced motion, switch at once. */
/* No default zoom between the two snapshots (it ran when their sizes differed, e.g. a phone's
   address bar moving, and made the light seem to come from the middle): both fill the screen. */
::view-transition-group(root) { animation: none; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; width: 100%; height: 100%; object-fit: cover; object-position: top left; }
html.lights-off::view-transition-old(root) { z-index: 2; }
html.lights-off::view-transition-new(root) { z-index: 1; }
.btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.8rem 1.4rem; border-radius: var(--radius-pill); background: linear-gradient(90deg, var(--btn-start), var(--btn-end)); color: #FFFFFF; font-weight: 500; text-decoration: none; box-shadow: 0 6px 20px rgba(4, 150, 223, 0.3); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-link { color: var(--action); font-weight: 500; text-decoration: none; padding: 0.8rem 0.4rem; }
.btn-link:hover { text-decoration: underline; }
.chip { display: inline-block; padding: 0.25rem 0.8rem; border-radius: var(--radius-pill); background: var(--chip); color: var(--chip-ink); font-size: 0.85rem; font-weight: 500; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin-top: 1.5rem; }

/* Cards and grids */
.card { background: var(--card); border-radius: var(--radius-card); box-shadow: var(--shadow); padding: clamp(1.25rem, 1rem + 1vw, 2rem); }
.grid-2, .grid-3 { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }

/* Long-form text (privacy, terms) */
.prose { max-width: 46rem; }
.prose h2 { margin-top: 2rem; font-size: 1.4rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.35rem; }
.prose code { font-size: 0.9em; background: var(--chip); color: var(--chip-ink); padding: 0.1em 0.4em; border-radius: 6px; }
.kicker { color: var(--action); font-weight: 500; text-transform: none; margin-bottom: 0.4rem; }
.banner { background: var(--chip); color: var(--chip-ink); border-radius: var(--radius-card); padding: 1rem 1.25rem; margin: 1rem 0 1.5rem; }
.table-scroll { overflow-x: auto; margin: 1rem 0; }
.table-scroll table { border-collapse: collapse; width: 100%; min-width: 36rem; background: var(--card); border-radius: 12px; overflow: hidden; }
.table-scroll th, .table-scroll td { text-align: left; vertical-align: top; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); font-size: 0.95rem; }

/* Footer */
.site-footer { padding-block: 2.5rem; color: var(--muted); font-size: 0.95rem; }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); padding-top: 1.5rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--action); }

/* Phone frame around app recordings */
.phone { position: relative; width: min(100%, 300px); aspect-ratio: 540 / 1200; border-radius: 40px; border: 10px solid var(--phone-edge); background: var(--page); overflow: hidden; box-shadow: var(--phone-shadow); }
.phone picture, .phone picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }

/* Home page */
.band { background: var(--band); }
.hero { padding-top: clamp(1.5rem, 1rem + 3vw, 3.5rem); }
.hero-grid { display: grid; gap: 2.5rem; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 52rem) { .hero-grid { grid-template-columns: 1.15fr 0.85fr; } }
.hero h1 { margin-top: 0.8rem; }
.soon { color: var(--muted); font-size: 0.95rem; }
a.soon { color: var(--action); font-weight: 500; }
a.soon:hover { text-decoration: underline; }
.trust { list-style: none; margin: 0 auto; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem 2rem; color: var(--muted); }
.trust li { display: inline-flex; align-items: center; gap: 0.5rem; }
.dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: linear-gradient(135deg, var(--grad-start), var(--grad-end)); }
.pillars { margin-top: 2rem; }


.moment { text-align: center; }
.flow { list-style: none; margin: 2rem auto 0; padding: 0; display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); max-width: 60rem; counter-reset: none; }
.flow-step { position: relative; background: var(--card); border-radius: var(--radius-card); box-shadow: var(--shadow); padding: 1.1rem 1.2rem 1.1rem 3.4rem; font-weight: 500; }
.flow-n { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center; background: var(--chip); color: var(--chip-ink); font-size: 0.9rem; }
.flow-accent { background: var(--action); color: var(--on-action); }
.flow-accent .flow-n { background: rgba(255, 255, 255, 0.25); color: inherit; }
.flow-cloud { text-align: center; margin-top: 1.5rem; color: var(--muted); }
.crossed { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--danger); font-weight: 500; }
.ai { align-items: center; }
.asks { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.8rem; }
.asks .card { padding: 1rem 1.25rem; border-radius: 18px 18px 18px 6px; }
.tester .steps { padding-left: 1.2rem; margin: 1rem 0 1.5rem; }
.tester .steps li { margin-bottom: 0.5rem; }
.faq details { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 0.9rem 1.1rem; margin-bottom: 0.7rem; }
.faq summary { cursor: pointer; font-weight: 500; }
.faq details p { margin: 0.6rem 0 0; color: var(--muted); }
.hero h1 .line { display: block; }

/* Diagrams (assets/js/diagram.js) */
.diagram { margin: 2rem auto 0; width: 100%; max-width: 56rem; }
.diagram svg { width: 100%; height: auto; display: block; overflow: visible; }
.diagram text { font-family: var(--font); font-size: 34px; font-weight: 500; fill: var(--ink); }
.diagram .dg-arrow-label { font-size: 26px; font-weight: 400; fill: var(--muted); }
.diagram .iq-svg { fill: var(--grad-start); }
.dg-box rect { fill: var(--card); filter: drop-shadow(0 6px 16px rgba(20, 33, 43, 0.08)); }
.dg-accent rect { fill: var(--action); }
.dg-accent text { fill: var(--on-action); }
.dg-crossed rect { fill: transparent; stroke: var(--danger); stroke-width: 3; stroke-dasharray: 12 10; filter: none; }
.dg-crossed text { fill: var(--danger); }
.dg-cross { stroke: var(--danger); stroke-width: 6; stroke-linecap: round; }
.dg-arrow line { stroke: var(--muted); stroke-width: 4; }
.dg-dashed line { stroke-dasharray: 10 10; }
.dg-head { fill: var(--muted); }
.diagram-caption { text-align: center; color: var(--muted); margin-top: 1rem; }
.privacy-block { display: grid; gap: 1.5rem; align-items: center; grid-template-columns: 1fr; margin-top: 3rem; }
@media (min-width: 60rem) { .privacy-block { grid-template-columns: 0.8fr 1.2fr; } }
.privacy-block .diagram { margin-top: 0; }

/* Features, testers, support */
.feature-row { display: grid; gap: 2.5rem; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 52rem) { .feature-row { grid-template-columns: 0.8fr 1.2fr; } .feature-row.reverse > .clip { order: 2; } }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.ticks li { position: relative; padding-left: 2rem; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 0.3em; width: 1.2rem; height: 1.2rem; border-radius: 50%; background: var(--chip) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23026AA6' d='M9.5 16.2 5.3 12l-1.4 1.4 5.6 5.6 11-11-1.4-1.4z'/%3E%3C/svg%3E") center / 0.9rem no-repeat; }
.big-steps { font-size: 1.05rem; }
.big-steps li { margin-bottom: 0.9rem; }
.support-faq { max-width: 46rem; margin: 2rem 0; }
.contact { max-width: 46rem; }

/* Narrow phones: the wrapped menu would take a fifth of the screen if it stayed pinned. */
@media (max-width: 40rem) {
  .site-header { position: static; }
  .pill { padding: 0.4rem 0.8rem; font-size: 0.9rem; }
}

/* Clips: real app recordings (assets/js/clips.js) */
.clip { margin: 0; display: flex; justify-content: center; }
.clip-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; background: transparent; }
.moment .clip, .feature-row .clip { margin-bottom: 1.25rem; }
.moment .phone { width: min(100%, 230px); border-width: 8px; border-radius: 32px; }

/* Phones float over the page as if over a table (T307): a 3D tilt, a glass sheen and rim light, a
   slow float, and a soft shadow on the "table" that shrinks and fades as the phone rises. The
   recordings themselves are untouched. On a mouse, clips.js turns the phone a little toward the
   pointer (--tx, --ty). Reduced motion keeps the tilt and shadow, without the movement. */
.clip { position: relative; perspective: 1400px; padding-bottom: 2.4rem; --rx: 9deg; --ry: -14deg; --rz: 1.5deg; --float-delay: 0s; }
.feature-row.reverse .clip, .moment:nth-child(even) .clip { --ry: 14deg; --rz: -1.5deg; }
.moment:nth-child(3n + 2) .clip { --float-delay: -2s; }
.moment:nth-child(3n) .clip { --float-delay: -4s; }
.clip .phone {
  transform: rotateX(calc(var(--rx) + var(--tx, 0deg))) rotateY(calc(var(--ry) + var(--ty, 0deg))) rotateZ(var(--rz));
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
  box-shadow: 0 0 0 1px var(--phone-rim), 0 46px 70px -38px var(--ground), inset 0 0 0 1px var(--phone-rim);
  animation: phone-float 6s ease-in-out var(--float-delay) infinite;
  will-change: transform, translate;
}
.clip .phone::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit;
  background: linear-gradient(118deg, rgba(255, 255, 255, 0.20) 0%, rgba(255, 255, 255, 0.05) 26%, transparent 42%, transparent 78%, rgba(255, 255, 255, 0.06) 100%);
}
.clip::after {
  content: ""; position: absolute; left: 50%; bottom: 0.35rem; width: min(74%, 230px); height: 1.7rem; pointer-events: none;
  border-radius: 50%; background: radial-gradient(closest-side, var(--ground), transparent 70%), radial-gradient(closest-side, var(--screen-glow), transparent);
  filter: blur(5px); transform: translateX(-50%);
  animation: phone-ground 6s ease-in-out var(--float-delay) infinite;
}
.moment .clip::after { width: min(70%, 180px); height: 1.4rem; }
/* On the black table the screen's light shows around the shadow, so the glow is wider than it. */
.clip::after { box-shadow: 0 0 34px 10px var(--screen-glow); }
@keyframes phone-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }
@keyframes phone-ground { 0%, 100% { transform: translateX(-50%) scale(1); opacity: 1; } 50% { transform: translateX(-50%) scale(0.8); opacity: 0.55; } }
@media (max-width: 40rem) { .clip { --rx: 7deg; --ry: -9deg; } .feature-row.reverse .clip, .moment:nth-child(even) .clip { --ry: 9deg; } }
@media (prefers-reduced-motion: reduce) { .clip .phone, .clip::after { animation: none; transition: none; } }
/* PhonIQ's own launcher icons (Calls, Messages, Money), cut from the app's icon render. */
.pillar-icon { display: block; width: 4rem; height: 4rem; margin-bottom: 0.85rem; border-radius: 16px; box-shadow: 0 8px 20px -10px rgba(2, 60, 100, 0.55); }

/* The promo loop on the home page (assets/js/clips.js mountPromo). */
.promo { position: relative; margin: 0; border-radius: 24px; overflow: hidden; background: #06101E;
  box-shadow: 0 24px 60px -24px rgba(2, 40, 70, 0.45); aspect-ratio: 16 / 9; }
.promo img, .promo-video { display: block; width: 100%; height: 100%; object-fit: cover; }
.promo-video { position: absolute; inset: 0; background: transparent; }
.promo-caption { margin-top: 0.75rem; font-size: 0.9rem; }
@media (max-width: 40rem) { .promo { border-radius: 16px; } }
