/* RektBoy: "loss journal" — a degen's notebook page. Cream ruled paper, black ink, one red, one violet pencil. */
:root {
  --paper: #f4efe4;
  --rule: rgba(60, 90, 160, .13);
  --margin: rgba(200, 50, 40, .45);
  --ink: #17151a;
  --ink-2: #5f5866;
  --ink-3: #8d8592;
  --red: #d2381e;
  --violet: #6b45b8;
  --green: #2c7a47;
  --highlight: rgba(255, 196, 60, .55);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.3 0 0 0 0 0.24 0 0 0 0 0.16 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --hand: 'Permanent Marker', 'Segoe Print', cursive;
  --pen: 'Caveat', 'Segoe Print', cursive;
  --sans: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --line: 32px;
}
* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: hidden; }
body {
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  background: var(--grain), repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--line) - 1px), var(--rule) calc(var(--line) - 1px), var(--rule) var(--line)), var(--paper);
  min-height: 100vh;
}
.page { position: relative; max-width: 1100px; margin: 0 auto; padding: 0 28px 0 96px; }
.page::before { /* red margin line */
  content: ''; position: fixed; top: 0; bottom: 0; left: max(68px, calc(50vw - 550px + 68px)); width: 2px; background: var(--margin);
}
a { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--ink-3); font-size: 14px; }
.label { display: flex; align-items: center; gap: 8px; font: 600 11px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
h2 { font: 400 30px/1.1 var(--hand); margin: 72px 0 20px; }
h2::after { content: ''; display: block; width: 90px; height: 8px; margin-top: 6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 8'%3E%3Cpath d='M2 5 C 20 2, 40 7, 60 3 S 85 5, 88 3' fill='none' stroke='%23d2381e' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat; }
.scribble { font: 700 24px/1.1 var(--pen); color: var(--violet); }
.scribble.small { font-size: 21px; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; padding: 26px 0; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; outline: 2px solid var(--ink); outline-offset: 2px; }
.brand span { font: 400 22px/1 var(--hand); }
.brand em { font: 700 12px/1 var(--mono); font-style: normal; color: var(--red); }
nav { display: flex; align-items: center; gap: 22px; }
.link { font-weight: 600; text-decoration: none; border-bottom: 2px solid var(--ink); padding-bottom: 1px; }
.btn {
  display: inline-block; text-decoration: none; font-weight: 600; font-size: 15px; color: var(--paper); background: var(--ink);
  padding: 10px 20px; border-radius: 3px; box-shadow: 4px 4px 0 var(--red); transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--red); }
.btn.big { padding: 15px 30px; font-size: 17px; }

/* hero */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; padding: 36px 0 12px; }
.date { margin: 0 0 14px; font: 700 26px/1 var(--pen); color: var(--ink-2); }
.hero h1 { margin: 0 0 26px; font: 400 clamp(54px, 7.6vw, 96px)/1.02 var(--hand); }
.circled { position: relative; display: inline-block; color: var(--red); }
.circled svg { position: absolute; left: -9%; top: -16%; width: 118%; height: 132%; overflow: visible; pointer-events: none; }
.circled path { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 900; stroke-dashoffset: 900; animation: draw 1.4s .4s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.lead { font-size: 19px; line-height: 1.6; color: var(--ink-2); max-width: 32em; margin: 0 0 22px; }
.lead a { color: var(--ink); text-decoration-thickness: 2px; text-underline-offset: 3px; }
mark { background: linear-gradient(104deg, transparent 2%, var(--highlight) 4%, var(--highlight) 96%, transparent 98%); color: var(--ink); font-weight: 600; padding: 0 3px; }
.rules { list-style: none; padding: 0; margin: 0 0 32px; display: grid; gap: 10px; max-width: 32em; }
.rules li { display: flex; gap: 12px; align-items: baseline; color: var(--ink-2); }
.rules b { color: var(--ink); }
.box { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border: 2px solid var(--ink); border-radius: 3px; font: 700 15px/1 var(--sans); color: var(--red); transform: rotate(-3deg); }
.box.ok { color: var(--green); transform: rotate(2deg); }
.cta { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.ca { display: flex; align-items: center; gap: 12px; margin-top: 26px; max-width: 100%; padding: 10px 14px; cursor: pointer; text-align: left;
  font: inherit; color: var(--ink); background: rgba(255, 253, 247, .8); border: 2px dashed var(--ink); border-radius: 3px; }
.ca:hover { border-style: solid; }
.ca-k { flex: none; font: 400 18px/1 var(--hand); color: var(--red); }
.ca code { min-width: 0; font: 500 13px/1.4 var(--mono); word-break: break-all; }
.ca-copy { flex: none; font: 700 20px/1 var(--pen); color: var(--violet); }

.sketch { margin: 0; justify-self: center; width: min(100%, 400px); text-align: center; }
.sketch img { display: block; width: 100%; border-radius: 2px; border: 2px solid var(--ink); box-shadow: 10px 10px 0 rgba(23, 21, 26, .9); }
.sketch figcaption { margin-top: 18px; font: 700 22px/1 var(--pen); color: var(--ink-2); }

/* teaser */
#teaser { margin-top: 28px; }
.opens { border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); padding: 28px 0; display: grid; justify-items: start; gap: 6px; }
.countdown { font: 700 clamp(48px, 8vw, 88px)/1.05 var(--mono); letter-spacing: -2px; font-variant-numeric: tabular-nums; color: var(--ink); }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; }
.steps li { display: flex; gap: 12px; }
.steps .n { font: 400 34px/1 var(--hand); color: var(--red); }
.steps h3 { font: 600 18px/1.3 var(--sans); margin: 4px 0 6px; }
.steps p { margin: 0; color: var(--ink-2); font-size: 15px; }

/* live desk */
#live { margin-top: 28px; }
.demo { margin: 0 0 12px; }
.desk { display: grid; grid-template-columns: 1.6fr 1fr; border: 2px solid var(--ink); background: rgba(255, 253, 247, .7); box-shadow: 10px 10px 0 var(--ink); }
.desk > div { padding: 26px 28px; min-width: 0; }
.next { border-left: 2px dashed var(--ink); display: grid; align-content: center; gap: 4px; }
.rec { width: 9px; height: 9px; border-radius: 50%; background: var(--red); animation: blink 1.2s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }
.now .pos { font: 400 32px/1.2 var(--hand); margin: 10px 0 16px; }
.now .pos .long { color: var(--green); } .now .pos .short { color: var(--red); }
.now .pos small { font: 500 14px/1 var(--mono); color: var(--ink-3); margin-left: 10px; }
.bar { position: relative; height: 4px; margin: 34px 0 14px; background: var(--ink); }
.bar::before, .bar::after { content: ''; position: absolute; top: -8px; width: 2px; height: 20px; background: var(--ink); }
.bar::before { left: 0; } .bar::after { right: 0; }
.bar .liq, .bar .tp { position: absolute; top: -30px; font: 500 12px/1 var(--mono); }
.bar .liq { left: 0; color: var(--red); } .bar .tp { right: 0; color: var(--green); }
.bar .mid { position: absolute; left: 50%; top: -5px; width: 1px; height: 14px; background: var(--ink-3); }
.bar .dot { position: absolute; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; background: var(--paper); border: 3px solid var(--red); transition: left .8s ease; }
.now .meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font: 500 12px/1.4 var(--mono); color: var(--ink-3); }
.idle { font: 700 28px/1.2 var(--pen); color: var(--ink-2); margin-top: 14px; }

/* live feed */
.feed { border: 2px solid var(--ink); background: rgba(255, 253, 247, .7); }
.feed-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 2px dashed var(--ink); }
.feed ol { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; }
.feed li { display: grid; grid-template-columns: 26px 1fr auto; align-items: baseline; gap: 4px 12px; padding: 10px 18px; border-bottom: 1px dotted rgba(0, 0, 0, .15); }
.feed li:last-child { border-bottom: 0; }
.feed li.new { animation: flash 2.4s ease-out; }
@keyframes flash { from { background: var(--highlight); } to { background: transparent; } }
.feed .ic { font-size: 16px; line-height: 1; }
.feed .tx { min-width: 0; font-size: 15px; color: var(--ink-2); overflow-wrap: anywhere; }
.feed .tx b { color: var(--ink); font-weight: 600; }
.feed .tx .w { font: 500 13px/1 var(--mono); color: var(--ink-3); }
.feed .tx .q { font: 700 19px/1.1 var(--pen); color: var(--violet); margin-left: 4px; }
.feed .t { font: 500 12px/1 var(--mono); color: var(--ink-3); white-space: nowrap; text-decoration: none; }
.feed a.t:hover { color: var(--ink); text-decoration: underline; }
.feed .buy b { color: var(--green); } .feed .sell b { color: var(--red); }
.feed .rekt { background: rgba(210, 56, 30, .06); } .feed .rekt .tx b { color: var(--red); }
.feed .paid { background: rgba(44, 122, 71, .07); } .feed .paid .tx b { color: var(--green); }
.feed .f-empty { display: block; color: var(--ink-3); }

.score { display: grid; }
.score .row { display: flex; align-items: center; gap: 14px; height: var(--line); min-width: 0; }
.score .row:not(.thin) { height: calc(var(--line) * 1.5); }
.score .k { font: 600 15px/1 var(--sans); white-space: nowrap; }
.score .thin .k { font-weight: 500; color: var(--ink-2); font-size: 14px; }
.score .dots { flex: 1; border-bottom: 2px dotted var(--ink-3); margin-bottom: 4px; }
.score .tally { flex: 1; font: 700 28px/1 var(--pen); color: var(--red); letter-spacing: 1px; white-space: nowrap; overflow: hidden; }
.score .tally.win { color: var(--green); }
.score .v { font: 700 22px/1 var(--mono); font-variant-numeric: tabular-nums; }
.score .thin .v { font-size: 16px; }
.v.loss { color: var(--red); } .v.win { color: var(--green); } .v.ash { color: var(--violet); }

/* receipt */
.receipt { position: relative; max-width: 560px; background: #fffdf8; color: var(--ink); font: 500 13px/1.5 var(--mono);
  padding: 26px 26px 34px; box-shadow: 0 1px 0 rgba(0, 0, 0, .05), 0 20px 40px -18px rgba(40, 30, 20, .35); transform: rotate(-.6deg); }
.receipt::after { /* torn zigzag bottom */
  content: ''; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px;
  background: linear-gradient(-45deg, transparent 6px, #fffdf8 0) 0 0 / 14px 10px repeat-x, linear-gradient(45deg, transparent 6px, #fffdf8 0) 0 0 / 14px 10px repeat-x; }
.r-head { text-align: center; border-bottom: 1px dashed var(--ink-3); padding-bottom: 12px; margin-bottom: 6px; }
.r-head b { display: block; font-size: 16px; letter-spacing: .3em; }
.r-head span { color: var(--ink-3); font-size: 12px; }
.r-foot { text-align: center; border-top: 1px dashed var(--ink-3); padding-top: 12px; color: var(--ink-3); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.receipt ol { list-style: none; margin: 0; padding: 0; }
.receipt li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px dotted rgba(0, 0, 0, .15); }
.receipt li:last-child { border-bottom: 0; }
.receipt .what b { font-weight: 700; }
.receipt .pos-tag { color: var(--ink-3); margin-left: 6px; }
.receipt .res { font-weight: 700; text-align: right; }
.receipt .res.violet { color: var(--violet); } .receipt .res.green { color: var(--green); }
.receipt .roast { grid-column: 1 / -1; font: 700 19px/1.15 var(--pen); color: var(--ink-2); }
.receipt .when { grid-column: 1 / -1; order: 3; color: var(--ink-3); font-size: 11px; }
.receipt .empty { grid-column: 1 / -1; color: var(--ink-3); }

footer { margin-top: 80px; padding: 26px 0 48px; border-top: 2px solid var(--ink); }
footer p { margin: 0; color: var(--ink-3); font-size: 13px; max-width: 68em; }
footer a { color: var(--ink); }

@media (max-width: 860px) {
  :root { --line: 28px; }
  .page { padding: 0 20px 0 44px; }
  .page::before { left: 30px; }
  .hero { grid-template-columns: 1fr; gap: 36px; padding-top: 8px; }
  .sketch { width: min(100%, 300px); order: -1; }
  .steps { grid-template-columns: 1fr; gap: 22px; }
  .desk { grid-template-columns: 1fr; box-shadow: 6px 6px 0 var(--ink); }
  .next { border-left: 0; border-top: 2px dashed var(--ink); }
  .score .tally { display: none; }
  .score .row { gap: 10px; }
  .score .row:not(.thin) .k::after { content: ''; }
  .score .row:not(.thin) { position: relative; }
  .score .row:not(.thin) .k + .tally + .v, .score .row .k ~ .v { margin-left: auto; }
  .brand span { display: none; }
}
