/* Onpaper page layout on top of the Onpaper design system. Colours come from tokens only. */
* { box-sizing: border-box; }
html { background: var(--paper); scroll-padding-top: 120px; }
body { min-height: 100vh; }
a { color: var(--pen-blue); text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--pen-blue); outline-offset: 3px; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
a.pd-btn { display: inline-block; text-decoration: none; text-align: center; }
a.pd-btn--ghost { text-decoration: underline wavy var(--ink-soft) 1px; text-underline-offset: 5px; }

/* Flat and boxy: a hand-drawn rectangle instead of the capsule curve, for every button and segmented control. */
.pd-btn, .pd-seg { border-radius: 4px 9px 5px 8px / 8px 5px 9px 4px; }

/* The design system sizes the checkbox as content-box (20px inside the border); the global border-box above shrank it and pushed the tick off-centre. */
.pd-box { box-sizing: content-box; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--space-4); }
/* The logo SVG is used as-is (never recoloured or redrawn); only its height changes. */
.logo { display: inline-block; flex: none; line-height: 0; }
.logo img { display: block; height: 48px; width: auto; }
.topnav .logo img { height: 44px; }
.site-foot .logo img { height: 56px; }
.kicker { text-transform: uppercase; color: var(--pencil); }

/* ---------- top bar + ticker tape ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 2px solid var(--ink); }
.topnav { max-width: 1120px; margin: 0 auto; padding: var(--space-2) var(--space-4); display: flex; align-items: center; gap: var(--space-6); }
.menu { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); }
.menu-links { list-style: none; padding: 0; display: flex; gap: var(--space-6); }
.menu-links a { color: var(--ink); text-decoration: none; font-size: 19px; }
.menu-links a:hover { text-decoration: underline wavy var(--ink) 1px; text-underline-offset: 6px; }
.menu-auth { display: flex; gap: var(--space-3); align-items: center; }
.menu-btn { display: none; margin-left: auto; }

.tape { display: flex; align-items: stretch; border-top: 1px dashed var(--ink); background: var(--paper-sheet); }
.tape-tag { flex: none; display: flex; align-items: center; padding: 0 var(--space-3); border-right: 2px solid var(--ink); color: var(--ink-soft); background: var(--paper-shade); text-transform: uppercase; }
.tape-window { overflow: hidden; flex: 1; }
.tape-track { display: flex; width: max-content; animation: tape 60s linear infinite; }
.tape:hover .tape-track, .tape:focus-within .tape-track { animation-play-state: paused; }
@keyframes tape { to { transform: translateX(-50%); } }
.tape-item {
  font: inherit; font-size: 16px; line-height: 20px; white-space: nowrap; cursor: pointer; color: var(--ink);
  background: transparent; border: 0; border-right: 1px solid var(--rule); padding: 6px var(--space-4);
  font-variant-numeric: tabular-nums;
}
.tape-item:hover { background: var(--paper-shade); }
.tape-item:focus-visible { outline: 2px solid var(--pen-blue); outline-offset: -3px; }
.tape-item.is-current { box-shadow: inset 0 -3px 0 var(--ink); }
.tape-sym { font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.tape-px { color: var(--ink-soft); }
.flash-up { animation: flash-up .9s ease-out; }
.flash-down { animation: flash-down .9s ease-out; }
@keyframes flash-up { from { background: var(--gain-wash); } }
@keyframes flash-down { from { background: var(--loss-wash); } }

/* ---------- hero ---------- */
.hero-band { border-bottom: 2px solid var(--ink); }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: calc(var(--space-6) * 2); align-items: center; padding-top: 56px; padding-bottom: 64px; }
.hero-title { font-family: var(--font-display); font-weight: 700; font-size: 84px; line-height: .95; margin-top: var(--space-2); }
.scribble { position: relative; white-space: nowrap; isolation: isolate; }
.scribble::after {
  content: ""; position: absolute; left: -4%; right: -6%; bottom: 4px; height: 12px;
  background: var(--loss); border-radius: 50% 40% 60% 30% / 60% 50% 40% 50%; transform: rotate(-2deg); opacity: .8; z-index: -1;
}
.hero-lede { font-size: 22px; line-height: 32px; color: var(--ink-soft); margin-top: var(--space-4); max-width: 30em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; margin-top: var(--space-6); }
.cta-big { font-size: 22px; line-height: 28px; padding: 10px var(--space-6); }
.hero-facts { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-6); margin-top: calc(var(--space-6) * 1.5); border-top: 2px dashed var(--ink); padding-top: var(--space-4); }
.hero-facts li { display: flex; flex-direction: column; }
.fact-n { font-family: var(--font-display); font-weight: 700; font-size: 36px; line-height: 36px; }
.hero-facts span { color: var(--pencil); font-size: 15px; line-height: 20px; }

/* hero chart */
.chart-card { padding: var(--space-4) var(--space-6) var(--space-4); }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-4); flex-wrap: wrap; }
.chart-sym { font-family: var(--font-display); font-weight: 700; font-size: 40px; line-height: 40px; margin-right: var(--space-2); }
.chart-px { display: flex; align-items: baseline; gap: var(--space-2); }
.chart-px .pd-figure { font-size: 32px; }
.chart-when { min-height: 20px; margin-top: var(--space-1); }
.chart-box { position: relative; margin: var(--space-3) 0; }
.chart { display: block; width: 100%; height: 260px; cursor: crosshair; touch-action: pan-y; }
.chart:focus-visible { outline: 2px solid var(--pen-blue); outline-offset: 3px; }
.chart path, .chart line, .grow-chart path, .grow-chart line { vector-effect: non-scaling-stroke; }
.c-grid { stroke: var(--rule); stroke-width: 1; }
.c-base { stroke: var(--pencil); stroke-width: 1; stroke-dasharray: 3 5; }
.c-ln { fill: none; stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.c-ln2 { fill: none; stroke-width: 1; opacity: .45; }
.c-ln.pd-gain, .c-ln2.pd-gain { stroke: var(--gain); }
.c-ln.pd-loss, .c-ln2.pd-loss { stroke: var(--loss); }
.c-cursor { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart-dot { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border: 2px solid var(--ink); border-radius: 50%; background: var(--paper-sheet); pointer-events: none; }
.chart-dot.pd-gain { background: var(--gain); }
.chart-dot.pd-loss { background: var(--loss); }
.chart-dot[hidden] { display: none; }
.chart-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.range-seg button { padding: 2px var(--space-3); font-size: 17px; }

/* ---------- bands ---------- */
.band { padding-top: 72px; padding-bottom: 72px; }
.band-shade { background: var(--paper-shade); border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); }
.band-title { max-width: 22em; }
.band-sub { color: var(--ink-soft); margin-top: var(--space-2); max-width: 36em; }
.band-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-6); }

.features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-6); margin-top: calc(var(--space-6) * 1.5); }
.feature { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-6) var(--space-4); transition: transform .12s; }
.feature:hover { transform: rotate(-.6deg) translateY(-2px); }
.feature p { color: var(--ink-soft); }
.doodle-ic { width: 64px; height: 48px; overflow: visible; }
.doodle-ic path, .doodle-ic rect { fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.ic-ink { stroke: var(--ink); }
.ic-gain { stroke: var(--gain); }
.ic-loss { stroke: var(--loss); }

/* try a trade */
.try-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--space-6); align-items: start; }
.try-quotes { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-4); }
.try-quotes .pd-quote { width: auto; }
.try-side { display: flex; flex-direction: column; gap: var(--space-4); }
.try-side .pd-ticket { width: 100%; }
.try-notes { min-height: 0; }
.try-notes .pd-note { width: auto; }
.try-pos { grid-column: 1 / -1; }
.try-pos .pd-sheet { overflow-x: auto; }

/* grow monthly */
.grow { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: calc(var(--space-6) * 2); align-items: center; }
.grow-copy { display: flex; flex-direction: column; gap: var(--space-4); }
.slider .pd-label { display: flex; justify-content: space-between; }
.slider-out { font-family: var(--font-display); font-weight: 700; font-size: 24px; text-transform: none; letter-spacing: 0; color: var(--ink); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; background: var(--ink); border-radius: 2px; }
input[type="range"]::-moz-range-track { height: 4px; background: var(--ink); border-radius: 2px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 24px; margin-top: -10px; background: var(--paper-sheet); border: 2px solid var(--ink); border-radius: 3px 6px 2px 5px; box-shadow: var(--shadow-press); }
input[type="range"]::-moz-range-thumb { width: 16px; height: 20px; background: var(--paper-sheet); border: 2px solid var(--ink); border-radius: 3px 6px 2px 5px; box-shadow: var(--shadow-press); }
input[type="range"]:focus-visible { outline: 2px solid var(--pen-blue); outline-offset: 3px; }
.grow-sheet { padding-top: var(--space-4); padding-right: var(--space-6); padding-bottom: var(--space-4); }
.grow-totals { display: flex; gap: calc(var(--space-6) * 2); flex-wrap: wrap; }
.grow-totals > div { display: flex; flex-direction: column; }
.grow-totals .pd-figure { font-size: 34px; line-height: 40px; }
.grow-chart { display: block; width: 100%; height: 200px; margin: var(--space-4) 0 var(--space-2); }
.g-floor { stroke: var(--ink); stroke-width: 2; }
.g-put { fill: var(--paper-sheet); stroke: var(--ink); stroke-width: 1.5; }
.g-grow { fill: var(--gain); stroke: var(--ink); stroke-width: 1.5; }
.key { display: inline-block; width: 12px; height: 12px; border: 1.5px solid var(--ink); vertical-align: -1px; }
.key-in { background: var(--paper-sheet); }
.key-grow { background: var(--gain); }

/* how it works */
.steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-6); margin-top: calc(var(--space-6) * 1.5); counter-reset: none; }
.step { position: relative; padding: var(--space-6) var(--space-4) var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); }
.step p { color: var(--ink-soft); }
.step-n {
  font-family: var(--font-display); font-weight: 700; font-size: 34px; line-height: 44px; width: 48px; height: 48px; text-align: center;
  border: 2px solid var(--ink); border-radius: 50% 45% 55% 48% / 52% 50% 46% 54%; background: var(--paper);
}

/* faq */
.faq { margin-top: var(--space-6); border-top: 2px solid var(--ink); max-width: 800px; }
.faq-item { border-bottom: 1px dashed var(--ink); }
.faq-item summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) 0; font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 30px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-family: var(--font-hand); font-weight: 400; font-size: 28px; transition: transform .15s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:focus-visible { outline: 2px solid var(--pen-blue); outline-offset: 3px; }
.faq-item p { padding: 0 0 var(--space-4); color: var(--ink-soft); max-width: 40em; }

/* call to action */
.cta-sheet { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); padding-top: var(--space-rule); padding-bottom: var(--space-6); }
.cta-sheet .cta-big { margin-top: var(--space-2); }

/* footer */
.site-foot { border-top: 2px solid var(--ink); padding: var(--space-6) 0 calc(var(--space-6) * 2); }
.foot-grid { display: grid; grid-template-columns: 1fr auto; gap: var(--space-4) var(--space-6); align-items: start; }
.foot-links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); }
.foot-links a { color: var(--ink); }
.foot-legal { grid-column: 1 / -1; border-top: 1px dashed var(--ink); padding-top: var(--space-3); max-width: 60em; }

/* ---------- log in / sign up pages ---------- */
/* Log in / sign up sit on a notebook page: faint ruled lines, a red margin and a few pen doodles in the corners. */
.auth-page {
  display: flex; flex-direction: column; min-height: 100vh;
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, transparent 71px, var(--margin) 71px, var(--margin) 73px, transparent 73px),
    repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--space-rule) * 1.25 - 1px), color-mix(in srgb, var(--rule) 55%, transparent) calc(var(--space-rule) * 1.25 - 1px), color-mix(in srgb, var(--rule) 55%, transparent) calc(var(--space-rule) * 1.25));
}
.auth-top, .auth-legal { background: var(--paper); position: relative; z-index: 1; }
.auth-main { position: relative; }
.auth-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
/* Doodles are placed from the page centre (the card is 460px wide and centred), so they never slide under the card or the tip note. */
.doodle { position: absolute; overflow: visible; opacity: .75; display: none; }
.doodle-tl { width: 260px; left: calc(50% - 540px); top: 8%; transform: rotate(-3deg); }
.doodle-bl { width: 240px; left: calc(50% - 520px); bottom: 8%; transform: rotate(2deg); }
.doodle-tr { width: 220px; left: calc(50% + 300px); bottom: 10%; transform: rotate(4deg); }
.doodle-br { width: 240px; left: calc(50% + 560px); top: 12%; transform: rotate(-3deg); }
@media (min-width: 1280px) { .doodle-tl, .doodle-bl, .doodle-tr { display: block; } }
@media (min-width: 1640px) { .doodle-br { display: block; } }
.doodle path, .doodle ellipse { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.dd-ink { stroke: var(--ink-soft); }
.dd-gain { stroke: var(--gain); }
.dd-loss { stroke: var(--loss); }
.doodle-bl .dd-gain { fill: var(--gain-wash); }
.dd-txt { font-family: var(--font-hand); font-size: 17px; fill: var(--ink-soft); }
.dd-gain-txt { fill: var(--gain); }
.dd-big { font-family: var(--font-display); font-weight: 700; font-size: 34px; fill: var(--ink); }
.auth-top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); padding: var(--space-3) var(--space-6); border-bottom: 2px solid var(--ink); }
/* The card is centred on the page on its own; the tip note hangs off its right edge so it can't pull the card sideways. */
.auth-main { flex: 1; display: flex; justify-content: center; align-items: center; padding: 48px var(--space-4); }
.auth-stage { position: relative; width: 100%; max-width: 460px; }
.auth-card { position: relative; width: 100%; padding: var(--space-6) var(--space-6) var(--space-6); }
.auth-sub { color: var(--ink-soft); margin-top: calc(var(--space-2) * -1); }
.auth-aside { position: absolute; left: calc(100% + 48px); top: var(--space-6); }
.aside-note { width: 220px; transform: rotate(2deg); }
.auth-legal { text-align: center; padding: var(--space-4); }
.auth-steps { list-style: none; padding: 0; display: flex; gap: var(--space-4); margin-bottom: var(--space-4); color: var(--pencil); }
.auth-steps li { padding-bottom: 2px; border-bottom: 2px solid transparent; }
.auth-steps .is-on { color: var(--ink); border-bottom-color: var(--ink); }

.auth-form { display: flex; flex-direction: column; gap: var(--space-4); }
.auth-form[hidden] { display: none; }
.auth-form .submit { align-self: stretch; margin-top: var(--space-2); font-size: 20px; padding: 8px var(--space-4); }
.auth-form .submit[aria-busy="true"] { cursor: progress; }
.pw-row { display: flex; align-items: flex-end; gap: var(--space-2); }
.pw-toggle { padding: 0 var(--space-2); font-size: 16px; flex: none; }
.login-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.cash-seg { align-self: flex-start; max-width: 100%; }
.cash-seg button { padding: 2px var(--space-3); font-variant-numeric: tabular-nums; }
.switch { text-align: center; }
.turnstile { min-height: 65px; }
.turnstile:empty::before { content: "Loading the human check…"; color: var(--pencil); font-size: 15px; }
.auth-notes { position: absolute; right: calc(var(--space-6) * -1); top: calc(var(--space-6) * -1); min-height: 0; z-index: 2; pointer-events: none; }
.auth-notes .pd-note { pointer-events: auto; }
.verify-sent { color: var(--ink-soft); }
.verify-sent b { color: var(--ink); font-weight: 400; overflow-wrap: anywhere; }
.code-input { font-size: 32px; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.link-btn { padding: 0 var(--space-1); font-size: inherit; }
.link-btn:disabled { color: var(--pencil); cursor: default; }

/* ---------- desk page ---------- */
.desk { max-width: 760px; margin: 0 auto; padding: var(--space-6) var(--space-4); display: flex; flex-direction: column; gap: var(--space-6); }
.desk-top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); }
.desk .pd-sheet { padding: var(--space-rule) var(--space-6) var(--space-6) calc(var(--space-margin) + var(--space-3)); }
.cash { font-size: 48px; line-height: 56px; font-variant-numeric: tabular-nums; }
.cash-unit { color: var(--pencil); }
.next { max-width: 420px; }
.next .pd-note { width: auto; }

/* ---------- smaller screens ---------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); padding-top: 40px; padding-bottom: 48px; }
  .hero-title { font-size: 64px; }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .try-grid { grid-template-columns: minmax(0, 1fr); }
  .grow { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }

}
@media (max-width: 1040px) { .auth-aside { display: none; } }
@media (max-width: 860px) {
  .menu-btn { display: inline-block; }
  .menu { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: var(--space-4);
    background: var(--paper-sheet); border-bottom: 2px solid var(--ink); padding: var(--space-4); }
  .menu.is-open { display: flex; }
  .topnav { position: relative; }
  .menu-links { flex-direction: column; gap: var(--space-2); }
  .menu-links a { font-size: 22px; line-height: 36px; }
  .menu-auth .pd-btn { flex: 1; }
  .steps { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .hero-title { font-size: 52px; }
  .hero-lede { font-size: 19px; line-height: 28px; }
  .cta-big { width: 100%; font-size: 20px; }
  .features { grid-template-columns: minmax(0, 1fr); }
  .band { padding-top: 48px; padding-bottom: 48px; }
  .chart-card { padding: var(--space-3) var(--space-4); }
  .chart { height: 200px; }
  .range-seg button { padding: 2px var(--space-2); }
  .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .auth-top { padding: var(--space-3) var(--space-4); }
  .auth-main { padding: var(--space-6) var(--space-4); }
  .auth-card { padding: var(--space-4); }
  .auth-notes { right: 0; }
  .cash-seg button { padding: 2px var(--space-2); font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .tape-track { animation: none; flex-wrap: wrap; width: auto; }
  .tape-item[aria-hidden="true"] { display: none; }
  .feature, .faq-item summary::after { transition: none; }
  .feature:hover { transform: none; }
}
