/* Storeyrafter — landing + docs styles.
   Identity: a tower seen in cross-section at night. 2D only, SVG + CSS. */

:root {
  --ink: #0b0d11;
  --room: #161b23;
  --line: #2b333f;
  --amber: #ffb347;
  --amber-dim: #a8743a;
  --up: #2fd987;
  --down: #ff4f6d;
  --cream: #f2e9dc;
  --muted: #8b95a4;

  --shaft-w: 84px;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: "Oswald", "Avenir Next Condensed", Impact, sans-serif;
  /* pixel face: wordmark and floor numbers only, never body text or prices */
  --pixel: "Silkscreen", "Oswald", monospace;
  --t: 140ms;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font: 400 15px/1.6 var(--mono);
  overflow-x: hidden;
}

/* night outside the tower: far buildings, flat, no grain, no vignette */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, #0b0d11 0%, #0d1118 55%, #10151d 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: auto 0 0 0;
  height: 42vh;
  z-index: -1;
  opacity: 0.5;
  background-repeat: repeat-x;
  background-position: bottom left;
  background-size: 420px 100%;
  background-image:
    repeating-linear-gradient(90deg, rgba(255, 179, 71, 0.1) 0 2px, transparent 2px 9px),
    linear-gradient(90deg,
      transparent 0 18px, #0e131b 18px 74px, transparent 74px 96px,
      #0d1117 96px 150px, transparent 150px 182px,
      #0e131b 182px 236px, transparent 236px 262px,
      #0c1016 262px 330px, transparent 330px 352px,
      #0e131b 352px 420px);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 62%);
  mask-image: linear-gradient(180deg, transparent 0, #000 62%);
}

a {
  color: var(--amber);
  text-decoration-color: var(--amber-dim);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: var(--amber);
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

h1,
h2,
h3,
.wordmark,
.tag-num,
.btn,
.car-digit,
.stat-num {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0;
}

figure {
  margin: 0;
}

p {
  margin: 0 0 0.9em;
  max-width: 62ch;
  color: var(--cream);
}

.muted {
  color: var(--muted);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--amber);
  color: var(--ink);
  padding: 8px 12px;
  z-index: 50;
}

.skip:focus {
  left: 8px;
  top: 8px;
}

/* ---------- top bar: the building sign ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px 0 calc(var(--shaft-w) + 10px);
  height: 52px;
  background: rgba(11, 13, 17, 0.94);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-family: var(--pixel);
  font-weight: 700;
  font-size: 17px;
  line-height: 1;
  color: var(--cream);
  text-decoration: none;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.wordmark b {
  color: var(--amber);
  font-weight: 600;
}

.topnav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.topnav a {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  padding: 6px 8px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.topnav a:hover {
  color: var(--cream);
  border-color: var(--line);
}

.topnav a.is-cta {
  color: var(--ink);
  background: var(--amber);
  border-color: var(--amber);
  font-family: var(--display);
  font-weight: 600;
}

.topnav a.is-cta:hover {
  background: var(--cream);
  border-color: var(--cream);
}

/* ---------- the lift shaft: scroll indicator ---------- */

.shaft {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--shaft-w);
  z-index: 20;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0)) ,
    var(--ink);
}

.shaft-rails {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, transparent calc(50% - 21px), var(--line) calc(50% - 21px), var(--line) calc(50% - 20px), transparent calc(50% - 20px)),
    linear-gradient(90deg, transparent calc(50% + 20px), var(--line) calc(50% + 20px), var(--line) calc(50% + 21px), transparent calc(50% + 21px));
}

.shaft-cable {
  position: absolute;
  left: 50%;
  top: 0;
  width: 1px;
  background: var(--amber-dim);
  opacity: 0.55;
  height: 0;
}

.shaft-car {
  position: absolute;
  left: 50%;
  top: 0;
  width: 40px;
  height: 44px;
  margin-left: -20px;
  will-change: transform;
}

.car-digit {
  position: absolute;
  left: 50%;
  bottom: -14px;
  transform: translateX(-50%);
  font-family: var(--pixel);
  font-weight: 700;
  font-size: 9px;
  line-height: 1;
  padding: 2px 3px;
  color: var(--amber);
  background: var(--ink);
  border: 1px solid var(--line);
  letter-spacing: 0.02em;
}

.shaft-weight {
  position: absolute;
  left: 50%;
  top: 0;
  width: 14px;
  height: 26px;
  margin-left: -7px;
  border: 1px solid var(--line);
  background: #11151c;
  will-change: transform;
}

.shaft-marks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.shaft-mark {
  position: absolute;
  left: 4px;
  right: 4px;
  height: 1px;
  background: var(--line);
}

.shaft-mark span {
  position: absolute;
  left: 2px;
  top: -14px;
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

/* ---------- the tower: floors ---------- */

.tower {
  margin-left: var(--shaft-w);
  padding: 0 clamp(14px, 4vw, 48px);
  max-width: 1180px;
}

.floor {
  position: relative;
  scroll-margin-top: 62px;
  padding: 46px 0 52px;
  border-top: 1px solid var(--line);
}

.floor:first-child {
  border-top: 0;
}

/* the concrete slab between floors */
.floor::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 7px;
  background-image: repeating-linear-gradient(135deg, var(--line) 0 1px, transparent 1px 6px);
  opacity: 0.75;
}

.floor-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 18px;
}

.tag-num {
  font-family: var(--pixel);
  font-weight: 700;
  font-size: clamp(26px, 5.4vw, 44px);
  line-height: 0.9;
  color: var(--amber-dim);
  letter-spacing: 0.02em;
}

.floor-head h2 {
  font-size: clamp(19px, 3.4vw, 27px);
  color: var(--cream);
}

.floor-head .floor-sub {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  margin-left: auto;
  text-align: right;
}

/* a lit room */
.room {
  position: relative;
  border: 1px solid var(--line);
  background: var(--room);
  padding: 20px;
  overflow: hidden;
}

/* window wall on the right side of the room */
.room::before {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 92px;
  pointer-events: none;
  background-image:
    linear-gradient(0deg, var(--line) 0 1px, transparent 1px),
    repeating-linear-gradient(0deg, rgba(255, 179, 71, 0.07) 0 26px, transparent 26px 34px),
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 30px);
  opacity: 0.8;
}

/* light spilling from the ceiling fitting */
.room::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 70px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 179, 71, 0.07), rgba(255, 179, 71, 0));
}

.room > * {
  position: relative;
}

/* ---------- hero (roof level) ---------- */

.roof {
  padding-top: 30px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 376px;
  gap: 26px;
  align-items: start;
}

.hero h1 {
  font-size: clamp(30px, 6.4vw, 60px);
  line-height: 0.96;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}

.hero h1 em {
  color: var(--amber);
  font-style: normal;
}

.tagline {
  font-size: clamp(14px, 2.4vw, 17px);
  color: var(--cream);
  margin-bottom: 18px;
}

.elevation {
  border: 1px solid var(--line);
  background: #0e131b;
  padding: 10px;
}

.elevation svg {
  display: block;
  width: 100%;
  height: auto;
}

.elevation figcaption {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 8px;
}

/* ---------- pixel art ---------- */

canvas.pixel {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.tower-art {
  display: flex;
  justify-content: center;
  min-height: 120px;
}

.tower-fallback {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
  padding: 10px 0;
}

/* a magnified cross-section of one floor, flush to the top of its room */
.room-art {
  margin: -21px -21px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--ink);
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.room-art:empty {
  display: none;
}

/* ---------- buttons ---------- */

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  font-size: 14px;
  line-height: 1;
  border: 1px solid var(--amber);
  background: var(--amber);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--t) var(--ease), color var(--t) var(--ease), transform var(--t) var(--ease);
}

.btn:hover {
  background: var(--cream);
  border-color: var(--cream);
}

.btn:active {
  transform: translateY(1px);
}

.btn--play {
  padding: 14px 22px;
  font-size: 16px;
}

.btn--ghost {
  background: transparent;
  color: var(--cream);
  border-color: var(--line);
}

.btn--ghost:hover {
  background: transparent;
  color: var(--amber);
  border-color: var(--amber);
}

.btn--sm {
  padding: 8px 12px;
  font-size: 12px;
}

.btn[disabled],
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}

.btn-note {
  font-size: 12px;
  color: var(--muted);
}

/* ---------- contract address plate ---------- */

.plate {
  border: 1px solid var(--line);
  background: #11151c;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.plate-label {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.plate-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ca {
  font-size: clamp(12px, 2.6vw, 15px);
  letter-spacing: 0.02em;
  color: var(--cream);
  word-break: break-all;
  margin: 0;
  flex: 1 1 220px;
}

.ca[data-state="placeholder"] {
  color: var(--muted);
}

.copy-ok {
  font-size: 11px;
  color: var(--up);
}

.hero-live {
  border: 1px solid var(--line);
  background: #11151c;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.hero-live-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 6px;
}

.hero-live-cell {
  border: 1px solid var(--line);
  padding: 5px 8px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  white-space: nowrap;
}

.hero-live-cell b {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--cream);
}

.hero-live-cell i {
  font-style: normal;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

.hero-live-more {
  font-size: 11px;
}

/* ---------- countdown ---------- */

.clock {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: flex-end;
  border: 1px solid var(--line);
  background: #11151c;
  padding: 12px 14px;
}

.clock-date {
  font-family: var(--display);
  font-size: clamp(20px, 4vw, 28px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--amber);
  line-height: 1;
}

.clock-note {
  font-size: 12px;
  color: var(--muted);
  max-width: 34ch;
}

/* ---------- live feed strip ---------- */

.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(188px, 1fr));
  gap: 10px;
}

.feed {
  border: 1px solid var(--line);
  background: #11151c;
  padding: 10px 12px;
}

.feed-sym {
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 0.08em;
  color: var(--cream);
}

.feed-px {
  font-size: 19px;
  color: var(--amber);
  margin: 2px 0 4px;
  font-variant-numeric: tabular-nums;
}

.feed-meta {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 2px;
  word-break: break-all;
}

.feed-meta a {
  font-size: 11px;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.dot {
  width: 8px;
  height: 8px;
  border: 1px solid var(--line);
  background: var(--muted);
  flex: none;
}

.dot[data-ok="yes"] {
  background: var(--up);
  border-color: var(--up);
}

.dot[data-ok="no"] {
  background: var(--down);
  border-color: var(--down);
}

/* ---------- order demo cards (the shift) ---------- */

.beats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 6px;
}

.beat {
  border: 1px solid var(--line);
  background: #11151c;
  padding: 12px;
}

.beat h3 {
  font-size: 14px;
  color: var(--cream);
  margin-bottom: 6px;
}

.beat p {
  font-size: 13px;
  margin: 0;
  color: var(--muted);
}

.chip {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 7px;
  border: 1px solid var(--line);
  color: var(--muted);
}

.chip--fill {
  color: var(--up);
  border-color: var(--up);
}

.chip--reject {
  color: var(--down);
  border-color: var(--down);
}

.chip--rule {
  color: var(--amber);
  border-color: var(--amber-dim);
}

/* ---------- tables ---------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: #11151c;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 520px;
  font-size: 13px;
}

caption {
  caption-side: top;
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

th,
td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-family: var(--display);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

tbody tr:last-child td {
  border-bottom: 0;
}

td.n {
  font-variant-numeric: tabular-nums;
  color: var(--amber);
  white-space: nowrap;
}

tr[data-locked="yes"] td {
  color: var(--muted);
}

/* ---------- lists ---------- */

ol,
ul {
  max-width: 68ch;
  padding-left: 1.3em;
}

li {
  margin-bottom: 0.5em;
}

code,
.mono {
  font-family: var(--mono);
  font-size: 0.92em;
  background: #0e131b;
  border: 1px solid var(--line);
  padding: 1px 5px;
  word-break: break-word;
}

/* ---------- board ---------- */

.empty {
  border: 1px dashed var(--line);
  padding: 18px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ---------- lobby + footer ---------- */

.lobby {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  align-items: center;
}

.foundation {
  margin-left: var(--shaft-w);
  padding: 22px clamp(14px, 4vw, 48px) 60px;
  border-top: 7px solid var(--line);
  max-width: 1180px;
}

.foundation p {
  font-size: 12px;
  color: var(--muted);
  max-width: 78ch;
}

.foot-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  margin-bottom: 10px;
}

[hidden] {
  display: none !important;
}

/* ---------- docs page ---------- */

.doc .floor {
  padding: 34px 0 38px;
}

.doc h3 {
  font-size: 15px;
  color: var(--amber);
  margin: 18px 0 8px;
}

.toc {
  columns: 2;
  column-gap: 24px;
  font-size: 13px;
}

/* ---------- motion ---------- */

.lit {
  opacity: 0;
  transition: opacity var(--t) var(--ease);
}

.lit.is-on {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
    animation: none !important;
  }

  .lit {
    opacity: 1;
  }
}

/* ---------- narrow screens ---------- */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .elevation {
    max-width: 376px;
  }
}

@media (max-width: 640px) {
  :root {
    --shaft-w: 34px;
  }

  body {
    font-size: 14px;
  }

  .shaft-car {
    width: 20px;
    height: 22px;
    margin-left: -10px;
  }

  .car-digit {
    font-size: 8px;
    bottom: -13px;
    padding: 1px 2px;
  }

  .shaft-rails {
    background-image:
      linear-gradient(90deg, transparent calc(50% - 13px), var(--line) calc(50% - 13px), var(--line) calc(50% - 12px), transparent calc(50% - 12px)),
      linear-gradient(90deg, transparent calc(50% + 12px), var(--line) calc(50% + 12px), var(--line) calc(50% + 13px), transparent calc(50% + 13px));
  }

  .shaft-marks,
  .shaft-weight {
    display: none;
  }

  .wordmark {
    font-size: 11px;
    letter-spacing: 0.02em;
  }

  .topbar {
    gap: 6px;
    padding-right: 8px;
  }

  .topnav a {
    padding: 6px 6px;
    font-size: 11px;
  }

  .nav-extra {
    display: none;
  }

  .room {
    padding: 14px;
  }

  .room-art {
    margin: -15px -15px 14px;
  }

  .room::before {
    width: 44px;
    opacity: 0.35;
  }

  .floor-head {
    flex-wrap: wrap;
    gap: 8px;
  }

  .floor-head .floor-sub {
    margin-left: 0;
    text-align: left;
    flex-basis: 100%;
  }

  .toc {
    columns: 1;
  }

  table {
    min-width: 600px;
  }
}
