/*
  Baristary home page (sales page). Loaded after styles.css. Every colour, font and motion value comes from
  motion/MOTION.md, mode Calm: palette §1, Geist only (Light 300 for the big numbers, as the app's timer), enter
  0.5 s cubic-bezier(0.22, 1, 0.36, 1), exit cubic-bezier(0.4, 0, 1, 1), no overshoot, rings 3.6 s, 1.2 s apart.
*/

/* Geist Light, digits and "s ./≈" only (subset of @expo-google-fonts/geist 300Light, SIL OFL: fonts/OFL.txt). */
@font-face { font-family: "Geist Figures"; src: url("fonts/Geist-Light-digits.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }

:root {
  --mega: clamp(5rem, 17.5vw, 15.75rem);
  --statement: clamp(1.75rem, 1.2rem + 1.9vw, 3rem);
  --gap-section: clamp(88px, 10vw, 144px);
  --field-pad: clamp(64px, 7vw, 104px);
  --display: clamp(2.75rem, 1.3rem + 4.4vw, 5.5rem);
  --dark: var(--text);
  --on-dark: var(--surf);
  --on-dark-2: #D8C7B2;            /* ringGrey: secondary text on the dark field (10.6 : 1) */
  --good: #5E7C56;
  --goodbg: #E5EBDF;
  --field-good: #4A6543;
  --r: 18px;                        /* the one corner radius (MOTION.md §5 cards) */
  --screen-r: 14% / 6.5%;           /* iPhone screen corners, as a share of the capture's width / height */
  --lift: 0 10px 30px rgba(80, 55, 35, 0.16);   /* MOTION.md §5: the one warm shadow */
  --press: 140ms;
}

.home h2 { font-size: var(--display); line-height: 1.02; letter-spacing: -0.03em; }
.home h3 { font-size: var(--t-head); line-height: 1.15; }
.num { font-family: "Geist Figures", "Geist", sans-serif; font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: -0.05em; }

/* ---------- Header action (shared look, see styles.css .nav-cta) ---------- */

/* ---------- The split stage ---------- */
.split { display: grid; }
.stage { display: none; }
.flow { min-width: 0; }

.hero { padding-block: clamp(24px, 6vw, 56px) clamp(56px, 10vw, 96px); display: grid; gap: 24px; }
.hero h1 { font-size: var(--display); line-height: 1; letter-spacing: -0.035em; max-width: 11ch; }
.hero .lead { font-size: var(--t-lead); max-width: 32ch; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 8px; }
.btn-big { min-height: 56px; padding: 0 30px; font-size: 1.0625rem; }
.cta-note { font-size: var(--t-small); color: var(--muted); }
.frame { background: var(--dark); border-radius: var(--r); padding: 36px 0; display: grid; justify-items: center; margin-top: 24px; }
.hero-shot, .step-shot { width: min(62vw, 300px); height: auto; border-radius: var(--screen-r); background: var(--surf); }

.steps h2 { font-size: var(--t-head); line-height: 1.15; margin-bottom: 8px; }
.step-list { list-style: none; padding: 0; display: grid; gap: 72px; margin-top: 40px; }
.step { display: grid; gap: 14px; }
.step .step-frame { order: -1; margin-top: 0; margin-bottom: 12px; }
.step h3 { font-size: var(--statement); line-height: 1.08; letter-spacing: -0.025em; max-width: 16ch; }
.step p:not(.says) { font-size: var(--t-lead); line-height: 1.45; }
.step p { max-width: 40ch; }
.says { color: var(--muted); }

@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: clamp(40px, 5vw, 88px); align-items: start; }
  .stage {
    display: block; position: sticky; top: 16px; height: calc(100svh - 32px); min-height: 560px;
    background: var(--dark); border-radius: var(--r); overflow: hidden;
  }
  .stage-shot {
    position: absolute; left: 50%; top: 50%; translate: -50% -50%;
    height: min(84%, 880px); width: auto; aspect-ratio: 900 / 1956; max-width: none;
    border-radius: var(--screen-r); opacity: 0; scale: 0.98;
    transition: opacity var(--t-exit) var(--exit), scale var(--t-exit) var(--exit);
  }
  .stage-shot.is-on { opacity: 1; scale: 1; transition: opacity var(--t-enter) var(--enter), scale var(--t-enter) var(--enter); }
  .stage-rings { position: absolute; inset: 0; opacity: 0; transition: opacity var(--t-enter) var(--enter); }
  .stage:has([data-screen="listening"].is-on) .stage-rings { opacity: 1; }
  .stage-rings { width: 100%; height: 100%; }
  .stage-rings circle { fill: none; stroke: var(--ring); stroke-width: 0.18; opacity: 0.55; transform-box: fill-box; transform-origin: center; }

  .hero { min-height: calc(100svh - var(--bar)); align-content: center; padding-block: 48px 10svh; }
  .hero-frame { display: none; }

  .steps { padding-bottom: 24svh; }
  .js .step-list { gap: 0; margin-top: 0; }
  .js .step { min-height: 78svh; align-content: center; }
  .js .step-frame { display: none; }
  .js .step h3, .js .step p { color: var(--muted); transition: color var(--t-enter) var(--enter); }
  .js .step.is-on h3, .js .step.is-on p:not(.says) { color: var(--text); }
}

/* ---------- Diary: the History showpiece ---------- */
.diary { background: var(--surf); margin-top: var(--gap-section); padding-block: var(--field-pad); }
.chart-show { display: grid; gap: 28px; margin-top: clamp(40px, 5vw, 64px); }
.chart-notes { list-style: none; padding: 0; display: grid; gap: 18px; align-content: end; }
.chart-notes li { font-size: var(--t-lead); line-height: 1.4; max-width: 30ch; }
.chart-notes strong { font-weight: 500; }
.diary-pair2 { display: grid; gap: 56px; margin-top: clamp(56px, 7vw, 96px); }
@media (min-width: 900px) {
  .chart-show { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); column-gap: clamp(32px, 4vw, 64px); }
  .diary-pair2 { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: clamp(32px, 5vw, 88px); align-items: start; }
}

/* ---------- The sweet-spot dial (the one live thing) ---------- */
.dial-sec { margin-top: var(--gap-section); display: grid; gap: 40px; }
.dial-head { display: grid; gap: 20px; align-content: start; }
.dial-head h2 { max-width: 12ch; }
.dial-head p { font-size: var(--t-lead); line-height: 1.45; max-width: 34ch; }
.dial { background: var(--surf); border-radius: var(--r); padding: clamp(28px, 4vw, 56px); display: grid; gap: 20px; }
.dial-read { display: flex; align-items: baseline; gap: 10px; }
.dial-read .num { font-size: var(--mega); line-height: 0.9; }
.dial-read .unit { font-size: var(--t-head); color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 16px; border-radius: 999px; font-weight: 500; font-size: var(--t-small); background: var(--line); color: var(--text); transition: background-color 0.2s var(--enter), color 0.2s var(--enter); }
.chip[data-kind="in"] { background: var(--goodbg); color: var(--field-good); }
.chip[data-kind="in"]::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.dial-track { position: relative; height: 48px; display: grid; align-items: center; margin-top: 8px; }
.dial-track::before { content: ""; position: absolute; left: 0; right: 0; height: 10px; border-radius: 999px; background: var(--line); }
.dial-band { position: absolute; left: calc(10 / 24 * 100%); width: calc(4 / 24 * 100%); height: 10px; border-radius: 999px; background: var(--goodbg); }
.dial-track input { position: relative; width: 100%; height: 48px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.dial-track input::-webkit-slider-runnable-track { height: 48px; background: transparent; }
.dial-track input::-moz-range-track { height: 48px; background: transparent; }
.dial-track input::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 30px; height: 30px; margin-top: 9px; border-radius: 50%; background: var(--text); transition: transform var(--press) var(--enter); }
.dial-track input::-moz-range-thumb { width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--text); }
.dial-track input:active::-webkit-slider-thumb { transform: scale(0.97); }
.chip { transition: background-color 150ms var(--enter), color 150ms var(--enter), opacity 75ms var(--exit), translate 75ms var(--exit); }
.chip.swap { opacity: 0; translate: 0 2px; }
.dial-track input:focus-visible { outline: 2px solid var(--acc); outline-offset: 4px; border-radius: 999px; }
.dial-scale { display: grid; grid-template-columns: 1fr auto 1fr; font-size: var(--t-small); color: var(--muted); }
.dial-scale span:nth-child(2) { color: var(--field-good); font-weight: 500; }
.dial-scale span:nth-child(3) { text-align: right; }
.dial-notes { display: grid; gap: 14px; max-width: 46ch; }
@media (min-width: 900px) {
  .dial-sec { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: clamp(40px, 6vw, 112px); row-gap: 40px; }
  .dial-head { grid-column: 1 / -1; grid-row: 1; }
  .dial-head h2 { max-width: none; }
  .dial { grid-column: 2; grid-row: 2; align-self: start; }
  .dial-notes { grid-column: 1; grid-row: 2; align-self: end; }
}

/* ---------- Everything in the app: a café menu sheet on the dark field ---------- */
.menu-sec { background: var(--dark); margin-top: var(--gap-section); padding-block: var(--field-pad); }
.menu {
  width: min(100%, 680px); margin-inline: auto; background: var(--surf); padding: clamp(48px, 6vw, 80px) clamp(22px, 5vw, 64px);
  clip-path: polygon(0.00% 0px, 2.50% 10px, 5.00% 0px, 7.50% 10px, 10.00% 0px, 12.50% 10px, 15.00% 0px, 17.50% 10px, 20.00% 0px, 22.50% 10px, 25.00% 0px, 27.50% 10px, 30.00% 0px, 32.50% 10px, 35.00% 0px, 37.50% 10px, 40.00% 0px, 42.50% 10px, 45.00% 0px, 47.50% 10px, 50.00% 0px, 52.50% 10px, 55.00% 0px, 57.50% 10px, 60.00% 0px, 62.50% 10px, 65.00% 0px, 67.50% 10px, 70.00% 0px, 72.50% 10px, 75.00% 0px, 77.50% 10px, 80.00% 0px, 82.50% 10px, 85.00% 0px, 87.50% 10px, 90.00% 0px, 92.50% 10px, 95.00% 0px, 97.50% 10px, 100.00% 0px, 100.00% calc(100% - 0px), 97.50% calc(100% - 10px), 95.00% calc(100% - 0px), 92.50% calc(100% - 10px), 90.00% calc(100% - 0px), 87.50% calc(100% - 10px), 85.00% calc(100% - 0px), 82.50% calc(100% - 10px), 80.00% calc(100% - 0px), 77.50% calc(100% - 10px), 75.00% calc(100% - 0px), 72.50% calc(100% - 10px), 70.00% calc(100% - 0px), 67.50% calc(100% - 10px), 65.00% calc(100% - 0px), 62.50% calc(100% - 10px), 60.00% calc(100% - 0px), 57.50% calc(100% - 10px), 55.00% calc(100% - 0px), 52.50% calc(100% - 10px), 50.00% calc(100% - 0px), 47.50% calc(100% - 10px), 45.00% calc(100% - 0px), 42.50% calc(100% - 10px), 40.00% calc(100% - 0px), 37.50% calc(100% - 10px), 35.00% calc(100% - 0px), 32.50% calc(100% - 10px), 30.00% calc(100% - 0px), 27.50% calc(100% - 10px), 25.00% calc(100% - 0px), 22.50% calc(100% - 10px), 20.00% calc(100% - 0px), 17.50% calc(100% - 10px), 15.00% calc(100% - 0px), 12.50% calc(100% - 10px), 10.00% calc(100% - 0px), 7.50% calc(100% - 10px), 5.00% calc(100% - 0px), 2.50% calc(100% - 10px), 0.00% calc(100% - 0px));
}
.menu h2 { text-align: center; font-size: var(--statement); }
.menu-sub { text-align: center; color: var(--muted); margin-top: 12px; }
.menu h3 { font-size: var(--t-lead); font-weight: 600; letter-spacing: -0.01em; margin: 48px 0 18px; }
.menu dl { display: grid; gap: 18px; }
.menu dl > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; align-items: baseline; }
.menu dt { display: flex; align-items: baseline; gap: 10px; font-weight: 500; font-size: var(--t-body); letter-spacing: -0.01em; }
.menu dt::after { content: ""; flex: 1; min-width: 24px; border-bottom: 4px dotted var(--ring); transform: translateY(-4px); }
.menu dd { margin: 0; font-size: var(--t-small); color: var(--muted); }
.menu dd.where { white-space: nowrap; }
.menu dd.what { grid-column: 1 / -1; max-width: 40ch; margin-top: 2px; }

/* ---------- Feature chapters: the main picture pinned on the left, the rest beside it ---------- */
.chapter { margin-top: var(--gap-section); }
.chapter-head, .diary .chapter-head { display: grid; gap: 16px; }
.chapter-head h2 { max-width: 22ch; }
.chapter-head p { font-size: var(--t-lead); line-height: 1.45; max-width: 40ch; color: var(--text); }
.feat-grid { display: grid; gap: 56px; margin-top: clamp(40px, 5vw, 72px); }
.feat { display: grid; gap: 18px; align-content: start; }
.feat-text { display: grid; gap: 10px; }
.feat-text h3 { font-size: var(--t-head); line-height: 1.15; max-width: 18ch; }
.feat-text p { max-width: 44ch; }
.feat-pic, .chart-pic, .proof-panel { display: grid; justify-items: start; }
.feat-pic img, .chart-pic img, .proof-panel img { width: 100%; height: auto; border-radius: var(--r); background: var(--surf); box-shadow: var(--lift); }
.feat-pic img[height="1043"] { width: min(62vw, 300px); border-radius: var(--screen-r); }
.f-portrait .feat-pic img { width: min(100%, 380px); }
.feat-words { background: var(--surf); border-radius: var(--r); padding: clamp(24px, 3vw, 36px); min-height: 132px; display: grid; align-content: center; }
.feat-words p { font-weight: 500; font-size: var(--t-lead); line-height: 1.35; letter-spacing: -0.01em; max-width: 26ch; }
.diary .feat-words { background: var(--bg); }
/* 900–1199 px: the main picture on the left, everything else in one column beside it (three columns are too narrow
   here: the app captures' text would shrink below reading size). */
@media (min-width: 900px) {
  .feat-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px clamp(32px, 4vw, 48px); grid-auto-flow: dense; }
  .f-tall { grid-column: 1; grid-row: 1 / span 12; position: sticky; top: 24px; align-self: start; }
  .f-wide, .f-half { grid-column: 2; }
  .f-tall .feat-pic img[height="1043"] { width: min(100%, 340px); }
}
@media (min-width: 1200px) {
  .feat-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 3.5fr) minmax(0, 3.5fr); }
  .f-wide { grid-column: 2 / 4; }
  .f-half { grid-column: span 1; }
}

/* ---------- Privacy as the point: a dark field ---------- */
.private { background: var(--dark); color: var(--on-dark); margin-top: var(--gap-section); padding-block: var(--field-pad); }
.private h2 { max-width: 13ch; }
.private-list { list-style: none; padding: 0; margin-top: clamp(40px, 6vw, 80px); display: grid; gap: 32px 40px; }
.private-list li { color: var(--on-dark-2); font-size: var(--t-lead); line-height: 1.45; max-width: 30ch; }
.private-list strong { display: block; color: var(--on-dark); font-weight: 500; margin-bottom: 6px; }
.private-link { margin-top: 48px; }
.private-pic { margin-top: clamp(40px, 6vw, 72px); display: grid; gap: 14px; max-width: 560px; }
.private-pic img { width: 100%; height: auto; border-radius: var(--r); }
.private-pic figcaption { font-size: var(--t-small); color: var(--on-dark-2); }
.private a { color: var(--on-dark); text-decoration-color: var(--crema); }
@media (hover: hover) and (pointer: fine) { .private a:hover { text-decoration-color: var(--on-dark); } }
.private :focus-visible { outline-color: var(--on-dark); }
@media (min-width: 700px) { .private-list { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1200px) { .private-list { grid-template-columns: repeat(4, 1fr); } }

/* ---------- FAQ: one question per line, the answer opens below (works without JS) ---------- */
.faq { margin-top: var(--gap-section); display: grid; gap: 32px; }
.faq h2 { font-size: var(--statement); line-height: 1.08; max-width: 12ch; }
.faq-list { display: grid; gap: 4px; max-width: 820px; }
.faq details { border-radius: var(--r); transition: background-color 0.2s var(--enter); }
.faq details[open] { background: var(--surf); }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; border-radius: var(--r); font-weight: 500; font-size: var(--t-lead); line-height: 1.3; letter-spacing: -0.01em; transition: transform var(--press) var(--enter); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { flex: none; width: 22px; height: 22px; stroke: var(--text); fill: none; stroke-width: 1.8; transition: transform 200ms var(--enter); }
.faq details[open] summary svg { transform: rotate(180deg); }
.faq summary:active { transform: scale(0.98); }
.faq details p { padding: 0 20px 22px; max-width: 62ch; }
@media (min-width: 900px) {
  .faq { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); column-gap: 48px; align-items: start; }
}

/* ---------- The close and the name, at full width ---------- */
.home .close { margin-top: var(--gap-section); padding-top: 8svh; display: grid; gap: 28px; justify-items: center; text-align: center; }
.home .close .cta-row { justify-content: center; }
.home .close-line { font-size: var(--display); line-height: 1.02; letter-spacing: -0.035em; max-width: 16ch; }
.giant { overflow: hidden; padding-inline: var(--gutter); margin-top: clamp(64px, 10vw, 160px); }
.giant span { display: block; font-weight: 500; font-size: var(--mega); line-height: 0.8; letter-spacing: -0.05em; white-space: nowrap; transform-origin: 0 100%; padding-bottom: 0.2em; }

/* ---------- Motion (MOTION.md Calm) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero h1, .hero .lead, .hero .cta-row { animation: rise var(--t-enter) var(--enter) both; }
  .hero .lead { animation-delay: 80ms; }
  .hero .cta-row { animation-delay: 160ms; }
  .stage { animation: stage-in var(--t-enter) var(--enter) both; }
  .stage-rings circle { animation: wave 3.6s ease-out infinite; }
  .stage-rings circle:nth-child(2) { animation-delay: 1.2s; }
  .stage-rings circle:nth-child(3) { animation-delay: 2.4s; }

  /* Each part rises once; siblings follow 50 ms apart (index set by js/home.js), capped at 8 steps. */
  .rise-on [data-rise] { opacity: 0; transform: translateY(24px); transition: opacity var(--t-enter) var(--enter), transform var(--t-enter) var(--enter); transition-delay: calc(min(var(--i, 0), 8) * 50ms); }
  .rise-on [data-rise].risen { opacity: 1; transform: none; }

  /* The History chart draws itself once, left to right (the drift over ten shots). */
  .rise-on .chart-pic img { clip-path: inset(-40px 100% -40px -40px); transition: clip-path 1s var(--enter) 0.2s; }
  .rise-on .chart-pic.risen img { clip-path: inset(-40px -40px -40px -40px); }

  @media (hover: hover) and (pointer: fine) {
    .btn:hover { transform: translateY(-1px); }
  }

  @supports (animation-timeline: view()) {
    .giant span { animation: settle linear both; animation-timeline: view(); animation-range: entry 0% cover 50%; }
  }
}
@keyframes stage-in { from { opacity: 0; scale: 0.97; } to { opacity: 1; scale: 1; } }
@keyframes wave {
  0% { transform: scale(0.82); opacity: 0; }
  10% { opacity: 0.55; }
  100% { transform: scale(1.04); opacity: 0; }
}
@keyframes settle { from { transform: scale(0.94); } to { transform: none; } }

.crop-settings { width: min(100%, 400px); margin-top: 12px; }
