/* Telly landing page: the app's "Lilac Keys" look on the web. Tokens mirror TellyTheme. */
:root {
  --butter: #FFF6DF;
  --ink: #2A2440;
  --ink-2: #5B5470;
  --key: #5B47C9;
  --key-ink: #FFFFFF;
  --lilac: #B9A6FF;
  --mist: #EFEAFF;
  --yellow: #FFD45C;
  --pink: #FF9DB5;
  --peach: #FCE3D7;
  --surface: #FFFFFF;
  --line: 2.5px solid var(--ink);
  --drop: 4px 4px 0 var(--ink);
  --radius: 22px;
  --radius-lg: 32px;
  --rounded: ui-rounded, "SF Pro Rounded", "SF Pro Display", system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Apple-style springs as linear() curves: settle (damping 1, response .4) and pop (damping .8). */
  --spring: linear(0, .009, .035 2.1%, .141 4.4%, .723 12.9%, .938 16.7%, 1.017 20.8%, 1.035 23.5%, 1.03 27.2%, 1.006 36.2%, .998 44.5%, 1);
  --settle: cubic-bezier(.2, .8, .2, 1);
  --page: min(1120px, calc(100% - 40px));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --butter: #17142A;
    --ink: #F4EEFF;
    --ink-2: #B9B2D0;
    --key: #8C79F0;
    --surface: #221E38;
    --mist: #221D3D;
    --peach: #2B2238;
    --lilac: #3A3166;
    --key-ink: #120F24; /* white on the lighter dark-mode key is only ~3:1; deep ink is 5.5:1 */
    --drop: 4px 4px 0 #0B0918;
    --line: 2.5px solid #4A4170; /* a near-black outline vanished against the dark butter */
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--butter);
  color: var(--ink);
  font: 600 1.0625rem/1.55 var(--rounded);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip; /* stickers may overhang their art; never let them scroll the page sideways */
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2 { font-weight: 900; letter-spacing: -0.02em; line-height: 1.05; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
h2 { font-size: clamp(2rem, 4.2vw, 3.1rem); }
p { margin: 0 0 1em; }
.lede { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--ink-2); max-width: 34ch; text-wrap: pretty; }
.fine { font-size: .9rem; color: var(--ink-2); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 900; color: var(--key); margin-bottom: .6rem; }
:focus-visible { outline: 3px solid var(--key); outline-offset: 3px; border-radius: 8px; }

/* Keycaps: buttons only. Press = sink into the shadow, instantly. */
.key {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  background: var(--key); color: var(--key-ink); text-decoration: none;
  font-weight: 900; border: var(--line); border-radius: 18px; box-shadow: var(--drop);
  min-height: 44px; padding: 0 1.2em;
  transition: transform .18s var(--settle), box-shadow .18s var(--settle);
}
@media (hover: hover) { .key:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 #0B0918; } }
@media (hover: hover) and (prefers-color-scheme: light) { .key:hover { box-shadow: 5px 5px 0 var(--ink); } }
.key:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink); transition-duration: 0s; }
.key-small { min-height: 40px; padding: 0 1em; font-size: .95rem; border-radius: 14px; }
.key-large { min-height: 56px; font-size: 1.1rem; padding: 0 1.5em; }

/* Stickers: thin outline, no shadow, a slight tilt. */
.sticker {
  position: absolute; z-index: 2;
  font-weight: 900; font-size: .85rem; letter-spacing: .04em; white-space: nowrap;
  padding: .45em .9em; border-radius: 999px; border: 2px solid #2A2440; color: #2A2440;
}
.sticker-yellow { background: var(--yellow); }
.sticker-pink { background: var(--pink); }
.sticker-mist { background: #EFEAFF; }

/* Navigation: a translucent butter bar. */
.site-nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--butter) 75%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
}
.nav-inner { width: var(--page); margin: 0 auto; height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.nav-icon { width: 36px; height: 36px; border-radius: 9px; border: 2px solid #2A2440; }
.wordmark { font-weight: 900; font-size: 1.5rem; letter-spacing: -0.03em; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-link { text-decoration: none; font-weight: 800; color: var(--ink-2); }
.nav-link:hover { color: var(--ink); }
@media (max-width: 720px) { .nav-link { display: none; } }

/* Hero */
.hero { padding: clamp(32px, 6vw, 80px) 0 40px; overflow: clip; }
.hero-inner { width: var(--page); margin: 0 auto; display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 40px; }
.hero-copy h1 { max-width: 12ch; }
.hero-lede { margin-bottom: 1.6rem; }
.hero-art { position: relative; justify-self: center; }
.hero-art .float-1 { top: 10%; left: -14%; rotate: -6deg; }
.hero-art .float-2 { top: 42%; right: -12%; rotate: 5deg; }
.hero-art .float-3 { bottom: 12%; left: -10%; rotate: 3deg; }
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-copy h1, .hero-lede { margin-inline: auto; }
  .download { justify-content: center; }
}

.mascot-button { background: none; border: 0; padding: 0; margin: 0 0 12px -6px; cursor: pointer; }
.mascot svg { display: block; width: 100%; height: auto; overflow: visible; }
.mascot-hero { width: 112px; }
.mascot-small { width: 96px; margin: 0 auto 16px; }
@media (max-width: 860px) { .mascot-button { margin-inline: auto; } }

/* The TV turns on: a flicker of static, then Telly's face. Replays when tapped. */
.tv-static { opacity: 0; }
.mascot.is-waking .tv-static { animation: tv-static .9s steps(6) both; }
.mascot.is-waking .tv-face { animation: tv-face .9s var(--settle) both; }
.mascot.is-waking svg { animation: tv-boing .7s var(--spring) .55s both; transform-origin: 50% 90%; }
@keyframes tv-static { 0% { opacity: 0; } 10%, 70% { opacity: 1; } 100% { opacity: 0; } }
@keyframes tv-face { 0%, 60% { opacity: 0; transform: scaleY(.1); } 100% { opacity: 1; transform: none; } }
@keyframes tv-boing { from { transform: scale(.94, 1.04); } to { transform: none; } }
.tv-face { transform-box: fill-box; transform-origin: center; }
.mascot [data-part="eye-left"], .mascot [data-part="eye-right"] { transform-box: fill-box; transform-origin: center; animation: blink 7s 2.5s infinite; }
@keyframes blink { 0%, 96%, 100% { transform: none; } 98% { transform: scaleY(.1); } }

/* Download row and counter */
.download { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-bottom: 14px; }
.badge-link { display: inline-block; line-height: 0; border-radius: 10px; }
.badge { height: 54px; width: auto; }
.badge-link.is-missing { display: none; }
.badge-fallback { display: none; }
.badge-link.is-missing + .badge-fallback { display: inline-flex; }
.counter { flex-basis: 100%; margin: 0; font-size: .95rem; font-weight: 800; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.counter .count { display: inline-flex; color: var(--ink); font-weight: 900; }
.digit { display: inline-block; width: 1ch; height: 1.2em; overflow: hidden; position: relative; vertical-align: bottom; }
.digit span { position: absolute; inset: 0; text-align: center; transition: transform .36s var(--settle), opacity .36s; }
.digit .out { transform: translateY(105%); opacity: 0; }
.digit .in-start { transform: translateY(-105%); opacity: 0; }
.sep { display: inline-block; width: .3em; text-align: center; }
@media (max-width: 860px) { .counter { text-align: center; } }

/* Screens: real screenshots, upright, never tilted. */
.screen { margin: 0; position: relative; z-index: 1; }
.screen img {
  width: min(320px, 72vw); border-radius: 44px; border: 3px solid #2A2440;
  box-shadow: 8px 10px 0 #2A2440; background: var(--surface);
}

/* Facts strip */
.facts-strip { padding: 8px 0 24px; }
.facts { width: var(--page); margin: 0 auto; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.facts li { background: var(--surface); border: var(--line); border-radius: var(--radius); padding: 18px 20px; display: grid; gap: 4px; }
.facts strong { font-weight: 900; font-size: 1.05rem; }
.facts span { color: var(--ink-2); font-size: .95rem; }
@media (max-width: 760px) { .facts { grid-template-columns: 1fr; } }

/* Feature sections */
.feature { padding: clamp(56px, 9vw, 112px) 0; overflow-x: clip; }
.tint-mist { background: var(--mist); }
.tint-lilac { background: color-mix(in srgb, var(--lilac) 45%, var(--butter)); }
.feature-inner { width: var(--page); margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 48px; }
.feature-inner.flipped .feature-copy { order: 2; }
.feature-art { position: relative; justify-self: center; }
.feature-art .float-1 { top: 14%; right: -16%; rotate: 6deg; }
@media (max-width: 860px) {
  .feature-inner { grid-template-columns: 1fr; text-align: center; }
  .feature-inner.flipped .feature-copy { order: 0; }
  .feature-copy .lede, .feature-copy h2 { margin-inline: auto; }
  .feature-art .float-1 { right: -6%; }
}

/* FAQ */
.faq { padding: clamp(56px, 9vw, 104px) 0; }
.faq h2 { width: var(--page); margin: 0 auto 28px; text-align: center; }
.faq-list { width: min(760px, calc(100% - 40px)); margin: 0 auto; display: grid; gap: 12px; }
.faq-item { background: var(--surface); border: var(--line); border-radius: var(--radius); padding: 0 22px; }
.faq-item summary { cursor: pointer; font-weight: 900; font-size: 1.08rem; min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.5rem; line-height: 1; transition: rotate .25s var(--settle); }
.faq-item[open] summary::after { rotate: 45deg; }
.faq-item p { color: var(--ink-2); margin: 0 0 18px; }
.faq-item a { color: var(--key); font-weight: 800; }

/* Closing */
.closing { text-align: center; padding: clamp(64px, 10vw, 120px) 20px; }
.closing .download { justify-content: center; }

/* Footer */
.site-footer { border-top: var(--line); padding: 32px 0 40px; }
.footer-row, .footer-legal { width: var(--page); margin: 0 auto; }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand p { margin: 0; font-weight: 800; }
.footer-icon { width: 32px; height: 32px; border-radius: 8px; border: 2px solid #2A2440; }
.footer-links { display: flex; gap: 22px; }
.footer-links a { font-weight: 800; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.footer-links a:hover { text-decoration: underline; }
.footer-legal { margin-top: 20px; font-size: .78rem; color: var(--ink-2); font-weight: 600; }

/* Privacy and support pages */
.legal { width: min(760px, calc(100% - 40px)); margin: 0 auto; padding: 56px 0 80px; }
.legal h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin-bottom: .2em; }
.legal h2 { font-size: 1.4rem; margin-top: 1.8em; }
.legal p, .legal li { color: var(--ink-2); }
.legal a { color: var(--key); font-weight: 800; }
.legal .faq-list { width: 100%; margin-top: 28px; }

/* Scroll reveals: a short settle up, only when motion is welcome. */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--settle), transform .6s var(--settle); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
  .tv-static { opacity: 0; }
}
@media (prefers-reduced-transparency: reduce) {
  .site-nav { background: var(--butter); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --ink-2: var(--ink); }
  .site-nav { background: var(--butter); border-bottom: var(--line); }
}

/* Friends illustration */
.friends-art { width: min(400px, 100%); min-height: 300px; display: grid; align-content: center; gap: 18px; }
.rec-card { background: var(--surface); border: var(--line); border-radius: var(--radius); box-shadow: var(--drop); padding: 18px; text-align: left; }
.card-1 { rotate: -2deg; }
.card-2 { rotate: 1.5deg; margin-left: 28px; }
.rec-head, .rec-mini { display: flex; align-items: center; gap: 10px; }
.rec-head p, .rec-mini p { margin: 0; font-weight: 700; color: var(--ink-2); }
.rec-head strong, .rec-mini strong { color: var(--ink); font-weight: 900; }
.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 2px solid #2A2440; display: grid; place-items: center; font-weight: 900; color: #2A2440; }
.avatar-yellow { background: var(--yellow); }
.avatar-pink { background: var(--pink); }
.rec-body { display: flex; gap: 14px; margin-top: 14px; align-items: flex-start; }
.rec-poster { flex: none; width: 72px; rotate: -3deg; }
.rec-poster svg { display: block; width: 100%; border: 2px solid #2A2440; border-radius: 12px; }
.rec-title { margin: 0 0 4px; font-weight: 900; font-size: 1.15rem; }
.rec-note { margin: 0 0 12px; color: var(--ink-2); font-size: .95rem; }
.rec-add { pointer-events: none; }
.friends-art .float-1 { top: -6%; right: -4%; rotate: 6deg; }
@media (max-width: 520px) {
  .friends-art { min-height: 0; }
  .friends-art .float-1 { top: -18px; right: 6px; }
  .card-2 { margin-left: 16px; }
  .rec-body { gap: 12px; }
  .rec-poster { width: 64px; }
}
