/* StableLaunch. One pixel vault hall. One pixel scale: 1 art pixel = 4 css px. */

@font-face {
  font-family: "Press Start 2P";
  src: url("/fonts/pressstart2p-latin.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "VT323";
  src: url("/fonts/vt323-latin.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}

:root {
  --hall: #070910;
  --wall: #151b26;
  --wall-deep: #0d121b;
  --steel: #5c6a7c;
  --steel-l: #a4b4c6;
  --paper: #e8eef6;
  --blue: #2a4bff;
  --blue-l: #6d86ff;
  --blue-deep: #1226a8;
  --amber: #ffb03a;

  --display: "Press Start 2P", "Courier New", monospace;
  --body: "VT323", "Courier New", monospace;

  --gutter: 40px;
  --air: 88px;
  --plate-slice: 72;
}

* { box-sizing: border-box; }
html { background: var(--hall); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--paper);
  background: var(--hall);
  font-family: var(--body);
  font-size: 30px;
  line-height: 1.32;
  -webkit-font-smoothing: none;
  font-synthesis: none;
  overflow-x: hidden;
}
img { image-rendering: pixelated; }

/* ---------- the hall itself: background, blurred and alive ---------- */
#hall { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
#hall-img {
  position: absolute; inset: -3%;
  background: url("/img/hall.png") center 38% / cover no-repeat, var(--hall);
  image-rendering: pixelated;
  filter: blur(2px) brightness(0.66) saturate(0.95);
  transform: scale(1.03);
}
#hall::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(120% 78% at 50% 22%, rgba(42, 75, 255, 0.16), transparent 62%),
    linear-gradient(180deg, rgba(7, 9, 16, 0.42) 0%, rgba(7, 9, 16, 0.72) 58%, rgba(7, 9, 16, 0.94) 100%);
}
#hall-life { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---------- skip link ---------- */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 90;
  font-family: var(--display); font-size: 16px; padding: 16px 24px;
  background: var(--blue); color: #fff; text-decoration: none;
}
.skip:focus { left: 16px; top: 16px; }

/* ---------- the gantry rail and its hanging signs ---------- */
#rail {
  position: relative; z-index: 6;
  padding: 0 var(--gutter);
}
.rail-beam {
  height: 84px;
  background: url("/img/rail-tile.png") left center / auto 84px repeat-x;
  image-rendering: pixelated;
  margin: 0 calc(var(--gutter) * -1);
}
#rail-signs {
  display: flex; justify-content: center; gap: 24px;
  margin-top: -26px;
}
#rail-toggle { display: none; font-size: 16px; }

/* one hanging sign, drawn at its own size: brackets on top, the enamel plate below */
.sign {
  display: flex; align-items: flex-end; justify-content: center;
  width: 260px; height: 124px;
  padding: 0 24px 20px;
  text-align: center; text-decoration: none;
  color: #fff;
  font-family: var(--display); font-size: 16px; line-height: 1.32;
  background: url("/img/sign.png") center / 260px 124px no-repeat;
  image-rendering: pixelated;
  transform-origin: 50% 8%;
  transition: transform 160ms ease-out, filter 160ms ease-out;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.5);
}
.sign span { display: block; }
.sign:hover, .sign:focus-visible { transform: rotate(-1.2deg) translateY(2px); filter: brightness(1.16); }
.sign[aria-current="page"] {
  filter: brightness(1.3) drop-shadow(0 0 18px rgba(109, 134, 255, 0.75));
}

/* ---------- page shell ---------- */
#page {
  position: relative; z-index: 5;
  max-width: 1680px;
  margin: 0 auto;
  padding: var(--air) var(--gutter) 120px;
  outline: none;
}
.screen + .screen { margin-top: var(--air); }

/* ---------- typography ---------- */
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; text-wrap: balance; }
h1 { font-size: 44px; line-height: 1.25; letter-spacing: 1px; text-shadow: 4px 4px 0 var(--blue-deep); }
h2 { font-size: 28px; line-height: 1.3; text-shadow: 3px 3px 0 var(--blue-deep); }
h3 { font-size: 19px; line-height: 1.35; }
p { margin: 0 0 18px; }
p:last-child { margin-bottom: 0; }
.lead { font-size: 32px; color: #eaf0f8; }
.muted { color: #c2cdda; }
.blue { color: var(--blue-l); }
.amber { color: var(--amber); }
.mono { font-family: var(--body); letter-spacing: 1px; overflow-wrap: anywhere; min-width: 0; }
.tiny { font-family: var(--display); font-size: 16px; line-height: 1.5; letter-spacing: 0.5px; }

/* ---------- the steel plate: every reading surface ---------- */
.plate {
  border: 48px solid transparent;
  border-image: url("/img/plate.png") 24 fill / 48px / 0 stretch;
  padding: 6px 12px 10px;
  min-width: 0;
}
.plate > :first-child { margin-top: 0; }
.plate h2 { margin-bottom: 22px; }

.rows { display: block; }
.row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
  padding: 15px 0;
  border-bottom: 2px solid rgba(12, 17, 27, 0.32);
}
.row:last-child { border-bottom: 0; padding-bottom: 0; }
.row .k { color: #d3dced; font-size: 27px; flex: 1 1 auto; min-width: 0; }
.row .v { font-size: 33px; text-align: right; flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; }
.row .v.big { font-family: var(--display); font-size: 22px; letter-spacing: 0.5px; }

/* ---------- keycaps: every button ---------- */
.key, a.key {
  display: inline-flex; align-items: center; justify-content: center; gap: 14px;
  min-height: 76px; padding: 14px 18px 16px;
  font-family: var(--display); font-size: 17px; line-height: 1.25;
  color: #e8eef6; text-decoration: none; text-align: center;
  background: none; border: 14px solid transparent; cursor: pointer;
  border-image: url("/img/keycap.png") 7 fill / 14px / 0 stretch;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6);
  transition: transform 90ms ease-out, filter 90ms ease-out;
}
.key:hover, .key:focus-visible { filter: brightness(1.18); }
.key:active { transform: translateY(4px); filter: brightness(0.94); }
.key.primary { border-image-source: url("/img/keycap-blue.png"); color: #fff; }
.key.wide { width: 100%; }
.key[disabled], .key[aria-disabled="true"] {
  filter: grayscale(0.7) brightness(0.62);
  cursor: not-allowed; pointer-events: none;
}
.key img.mark { width: 26px; height: 26px; image-rendering: auto; flex: none; }
.key.big { min-height: 92px; font-size: 20px; padding: 20px 26px 22px; }

.keys { display: flex; flex-wrap: wrap; gap: 16px; }

/* ---------- the vault door, the drum, the stack ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr 1.34fr 1fr;
  gap: 34px;
  align-items: start;
}
.hero > * { min-width: 0; }

.door-col { display: flex; flex-direction: column; align-items: center; }
.drum {
  width: 100%;
  border: 36px solid transparent; border-left-width: 44px; border-right-width: 44px;
  border-image: url("/img/drum.png") 18 22 18 22 fill / 36px 44px 36px 44px / 0 stretch;
  padding: 12px 14px 14px;
  text-align: center;
}
.drum .label { font-family: var(--display); font-size: 16px; color: #9db0c8; letter-spacing: 1px; }
.drum .num {
  font-size: 68px; line-height: 1; margin-top: 12px;
  color: var(--blue-l);
  text-shadow: 0 0 22px rgba(42, 75, 255, 0.75);
  font-variant-numeric: tabular-nums;
}
.drum .sub { font-size: 26px; color: #9db0c8; margin-top: 12px; }

.door-wrap { position: relative; margin-top: 26px; width: 100%; text-align: center; }
.door {
  display: block; width: min(100%, 480px); height: auto; margin: 0 auto;
  filter: drop-shadow(0 22px 34px rgba(0, 0, 0, 0.7));
}
.door.open { animation: breathe 5.5s ease-in-out infinite; }
@keyframes breathe {
  0%, 100% { filter: drop-shadow(0 22px 34px rgba(0, 0, 0, 0.7)) drop-shadow(-12px 0 22px rgba(42, 75, 255, 0.45)); }
  50%      { filter: drop-shadow(0 22px 34px rgba(0, 0, 0, 0.7)) drop-shadow(-12px 0 40px rgba(42, 75, 255, 0.9)); }
}
.stack {
  display: flex; flex-wrap: wrap-reverse; justify-content: center; align-items: flex-end;
  gap: 2px 4px; margin-top: 18px; min-height: 96px;
  max-width: 460px; margin-left: auto; margin-right: auto;
}
.stack img { width: 72px; height: 50px; }
.stack img.drop { animation: drop 620ms cubic-bezier(.3,1.5,.5,1) 1; }
@keyframes drop { 0% { transform: translateY(-160px); opacity: 0; } 100% { transform: none; opacity: 1; } }
.stack-note { text-align: center; margin-top: 16px; font-size: 26px; color: #b3c0d2; }

/* ---------- the contract brick ---------- */
.slab {
  border: 24px solid transparent; border-top-width: 32px;
  border-image: url("/img/brick-slab.png") 16 12 12 12 fill / 32px 24px 24px 24px / 0 stretch;
  padding: 10px 14px 14px;
  color: #10151e;
}
.slab .label { font-family: var(--display); font-size: 16px; color: #26304a; letter-spacing: 1px; }
.slab .addr {
  font-size: 30px; line-height: 1.24; margin: 14px 0 20px;
  letter-spacing: 1px; overflow-wrap: anywhere; min-width: 0;
  color: #10151e;
}
.slab .addr.empty { color: #6b5320; }

/* ---------- the safe deposit boxes: the pad's coins ---------- */
.wall {
  display: grid; gap: 26px;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}
.box {
  position: relative; display: block; text-decoration: none; color: inherit;
  padding: 0 0 22px;
  transition: transform 140ms ease-out, filter 140ms ease-out;
}
.box:hover, .box:focus-visible { transform: translateY(-6px) scale(1.02); filter: drop-shadow(0 0 20px rgba(109, 134, 255, 0.55)); }
.box .front { display: block; position: relative; }
.box .front > img { display: block; width: 100%; height: auto; }
.box .plateface {
  position: absolute; left: 15%; right: 19%; top: 42%; height: 14%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 16px; line-height: 1;
  color: #10151e;
  overflow: hidden; white-space: nowrap;
}
.box .meta { display: block; margin-top: 14px; text-align: center; font-size: 27px; }
.box .meta b { color: var(--blue-l); font-weight: 400; }
.box .meta .tick { display: none; }
.box .meta .apr { display: block; color: #b3c0d2; font-size: 25px; }

/* ---------- how it works ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }
.step { display: flex; flex-direction: column; }
.step .pic { width: 100%; height: auto; display: block; margin-bottom: 22px; }
.step h3 { margin-bottom: 12px; color: var(--blue-l); }
.step p { font-size: 28px; color: #cdd8e6; }

/* ---------- my box ---------- */
.tray-wrap { position: relative; width: 100%; max-width: 560px; margin: 0 auto; }
.tray { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.tray-stack {
  position: absolute; left: 15%; right: 27%; bottom: 40%;
  display: flex; flex-wrap: wrap-reverse; justify-content: center; align-items: flex-end; gap: 2px 4px;
}
.tray-stack img { width: 48px; height: 33px; }

/* ---------- forms on the deposit slip ---------- */
.slip {
  border: 36px solid transparent; border-top-width: 52px;
  border-image: url("/img/slip.png") 18 fill / 52px 36px 36px 36px / 0 stretch;
  padding: 10px 16px 16px;
  color: #171d28;
}
.slip h2 { color: #10151e; }
.slip .label { display: block; font-family: var(--display); font-size: 16px; color: #3a4658; margin-bottom: 10px; letter-spacing: 0.5px; }
.slip .field { margin-bottom: 28px; }
.slip input[type="text"], .slip input[type="number"], .slip input[type="file"] {
  width: 100%; min-height: 58px;
  font-family: var(--body); font-size: 30px; color: #10151e;
  padding: 12px 16px;
  background: rgba(16, 21, 30, 0.07);
  border: 3px solid #2b3446; border-radius: 0;
}
.slip input:focus-visible { outline: 4px solid var(--blue); outline-offset: 2px; }
.slip .hint { font-size: 25px; color: #4b566a; margin-top: 8px; }

/* ---------- honest states ---------- */
.notyet { font-size: 29px; color: var(--amber); }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 40px; transform: translate(-50%, 24px);
  z-index: 80; opacity: 0; pointer-events: none;
  font-family: var(--display); font-size: 17px; color: #fff;
  padding: 16px 22px;
  border: 14px solid transparent;
  border-image: url("/img/keycap-blue.png") 7 fill / 14px / 0 stretch;
  transition: opacity 160ms ease-out, transform 160ms ease-out;
  max-width: calc(100vw - 48px); text-align: center;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- deposits ledger ---------- */
.ledger { max-height: none; }
.ledger .row .k { font-size: 26px; }
.ledger a { color: var(--blue-l); }

/* ---------- head of a screen ---------- */
.head { margin-bottom: 34px; }
.head h2 { margin-bottom: 14px; }
.head p { font-size: 29px; color: #a9b7c8; max-width: 70ch; }

/* ---------- focus ---------- */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 4px solid var(--blue-l); outline-offset: 3px;
}

/* ---------- 1366: the door takes the whole first row, the two plates share the second ---------- */
@media (max-width: 1440px) {
  :root { --gutter: 32px; --air: 72px; }
  h1 { font-size: 38px; }
  .drum .num { font-size: 60px; }
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1440px) and (min-width: 1081px) {
  .hero { grid-template-columns: 1fr 1fr; }
  .door-col { grid-column: 1 / -1; order: -1; }
  .door-col .drum { max-width: 720px; margin: 0 auto; }
  .door { width: min(100%, 420px); }
  .stack { max-width: 720px; }
}

/* ---------- tablet ---------- */
@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; }
  .door-col { order: -1; }
  .door { width: min(100%, 380px); }
}

/* ---------- phone ---------- */
@media (max-width: 760px) {
  :root { --gutter: 18px; --air: 56px; }
  body { font-size: 28px; }
  h1 { font-size: 22px; line-height: 1.45; }
  .wordmark h1 .blue { display: block; margin-top: 10px; }
  h2 { font-size: 21px; }
  h3 { font-size: 17px; }
  .lead { font-size: 29px; }
  #page { padding: 30px var(--gutter) 84px; }
  .wordmark-screen + .screen { margin-top: 40px; }

  #rail { padding: 0; }
  .rail-beam { margin: 0; }
  #rail-toggle {
    display: flex; align-items: flex-end; justify-content: center;
    margin: -26px auto 0; width: 260px; height: 124px; padding: 0 24px 20px;
    font-family: var(--display); font-size: 16px; color: #fff;
    background: url("/img/sign.png") center / 260px 124px no-repeat;
    image-rendering: pixelated; border: 0; cursor: pointer;
    text-shadow: 0 3px 0 rgba(0, 0, 0, 0.5);
  }
  #rail-signs {
    display: none; flex-direction: column; align-items: center; gap: 14px;
    margin-top: 16px;
  }
  #rail-signs.open { display: flex; }
  .sign { width: 260px; }

  .plate { border-width: 34px; border-image-width: 34px; padding: 6px 8px 10px; }
  .slab { border-width: 18px; border-top-width: 24px; border-image-width: 24px 18px 18px 18px; padding: 8px 10px 12px; }
  .slip { border-width: 26px; border-top-width: 38px; border-image-width: 38px 26px 26px 26px; padding: 8px 10px 12px; }
  .drum { border-width: 26px; border-left-width: 30px; border-right-width: 30px; border-image-width: 26px 30px 26px 30px; padding: 10px 10px 12px; }
  .drum .num { font-size: 52px; }
  .steps { grid-template-columns: 1fr; }
  .wall { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
  .box .plateface { display: none; }
  .box .meta .tick { display: block; font-size: 26px; color: #fff; margin-bottom: 4px; }
  .box .meta { font-size: 24px; }
  .key, a.key { font-size: 16px; padding: 14px 16px 16px; min-height: 68px; }
  .row { flex-direction: column; align-items: flex-start; gap: 4px; }
  .row .v { text-align: left; }
  .stack img { width: 54px; height: 38px; }
  .tray-stack img { width: 36px; height: 25px; }
}

/* ---------- 320 ---------- */
@media (max-width: 360px) {
  :root { --gutter: 12px; }
  h1 { font-size: 17px; }
  .wall { grid-template-columns: 1fr 1fr; }
  .drum .num { font-size: 40px; }
  .drum { border-width: 22px; border-left-width: 24px; border-right-width: 24px; border-image-width: 22px 24px 22px 24px; padding: 8px 8px 10px; }
  .key, a.key { font-size: 16px; padding: 12px 12px 14px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  #hall-life { display: none; }
}

/* the contract brick's own facts, printed under the keys on the same white face */
.slab-rows { margin-top: 26px; }
.slab-rows .row { border-bottom-color: rgba(16, 21, 30, 0.18); padding: 12px 0; }
.slab-rows .row .k { color: #45536b; font-size: 25px; }
.slab-rows .row .v { color: #10151e; font-size: 27px; }

/* the slip's own dark ink: white display type would vanish on the paper */
.slip h1, .slip h2, .slip h3 { color: #10151e; text-shadow: 3px 3px 0 rgba(42, 75, 255, 0.28); }
.slab h2 { color: #10151e; text-shadow: 3px 3px 0 rgba(42, 75, 255, 0.28); }

/* the picture field: the browser's own file button prints in the browser's language */
.filehide { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; overflow: hidden; clip-path: inset(50%); }
.filerow { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.filerow .key { min-height: 64px; }
.filename { font-size: 27px; color: #3a4658; overflow-wrap: anywhere; min-width: 0; }

/* the counter: whole dollars big, the running tail smaller, so the rate reads as motion */
.drum .num .int { }
.drum .num .dec { font-size: 0.55em; color: #b9c7ff; }

/* one coin: the bar of this coin's slice of the whole vault */
.bar { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 3px; }
.bar .pip { width: 36px; height: 25px; image-rendering: pixelated; }
.bar .pip.off { opacity: 0.2; filter: grayscale(1); }
.key.markonly { min-width: 76px; padding-left: 14px; padding-right: 14px; }
