/* Inurage Pad: one cream 1984 terminal on a light desk. Surfaces are generated pictures (nine-sliced), never CSS boxes. */
:root {
  --cream: #f6f1e7; --cream-2: #efe7d6; --ink: #1e1b16; --ink-2: #5a5245; --line: rgba(30, 27, 22, 0.16);
  --orange: #f0a047; --orange-ink: #a8540c; --mint: #bfe3cc; --mint-ink: #2b6a45; --red: #d8322b;
  --display: "Sono", ui-monospace, monospace; --body: "Sono", ui-monospace, monospace;
  --bezel-w: clamp(30px, 4.2vw, 62px);
}
* { box-sizing: border-box; }
html { overflow-x: clip; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 400 18px/1.5 var(--body); font-synthesis: none; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(36px, 4.2vw, 58px); }
h2 { font-size: clamp(30px, 3vw, 38px); }
h3 { font-size: 24px; }
p { margin: 0; }
.mono { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--mint-ink); outline-offset: 3px; border-radius: 4px; }

/* the living background: shader under frosted glass stripes */
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
.stripes { position: fixed; inset: 0; z-index: 0; display: flex; justify-content: space-evenly; pointer-events: none; }
.stripes i { display: block; width: 9vw; max-width: 160px; height: 100%; background: rgba(255, 255, 255, 0.22); backdrop-filter: blur(18px) saturate(1.1); -webkit-backdrop-filter: blur(18px) saturate(1.1); border-left: 1px solid rgba(255, 255, 255, 0.55); border-right: 1px solid rgba(30, 27, 22, 0.08); }
.stripes i:nth-child(2n) { width: 5vw; background: rgba(255, 255, 255, 0.3); }

.desk { position: relative; z-index: 1; width: min(1360px, 100% - 32px); margin: 0 auto; padding: 40px 0 88px; }

/* the terminal */
.terminal { display: grid; gap: 22px; }
.bezel { scroll-margin-top: 16px; border: var(--bezel-w) solid transparent; border-image: url(/img/bezel.png) 125 fill / var(--bezel-w) / 0 stretch; filter: drop-shadow(0 22px 34px rgba(60, 40, 10, 0.16)); }
.screen { position: relative; display: grid; grid-template-columns: 262px 1fr; min-height: 640px; background: linear-gradient(160deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.34)); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6), inset 0 0 60px rgba(60, 40, 10, 0.08); }
.menu { display: flex; flex-direction: column; gap: 6px; padding: 40px 24px 40px 34px; border-right: 1px solid var(--line); }
.menu a { font-family: var(--display); font-size: 23px; white-space: nowrap; font-weight: 500; text-decoration: none; padding: 10px 14px; border-radius: 6px; position: relative; }
.menu a::before { content: ""; position: absolute; left: -2px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: transparent; }
.menu a.on { background: rgba(255, 255, 255, 0.6); box-shadow: inset 0 0 0 1px var(--line); }
.menu a.on::before { background: var(--mint-ink); box-shadow: 0 0 10px var(--mint); }
.menu a:hover { background: rgba(255, 255, 255, 0.5); }
.menu .wallet { margin-top: auto; text-align: left; border: 0; background: rgba(255, 255, 255, 0.55); box-shadow: inset 0 0 0 1px var(--line); border-radius: 6px; padding: 12px 14px; font-family: var(--display); font-size: 18px; font-weight: 600; cursor: pointer; min-height: 48px; overflow-wrap: anywhere; }
.menu .wallet:hover { background: rgba(255, 255, 255, 0.8); }
.pane { padding: 44px 48px 48px; min-width: 0; }
.scr { display: none; }
.scr.on { display: block; }
.sub { color: var(--ink-2); margin: 12px 0 28px; max-width: 64ch; }
.note { color: var(--ink-2); font-size: 16px; margin-top: 16px; max-width: 64ch; }

/* boot screen */
.boot { display: grid; justify-items: center; text-align: center; gap: 22px; padding-top: 8px; }
.mark { position: relative; width: clamp(200px, 26vw, 320px); aspect-ratio: 1; }
.mark .brackets { position: absolute; inset: 0; width: 100%; height: 100%; }
.mark .dog { position: absolute; left: 50%; bottom: 14%; height: 62%; width: auto; transform: translateX(-50%); }
.mark .dog-blink, .mark .dog-wag, .mark .dog-long, .mark .dog-short { opacity: 0; }
.mark.blink .dog-blink { opacity: 1; } .mark.blink .dog-idle { opacity: 0; }
.mark.wag .dog-wag { opacity: 1; } .mark.wag .dog-idle { opacity: 0; }
.mark.pose-long .dog-long { opacity: 1; } .mark.pose-long .dog-idle, .mark.pose-long .dog-blink, .mark.pose-long .dog-wag { opacity: 0; }
.mark.pose-short .dog-short { opacity: 1; height: 30%; bottom: 16%; } .mark.pose-short .dog-idle, .mark.pose-short .dog-blink, .mark.pose-short .dog-wag { opacity: 0; }
.boot h1 { max-width: 18ch; text-wrap: balance; }
.boot .lead { max-width: 56ch; font-size: 20px; color: var(--ink-2); }
.keys { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin-top: 6px; }

/* keycaps: generated surfaces */
.key { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 58px; padding: 0 30px 2px; border: 0; background: none; text-decoration: none; font-family: var(--display); font-size: 20px; font-weight: 700; color: var(--ink); cursor: pointer; border-style: solid; border-width: 14px 28px 40px; border-image: url(/img/key-cream.png) 22 45 66 fill / 14px 28px 40px / 0 stretch; transition: transform 0.08s ease, filter 0.15s ease; user-select: none; }
.key:hover { filter: brightness(1.04) drop-shadow(0 6px 10px rgba(60, 40, 10, 0.12)); }
.key:active, .key.pressed { transform: translateY(3px); filter: brightness(0.97); }
.key-mint { border-image-source: url(/img/key-mint.png); border-width: 14px 30px 40px; border-image-slice: 20 50 66 fill; border-image-width: 14px 30px 40px; color: var(--mint-ink); }
.key-orange { border-image-source: url(/img/key-orange.png); border-width: 14px 30px 40px; border-image-slice: 14 50 66 fill; border-image-width: 14px 30px 40px; color: var(--orange-ink); }
.key.wide { width: 100%; }
.key.small { min-height: 46px; font-size: 18px; padding: 0 14px 2px; border-width: 10px 20px 28px; border-image-width: 10px 20px 28px; }
.key[disabled], .key[aria-disabled="true"] { cursor: not-allowed; filter: grayscale(0.6) opacity(0.55); pointer-events: none; }
.side .key:not(.on) { filter: grayscale(0.55) opacity(0.6); }
.side .key.on { filter: none; }

/* rows on the screen: thin lines, no boxes */
.rows { display: grid; border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 1.4fr 1.2fr 0.7fr 1.1fr 1.2fr; gap: 14px; align-items: center; padding: 14px 4px; border-bottom: 1px solid var(--line); min-height: 60px; font-variant-numeric: tabular-nums; }
.row.head { font-size: 16px; color: var(--ink-2); min-height: 44px; padding: 8px 4px; }
.row.empty { display: block; color: var(--ink-2); }
.row .dogname { font-family: var(--display); font-size: 20px; font-weight: 700; overflow-wrap: anywhere; }
.row .up { color: var(--mint-ink); } .row .down { color: var(--orange-ink); }
.row .tag { font-size: 16px; color: var(--ink-2); }
.row button.trade { min-height: 44px; }
.row.on { background: rgba(255, 255, 255, 0.5); }
.rows.pos .row { grid-template-columns: 1.3fr 1fr 1fr 1fr 1fr; }
.row .dogname { overflow-wrap: normal; }

/* the ticket */
.ticket { margin-top: 32px; padding-top: 28px; border-top: 2px solid var(--ink); display: grid; gap: 22px; max-width: 780px; }
.ticket-head { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline; }
.ticket-head .mono { color: var(--ink-2); }
.side { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lev-label { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.lev-label strong { font-family: var(--display); font-size: 22px; font-weight: 800; }
.dogs { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; cursor: pointer; touch-action: none; padding: 6px 0; }
.dogs img { width: 100%; height: auto; transition: filter 0.15s ease, transform 0.15s ease; filter: grayscale(1) opacity(0.32); }
.dogs img.lit { filter: none; transform: translateY(-4px); }
.dogs.short img { object-fit: contain; }
.field { display: grid; gap: 8px; }
.field span { font-size: 16px; color: var(--ink-2); }
.field input { width: 100%; min-height: 52px; padding: 10px 14px; border: 0; border-bottom: 2px solid var(--ink); background: rgba(255, 255, 255, 0.55); border-radius: 6px 6px 0 0; font-size: 20px; }
.field input[type="file"] { padding: 12px 14px; font-size: 16px; }
.calc { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; margin: 0; }
.calc div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 8px 0; }
.calc dt { color: var(--ink-2); font-size: 16px; }
.calc dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.positions { margin-top: 36px; display: grid; gap: 14px; }
.form { display: grid; gap: 18px; max-width: 640px; }

/* how it works */
.steps { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 30px 40px; counter-reset: s; }
@media (min-width: 1500px) { .steps { grid-template-columns: 1fr 1fr; } }
.steps li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 20px; align-items: start; counter-increment: s; }
.steps li img { width: 150px; height: 150px; border-radius: 10px; }
.steps h3::before { content: counter(s) ". "; color: var(--orange-ink); }
.steps p { margin-top: 8px; color: var(--ink-2); }

/* the nameplate */
.badge { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 24px 36px; align-items: center; min-height: 118px; border-style: solid; border-width: 22px 44px 22px 44px; border-image: url(/img/badge-plain.png) 40 80 40 80 fill / 22px 44px 22px 44px / 0 stretch; padding: 4px 0; filter: drop-shadow(0 12px 18px rgba(60, 40, 10, 0.14)); }
.badge-name { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 14px; align-items: center; line-height: 1.1; }
.badge-mark { grid-row: 1 / 3; width: 60px; height: 60px; }
.badge-name .name { font-family: var(--display); font-size: 30px; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; }
.badge-name .ticker { font-family: var(--display); font-size: 21px; font-weight: 700; color: var(--orange-ink); }
.ca { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ca-label { font-size: 16px; color: var(--ink-2); }
.ca-addr { font-family: var(--body); font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; user-select: all; min-width: 0; background: rgba(255, 255, 255, 0.45); padding: 8px 12px; border-radius: 6px; border: 1px solid var(--line); }
.ca-addr.empty { color: var(--ink-2); user-select: none; font-style: italic; }
.marks { display: flex; gap: 10px; flex-wrap: wrap; }
.mark-btn { min-height: 54px; min-width: 64px; padding: 0 10px 2px; border-width: 10px 20px 28px; border-image-width: 10px 20px 28px; }
.mark-btn img { width: 28px; height: 28px; }

/* the bowl on the desk */
.bowlzone { margin-top: 30px; }
.plate { border-style: solid; border-width: 44px; border-image: url(/img/plate.png) 88 fill / 44px / 0 stretch; padding: 6px 12px; filter: drop-shadow(0 18px 28px rgba(60, 40, 10, 0.14)); }
.bowlplate { display: grid; grid-template-columns: 340px 1fr; gap: 20px 40px; align-items: center; }
.bowl-art { position: relative; height: 330px; overflow: visible; }
.bowl-art .bowl { position: absolute; left: 50%; bottom: 0; width: 300px; transform: translateX(-50%); }
.bowl-art .bone { position: absolute; left: 50%; top: -40px; width: 110px; margin-left: -55px; animation: drop 1.6s cubic-bezier(0.4, 0, 0.9, 1) forwards; pointer-events: none; }
@keyframes drop { 0% { transform: translateY(0) rotate(-30deg); opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(240px) rotate(20deg) scale(0.8); opacity: 0; } }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 32px; margin: 20px 0 0; }
.stats div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 8px 0; }
.stats dt { color: var(--ink-2); font-size: 16px; }
.stats dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.feed { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 8px; }
.feed li { display: flex; gap: 12px; align-items: baseline; font-size: 17px; }
.feed li .when { color: var(--ink-2); font-size: 15px; white-space: nowrap; }
.feed li.empty { color: var(--ink-2); }
.feed a { color: var(--mint-ink); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 5; max-width: min(560px, 100% - 32px); padding: 14px 22px; background: var(--ink); color: var(--cream); border-radius: 8px; font-size: 17px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); }

@media (prefers-reduced-motion: reduce) { .bowl-art .bone { animation: none; opacity: 0; } .key, .dogs img { transition: none; } }

/* phone and narrow desktop: drawn again, not squeezed */
@media (max-width: 1100px) {
  .badge { grid-template-columns: 1fr 1fr; }
  .bowlplate { grid-template-columns: 260px 1fr; }
}
@media (max-width: 900px) {
  .desk { width: min(1360px, 100% - 20px); padding-top: 18px; }
  .screen { grid-template-columns: 1fr; min-height: 0; }
  .menu { flex-direction: row; flex-wrap: wrap; gap: 6px 4px; padding: 18px 16px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .menu a { font-size: 19px; padding: 8px 10px; }
  .menu a::before { display: none; }
  .menu .wallet { margin-top: 4px; width: 100%; font-size: 18px; }
  .pane { padding: 26px 20px 30px; }
  .boot .lead { font-size: 18px; }
  .row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name perps" "mark perps"; gap: 6px 14px; }
  .row.head { display: none; }
  .row .c-name { grid-area: name; } .row .c-mark { grid-area: mark; font-size: 16px; color: var(--ink-2); } .row .c-perps { grid-area: perps; justify-self: end; text-align: right; }
  .row .c-24, .row .c-oi { display: none; }
  .rows.pos .row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name pnl" "mark perps"; }
  .rows.pos .row .c-24 { display: block; grid-area: pnl; justify-self: end; }
  .calc { grid-template-columns: 1fr; }
  .badge { grid-template-columns: 1fr; gap: 16px; border-width: 40px; border-image: url(/img/plate.png) 88 fill / 40px / 0 stretch; padding: 4px 6px; }
  .badge-name { grid-template-columns: auto 1fr; }
  .ca { flex-wrap: wrap; }
  .marks { gap: 8px; }
  .plate { border-width: 34px; border-image-width: 34px; padding: 2px 4px; }
  .bowlplate { grid-template-columns: 1fr; }
  .bowl-art { height: 220px; }
  .bowl-art .bowl { width: 220px; }
  .bowl-art .bone { width: 80px; margin-left: -40px; }
  @keyframes drop { 0% { transform: translateY(0) rotate(-30deg); opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(150px) rotate(20deg) scale(0.8); opacity: 0; } }
  .stats { grid-template-columns: 1fr; }
  .steps li { grid-template-columns: 110px 1fr; gap: 14px; }
  .steps li img { width: 110px; height: 110px; }
}
@media (max-width: 480px) {
  .steps li { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 400px) {
  .key { padding: 0 20px 4px; font-size: 20px; }
  .side { gap: 10px; }
  .menu a { font-size: 17px; padding: 8px 8px; }
}
