/* CruisePro — the tally book.
   Tokens follow the app (CruisePro/design/DIRECTION.md): a yellow cover, pencil ink,
   a gridded page behind each hero, gates of five. Dark swaps the two materials. */

:root {
  --ground: #FFD21F;
  --ink: #14130F;
  --ink-2: #3A3314;
  --rule: rgba(20, 19, 15, .2);
  --on-ink: #FFD21F;
  --bezel: #14130F;
  --m: 16px;
  --r: 6px;
  --b: 2.5px;
  --g: 18.5px;
  --face: "Archivo", "Arial Narrow", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #14130F;
    --ink: #FFD21F;
    --ink-2: #D9BC4A;
    --rule: rgba(255, 210, 31, .22);
    --on-ink: #14130F;
    --bezel: #2B2816;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 500 17px/1.5 var(--face);
  font-stretch: 88%;
  font-optical-sizing: auto;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

/* type scale: 168 · 40 · 28 · 20 · 16 · 13, one family by width */
.num  { font: 900 clamp(112px, 17vw, 168px)/.8 var(--face); font-stretch: 62%; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.disp { font: 900 40px/.95 var(--face); font-stretch: 62%; text-transform: uppercase; letter-spacing: .01em; }
.key  { font: 900 28px/1 var(--face); font-stretch: 70%; }
.row-t{ font: 800 20px/1.2 var(--face); font-stretch: 75%; }
.sec  { font: 600 16px/1.3 var(--face); font-stretch: 85%; color: var(--ink-2); }
.cap  { font: 600 13px/1.2 var(--face); font-stretch: 85%; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 var(--m); }
.wrap.narrow { max-width: 760px; }

/* ── top bar ── */
.top { display: flex; align-items: center; gap: 12px; min-height: 76px; }
.top .brand { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; min-height: 60px; }
.icon { width: 44px; height: 44px; flex: none; border-radius: 10px; background: #FFD21F; border: var(--b) solid var(--ink); }
.icon path { fill: none; stroke: #14130F; stroke-width: 26; stroke-linecap: round; }
.top .disp { font-size: 32px; }
.pill { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: var(--b) solid var(--ink); border-radius: 22px;
        font: 800 17px/1 var(--face); font-stretch: 75%; text-decoration: none; white-space: nowrap; }
.pill:hover, .pill[aria-current] { background: var(--ink); color: var(--on-ink); }

/* ── the gridded page: only behind a hero, bounded by two ink rules ── */
.page { border-top: var(--b) solid var(--ink); border-bottom: var(--b) solid var(--ink);
        background-image: linear-gradient(var(--rule) 1px, transparent 1px), linear-gradient(90deg, var(--rule) 1px, transparent 1px);
        background-size: var(--g) var(--g); background-position: left bottom; }
.hl { display: flex; align-items: flex-end; gap: 14px; }
.hl .disp { padding-bottom: 6px; }

/* ── primary bar: the lowest element of its block ── */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 84px; padding: 12px 20px;
       border-radius: var(--r); background: var(--ink); color: var(--on-ink); text-decoration: none; width: 100%; text-align: left;
       box-shadow: inset 0 0 0 0 var(--ink); transition: transform .12s; }
.bar .sec { color: var(--on-ink); text-align: right; overflow-wrap: anywhere; }
.bar:hover { background: var(--ground); color: var(--ink); box-shadow: inset 0 0 0 4px var(--ink); }
.bar:hover .sec { color: var(--ink); }
.bar:active { transform: scale(.98); }

.box { border: var(--b) solid var(--ink); border-radius: var(--r); }

/* ── hero ── */
.hero { display: grid; gap: 40px; padding: 8px 0 72px; align-items: start; }
.hero-copy { display: flex; flex-direction: column; gap: 16px; }
.hero-copy .page { padding: 56px 0 29.5px; }
.hero-copy .lede { font-size: 20px; line-height: 1.35; color: var(--ink); max-width: 34em; }
.demo { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.demo > .cap { text-align: center; }

@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr) 372px; gap: 64px; padding-top: 24px; }
  .hero-copy { position: sticky; top: 24px; }
  .hero-copy .page { padding-top: 112px; }
}

/* ── sections: title on the left edge, matter on the right ── */
.block { display: grid; gap: 20px; padding: 40px 0 56px; border-top: var(--b) solid var(--ink); }
.block > header { display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 900px) {
  .block { grid-template-columns: 280px minmax(0, 1fr); gap: 64px; }
}

.rows > * { border-bottom: 1.5px solid var(--ink); }
.rows > *:first-child { border-top: 1.5px solid var(--ink); }

/* the loop: plot keys in cruise order */
.loop li { display: flex; gap: 16px; align-items: center; padding: 14px 0; min-height: 84px; }
.loop .k { width: 56px; height: 56px; flex: none; display: grid; place-items: center; border-radius: var(--r); background: var(--ink); color: var(--on-ink); }
.loop .sec { margin-top: 2px; }

/* free against professional */
.plans { width: 100%; border-collapse: collapse; }
.plans th, .plans td { padding: 0 12px; height: 60px; text-align: left; border-bottom: 1.5px solid var(--ink); }
.plans thead th { height: 36px; border-bottom: var(--b) solid var(--ink); }
.plans th:first-child, .plans td:first-child { padding-left: 0; }
.plans td { font: 600 17px/1.2 var(--face); font-stretch: 85%; }
.plans td:last-child, .plans thead th:last-child { text-align: right; padding-right: 0; }
.note { margin-top: 14px; }

/* FAQ: one answer open at a time, like the app */
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; padding: 12px 0; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; width: 18px; height: 18px; flex: none;
  background: linear-gradient(var(--ink), var(--ink)) center / 100% 3px no-repeat, linear-gradient(var(--ink), var(--ink)) center / 3px 100% no-repeat; }
.faq details[open] summary::after { background: linear-gradient(var(--ink), var(--ink)) center / 100% 3px no-repeat; }
.faq details p { padding: 0 34px 18px 0; max-width: 40em; }

.fix li { padding: 14px 0; }
.fix .sec { margin-top: 4px; color: var(--ink); font-weight: 500; }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; }
.facts div { display: flex; flex-direction: column; gap: 4px; }
@media (min-width: 620px) { .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding: 24px 0 48px; border-top: var(--b) solid var(--ink); }
.foot a { display: inline-flex; align-items: center; min-height: 44px; font: 800 17px/1 var(--face); font-stretch: 75%; }
.foot .cap { margin-left: auto; }

/* ── legal pages ── */
.doc-head { padding: 8px 0 20px; display: flex; flex-direction: column; gap: 10px; }
.doc-head .page { padding: 64px 0 11px; }
.doc { padding-bottom: 56px; }
.doc h2 { font: 800 22px/1.2 var(--face); font-stretch: 75%; margin: 36px 0 10px; padding-top: 16px; border-top: 1.5px solid var(--ink); }
.doc h3 { font: 600 13px/1.2 var(--face); font-stretch: 85%; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); margin: 22px 0 8px; }
.doc p { margin: 0 0 12px; }
.doc ul { margin: 0 0 14px; }
.doc li { position: relative; padding: 4px 0 4px 22px; }
.doc li::before { content: ""; position: absolute; left: 2px; top: .72em; width: 10px; height: 3px; background: var(--ink); }
.doc .none li::before { width: 13px; height: 13px; top: .5em; left: 0;
  background: linear-gradient(45deg, transparent 42%, var(--ink) 42% 58%, transparent 58%), linear-gradient(-45deg, transparent 42%, var(--ink) 42% 58%, transparent 58%); }
.doc .highlight { border: var(--b) solid var(--ink); border-radius: var(--r); padding: 16px; margin: 16px 0; }
.doc .highlight > :last-child { margin-bottom: 0; }
.privacy-badge { display: inline-block; padding: 3px 7px 2px; border-radius: 4px; background: var(--ink); color: var(--on-ink);
                 font: 800 12px/1.2 var(--face); font-stretch: 80%; letter-spacing: .07em; vertical-align: 1px; }

/* ── the phone: a drawn tally screen that works. Every size is in design px × --u (402 wide). ── */
.phone { container-type: inline-size; width: min(100%, 372px); }
.screen { --u: calc(100cqw / 402); background: var(--ground); color: var(--ink);
          border: calc(var(--u) * 9) solid var(--bezel); border-radius: calc(var(--u) * 54);
          padding: calc(var(--u) * 14) calc(var(--u) * 14) calc(var(--u) * 20);
          display: flex; flex-direction: column; gap: calc(var(--u) * 10); user-select: none; -webkit-user-select: none; }
.screen .status { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: calc(var(--u) * 34); padding: 0 calc(var(--u) * 18); }
.screen .status b { font: 700 calc(var(--u) * 16)/1 var(--face); font-stretch: 100%; }
.screen .status i { width: calc(var(--u) * 104); height: calc(var(--u) * 30); border-radius: calc(var(--u) * 15); background: #000; }
.screen .cap  { font-size: calc(var(--u) * 13); }
.screen .sec  { font-size: calc(var(--u) * 16); }
.screen .row-t{ font-size: calc(var(--u) * 20); font-weight: 900; }
.screen .key  { font-size: calc(var(--u) * 28); }
.screen .disp { font-size: calc(var(--u) * 40); white-space: nowrap; }
.screen .num  { font-size: calc(var(--u) * 168); }
.screen .box  { border-width: calc(var(--u) * 2.5); border-radius: calc(var(--u) * 6); }
.screen .on   { background: var(--ink); color: var(--on-ink); }
.screen .on .cap { color: var(--on-ink); }

.s-top { display: flex; align-items: center; gap: calc(var(--u) * 10); height: calc(var(--u) * 56); }
.s-top .disp { margin-right: auto; }
.s-top span { display: grid; place-items: center; height: calc(var(--u) * 48); padding: 0 calc(var(--u) * 16); border-radius: calc(var(--u) * 24);
              box-shadow: inset 0 0 0 calc(var(--u) * 2) var(--ink); }
.s-strip { display: flex; align-items: center; justify-content: space-between; height: calc(var(--u) * 48); }
.s-strip .sec { text-align: right; }
.marks { display: block; height: calc(var(--u) * 44); flex: none; overflow: visible; }
.marks path { fill: none; stroke: var(--ink); stroke-width: 3.4; stroke-linecap: round; }
.s-last { display: flex; align-items: center; height: calc(var(--u) * 64); border-top: calc(var(--u) * 2.5) solid var(--ink); margin-bottom: calc(var(--u) * -10); }
.s-last .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: calc(var(--u) * 3); }
.s-last .row-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-last .undo { align-self: stretch; display: flex; align-items: center; gap: calc(var(--u) * 8); padding: 0 calc(var(--u) * 4) 0 calc(var(--u) * 18);
                border-left: calc(var(--u) * 2.5) solid var(--ink); }
.s-last .undo svg { width: calc(var(--u) * 24); height: calc(var(--u) * 24); fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.s-last .undo:disabled { opacity: .45; cursor: default; }
.screen .page { --g: calc(var(--u) * 18.5); border-width: calc(var(--u) * 2.5) 0; height: calc(var(--u) * 185); display: flex; align-items: flex-end;
                padding-bottom: calc(var(--u) * 29.5); }
.screen .hl { gap: calc(var(--u) * 14); transition: transform .25s cubic-bezier(.3, 1.3, .6, 1); transform-origin: left bottom; }
.screen .hl .disp { padding-bottom: calc(var(--u) * 7); }
.s-pad, .s-species { display: grid; grid-template-columns: repeat(4, 1fr); gap: calc(var(--u) * 8); }
.s-pad button { height: calc(var(--u) * 76); }
.s-row2 { display: flex; gap: calc(var(--u) * 8); }
.s-logs, .s-seg { display: flex; height: calc(var(--u) * 62); overflow: hidden; }
.s-logs { flex: 1.2; } .s-seg { flex: 1; }
.s-logs button { width: calc(var(--u) * 50); }
.s-logs .val { flex: 1; display: flex; align-items: center; justify-content: center; gap: calc(var(--u) * 5); white-space: nowrap;
               border: solid var(--ink); border-width: 0 calc(var(--u) * 2.5); }
.s-seg button { flex: 1; }
.s-seg button + button { border-left: calc(var(--u) * 2.5) solid var(--ink); }
.s-species button { height: calc(var(--u) * 64); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--u) * 3); }
.s-species .cap { letter-spacing: 0; text-transform: none; white-space: nowrap; font-stretch: 72%; }
.s-species button:disabled { cursor: default; }
.screen .bar { min-height: 0; height: calc(var(--u) * 84); padding: 0 calc(var(--u) * 20); border-radius: calc(var(--u) * 6); gap: calc(var(--u) * 10); }
.screen .bar .sec { white-space: nowrap; }
.screen .bar:hover { background: var(--ink); color: var(--on-ink); box-shadow: none; }
.screen .bar:hover .sec { color: var(--on-ink); }
.screen button:not(.bar):not(:disabled):active { background: var(--ink); color: var(--on-ink); }

/* the signature: press hollows the bar and lifts the numeral, then a pencil stroke is drawn */
.screen.pressing .bar { background: var(--ground); color: var(--ink); box-shadow: inset 0 0 0 calc(var(--u) * 4) var(--ink); transform: scale(.97); }
.screen.pressing .bar .sec { color: var(--ink); }
.screen.pressing .hl { transform: translateY(calc(var(--u) * -14)) scale(.94); transition-duration: .08s; }

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 520px) {
  .top .pill.opt { display: none; }
  .disp { font-size: 34px; }
  .bar { padding: 12px 16px; }
  .bar .disp { font-size: 30px; }
  .plans th, .plans td { padding: 0 6px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bar, .screen .hl { transition: none; }
  .screen.pressing .hl, .screen.pressing .bar { transform: none; }
}
