/* ==========================================================
   App pages (one page per app). Loaded after styles.css.
   Each page sets --c and --c-soft on <body> for its app color.
   ========================================================== */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* Nav: "Get the app" button in place of the sound toggle */
.nav-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px;
  background: var(--cream); color: var(--ink);
  font-size: 14px; font-weight: 500; letter-spacing: -.01em;
  transition: transform .35s var(--ease-spring), background .25s;
}
.nav-cta:hover { background: #fff; transform: translateY(-1px); }
.nav-cta svg { width: 15px; height: 15px; }

/* ---------- Hero ---------- */
.app-hero {
  position: relative;
  max-width: var(--max); margin: 0 auto;
  padding: clamp(116px, 16vh, 168px) var(--gutter) clamp(56px, 7vw, 96px);
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: clamp(40px, 6vw, 96px); align-items: center;
}
.app-hero::before {
  content: ""; position: absolute; z-index: -1;
  right: -12%; top: 4%;
  width: 72vw; max-width: 940px; aspect-ratio: 1;
  background: radial-gradient(closest-side, var(--c-soft), transparent 70%);
  pointer-events: none;
}

.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-family: var(--mono); font-size: 13px; color: var(--faint); }
.crumbs a { transition: color .25s; }
.crumbs a:hover { color: var(--text); }

.app-id { margin-top: 30px; display: flex; align-items: center; gap: 18px; }
.app-icon {
  width: 84px; height: 84px; border-radius: 21px; flex: none;
  box-shadow: 0 22px 50px -20px var(--c), 0 0 0 1px var(--line);
}
.app-id b { display: block; font-size: 21px; font-weight: 500; letter-spacing: -.025em; line-height: 1.2; }
.app-id span { display: block; margin-top: 4px; font-size: 14.5px; color: var(--muted); }

.app-title {
  margin-top: 30px;
  font-size: clamp(42px, 5.6vw, 84px);
  font-weight: 500; line-height: .98; letter-spacing: -.05em;
  text-wrap: balance;
}
.app-title em {
  background: linear-gradient(95deg, var(--c) 10%, var(--cream) 120%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-right: .06em;
}
.app-lead { margin-top: 24px; max-width: 54ch; font-size: clamp(17.5px, 1.45vw, 20px); color: var(--muted); }

.app-cta { margin-top: 34px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 26px; }

/* Official store badges (artwork from Apple and Google, unchanged) */
.store-badge {
  display: inline-block; flex: none; border-radius: 12px;
  transition: transform .4s var(--ease-spring), box-shadow .4s, filter .25s;
}
.store-badge img { display: block; height: 56px; width: auto; }
.store-badge:hover { transform: translateY(-3px); box-shadow: 0 24px 60px -24px var(--c); filter: brightness(1.15); }
.store-badge:active { transform: translateY(0) scale(.98); }
.store-badge:focus-visible { outline: 2px solid var(--c); outline-offset: 4px; }

/* "Scan to download" QR code: desktop only, since phone visitors can tap the badge */
.qr-card { display: none; }
@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  .qr-card {
    display: flex; align-items: center; gap: 14px;
    padding: 8px 18px 8px 8px; border: 1px solid var(--line); border-radius: 18px;
    background: rgba(244, 239, 230, .03);
  }
  .qr-card img { width: 84px; height: 84px; border-radius: 10px; background: #fff; }
  .qr-card b { display: block; color: var(--text); font-size: 15px; font-weight: 500; letter-spacing: -.01em; }
  .qr-card span { display: block; margin-top: 2px; max-width: 16ch; color: var(--muted); font-size: 13px; line-height: 1.35; }
}

.rating { display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--muted); }
.rating b { color: var(--text); font-size: 18px; font-weight: 500; letter-spacing: -.02em; }
.rating .stars { color: var(--accent-2); letter-spacing: 2px; font-size: 15px; }
.rating .new { color: var(--c); }

.app-hero .chips { margin-top: 30px; }
.app-hero .chips li { color: var(--muted); }

/* Hero screenshots: three cards that fan out on load */
.shot-fan { position: relative; height: clamp(440px, 46vw, 640px); }
.shot-fan img {
  position: absolute; top: 50%; left: 50%;
  width: clamp(170px, 17.5vw, 262px); height: auto;
  border-radius: clamp(18px, 1.8vw, 26px);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .85), 0 0 0 1px rgba(244, 239, 230, .1);
  transform: translate(-50%, -50%) scale(.92);
  opacity: 0;
  transition: transform 1.3s var(--ease-spring), opacity .8s var(--ease);
}
.shot-fan img:nth-child(2) { z-index: 2; }
.is-loaded .shot-fan img { opacity: 1; }
.is-loaded .shot-fan img:nth-child(1) { transform: translate(-112%, -47%) rotate(-8deg); transition-delay: .15s; }
.is-loaded .shot-fan img:nth-child(2) { transform: translate(-50%, -53%); }
.is-loaded .shot-fan img:nth-child(3) { transform: translate(12%, -47%) rotate(8deg); transition-delay: .25s; }
.shot-fan:hover img:nth-child(1) { transform: translate(-122%, -47%) rotate(-11deg); }
.shot-fan:hover img:nth-child(3) { transform: translate(22%, -47%) rotate(11deg); }

/* ---------- Screenshot gallery ---------- */
.gallery {
  display: flex; gap: 18px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding: 10px max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter))) 26px;
  scroll-padding: 0 max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));
  scrollbar-width: thin; scrollbar-color: rgba(244, 239, 230, .2) transparent;
}
.gallery img {
  flex: 0 0 auto;
  height: clamp(380px, 40vw, 560px); width: auto;
  border-radius: clamp(18px, 1.8vw, 26px);
  scroll-snap-align: start;
  box-shadow: 0 0 0 1px rgba(244, 239, 230, .1);
}
.gallery-hint { margin-top: 4px; font-family: var(--mono); font-size: 12px; color: var(--faint); }

/* ---------- Sections ---------- */
.app-section { padding-top: clamp(96px, 12vw, 160px); }
.app-section .section-head h2 { font-size: clamp(40px, 6vw, 92px); }
.app-section .section-head h2 em {
  background: linear-gradient(95deg, var(--c) 10%, var(--cream) 120%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Features */
.features {
  margin-top: clamp(48px, 6vw, 80px);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: clamp(22px, 2.6vw, 32px); overflow: hidden;
}
.feature { position: relative; background: var(--ink); padding: clamp(26px, 3vw, 40px); transition: background .4s; }
.feature::after {
  content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 2px;
  background: var(--c); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease);
}
.feature:hover { background: var(--ink-2); }
.feature:hover::after { transform: scaleX(1); }
.feature-no { font-family: var(--mono); font-size: 13px; color: var(--c); }
.feature h3 { margin-top: clamp(28px, 3.4vw, 48px); font-size: clamp(21px, 1.8vw, 25px); font-weight: 500; letter-spacing: -.03em; line-height: 1.15; }
.feature p { margin-top: 10px; font-size: 16px; color: var(--muted); }

/* How it works (cream band) */
.how {
  margin-top: clamp(96px, 12vw, 160px);
  padding: clamp(80px, 11vw, 150px) 0;
  background: var(--cream); color: var(--ink);
  border-radius: clamp(28px, 4vw, 56px);
  --muted: rgba(14, 13, 20, .64);
  --line: rgba(14, 13, 20, .12);
}
.how .kicker { color: rgba(14, 13, 20, .55); }
.how .section-head h2 { font-size: clamp(40px, 6vw, 92px); }
.how .section-head h2 em {
  background: linear-gradient(95deg, var(--accent), #C2341A);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.steps { margin-top: clamp(48px, 6vw, 80px); display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
.step { padding: 30px 28px 34px; background: var(--cream-2); border: 1px solid var(--line); border-radius: 26px; }
.step::before {
  counter-increment: step; content: counter(step);
  display: block; font-family: var(--serif); font-style: italic; font-size: clamp(64px, 6vw, 92px); line-height: .9;
  color: var(--accent);
}
.step h3 { margin-top: 26px; font-size: 24px; font-weight: 500; letter-spacing: -.03em; line-height: 1.15; }
.step p { margin-top: 10px; font-size: 16px; color: var(--muted); }

/* FAQ */
.faq { margin-top: clamp(40px, 5vw, 64px); border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: clamp(20px, 2.4vw, 28px) 4px;
  font-size: clamp(19px, 1.7vw, 24px); font-weight: 500; letter-spacing: -.025em; line-height: 1.25;
  transition: color .25s;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--c); }
.faq summary::after {
  content: "+"; flex: none;
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  display: grid; place-items: center;
  font-family: var(--mono); font-weight: 400; font-size: 18px; color: var(--muted);
  transition: transform .4s var(--ease-spring), background .25s, color .25s, border-color .25s;
}
.faq details[open] summary::after { transform: rotate(45deg); background: var(--c); border-color: var(--c); color: var(--ink); }
.faq details p { padding: 0 60px clamp(22px, 2.4vw, 30px) 4px; max-width: 72ch; font-size: 17px; color: var(--muted); }

/* Download band */
.get {
  position: relative; overflow: hidden;
  margin-top: clamp(96px, 12vw, 160px);
  padding: clamp(56px, 8vw, 110px) clamp(24px, 5vw, 80px);
  border: 1px solid var(--line); border-radius: clamp(28px, 4vw, 56px);
  background: radial-gradient(120% 140% at 100% 0%, var(--c-soft), transparent 60%), var(--ink-2);
  display: grid; grid-template-columns: auto 1fr auto; gap: clamp(24px, 4vw, 56px); align-items: center;
}
.get .app-icon { width: clamp(84px, 9vw, 128px); height: clamp(84px, 9vw, 128px); border-radius: 28%; }
.get h2 { font-size: clamp(36px, 5vw, 72px); font-weight: 500; line-height: .95; letter-spacing: -.05em; }
.get h2 em {
  background: linear-gradient(95deg, var(--c) 10%, var(--cream) 120%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.get p { margin-top: 12px; color: var(--muted); font-size: 16px; }

/* More apps */
.more { margin-top: clamp(48px, 6vw, 80px); display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.more a {
  display: flex; flex-direction: column; gap: 14px;
  padding: 22px; border: 1px solid var(--line); border-radius: 24px;
  transition: transform .5s var(--ease-spring), border-color .3s, background .3s;
}
.more a:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--mc) 50%, transparent); background: var(--ink-2); }
.more img { width: 56px; height: 56px; border-radius: 14px; transition: transform .6s var(--ease-spring); }
.more a:hover img { transform: rotate(-7deg) scale(1.06); }
.more b { font-size: 18px; font-weight: 500; letter-spacing: -.025em; line-height: 1.2; }
.more span { font-size: 14px; color: var(--muted); }
.more i { margin-top: auto; font-style: normal; font-family: var(--mono); font-size: 12px; color: var(--faint); }

.app-legal { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 8px; }
.app-legal a {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  font-size: 13.5px; color: var(--muted); transition: color .25s, border-color .25s;
}
.app-legal a:hover { color: var(--text); border-color: rgba(244, 239, 230, .4); }

.app-page main { padding-bottom: clamp(96px, 12vw, 160px); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .more { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .app-hero { grid-template-columns: 1fr; }
  .shot-fan { height: clamp(380px, 92vw, 520px); }
  .shot-fan img { width: clamp(150px, 36vw, 230px); }
  .steps { grid-template-columns: 1fr; }
  .get { grid-template-columns: 1fr; text-align: left; }
}
@media (max-width: 720px) {
  .nav-cta { padding: 9px 14px; font-size: 13.5px; }
  .app-hero { padding-top: 104px; }
  .app-icon { width: 68px; height: 68px; border-radius: 17px; }
  .features { grid-template-columns: 1fr; }
  .more { grid-template-columns: 1fr 1fr; }
  .gallery img { height: 420px; }
  .faq details p { padding-right: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .shot-fan img { opacity: 1; }
}
.get h2 em { white-space: nowrap; }

/* ==========================================================
   Guides (/guides and /guides/<slug>). Built by tools/build_app_pages.py.
   ========================================================== */
.app-guide { margin-top: 28px; font-size: 17px; color: var(--muted); }
.app-guide a { color: var(--text); text-decoration: underline; text-decoration-color: var(--c); text-underline-offset: 4px; transition: color .25s; }
.app-guide a:hover { color: var(--c); }

.g-head {
  position: relative;
  max-width: var(--max); margin: 0 auto;
  padding: clamp(116px, 16vh, 160px) var(--gutter) clamp(40px, 5vw, 64px);
}
.g-head::before {
  content: ""; position: absolute; z-index: -1; right: -10%; top: -10%;
  width: 60vw; max-width: 760px; aspect-ratio: 1;
  background: radial-gradient(closest-side, var(--c-soft), transparent 70%);
  pointer-events: none;
}
.g-head .app-title { max-width: 17ch; font-size: clamp(40px, 5.4vw, 78px); margin-top: 22px; }
.g-head .app-lead { max-width: 60ch; }
.g-meta { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 8px 10px; font-family: var(--mono); font-size: 13px; color: var(--faint); }
.g-meta span:first-child { color: var(--c); }
.g-meta span + span::before { content: "·"; margin-right: 10px; color: var(--faint); }

.g-layout {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: minmax(0, 740px) 280px; justify-content: space-between;
  gap: 64px; align-items: start;
}
.g-body { font-size: 18px; line-height: 1.7; color: rgba(244, 239, 230, .82); }
.g-body p + p, .g-body p + ol, .g-body p + ul, .g-body ol + p, .g-body ul + p { margin-top: 16px; }
.g-body b { color: var(--text); font-weight: 600; }
.g-body a:not(.store-badge):not(.g-more) { color: var(--text); text-decoration: underline; text-decoration-color: var(--c); text-underline-offset: 3px; }

.g-answer {
  padding: clamp(20px, 2.6vw, 28px) clamp(20px, 2.8vw, 32px);
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); border-radius: 22px;
  background: color-mix(in srgb, var(--c) 8%, transparent);
  color: var(--text);
}
.g-answer-label { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--c); }
.g-answer p + p { margin-top: 8px; }

.g-section { margin-top: clamp(52px, 6vw, 72px); scroll-margin-top: 110px; }
.g-section h2 { margin-bottom: 18px; color: var(--text); font-size: clamp(27px, 2.8vw, 38px); font-weight: 500; line-height: 1.12; letter-spacing: -.035em; text-wrap: balance; }

.g-steps, .g-list { margin: 0; padding: 0; list-style: none; }
.g-steps { counter-reset: g; }
.g-steps li { position: relative; padding-left: 50px; counter-increment: g; }
.g-steps li + li, .g-list li + li { margin-top: 12px; }
.g-steps li::before {
  content: counter(g); position: absolute; left: 0; top: -1px;
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line);
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 13.5px; color: var(--c); line-height: 1;
}
.g-list li { position: relative; padding-left: 24px; }
.g-list li::before { content: ""; position: absolute; left: 4px; top: .72em; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }

.g-tip {
  margin-top: 20px !important; padding: 16px 20px;
  border-left: 3px solid var(--c); border-radius: 0 14px 14px 0;
  background: rgba(244, 239, 230, .04);
  font-size: 16.5px; line-height: 1.6; color: var(--muted);
}
.g-tip b { display: block; margin-bottom: 4px; font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--text); }
.g-code {
  margin: 16px 0 0; padding: 16px 20px; overflow-x: auto;
  border: 1px solid var(--line); border-radius: 14px; background: var(--ink-2);
  font-family: var(--mono); font-size: 15px; line-height: 1.5; color: var(--cream);
}

/* App card inside a guide */
.g-app {
  margin-top: 28px; padding: clamp(18px, 2.4vw, 26px);
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(20px, 3vw, 32px); align-items: center;
  border: 1px solid var(--line); border-radius: 26px;
  background: radial-gradient(120% 140% at 0% 0%, var(--c-soft), transparent 60%), var(--ink-2);
}
.g-app-shots { display: flex; gap: 10px; padding-bottom: 14px; }
.g-app-shots img { width: clamp(92px, 10vw, 116px); height: auto; border-radius: 14px; box-shadow: 0 0 0 1px var(--line); }
.g-app-shots img:last-child { transform: translateY(14px); }
.g-app-id { display: flex; align-items: center; gap: 14px; }
.g-app-id img { width: 56px; height: 56px; border-radius: 14px; flex: none; }
.g-app-id b { display: block; color: var(--text); font-size: 18px; font-weight: 500; letter-spacing: -.02em; line-height: 1.25; }
.g-app-id span { display: block; font-size: 13.5px; color: var(--muted); line-height: 1.4; }
.g-app p { margin-top: 14px !important; font-size: 16px; line-height: 1.55; color: var(--muted); }
.g-app-cta { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }
.g-app .store-badge img, .g-side-app .store-badge img { height: 46px; }
.g-more { font-size: 15px; color: var(--muted); transition: color .25s; }
.g-more:hover { color: var(--c); }

.g-section .faq { margin-top: 4px; }
.g-section .faq summary { font-size: clamp(18px, 1.5vw, 21px); }
.g-section .faq details p { padding-right: 20px; font-size: 16.5px; line-height: 1.6; }

/* Sticky side column (desktop only) */
.g-side { position: sticky; top: 104px; display: flex; flex-direction: column; gap: 18px; }
.g-toc p { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.g-toc ol { margin: 10px 0 0; padding: 0; list-style: none; border-left: 1px solid var(--line); }
.g-toc a { display: block; padding: 6px 0 6px 16px; font-size: 14.5px; line-height: 1.35; color: var(--muted); transition: color .25s; }
.g-toc a:hover { color: var(--text); }
.g-side-app {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--ink-2);
}
.g-side-app > img { width: 48px; height: 48px; border-radius: 12px; margin-bottom: 8px; }
.g-side-app b { font-size: 16px; font-weight: 500; letter-spacing: -.02em; line-height: 1.3; }
.g-side-app span { font-size: 13.5px; color: var(--muted); }
.g-side-app .store-badge { margin-top: 12px; }

/* Guide cards */
.g-cards { margin-top: clamp(40px, 5vw, 64px); display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.g-cards-index { margin-top: 0; padding-bottom: clamp(96px, 12vw, 160px); }
.g-card {
  display: flex; flex-direction: column; gap: 10px; min-height: 240px;
  padding: 24px; border: 1px solid var(--line); border-radius: 22px;
  transition: transform .5s var(--ease-spring), border-color .3s, background .3s;
}
.g-card:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--mc) 50%, transparent); background: var(--ink-2); }
.g-card img { width: 48px; height: 48px; border-radius: 12px; margin-bottom: 6px; }
.g-card b { font-size: 19px; font-weight: 500; letter-spacing: -.025em; line-height: 1.25; }
.g-card span { font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.g-card i { margin-top: auto; padding-top: 8px; font-style: normal; font-family: var(--mono); font-size: 12px; color: var(--faint); }

@media (max-width: 1000px) {
  .g-layout { grid-template-columns: minmax(0, 1fr); }
  .g-side { display: none; }
}
@media (max-width: 620px) {
  .g-body { font-size: 17px; }
  .g-app { grid-template-columns: minmax(0, 1fr); }
  .g-app-shots img { width: calc(50% - 5px); max-width: 150px; }
  .g-steps li { padding-left: 44px; }
}
