/* Paper Bull web: one stylesheet for the front page and the legal and support pages.
   Colours and type come from the app (apps/mobile/src/theme/tokens.ts, Nunito). */
@font-face { font-family: "Nunito"; font-weight: 400; font-display: swap; src: url("/fonts/nunito-400.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 700; font-display: swap; src: url("/fonts/nunito-700.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 900; font-display: swap; src: url("/fonts/nunito-900.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --ink: #0F1320;        /* app background, used here as text and the deep band */
  --ink-2: #4A5168;
  --ink-3: #737A90;
  --paper: #FFFFFF;
  --mist: #F1F4FA;
  --line: #E1E6F0;
  --bull: #3DDC84;
  --bull-deep: #1FA45A;
  --bull-ink: #0E6B39;
  --bear: #B48CFF;
  --bear-deep: #8A5FE0;
  --bear-ink: #5B34B0;
  --gold: #FFD166;
  --gold-deep: #E0A82E;
  --radius: 18px;
  --wrap: 72rem;
  --read: 44rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1.0625rem/1.6 "Nunito", ui-rounded, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--bull-ink); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--bear-deep); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: .5rem 1rem; border-radius: 10px; z-index: 10; }
.skip:focus { left: 8px; }

/* Header */
.top { border-bottom: 2px solid var(--line); background: var(--paper); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 900; font-size: 1.45rem; color: var(--bull-deep);
  text-decoration: none; letter-spacing: -.01em; }
.brand img { width: 2.25rem; height: 2.25rem; border-radius: 10px; }
.brand:hover { color: var(--bull-deep); }
.pages { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; font-weight: 700; font-size: .95rem; }
.pages a { color: var(--ink-2); text-decoration: none; padding: .25rem 0; border-bottom: 3px solid transparent; }
.pages a:hover { color: var(--ink); }
.pages a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--bull); }

/* Chunky buttons, pressed into the page like the app's */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 3.25rem; padding: .75rem 1.5rem;
  border-radius: 16px; border: 0; font: 900 1.05rem/1.2 "Nunito", sans-serif; text-decoration: none; cursor: pointer;
  background: var(--bull); color: var(--ink); box-shadow: 0 5px 0 var(--bull-deep); transition: transform .08s, box-shadow .08s; }
.btn:hover { color: var(--ink); filter: brightness(1.04); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--bull-deep); }
.btn.ghost { background: var(--paper); color: var(--ink); box-shadow: 0 5px 0 var(--line), inset 0 0 0 2px var(--line); }
.btn[aria-disabled="true"] { cursor: default; }
.btn[aria-disabled="true"]:active { transform: none; box-shadow: 0 5px 0 var(--line), inset 0 0 0 2px var(--line); }
.btn small { display: block; font-weight: 700; font-size: .72rem; color: var(--ink-3); }
.btn .stack { text-align: left; }

/* Front page: the argument */
.hero { padding: 3.5rem 0 4rem; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 2.5rem; align-items: center; }
.hero h1 { font-weight: 900; font-size: clamp(2.5rem, 5.6vw, 4.25rem); line-height: 1.02; letter-spacing: -.025em; margin: 0 0 1.25rem; }
.hero .sub { font-size: 1.25rem; color: var(--ink-2); max-width: 30rem; margin: 0 0 2rem; }
.hero .ctas { display: flex; flex-wrap: wrap; gap: 1rem; }
.hero .fine { margin: 1.5rem 0 0; font-size: .9rem; color: var(--ink-3); }

.duel { position: relative; display: grid; grid-template-columns: 1fr 1fr; align-items: end; min-height: 28rem; }
.duel::before { content: ""; position: absolute; left: 4%; right: 4%; bottom: 0; height: 2.25rem; border-radius: 50%;
  background: var(--mist); z-index: 0; }
.duel figure { margin: 0; position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
/* Each character is a button holding a stack of poses; site.js shows one (.on) and plays a reaction on the button. */
.actor { display: block; width: min(100%, 18.5rem); padding: 0; border: 0; background: none; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; transform-origin: 50% 100%; border-radius: 24px; }
.bear .actor { width: min(94%, 17rem); }
.actor .body { display: block; position: relative; transform-origin: 50% 100%; }
.actor img { width: 100%; opacity: 0; }
.actor img + img { position: absolute; inset: 0; }
.actor img.on { opacity: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The play market under the floor: a ticker the two react to (site.js); without script it stays hidden. */
.market { display: none; margin: 1.25rem auto 0; max-width: 30rem; }
.js .market { display: block; }
.quote { display: flex; align-items: baseline; gap: .6rem; font-weight: 900; }
.quote .name { color: var(--ink-3); font-size: .95rem; }
.quote .price { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.quote .move { font-size: .95rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.market[data-dir="up"] .move { color: var(--bull-ink); }
.market[data-dir="down"] .move { color: var(--bear-ink); }
.spark { display: block; width: 100%; height: 3.5rem; margin: .35rem 0 .9rem; overflow: visible; }
.spark .line { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark .area { fill: var(--mist); }
.spark .dot { fill: var(--gold); stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; transform-box: fill-box; transform-origin: center; }
.market[data-dir="up"] .dot { fill: var(--bull); }
.market[data-dir="down"] .dot { fill: var(--bear); }
.moves { display: flex; gap: .75rem; }
.moves .btn { flex: 1; min-height: 2.9rem; padding: .55rem 1rem; }
.btn.down { background: var(--bear); box-shadow: 0 5px 0 var(--bear-deep); }
.bubble { position: relative; font-weight: 900; font-size: 1.15rem; line-height: 1.25; padding: .8rem 1.1rem; border-radius: 20px;
  background: var(--paper); border: 3px solid var(--ink); margin-bottom: 1rem; max-width: 13rem; text-align: center; }
.bubble::after { content: ""; position: absolute; bottom: -12px; left: 50%; width: 18px; height: 18px; background: var(--paper);
  border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: translateX(-50%) rotate(45deg); }
.bull .bubble { background: #E6FBEF; border-color: var(--bull-deep); color: var(--bull-ink); }
.bull .bubble::after { background: #E6FBEF; border-color: var(--bull-deep); }
.bear .bubble { background: #F2EBFF; border-color: var(--bear-deep); color: var(--bear-ink); margin-bottom: 1.75rem; }
.bear .bubble::after { background: #F2EBFF; border-color: var(--bear-deep); }
.duel figcaption { font-weight: 900; font-size: .95rem; margin-top: .25rem; }
.bull figcaption { color: var(--bull-deep); }
.bear figcaption { color: var(--bear-deep); }

@media (prefers-reduced-motion: no-preference) {
  .duel .bull .bubble { animation: pop .45s cubic-bezier(.2, 1.4, .4, 1) .25s both; }
  .duel .bear .bubble { animation: pop .45s cubic-bezier(.2, 1.4, .4, 1) 1.05s both; }
  @keyframes pop { from { opacity: 0; transform: scale(.6) translateY(10px); } to { opacity: 1; transform: none; } }
  .duel .bubble.say { animation: pop .22s cubic-bezier(.2, 1.4, .4, 1) both; }

  /* Alive at rest: the bull bobs, the bear breathes, out of step. Paused off screen (site.js sets .still). */
  .bull .body { animation: bob 2.6s ease-in-out infinite; }
  .bear .body { animation: breathe 3.2s ease-in-out -1.1s infinite; }
  .still .body { animation-play-state: paused; }
  @keyframes bob { 50% { transform: translateY(-6px); } }
  @keyframes breathe { 50% { transform: scaleY(1.015); } }

  /* Reactions: a hard pose cut on the squash frame reads like a sticker flipbook. */
  .actor.jump { animation: jump .52s cubic-bezier(.34, 1.56, .64, 1); }
  .actor.shake { animation: shake .3s linear 3; }
  .actor.smug { animation: smug .6s ease-in-out both; }
  .actor.shiver { animation: shiver .12s linear 4; }
  .actor.squish { animation: squish .18s cubic-bezier(.34, 1.56, .64, 1); }
  @keyframes jump { 0% { transform: scale(1.06, .92); } 40% { transform: translateY(-18px) scale(.97, 1.04); } 75% { transform: scale(1.06, .92); } 100% { transform: none; } }
  @keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
  @keyframes smug { 50%, 100% { transform: rotate(-4deg); } }
  @keyframes shiver { 25% { transform: rotate(-2deg); } 75% { transform: rotate(2deg); } }
  @keyframes squish { 0% { transform: scale(1.06, .94); } 100% { transform: none; } }
  .market .dot.ping { animation: ping .45s cubic-bezier(.34, 1.56, .64, 1); }
  @keyframes ping { 0% { transform: scale(.4); } 60% { transform: scale(1.5); } 100% { transform: none; } }
  .js .market:not(.drawn) .line { stroke-dasharray: 1; stroke-dashoffset: 1; }
  .market.drawn .line.first { stroke-dasharray: 1; animation: draw 1.6s cubic-bezier(.2, .8, .3, 1) both; }
  @keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

  /* Further down, each character does one beat when it scrolls into view. */
  .js .reveal .steps-row li { opacity: 0; transform: translateY(16px); transition: opacity .4s ease-out, transform .4s ease-out; }
  .js .reveal .steps-row li:nth-child(2) { transition-delay: .12s; }
  .js .reveal .steps-row li:nth-child(3) { transition-delay: .24s; }
  .js .reveal.seen .steps-row li { opacity: 1; transform: none; }
  .reveal.seen .steps-row li:nth-child(1) img { animation: nudge .5s ease-out .5s both; }
  .reveal.seen .steps-row li:nth-child(2) img { animation: droop 1.2s ease-in-out .6s both; transform-origin: 50% 100%; }
  .reveal.seen .steps-row li:nth-child(3) img { animation: puff .5s cubic-bezier(.34, 1.56, .64, 1) .75s both; transform-origin: 50% 100%; }
  @keyframes nudge { 50% { transform: translateX(6px); } }
  @keyframes droop { to { transform: rotate(3deg); } }
  @keyframes puff { 50% { transform: scale(1.06); } 100% { transform: scale(1.04); } }
  .js .honest.reveal img { opacity: 0; transform: translateX(-40px); }
  .honest.reveal.seen img { opacity: 1; transform: none; transition: opacity .3s ease-out, transform .5s cubic-bezier(.34, 1.56, .64, 1); }
  .js .closing.reveal .pair img:first-child { transform: translateX(-28px); }
  .js .closing.reveal .pair img:last-child { transform: translateX(28px); }
  .closing.reveal .pair img { transition: transform .3s cubic-bezier(.34, 1.56, .64, 1) .1s; }
  .closing.reveal.seen .pair img { transform: none; }
}

/* The closing pair: they agree on one thing. */
.pair { display: flex; justify-content: center; align-items: flex-end; gap: .25rem; margin: 0 auto 1rem; }
.pair img { width: 7.5rem; }
.pair img:last-child { width: 7rem; margin-left: -1.75rem; }

/* A day in Paper Bull: three real steps */
.day { background: var(--mist); padding: 4.5rem 0; }
.section-title { font-weight: 900; font-size: clamp(1.9rem, 3.6vw, 2.75rem); line-height: 1.1; letter-spacing: -.02em; margin: 0 0 .75rem; }
.section-sub { color: var(--ink-2); font-size: 1.15rem; max-width: 38rem; margin: 0 0 2.75rem; }
.steps-row { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; counter-reset: step; }
.steps-row li { counter-increment: step; background: var(--paper); border-radius: 24px; padding: 1.75rem 1.5rem 1.5rem;
  border: 2px solid var(--line); border-bottom-width: 6px; position: relative; }
.steps-row li::before { content: counter(step); position: absolute; top: -1rem; left: 1.5rem; width: 2.25rem; height: 2.25rem;
  border-radius: 50%; display: grid; place-items: center; font-weight: 900; background: var(--gold); box-shadow: 0 3px 0 var(--gold-deep); }
.steps-row img { width: 10rem; margin: 0 auto .75rem; }
.steps-row h3 { font-weight: 900; font-size: 1.3rem; margin: 0 0 .4rem; }
.steps-row p { margin: 0; color: var(--ink-2); }

/* Screens */
.screens { padding: 4.5rem 0 5rem; }
.phones { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; margin: 0; padding: 0; list-style: none; }
.phones figure { margin: 0; }
.phones img { border-radius: 28px; border: 6px solid var(--ink); background: var(--ink); aspect-ratio: 600 / 1304; object-fit: cover; }
.phones figcaption { margin-top: .75rem; font-weight: 700; color: var(--ink-2); font-size: .95rem; }

/* The honest band */
.honest { background: var(--ink); color: #fff; padding: 4rem 0; }
.honest .wrap { display: grid; grid-template-columns: auto 1fr; gap: 2.5rem; align-items: center; }
.honest img { width: 11rem; }
.honest h2 { font-weight: 900; font-size: clamp(1.8rem, 3.4vw, 2.5rem); line-height: 1.1; margin: 0 0 1rem; }
.honest p { color: rgba(255, 255, 255, .78); margin: 0 0 .75rem; max-width: 40rem; }
.honest a { color: var(--bull); }

.closing { padding: 4.5rem 0; text-align: center; }
.closing .section-sub { margin: 0 auto; }
.closing .ctas { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }

/* Reading pages: privacy, terms, support, delete-account */
.doc { max-width: var(--read); margin: 0 auto; padding: 2.75rem 16px 4rem; }
.doc h1 { font-weight: 900; font-size: clamp(2.1rem, 5vw, 2.9rem); line-height: 1.08; letter-spacing: -.02em; margin: 0 0 .5rem; }
.doc h2 { font-weight: 900; font-size: 1.45rem; line-height: 1.25; margin: 2.5rem 0 .75rem; scroll-margin-top: 1rem; }
.doc h3 { font-weight: 900; font-size: 1.1rem; margin: 1.75rem 0 .5rem; }
.doc .updated { color: var(--ink-3); font-size: .95rem; margin: 0 0 1.5rem; }
.doc .lead { font-size: 1.2rem; color: var(--ink-2); }
.doc li { margin: .35rem 0; }
.doc .toc { background: var(--mist); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1.75rem 0; }
.doc .toc ol { margin: 0; padding-left: 1.4rem; columns: 2 16rem; column-gap: 2rem; }
.doc .toc a { color: var(--ink); text-decoration: none; font-weight: 700; }
.doc .toc a:hover { text-decoration: underline; }
.note { border-radius: var(--radius); padding: 1rem 1.25rem 1rem 1.25rem; margin: 1.5rem 0; border-left: 6px solid; }
.note p { margin: .4rem 0; }
.note.bull { background: #E9FBF1; border-color: var(--bull); }
.note.bear { background: #F4EEFF; border-color: var(--bear); }
.note.with-art { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; }
.note.with-art img { width: 5.5rem; }
.table-scroll { overflow-x: auto; margin: 1rem 0; border: 2px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; min-width: 34rem; }
th, td { text-align: left; vertical-align: top; padding: .7rem .9rem; border-bottom: 1px solid var(--line); }
th { background: var(--mist); font-weight: 900; }
tr:last-child td { border-bottom: 0; }
ol.steps { padding-left: 1.4rem; }
details { border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 16px; padding: .85rem 1.1rem; margin: .75rem 0; }
details[open] { border-color: var(--bull); }
summary { font-weight: 900; cursor: pointer; }
details p { margin: .6rem 0 .2rem; color: var(--ink-2); }
.contact-card { display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; align-items: center; background: #E9FBF1;
  border: 2px solid var(--bull); border-bottom-width: 6px; border-radius: 24px; padding: 1.25rem 1.5rem; margin: 1.75rem 0; }
.contact-card img { width: 6rem; }
.contact-card h2 { margin: 0 0 .35rem; }
.contact-card p { margin: .3rem 0; }
.contact-card .btn { margin-top: .6rem; }
address { font-style: normal; }

/* 404 */
.lost { text-align: center; padding: 4rem 16px 5rem; }
.lost img { width: 12rem; margin: 0 auto 1rem; }
.lost h1 { font-weight: 900; font-size: 2.4rem; margin: 0 0 .5rem; }
.lost p { color: var(--ink-2); margin: 0 0 1.75rem; }

/* Footer */
.bottom { border-top: 2px solid var(--line); background: var(--mist); color: var(--ink-2); font-size: .92rem; }
.bottom .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; padding-top: 2rem; padding-bottom: 2.25rem; }
.bottom p { margin: .2rem 0; }
.bottom nav { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; font-weight: 700; }
.bottom nav a { color: var(--ink); text-decoration: none; }
.bottom nav a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .hero { padding-top: 2rem; }
  .hero .wrap { grid-template-columns: 1fr; gap: 1.5rem; }
  .arena { max-width: 30rem; margin: 0 auto; width: 100%; }
  .duel { min-height: 0; }
  .steps-row { grid-template-columns: 1fr; gap: 2rem; }
  .phones { grid-template-columns: repeat(2, 1fr); }
  .honest .wrap { grid-template-columns: 1fr; text-align: left; }
  .honest img { width: 8rem; }
}
@media (max-width: 480px) {
  /* Two lines tall, so a new line from site.js doesn't move the page. */
  .bubble { font-size: 1rem; padding: .6rem .8rem; min-height: calc(2.5em + 1.2rem + 6px); display: flex; align-items: center; justify-content: center; }
  .actor, .bear .actor { width: 100%; }
  .hero .ctas .btn { flex: 1 1 100%; }
  .contact-card, .note.with-art { grid-template-columns: 1fr; }
  .contact-card img, .note.with-art img { width: 4.5rem; }
}
