/* Alpenglow: one system. Night sky + one lit paper object. Tokens from the avatar (DESIGN-NOTES.md section 3). */
@font-face { font-family: "Geologica"; src: url(/fonts/geologica.woff2) format("woff2"); font-weight: 700 900; font-display: swap; }
@font-face { font-family: "Red Hat Text"; src: url(/fonts/redhattext.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Red Hat Mono"; src: url(/fonts/redhatmono.woff2) format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --night: #020a22; --navy: #0b132e; --indigo: #1f235a; --lav: #8072be; --lav-text: #b4a9e6;
  --mauve: #e19daf; --apricot: #ed986e; --cream: #fee5c8; --cyan: #59edfb; --grey: #8a8fa8;
  --plate: rgba(11, 19, 46, 0.84); --line: rgba(128, 114, 190, 0.34);
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px; --s6: 64px; --s7: 96px;
  --wrap: 1240px; --gut: 32px; --r: 16px;
  --display: "Geologica", "Red Hat Text", system-ui, sans-serif;
  --text: "Red Hat Text", system-ui, sans-serif;
  --mono: "Red Hat Mono", ui-monospace, monospace;
}
@media (max-width: 720px) { :root { --gut: 16px; } }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--night); color: var(--cream); }
body { margin: 0; font: 400 18px/1.55 var(--text); font-feature-settings: "tnum" 1, "liga" 0; -webkit-font-smoothing: antialiased; overflow-x: clip; min-height: 100svh; }
body::before { /* the sky: the avatar's grid, everywhere */
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image: linear-gradient(rgba(89, 237, 251, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(89, 237, 251, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }
.wrap { width: min(100%, var(--wrap) + 2 * var(--gut)); margin: 0 auto; padding: 0 var(--gut); }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.mono { font-family: var(--mono); font-weight: 500; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header: one on every page ---------- */
.bar { position: relative; z-index: 20; }
.bar .wrap { display: flex; align-items: center; gap: var(--s4); min-height: 76px; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; font: 800 24px/1 var(--display); font-variation-settings: "SHRP" 100; letter-spacing: -0.01em; }
/* the mark: the avatar's three paper triangles, cut out, no square behind them */
.logo .mk { position: relative; height: 40px; width: 46px; flex: none; }
.logo .mk img { display: block; height: 40px; width: 46px; }
/* the header lives: the mark flashes at its tip on a buy, a forward and a burn (no tint over it: it stays crisp) */
.logo .mk.flash::after { -webkit-mask: url(/img/logo-80.webp) center / 100% 100% no-repeat; mask: url(/img/logo-80.webp) center / 100% 100% no-repeat; }
.logo .mk.flash::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 42% 8%, rgba(254, 229, 200, 0.95), transparent 45%); animation: mkflash 0.7s ease-out forwards; }
@keyframes mkflash { from { opacity: 1; } to { opacity: 0; } }
.nav { display: flex; gap: var(--s1); margin: 0; padding: 0; list-style: none; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; text-decoration: none; font-weight: 500; color: var(--lav-text); }
.nav a:hover { color: var(--cream); background: rgba(128, 114, 190, 0.14); }
.nav a[aria-current="page"] { color: var(--night); background: var(--cream); font-weight: 700; }
.badge { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 18px; border: 1px solid var(--lav); border-radius: 999px; color: var(--cream); font-weight: 600; font-size: 16px; white-space: nowrap; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--apricot); box-shadow: 0 0 10px var(--apricot); }
.badge.live::before { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.menu-btn { display: none; margin-left: auto; min-height: 44px; padding: 0 18px; border: 1px solid var(--lav); border-radius: 999px; background: none; cursor: pointer; font-weight: 600; }
.note { border-top: 1px solid rgba(128, 114, 190, 0.18); border-bottom: 1px solid rgba(128, 114, 190, 0.18); background: rgba(2, 10, 34, 0.72); position: relative; z-index: 19; }
.note .wrap { display: flex; align-items: center; gap: var(--s2); min-height: 48px; font-size: 16px; color: var(--lav-text); }
.note p { margin: 0; flex: 1; min-width: 0; }
.note b { color: var(--cream); font-weight: 600; }
.replay { display: none; align-items: center; gap: 12px; white-space: nowrap; color: var(--cream); font-weight: 600; }
.replay.on { display: inline-flex; }
.replay .skip, .replay-start { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--apricot); background: none; color: var(--apricot); font-weight: 700; font-size: 16px; cursor: pointer; }
.replay .skip:hover, .replay-start:hover { background: rgba(237, 152, 110, 0.14); }
.replay-start.hide { display: none; }

@media (max-width: 980px) {
  .bar .wrap { gap: var(--s2); }
  .menu-btn { display: inline-flex; align-items: center; }
  .badge { margin-left: 0; }
  .nav { display: none; position: absolute; top: 76px; left: var(--gut); right: var(--gut); flex-direction: column; padding: var(--s2); border-radius: var(--r); background: var(--navy); border: 1px solid var(--line); }
  .nav.open { display: flex; }
  .nav a { min-height: 48px; }
}
@media (max-width: 720px) {
  .note .wrap { flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; gap: 8px 16px; }
  .note p { flex: 1 1 100%; }
}
@media (max-width: 520px) {
  .logo { font-size: 20px; gap: 10px; }
  .logo .mk, .logo .mk img { height: 36px; width: 41px; }
  .bar .wrap { gap: 10px; }
  .menu-btn { padding: 0 16px; }
  .badge { width: 44px; min-height: 44px; padding: 0; justify-content: center; }
  .badge .t { display: none; }
}

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 1.3em; border-radius: 999px; border: 1px solid transparent; font: 700 18px/1 var(--text); text-decoration: none; cursor: pointer; transition: transform 0.12s ease-out, background 0.15s, box-shadow 0.15s; }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn.primary { background: var(--apricot); color: var(--night); box-shadow: 0 0 0 0 rgba(237, 152, 110, 0); }
.btn.primary:hover { background: #f3a983; box-shadow: 0 0 28px rgba(237, 152, 110, 0.45); }
.btn.ghost { border-color: var(--lav); color: var(--cream); background: rgba(2, 10, 34, 0.4); }
.btn.ghost:hover { border-color: var(--cream); background: rgba(128, 114, 190, 0.16); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 1; cursor: not-allowed; color: var(--grey); border-color: rgba(138, 143, 168, 0.45); background: rgba(11, 19, 46, 0.6); box-shadow: none; }

/* ---------- the contract bar (first screen) ---------- */
.ca { display: flex; align-items: stretch; gap: var(--s1); padding: var(--s1); border-radius: 20px; background: var(--plate); border: 1px solid var(--line); backdrop-filter: blur(8px); max-width: 640px; }
.ca .addr { flex: 1; min-width: 0; display: flex; align-items: center; padding: 0 var(--s2); min-height: 52px; border-radius: 14px; background: rgba(2, 10, 34, 0.7); font-size: 16px; color: var(--lav-text); white-space: nowrap; overflow: hidden; }
.ca .addr.set { color: var(--cream); cursor: pointer; gap: 12px; }
.ca .addr.set .mono { font-size: 17px; }
.ca .addr-hint { color: var(--lav-text); font-size: 16px; }
.ca .addr.set:hover .mono { color: var(--apricot); }
@media (max-width: 380px) { .ca .addr-hint { display: none; } }
.ca .copy { display: inline-flex; align-items: center; justify-content: center; min-width: 88px; min-height: 52px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--lav); background: none; font-weight: 700; cursor: pointer; }
.ca .copy:hover:not([disabled]) { border-color: var(--cream); background: rgba(128, 114, 190, 0.16); }
.ca .copy[disabled] { color: var(--grey); border-color: rgba(138, 143, 168, 0.4); cursor: not-allowed; }
.links { display: flex; gap: var(--s1); }
.lk { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 14px; background: var(--cream); border: 1px solid var(--cream); transition: transform 0.12s, box-shadow 0.15s; }
.lk img { width: 26px; height: 26px; object-fit: contain; }
.lk:hover { box-shadow: 0 0 20px rgba(254, 229, 200, 0.5); }
.lk:active { transform: scale(0.96); }
.lk.off { background: rgba(11, 19, 46, 0.9); border-color: rgba(138, 143, 168, 0.5); cursor: not-allowed; }
.lk.off img { filter: grayscale(1) brightness(1.6); opacity: 0.55; }
.lk.off::after { content: "\1F512"; position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%; background: var(--navy); border: 1px solid var(--grey); font-size: 10px; display: grid; place-items: center; }
.tip { position: fixed; z-index: 60; max-width: 260px; padding: 10px 14px; border-radius: 12px; background: var(--cream); color: var(--night); font-size: 16px; font-weight: 600; line-height: 1.35; pointer-events: none; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4); }
@media (max-width: 520px) {
  .ca { flex-wrap: wrap; }
  .ca .addr { flex: 1 1 100%; }
  .ca .copy { flex: 1; }
  .nums { display: grid !important; grid-template-columns: 1fr 1fr; gap: var(--s2) 0 !important; }
  .nums > div { padding: 0 0 0 var(--s2) !important; border-right: 0 !important; border-left: 1px solid var(--line); }
  .nums > div:nth-child(1), .nums > div:nth-child(2) { border-left: 0; padding-left: 0 !important; }
  .nums > div:nth-child(2) { grid-column: 1 / -1; order: 3; }
  .nums b { font-size: 26px !important; }
  .tbl thead th { white-space: normal; line-height: 1.2; }
  .tbl td, .tbl thead th { padding: 0 8px !important; }
  .tbl .sigtxt { display: none; }
  .tbl { table-layout: fixed; }
  .tbl td { white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
  .tbl .ic { width: 22px; margin-left: 0; }
  .tbl thead th:first-child { width: 34%; }
  .tbl .side { display: inline; }
}

/* ---------- the toast: the cream paper dialog from the reference, one at a time ---------- */
.toast { position: fixed; z-index: 50; left: 50%; bottom: 24px; width: min(420px, calc(100vw - 32px)); transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: opacity 0.22s ease-out, transform 0.22s ease-out; border-radius: 10px; background: #f6e8d4; color: var(--night); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(31, 35, 90, 0.5); overflow: hidden; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 721px) {
  /* bottom right, above the row of small peaks: never on the copy, never on the mountain's tip */
  .toast { left: auto; right: 24px; top: auto; bottom: 150px; transform: translateY(12px); }
  .toast.on { transform: none; }
}
.toast .tb { display: flex; align-items: center; justify-content: space-between; height: 30px; padding: 0 12px; background: var(--indigo); color: var(--cream); font-size: 16px; font-weight: 600; }
.toast .tb span { letter-spacing: 0.02em; }
.toast .tb i { display: inline-block; width: 12px; height: 12px; border: 1.5px solid var(--cream); border-radius: 2px; margin-left: 6px; }
.toast .bd { padding: 14px 16px 16px; font-size: 17px; font-weight: 600; line-height: 1.4; }
.toast .bd small { display: block; margin-top: 2px; font-size: 16px; font-weight: 500; color: #3b3f6e; }

/* ---------- sections ---------- */
.sec { padding-top: var(--s7); }
.sec:last-of-type { padding-bottom: var(--s6); }
.sec.wrap { padding-left: var(--gut); padding-right: var(--gut); }
.sh { display: flex; align-items: end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s4); flex-wrap: wrap; }
.sh h2 { margin: 0; font: 800 44px/1.05 var(--display); font-variation-settings: "SHRP" 100; letter-spacing: -0.015em; }
.sh p { margin: var(--s1) 0 0; color: var(--lav-text); max-width: 62ch; }
.plate { background: var(--plate); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4); }
@media (max-width: 720px) { .sh h2 { font-size: 34px; } .sec { padding-top: var(--s6); } .plate { padding: var(--s3); } }

/* tables: one style */
.tbl { width: 100%; border-collapse: collapse; font-size: 17px; }
.tbl-wrap { border: 1px solid var(--line); border-radius: var(--r); background: var(--plate); }
.tbl thead th { position: sticky; top: 0; z-index: 2; background: var(--navy); text-align: left; font-size: 16px; font-weight: 600; color: var(--lav-text); padding: 0 20px; height: 52px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl thead th:first-child { border-top-left-radius: var(--r); }
.tbl thead th:last-child { border-top-right-radius: var(--r); }
.tbl td { height: 54px; padding: 0 20px; border-bottom: 1px solid rgba(128, 114, 190, 0.14); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; }
.tbl tbody tr { transition: background 0.15s; }
.tbl tbody tr:hover, .tbl tbody tr.hot { background: rgba(237, 152, 110, 0.09); }
.tbl .side { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.tbl .side::before { content: ""; width: 10px; height: 10px; border-radius: 50%; }
.tbl .side.buy::before { background: var(--apricot); box-shadow: 0 0 8px var(--apricot); }
.tbl .side.sell::before { background: var(--grey); }
.tbl .side.summit::before { background: var(--cream); box-shadow: 0 0 10px var(--cream); }
.tbl .side.fwd::before { background: var(--mauve); }
.ic { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-left: 6px; border-radius: 6px; border: 0; background: none; color: var(--lav-text); font-size: 16px; text-decoration: none; cursor: pointer; vertical-align: middle; }
.ic:hover { color: var(--cream); background: rgba(128, 114, 190, 0.2); }
.dimtxt { color: var(--grey); font-size: 16px; }
.tbl-foot { display: flex; justify-content: center; padding: var(--s2); border-top: 1px solid var(--line); }
.sample-tag { display: inline-block; margin: 0 0 var(--s2); padding: 4px 12px; border-radius: 999px; border: 1px solid var(--mauve); color: var(--mauve); font-size: 16px; font-weight: 600; }
.scroll-x { max-width: 100%; }
@media (max-width: 900px) { .tbl .hide-m { display: none; } }
@media (max-width: 720px) { .tbl td, .tbl thead th { padding: 0 10px; } .tbl .hide-s { display: none; } .tbl { font-size: 16px; } .tbl .side::before { display: none; } .ic { width: 24px; margin-left: 2px; } }

/* numbers row */
.nums { display: flex; gap: var(--s4); }
.nums > div { display: flex; flex-direction: column; gap: 2px; padding-right: var(--s4); border-right: 1px solid var(--line); }
.nums > div:last-child { border-right: 0; padding-right: 0; }
.nums b { font: 700 34px/1.1 var(--text); color: var(--cream); white-space: nowrap; }
.nums span { font-size: 16px; color: var(--lav-text); white-space: nowrap; }
.nums.replaying b { color: var(--mauve); }
.flip { display: inline-block; animation: flip 0.55s cubic-bezier(.2,.8,.2,1); }
@keyframes flip { 0% { transform: translateY(-45%) rotateX(70deg); opacity: 0; color: var(--apricot); } 60% { opacity: 1; color: var(--apricot); } 100% { transform: none; } }

/* the one-line contract at the end of every page */
.endline { margin-top: 0; border-top: 1px solid rgba(128, 114, 190, 0.18); }
.endline .wrap { display: flex; align-items: center; gap: var(--s2); min-height: 72px; font-size: 16px; color: var(--lav-text); flex-wrap: wrap; }
.endline .mono { color: var(--cream); }
.endline .ca-mini { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- inner page head: the living header picture ---------- */
.phead { position: relative; padding: var(--s4) 0 0; }
.phead .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s5); align-items: center; }
.phead h1 { margin: 0; font: 800 76px/0.98 var(--display); font-variation-settings: "SHRP" 100; letter-spacing: -0.02em; }
.phead .lead { margin: var(--s3) 0 0; font-size: 20px; color: var(--lav-text); max-width: 34ch; }
.phead .lead b { color: var(--cream); }
/* the page's picture sits straight on the night, no frame; its edges melt into the sky */
.pic { position: relative; justify-self: end; width: fit-content; max-width: 100%; }
.pic img { width: auto; max-width: 100%; max-height: 440px; -webkit-mask-image: radial-gradient(ellipse 72% 70% at 50% 50%, #000 62%, transparent 100%); mask-image: radial-gradient(ellipse 72% 70% at 50% 50%, #000 62%, transparent 100%); }
.pic canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
@media (max-width: 900px) {
  .phead .wrap { grid-template-columns: 1fr; gap: var(--s4); }
  .phead h1 { font-size: 56px; }
}

.reduced-note { display: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }
