/* YTWatch — ytwatch.app
   Palette sampled from the app icon: #FF0F00 / #FF6259 / #FFAAA5 on white. */

:root {
  color-scheme: light;

  --red:    #FF0F00;
  --coral:  #FF6259;
  --blush:  #FFAAA5;

  --bg:       #FFFFFF;
  --bg-soft:  #FFF6F4;
  --bg-tint:  #FFFAF9;
  --ink:      #170F0E;
  --ink-2:    #4A3F3D;
  --muted:    #7C6F6C;
  --line:     #F2E2DF;
  --line-2:   #FBEEEC;

  --radius-sm: 12px;
  --radius:    18px;
  --radius-lg: 28px;

  --shadow-sm: 0 1px 2px rgba(80, 20, 12, .05), 0 4px 12px rgba(80, 20, 12, .04);
  --shadow:    0 2px 4px rgba(80, 20, 12, .05), 0 12px 32px rgba(80, 20, 12, .07);
  --shadow-lg: 0 4px 8px rgba(80, 20, 12, .05), 0 28px 64px rgba(80, 20, 12, .11);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter,
          system-ui, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", sans-serif;

  --wrap: 1120px;
  --pad: 24px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -.022em;
  margin: 0 0 .5em;
  font-weight: 700;
}
h1 { font-size: clamp(2.35rem, 6vw, 3.85rem); letter-spacing: -.035em; }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.6rem); letter-spacing: -.03em; }
h3 { font-size: 1.12rem; letter-spacing: -.015em; }
p  { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: 6px;
}

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--red); color: #fff; padding: 12px 18px;
  border-radius: 0 0 var(--radius-sm) 0; z-index: 100;
}
.skip:focus { left: 0; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line-2);
}
.nav {
  display: flex; align-items: center; gap: 20px;
  height: 62px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); font-weight: 650; font-size: 1.06rem;
  letter-spacing: -.02em; margin-right: auto;
}
.brand:hover { text-decoration: none; }
.brand svg { width: 28px; height: 28px; flex: none; }

/* margin-right, not a bigger .nav gap: this separates the links from the CTA
   without also pushing the wordmark around. Collapses with the links below. */
.nav-links { display: flex; align-items: center; gap: 26px; margin-right: 24px; }
.nav-links a {
  color: var(--ink-2); font-size: .95rem; font-weight: 500;
}
.nav-links a:hover { color: var(--red); text-decoration: none; }
/* Two short links fit far below the old 860px cutoff, which was sized for five. */
@media (max-width: 600px) { .nav-links { display: none; } }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px;
  font-size: .97rem; font-weight: 600; letter-spacing: -.01em;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: var(--red); color: #fff;
  box-shadow: 0 1px 2px rgba(255, 15, 0, .3), 0 8px 22px rgba(255, 15, 0, .26);
}
.btn-primary:hover { background: #EB0E00; box-shadow: 0 2px 4px rgba(255,15,0,.3), 0 14px 30px rgba(255,15,0,.32); }
.btn-ghost {
  background: #fff; color: var(--ink); border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { border-color: var(--blush); }
.btn-sm { padding: 9px 18px; font-size: .9rem; }

/* App Store badge */
.appstore { display: inline-block; line-height: 0; transition: transform .18s ease, opacity .18s ease; }
.appstore:hover { transform: translateY(-1px); opacity: .88; text-decoration: none; }
.appstore svg { width: 168px; height: 56px; display: block; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: clamp(52px, 8vw, 104px) 0 clamp(48px, 7vw, 88px);
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: -30% -20% auto -20%; height: 780px;
  background:
    radial-gradient(48% 52% at 22% 34%, rgba(255, 98, 89, .19), transparent 70%),
    radial-gradient(42% 46% at 78% 20%, rgba(255, 170, 165, .26), transparent 72%);
  pointer-events: none; z-index: 0;
}
.hero > .wrap { position: relative; z-index: 1; }

.hero-grid {
  display: grid; grid-template-columns: 1.05fr .95fr;
  gap: clamp(28px, 5vw, 64px); align-items: center;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-copy .eyebrow, .hero-actions, .hero-meta { justify-content: center; }
  .hero-copy p { margin-inline: auto; }
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255, 15, 0, .06);
  border: 1px solid rgba(255, 15, 0, .16);
  color: var(--red); font-size: .82rem; font-weight: 600;
  letter-spacing: .01em; padding: 7px 15px; border-radius: 999px;
  margin-bottom: 22px;
}
.eyebrow-icon { width: 14px; height: 14px; flex: none; }

.hero-copy .lede {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--muted); max-width: 30em; margin-bottom: 30px;
}
.hero-copy .lede strong { color: var(--ink-2); font-weight: 600; }

.hero-actions {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-bottom: 26px;
}

/* Chips rather than text + divider rules: these four items wrap at almost every
   width, and a divider stranded at the start of a wrapped line looks broken. */
.hero-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: .82rem; color: var(--muted);
}
.hero-meta > span {
  background: #fff; border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px; white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.stars { color: var(--red); letter-spacing: .06em; }

/* ---------- Device shots ----------
   assets/shot-*.png are alpha cutouts of the raw screenshots in /screenshots
   (white background flood-filled to transparent), so they sit on any backdrop
   and can be freely transformed. */

.device-shot { height: auto; }

.hero-art { display: flex; justify-content: center; }
.hero-art .device-shot { width: min(100%, 355px); }
@media (max-width: 900px) {
  .hero-art { margin-top: 18px; }
  .hero-art .device-shot { width: min(82%, 300px); }
}

/* ---------- Sections ---------- */

section { padding: clamp(56px, 8vw, 96px) 0; }
.section-soft { background: var(--bg-soft); }
.section-head { max-width: 46rem; margin-bottom: clamp(32px, 5vw, 52px); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head p { color: var(--muted); font-size: 1.05rem; margin-bottom: 0; }
.kicker {
  display: block; font-size: .8rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--red); margin-bottom: 12px;
}

/* ---------- Cards ---------- */

.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 24px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--blush); }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); font-size: .95rem; margin: 0; }

.icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; margin-bottom: 16px;
  background: linear-gradient(150deg, rgba(255, 15, 0, .12), rgba(255, 170, 165, .22));
  color: var(--red);
}
.icon svg { width: 21px; height: 21px; }

.pill {
  display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--red);
  background: rgba(255, 15, 0, .08); border-radius: 999px;
  padding: 3px 9px; margin-left: 8px; vertical-align: 2px;
}

/* Feature list (compact, two columns) */
.feature-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 44px; }
@media (max-width: 760px) { .feature-list { grid-template-columns: 1fr; } }
.feature-list .item {
  display: flex; gap: 14px; padding: 18px 0;
  border-bottom: 1px solid var(--line-2);
}
.feature-list .item .icon { margin-bottom: 0; flex: none; width: 36px; height: 36px; border-radius: 10px; }
.feature-list .item .icon svg { width: 18px; height: 18px; }
.feature-list h3 { font-size: 1rem; margin-bottom: 3px; }
.feature-list p { font-size: .92rem; color: var(--muted); margin: 0; }

/* ---------- Split ---------- */

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.split-art { display: flex; justify-content: center; }
.split-art .device-shot { width: min(100%, 320px); }
@media (max-width: 860px) { .split-art .device-shot { width: min(82%, 300px); } }

.checks { list-style: none; margin: 0; padding: 0; }
.checks li {
  position: relative; padding: 9px 0 9px 32px;
  color: var(--ink-2); font-size: 1rem;
}
.checks li::before {
  content: ""; position: absolute; left: 0; top: 15px;
  width: 19px; height: 19px; border-radius: 50%;
  background: rgba(255, 15, 0, .09) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF0F00' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* ---------- FAQ ---------- */

.faq { max-width: 780px; margin-inline: auto; }
.faq details {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 4px 22px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
}
.faq details[open] { border-color: var(--blush); }
.faq summary {
  cursor: pointer; list-style: none; padding: 18px 34px 18px 0;
  font-weight: 600; color: var(--ink); font-size: 1.02rem;
  position: relative; letter-spacing: -.012em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 2px; top: 50%;
  width: 12px; height: 12px; margin-top: -8px;
  border-right: 2.2px solid var(--red); border-bottom: 2.2px solid var(--red);
  transform: rotate(45deg); transition: transform .22s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -3px; }
.faq .answer { padding: 0 0 20px; color: var(--muted); font-size: .96rem; }

/* ---------- CTA ---------- */

.cta-band {
  background: linear-gradient(150deg, #FF2A18 0%, var(--red) 42%, #E00D00 100%);
  border-radius: var(--radius-lg);
  padding: clamp(40px, 6vw, 66px) clamp(28px, 5vw, 60px);
  text-align: center; color: #fff;
  box-shadow: 0 22px 60px rgba(255, 15, 0, .28);
}
.cta-band h2 { color: #fff; margin-bottom: 12px; }
.cta-band p { color: rgba(255, 255, 255, .9); max-width: 34em; margin: 0 auto 28px; }
.cta-band .appstore svg .badge-bg { fill: #fff; }
.cta-band .appstore svg .badge-fg { fill: #16110F; }
.cta-band .appstore svg .badge-stroke { stroke: rgba(0,0,0,.14); }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line-2);
  background: var(--bg-tint);
  padding: 52px 0 40px; font-size: .9rem; color: var(--muted);
}
.footer-top {
  display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap;
  padding-bottom: 30px; border-bottom: 1px solid var(--line);
}
.footer-brand { max-width: 26rem; }
.footer-brand .brand { margin-bottom: 12px; }
.footer-nav { display: flex; gap: 56px; flex-wrap: wrap; }
.footer-nav h4 { font-size: .78rem; letter-spacing: .09em; text-transform: uppercase; color: var(--ink); margin-bottom: 12px; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; }
.footer-nav li { margin-bottom: 9px; }
.footer-nav a { color: var(--muted); }
.footer-nav a:hover { color: var(--red); }
.footer-bottom { padding-top: 26px; display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; font-size: .84rem; }
.disclaimer { font-size: .84rem; line-height: 1.6; }

/* ---------- Legal pages ---------- */

.legal-hero { padding: clamp(44px, 6vw, 72px) 0 clamp(24px, 3vw, 34px); background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.legal-hero h1 { font-size: clamp(2rem, 4.4vw, 2.9rem); margin-bottom: 10px; }
.legal-hero .updated { color: var(--muted); font-size: .95rem; margin: 0; }

.legal { padding: clamp(38px, 5vw, 60px) 0 clamp(56px, 7vw, 88px); }
.legal .wrap { max-width: 800px; }
.legal h2 {
  font-size: 1.32rem; letter-spacing: -.018em;
  margin: 42px 0 12px; padding-top: 4px;
}
.legal h2:first-of-type { margin-top: 0; }
.legal h3 { font-size: 1.02rem; margin: 24px 0 8px; }
.legal p, .legal li { font-size: .99rem; line-height: 1.72; }
.legal ul { padding-left: 22px; margin: 0 0 1em; }
.legal li { margin-bottom: 7px; }
.legal a { word-break: break-word; }
.legal .caps { font-size: .93rem; }

.toc {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 26px; margin-bottom: 40px; box-shadow: var(--shadow-sm);
}
.toc h2 { font-size: .78rem !important; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px !important; }
.toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 32px; }
@media (max-width: 620px) { .toc ol { columns: 1; } }
.toc li { margin-bottom: 6px; font-size: .93rem; }
.toc a { color: var(--ink-2); }
.toc a:hover { color: var(--red); }

.callout {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  border-radius: var(--radius-sm); padding: 18px 22px; margin: 0 0 32px;
}
.callout p { margin: 0; font-size: .95rem; color: var(--ink-2); }

.legal-nav { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 46px; padding-top: 30px; border-top: 1px solid var(--line); }

/* ---------- 404 ---------- */
.notfound { min-height: 58vh; display: grid; place-items: center; text-align: center; padding: 80px 0; }
.notfound .code { font-size: 4.5rem; font-weight: 700; color: var(--red); letter-spacing: -.05em; line-height: 1; margin-bottom: 8px; }
.notfound-title { font-size: 1.7rem; }
.notfound-text { color: var(--muted); max-width: 30em; margin: 0 auto 26px; }

/* ---------- Small utilities ----------
   These exist as classes rather than style="" attributes because the CSP in
   _headers sets style-src 'self', which blocks inline style attributes. */

.wrap-narrow { max-width: 800px; }
.footer-bottom-flush { padding-top: 0; }
.split-lede { color: var(--muted); font-size: 1.05rem; margin-bottom: 20px; }
.split-note { margin-top: 22px; font-size: .9rem; color: var(--muted); }

/* ============ MOTION ============
   Every rule here is scoped to html.js, which assets/motion.js sets before
   first paint. No script, no hidden content. */

@keyframes rise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* Hero entrance — pure CSS, no observer needed above the fold. */
.hero-copy > *,
.hero-art { animation: rise .85s cubic-bezier(.22, .9, .3, 1) backwards; }
.hero-copy .eyebrow  { animation-delay: .04s; }
.hero-copy h1        { animation-delay: .12s; }
.hero-copy .lede     { animation-delay: .20s; }
.hero-actions        { animation-delay: .28s; }
.hero-meta           { animation-delay: .36s; }
.hero-art            { animation-delay: .18s; }

.hero-art .device-shot { animation: floaty 7s ease-in-out 1.2s infinite; }

/* Scroll reveal */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .75s cubic-bezier(.22, .9, .3, 1),
              transform .75s cubic-bezier(.22, .9, .3, 1);
}
.js .reveal.in { opacity: 1; transform: none; }

/* Stagger within each group. nth-child rather than a --delay custom property
   so no inline style attribute is needed (see CSP note above). */
.js .grid > .reveal:nth-child(2)         { transition-delay: .09s; }
.js .grid > .reveal:nth-child(3)         { transition-delay: .18s; }
.js .feature-list > .reveal:nth-child(n) { transition-delay: .05s; }
.js .feature-list > .reveal:nth-child(3),
.js .feature-list > .reveal:nth-child(4) { transition-delay: .12s; }
.js .feature-list > .reveal:nth-child(5),
.js .feature-list > .reveal:nth-child(6) { transition-delay: .19s; }
.js .feature-list > .reveal:nth-child(7),
.js .feature-list > .reveal:nth-child(8) { transition-delay: .26s; }
.js .faq > .reveal:nth-child(n+2) { transition-delay: .06s; }
.js .faq > .reveal:nth-child(n+4) { transition-delay: .12s; }

/* Header gains a hairline shadow once the page moves. */
.site-header { transition: box-shadow .3s ease, border-color .3s ease; }
.site-header.is-scrolled {
  box-shadow: 0 1px 0 rgba(80, 20, 12, .04), 0 6px 24px rgba(80, 20, 12, .06);
  border-bottom-color: transparent;
}

/* Micro-interactions */
.card .icon,
.feature-list .item .icon { transition: transform .25s cubic-bezier(.22, .9, .3, 1); }
.card:hover .icon { transform: scale(1.08) rotate(-3deg); }
.feature-list .item:hover .icon { transform: scale(1.08); }
.nav-links a { transition: color .2s ease; }
.checks li { transition: transform .25s ease; }
.checks li:hover { transform: translateX(3px); }

/* Smoothly expand FAQ answers where the browser supports it. */
@supports selector(details::details-content) {
  .faq details::details-content {
    block-size: 0;
    overflow: hidden;
    transition: block-size .32s cubic-bezier(.22, .9, .3, 1),
                content-visibility .32s allow-discrete;
  }
  .faq details[open]::details-content { block-size: auto; }
}

/* Reduced motion: the global rule near the top already collapses every
   duration; this also drops the transforms so nothing shifts at all. */
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; }
  .hero-copy > *, .hero-art, .hero-art .device-shot { animation: none; }
  .card:hover .icon, .feature-list .item:hover .icon, .checks li:hover { transform: none; }
}
