/* Phim: the app's App Store look. A deep indigo night with violet and pink glows (the icon's
   ground), white glass panels like the keyboard's own keys, and the peach-to-pink of the slide
   titles for one word at a time. The text-style playground runs the app's own styles (textstyles.js). */

:root {
    --night: #15132E;
    --night-2: #221C4A;
    --ink: #17152B;
    --ink-2: #45425C;
    --muted: #5F5B76;           /* 5.9:1 on --paper */
    --paper: #F6F4FB;
    --paper-2: #ECE8F6;
    --card: #FFFFFF;
    --line: rgba(23, 21, 43, .12);
    --violet: #6A4BD8;
    --violet-text: #5A3CC4;     /* 6.2:1 on paper */
    --pink: #E0559A;
    --peach: #FFB27D;
    --on-dark: #F3F1FF;
    --on-dark-2: #BDB7DD;       /* 8.4:1 on night */
    --shadow: 0 1px 2px rgba(23, 21, 43, .06), 0 16px 40px rgba(23, 21, 43, .12);
    --display: 'Outfit', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--sans); background: var(--paper); color: var(--ink); line-height: 1.55; -webkit-font-smoothing: antialiased; text-wrap: pretty; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
ul, ol { list-style: none; }
button, input { font: inherit; color: inherit; }
h1, h2, h3, dt, strong { text-wrap: balance; }
.nw { white-space: nowrap; }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; border-radius: 6px; }

.wrap { position: relative; max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 300; padding: 10px 16px; border-radius: 10px; background: var(--ink); color: #fff; }
.skip:focus { left: 16px; }

/* ---------- Navigation ---------- */
.navbar { position: fixed; inset: 0 0 auto; z-index: 100; background: rgba(21, 19, 46, .82); -webkit-backdrop-filter: saturate(1.4) blur(16px); backdrop-filter: saturate(1.4) blur(16px); border-bottom: 1px solid rgba(255, 255, 255, .08); color: var(--on-dark); }
.nav-container { max-width: 1160px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; gap: 16px; }
.nav-back { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; color: var(--on-dark-2); }
.nav-back:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-logo { display: flex; align-items: center; gap: 10px; margin-right: auto; text-decoration: none; }
.nav-icon { width: 30px; height: 30px; border-radius: 8px; }
.logo-text { font-family: var(--display); font-weight: 700; font-size: 1.2rem; letter-spacing: -0.01em; }
.nav-links { display: flex; gap: 26px; }
.nav-links a { font-size: 0.9rem; font-weight: 500; color: var(--on-dark-2); text-decoration: none; }
.nav-links a:hover { color: #fff; }
.nav-cta { font-size: 0.88rem; font-weight: 700; padding: 9px 18px; border-radius: 999px; background: linear-gradient(135deg, var(--violet), var(--pink)); color: #fff; text-decoration: none; }
.mobile-toggle { display: none; flex-direction: column; gap: 5px; padding: 8px; background: none; border: 0; cursor: pointer; }
.mobile-toggle span { width: 22px; height: 2px; border-radius: 1px; background: var(--on-dark); }

/* ---------- Type ---------- */
.kicker { display: inline-flex; align-items: center; gap: 10px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--violet-text); }
h1 { font-family: var(--display); font-size: clamp(2.8rem, 6.2vw, 4.8rem); font-weight: 700; line-height: 1.02; letter-spacing: -0.03em; margin: 20px 0 22px; }
h1 .l2 { display: block; text-wrap: balance; }
h1 .grad, h2 .grad { background: linear-gradient(90deg, var(--peach), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { font-family: var(--display); font-size: clamp(2rem, 4.2vw, 3.1rem); font-weight: 700; line-height: 1.06; letter-spacing: -0.025em; margin: 12px 0 16px; }
h3 { font-family: var(--display); font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
.lede { font-size: 1.15rem; line-height: 1.65; max-width: 34em; text-wrap: pretty; }
.body { font-size: 1.05rem; line-height: 1.65; color: var(--ink-2); max-width: 40em; }
.body + .body { margin-top: 12px; }
.note { font-size: 0.9rem; line-height: 1.6; color: var(--muted); margin-top: 22px; max-width: 52em; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: clip; padding: 128px 0 88px; background: radial-gradient(120% 120% at 70% 0%, #2B2160 0%, var(--night) 55%); color: var(--on-dark); }
.glow { position: absolute; border-radius: 50%; filter: blur(70px); pointer-events: none; }
.g1 { width: 520px; height: 520px; right: -120px; top: 40px; background: radial-gradient(circle, rgba(224, 85, 154, .55), transparent 65%); }
.g2 { width: 460px; height: 460px; left: -160px; bottom: -160px; background: radial-gradient(circle, rgba(106, 75, 216, .55), transparent 65%); }
.g3 { width: 520px; height: 520px; right: -160px; top: -120px; background: radial-gradient(circle, rgba(224, 85, 154, .4), transparent 65%); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: center; }
.eyebrow { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-family: var(--display); font-size: 1.35rem; font-weight: 700; }
.eyebrow img { width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 8px 20px rgba(0, 0, 0, .35); }
.eyebrow span { color: var(--on-dark-2); font-weight: 500; }
.eyebrow .eyebrow-mean { font-family: var(--sans); font-size: 0.9rem; font-weight: 500; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .08); }
.hero .lede { color: var(--on-dark-2); }
.soon { display: flex; flex-direction: column; gap: 10px; margin-top: 30px; }
.store-badge { align-self: flex-start; display: inline-block; line-height: 0; border-radius: 12px; }
.store-badge img { display: block; height: 52px; width: auto; }
.store-badge:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.soon-note { font-size: 0.9rem; color: var(--on-dark-2); }
.promise { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.promise li { padding: 6px 13px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); font-size: 0.86rem; font-weight: 600; }
.promise li::before { content: "✓"; margin-right: 6px; color: var(--peach); }

.hero-art { position: relative; padding: 30px 0 40px; }
.tablet { margin: 0; padding: 10px 10px 0; border-radius: 28px 28px 14px 14px; background: #0E0D1F; box-shadow: 0 30px 80px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .1); }
.tablet img { border-radius: 20px 20px 8px 8px; }
.hero-art .phone { position: absolute; right: -14px; bottom: -6px; width: 34%; }
.phone { margin: 0; padding: 7px; border-radius: 34px; background: #0E0D1F; box-shadow: 0 2px 4px rgba(0,0,0,.1), 0 26px 60px rgba(0, 0, 0, .45); }
.phone img { border-radius: 28px; }

/* ---------- Sections ---------- */
.section { position: relative; padding: 104px 0; }
.section.tint { background: var(--paper-2); }
.head { max-width: 780px; margin-bottom: 40px; }
.split { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 56px; align-items: center; }
.tablet.wide { padding: 10px 10px 0; }

/* The playground */
.playground { padding: 26px; border-radius: 26px; background: var(--card); box-shadow: var(--shadow); }
.field { display: block; }
.field span { display: block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.field input { width: 100%; padding: 14px 18px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--paper); font-size: 1.15rem; }
.field input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px rgba(106, 75, 216, .15); }
.frames { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 6px; }
.frames button { padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font-size: 0.85rem; cursor: pointer; }
.frames button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; margin-top: 14px; }
.results li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--paper); }
.results .name { grid-column: 1; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.results .out { grid-column: 1; font-size: 1.2rem; line-height: 1.35; overflow-wrap: anywhere; }
.results button { grid-column: 2; grid-row: 1 / span 2; padding: 8px 14px; border-radius: 999px; border: 0; background: var(--ink); color: #fff; font-size: 0.82rem; font-weight: 700; cursor: pointer; }
.results button.copied { background: var(--violet); }

/* Ticks */
.ticks { margin-top: 20px; }
.ticks li { position: relative; padding: 10px 0 10px 28px; border-top: 1px solid var(--line); font-size: 0.98rem; line-height: 1.55; color: var(--ink-2); }
.ticks li::before { content: ""; position: absolute; left: 2px; top: 17px; width: 12px; height: 6px; border-left: 2.5px solid var(--pink); border-bottom: 2.5px solid var(--pink); transform: rotate(-45deg); }
.ticks strong { color: var(--ink); }

/* Languages */
.scripts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.script { padding: 18px 20px; border-radius: 18px; background: var(--card); box-shadow: 0 0 0 1px var(--line); }
.script:first-child { grid-column: span 2; grid-row: span 2; }
.script h3 { font-size: 0.82rem; font-family: var(--sans); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--violet-text); margin-bottom: 8px; }
.script p { font-size: 1.02rem; line-height: 1.7; }
.script:first-child p { font-size: 1.12rem; line-height: 1.8; }
.engines { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.engines div { padding: 16px 18px; border-radius: 16px; background: rgba(255, 255, 255, .6); }
.engines dt { font-family: var(--display); font-weight: 700; margin-bottom: 4px; }
.engines dd { font-size: 0.92rem; color: var(--ink-2); line-height: 1.5; }

/* Toolbox */
.tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tool { padding: 12px 12px 22px; border-radius: 24px; background: var(--card); box-shadow: 0 0 0 1px var(--line); }
.tool img { display: block; width: 100%; height: auto; border-radius: 15px; box-shadow: 0 1px 2px rgba(21, 19, 46, 0.08), 0 8px 22px rgba(21, 19, 46, 0.10); }
.tool h3 { margin: 18px 10px 6px; }
.tool p { margin: 0 10px; }
.tool p { font-size: 0.93rem; line-height: 1.55; color: var(--ink-2); }

/* Privacy */
.section.dark { overflow: clip; background: radial-gradient(120% 120% at 0% 100%, #2B2160 0%, var(--night) 60%); color: var(--on-dark); }
.dark .kicker { color: var(--peach); }
.dark .body { color: var(--on-dark-2); }
.dark .body a { color: #fff; font-weight: 700; text-underline-offset: 4px; }
.privacy { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.access { display: grid; gap: 10px; }
.access div { padding: 18px 20px; border-radius: 18px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); }
.access dt { font-family: var(--display); font-weight: 700; font-size: 1.1rem; margin-bottom: 4px; }
.access dd { font-size: 0.95rem; color: var(--on-dark-2); line-height: 1.55; }

/* Screenshots */
.shots-section { padding-bottom: 88px; }
.shots-row { display: flex; align-items: center; gap: 14px; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.shots { flex: 1; min-width: 0; display: flex; gap: 20px; overflow-x: auto; padding: 8px 4px 24px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.shots::-webkit-scrollbar { display: none; }
.shot { flex: 0 0 236px; scroll-snap-align: start; margin: 0; }
.shot img { width: 100%; border-radius: 18px; box-shadow: var(--shadow); }
.shot figcaption { margin-top: 12px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.scroll-btn { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; transition: background .2s, color .2s, opacity .2s; }
.scroll-btn:hover { background: var(--ink); color: #fff; }
.scroll-btn:disabled { opacity: .35; cursor: default; background: var(--card); color: var(--ink); }

/* Download */
.cta { position: relative; overflow: clip; padding: 96px 0 104px; text-align: center; background: radial-gradient(100% 120% at 50% 0%, #2B2160 0%, var(--night) 60%); color: var(--on-dark); }
.cta-inner { display: flex; flex-direction: column; align-items: center; }
.cta .store-badge { align-self: center; margin: 10px 0 22px; }
.cta .cta-mail { font-size: 0.95rem; }
.cta-icon { width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 16px 40px rgba(0, 0, 0, .4); }
.cta h2 { margin-top: 24px; max-width: 14em; }
.cta .body { color: var(--on-dark-2); }
.cta .body a { color: #fff; font-weight: 700; text-underline-offset: 4px; }

/* Footer */
.footer { padding: 36px 0 40px; background: var(--paper); border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--muted); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.footer-icon { width: 26px; height: 26px; border-radius: 7px; }

/* ---------- Narrower screens ---------- */
@media (max-width: 1020px) {
    .hero-grid, .split, .privacy { grid-template-columns: minmax(0, 1fr); gap: 44px; }
    .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .engines { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .scripts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .nav-links, .nav-cta { display: none; }
    .mobile-toggle { display: flex; }
}
@media (max-width: 640px) {
    .hero { padding: 100px 0 60px; }
    .section { padding: 72px 0; }
    .hero-art .phone { width: 38%; right: -6px; }
    .playground { padding: 18px 14px; }
    .results { grid-template-columns: minmax(0, 1fr); }
    .scripts, .engines, .tools { grid-template-columns: minmax(0, 1fr); }
    .script:first-child { grid-column: auto; grid-row: auto; }
    .scroll-btn { display: none; }
    .shots-row { padding: 0 8px; }
    .shot { flex-basis: 200px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Text contrast to WCAG AA: muted #5F5B76 on paper #F6F4FB 5.9:1, on paper-2 #ECE8F6 5.4:1;
   violet-text #5A3CC4 on paper 6.2:1; on-dark-2 #BDB7DD on night #15132E 8.4:1;
   peach #FFB27D on night 10.6:1. */
