:root {
  color-scheme: dark;
  --black: #000;
  --white: #f4f4f1;
  --muted: #8d8d88;
  --line: #343434;
  --hot: #fff;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html { background: var(--black); scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--black);
  color: var(--white);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.5;
}

button, input, a { font: inherit; }
button, a { border-radius: 0; }

::selection { background: var(--white); color: var(--black); }

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  opacity: .055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.terminal {
  width: min(1500px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  border-inline: 1px solid var(--line);
}

.topbar {
  min-height: 52px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  letter-spacing: .08em;
}

.prompt, .live { color: var(--hot); }
.status { color: var(--muted); }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; background: var(--white); box-shadow: 0 0 10px var(--white); }
#clock { justify-self: end; color: var(--muted); }

.hero {
  min-height: 53vh;
  display: grid;
  grid-template-columns: 1fr 290px;
  border-bottom: 1px solid var(--line);
}

.hero-copy { display: flex; flex-direction: column; justify-content: center; padding: clamp(38px, 7vw, 100px); min-width: 0; }
.eyebrow { margin: 0 0 30px; color: var(--muted); letter-spacing: .08em; }
.logo { display: block; width: min(100%, 960px); height: auto; margin: -8% 0; mix-blend-mode: screen; }
.boot-line { margin: 26px 0 0; color: var(--muted); }
.boot-line > span:first-child { color: var(--white); }
.cursor { animation: blink .75s steps(1) infinite; }

.stamp-button {
  position: relative;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--black);
  color: var(--white);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  transition: background .08s linear, color .08s linear;
}

.stamp-button:hover, .stamp-button:focus-visible, .stamp-button.is-stamped { background: var(--white); color: var(--black); outline: 0; }
.stamp-count { font-size: 12px; letter-spacing: .16em; opacity: .65; }
.stamp-label { font-size: clamp(28px, 4vw, 54px); font-weight: 700; writing-mode: vertical-rl; transform: rotate(180deg); letter-spacing: .12em; }

.grid { display: grid; grid-template-columns: 1.4fr 1fr; border-bottom: 1px solid var(--line); }
.panel { min-height: 290px; }
.panel + .panel { border-left: 1px solid var(--line); }
.panel-title { height: 48px; padding: 0 18px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); font-size: 13px; letter-spacing: .08em; }
.panel-title span:first-child { color: var(--muted); }
.panel-title span:last-child { margin-left: auto; color: var(--muted); }

.ledger { height: 242px; overflow: hidden; padding: 14px 18px; }
.ledger-row { display: grid; grid-template-columns: 84px 1fr auto; gap: 12px; padding: 7px 0; border-bottom: 1px dotted #242424; }
.ledger-row time, .ledger-row .hash { color: var(--muted); }

.data-list { margin: 0; }
.data-list > div { display: grid; grid-template-columns: 120px 1fr; padding: 11px 18px; border-bottom: 1px dotted #242424; }
.data-list dt { color: var(--muted); }
.data-list dd { margin: 0; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-button { border: 0; padding: 0; background: transparent; color: var(--white); cursor: pointer; }
.text-button:hover { text-decoration: underline; text-underline-offset: 4px; }

.links { display: grid; grid-template-columns: repeat(3, 1fr); }
.links a { min-height: 66px; display: grid; place-items: center; border-right: 1px solid var(--line); color: var(--white); text-decoration: none; font-weight: 700; font-size: 13px; }
.links a:last-child { border-right: 0; }
.links a:hover, .links a:focus-visible { background: var(--white); color: var(--black); outline: 0; }
.links a[aria-disabled="true"] { color: #555; cursor: not-allowed; }
.links a[aria-disabled="true"]:hover { background: transparent; color: #555; }

.command-panel { padding: 18px 24px 22px; border-bottom: 1px solid var(--line); }
.command-history { min-height: 86px; max-height: 170px; overflow-y: auto; color: #c8c8c4; }
.command-history p { margin: 0 0 5px; }
.dim { color: var(--muted); }
.inline-command { border: 0; padding: 0; background: transparent; color: var(--white); text-decoration: underline; cursor: pointer; }
.command-form { display: flex; align-items: center; gap: 10px; }
.command-form label { white-space: nowrap; color: var(--white); }
.command-form input { min-width: 0; flex: 1; border: 0; outline: 0; padding: 4px 0; background: transparent; color: var(--white); caret-color: transparent; }
.input-cursor { width: 9px; height: 18px; margin-left: -10px; background: var(--white); animation: blink .75s steps(1) infinite; pointer-events: none; }

footer { min-height: 48px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; color: var(--muted); font-size: 12px; letter-spacing: .07em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@keyframes blink { 50% { opacity: 0; } }
@keyframes kick { 0%,100% { transform: translate(0); } 25% { transform: translate(-2px,1px); } 50% { transform: translate(2px,-1px); } 75% { transform: translate(-1px,-1px); } }
.terminal.is-kicked { animation: kick .16s steps(1) 2; }

@media (max-width: 760px) {
  body { font-size: 14px; }
  .terminal { border-inline: 0; }
  .topbar { grid-template-columns: 1fr auto; padding: 0 14px; }
  .status { display: none; }
  .hero { min-height: 60vh; grid-template-columns: 1fr; grid-template-rows: 1fr 104px; }
  .hero-copy { padding: 40px 20px 26px; }
  .eyebrow { margin-bottom: 12px; font-size: 12px; }
  .logo { width: 100%; margin: -2% 0; }
  .boot-line { font-size: 13px; }
  .stamp-button { border-left: 0; border-top: 1px solid var(--line); flex-direction: row; }
  .stamp-label { writing-mode: initial; transform: none; font-size: 25px; }
  .grid { grid-template-columns: 1fr; }
  .panel + .panel { border-left: 0; border-top: 1px solid var(--line); }
  .links { grid-template-columns: 1fr; }
  .links a { min-height: 50px; border-right: 0; border-bottom: 1px solid var(--line); }
  .links a:last-child { border-bottom: 0; }
  .ledger-row { grid-template-columns: 72px 1fr; }
  .ledger-row .hash { display: none; }
  .command-panel { padding-inline: 14px; }
  .command-form label { font-size: 12px; }
  footer { padding: 12px 14px; align-items: flex-start; flex-direction: column; gap: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; }
}
