/* Street Smart — the arcade hub.
 *
 * The shelf is a row of cabinets, not a syllabus: each card keeps its own
 * accent, its own hand-drawn preview of the surface the game happens on, and
 * nothing is numbered like a lesson except the small index in the corner.
 *
 * Straight Talk deliberately breaks the kit. No accent, no art, no play
 * button - so the tonal change registers before anyone reads a word of it.
 */

.wrap {
  position: relative;
  z-index: 1;
  max-width: 430px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 20px
           max(40px, calc(env(safe-area-inset-bottom) + 28px));
}

/* The games are single-screen, so their .back can be fixed. The hub scrolls,
   so here it sits in the flow instead of riding over the cards. */
.back {
  position: static;
  margin-bottom: 30px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- wordmark ----------
 *
 * The typographic move: STREET is hollow, stroked in paper, and sits over a
 * painted zebra crossing in the three game accents. SMART is solid and drops
 * on top with a negative margin so the two words interlock rather than stack.
 */

/* Kept deliberately tight on phones: the wordmark used to eat the whole
   first screen, so the first thing anyone saw was a title and no games. */
.masthead { margin-bottom: 24px; }

.wordmark {
  margin: 0;
  font-weight: 700;
  line-height: 0.82;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  font-size: clamp(50px, 16vw, 104px);
}

.wm-street {
  position: relative;
  display: block;
  width: max-content;
  max-width: 100%;
  padding: 0 0.06em;
}

/* The crossing. Hard-edged stripes, clipped to the width of the word, and
   swept open once on load. */
.wm-zebra {
  position: absolute;
  inset: 0.08em 0.03em 0.1em 0.04em;
  background: repeating-linear-gradient(
    74deg,
    var(--hot)   0 0.13em,
    transparent  0.13em 0.42em,
    var(--gold)  0.42em 0.55em,
    transparent  0.55em 0.84em,
    var(--volt)  0.84em 0.97em,
    transparent  0.97em 1.26em
  );
  opacity: 0.5;
  transform: scaleX(0);
  transform-origin: left center;
}

/* The letters are filled with the page colour so each one punches a clean
   hole in the crossing behind it - the stripes read as paint on the road,
   not as texture inside the type. */
.wm-word {
  position: relative;
  display: block;
  color: var(--void);
  -webkit-text-stroke: 2px var(--paper);
  text-stroke: 2px var(--paper);
  paint-order: stroke fill;
}

.wm-smart {
  display: block;
  margin-top: -0.11em;
  margin-left: 0.04em;
  color: var(--paper);
  text-shadow: 0 0.06em 0 var(--void), 0 -0.02em 0 var(--void);
}

/* Firefox pre-text-stroke and anything else that ignores the stroke would
   render STREET invisible, so fall back to a filled word there. */
@supports not (-webkit-text-stroke: 2px red) {
  .wm-word { color: var(--paper); -webkit-text-stroke: 0; }
  .wm-zebra { opacity: 0.35; }
}

.standfirst {
  margin: 18px 0 0;
  font-size: 17px;
  line-height: 1.5;
  color: var(--paper);
  max-width: 32ch;
}

.fineprint {
  margin: 7px 0 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--dim);
}

/* The back link is the only thing above the wordmark, so it should not
   cost 50px of the first screen on a phone. */
.back { margin-bottom: 18px; }

/* ---------- shelf ---------- */

.shelf {
  display: grid;
  gap: 14px;
}

/* ---------- groups ----------
 * Ten cards on one shelf is a long thumb-scroll with no landmarks. The
 * groups give the page a shape you can skim: Arcade first because those
 * are the ones that are games before they are anything else. */

.group { margin-top: 38px; }
.group:first-of-type { margin-top: 26px; }

.group-name {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--paper);
}

.group-line {
  margin: 5px 0 15px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--dim);
  max-width: 42ch;
}

/* ---------- cabinet card ---------- */

.cab {
  position: relative;
  display: block;
  overflow: hidden;
  padding: 0 0 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background:
    linear-gradient(170deg, var(--accent-soft), transparent 46%),
    linear-gradient(165deg, var(--panel-lift), var(--panel));
  color: inherit;
  text-decoration: none;
  transition: transform 0.16s var(--ease-snap), border-color 0.16s;
}

/* The accent lives as a painted edge rather than a coloured card, so three
   different accents can sit together without the shelf turning into confetti. */
.cab::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent);
}

.cab:hover { border-color: var(--accent); }
.cab:active { transform: scale(0.988); }

.cab-body { padding: 16px 18px 0; }

.cab-idx {
  margin: 0;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.cab-name {
  margin: 7px 0 0;
  font-size: clamp(26px, 7.6vw, 32px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.cab-line {
  margin: 9px 0 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--dim);
  max-width: 34ch;
}

.cab-go {
  margin: 14px 18px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.arrow { transition: transform 0.18s var(--ease-snap); }
.cab:hover .arrow { transform: translateX(4px); }

/* ---------- the lead cabinet ----------
 *
 * Link Runner is the one to play first, so it gets the room to say so: a
 * taller corridor, a thicker accent edge and display-sized type. Everything
 * else about it is the same kit - it is the same card, turned up, not a
 * different component. */

.cab-lead { border-color: var(--accent); }
.cab-lead::before { height: 5px; }
.cab-lead .art { height: 132px; }
.cab-lead .cab-name { font-size: clamp(34px, 10vw, 42px); }
.cab-lead .cab-line { font-size: 15.5px; max-width: 30ch; }

/* A quiet flag rather than a badge - it names the card's job and stops. */
.cab-lead .cab-idx::after {
  content: " · Start here";
  letter-spacing: 0.08em;
}

/* ---------- card art ----------
 *
 * Each one is a flat, low-fidelity draw of the surface the game plays on.
 * Drawn, not illustrated - enough to recognise, not enough to distract.
 */

.art {
  height: 96px;
  padding: 16px 18px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

/* 01 — an address bar that is one letter off */

.art-url { justify-content: center; }

.bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid var(--line);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  overflow: hidden;
}

.bar-lock { color: var(--dim); flex: none; }

.bar-url {
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-url b {
  color: var(--hot);
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--hot);
}

.bar-caret {
  width: 1.5px;
  height: 14px;
  flex: none;
  background: var(--hot);
  animation: hub-caret 1.1s steps(1, end) infinite;
}

@keyframes hub-caret {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* 02 — three messages, the middle one a link */

.art-chat {
  gap: 5px;
  align-items: flex-start;
  justify-content: flex-end;
  padding-bottom: 4px;
}

.msg {
  max-width: 88%;
  padding: 6px 11px;
  border-radius: 12px 12px 12px 4px;
  font-size: 12.5px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-them { background: var(--panel-lift); color: var(--paper); }

.msg-link {
  background: rgba(0, 229, 192, 0.1);
  border: 1px solid rgba(0, 229, 192, 0.32);
  color: var(--volt);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
}

.msg-link b { font-weight: 700; box-shadow: inset 0 -2px 0 var(--volt); }

.msg-you {
  align-self: flex-end;
  border-radius: 12px 12px 4px 12px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--dim);
}

/* 03 — the line people expect vs the line they get */

.art-chart { padding: 14px 18px 8px; }
.art-chart svg { display: block; }

/* 06 — one node, and everyone it reaches */

.art-cascade { padding: 10px 18px 6px; }
.art-cascade svg { display: block; }

/* 05 — a statement, with the interest line arriving in the wrong colour */

.art-stmt {
  justify-content: center;
  gap: 5px;
  padding: 14px 18px 10px;
}

.art-stmt .stmt-line {
  height: 5px;
  width: 62%;
  border-radius: 99px;
  background: var(--line);
}

.art-stmt .stmt-line.short { width: 38%; }
.art-stmt .stmt-head { width: 30%; background: var(--panel-lift); }

.art-stmt .stmt-big {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.art-stmt .stmt-int {
  margin-top: 1px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--hot);
  font-variant-numeric: tabular-nums;
}

/* 07 — a three-lane corridor with two gates and a runner under them */

.art-lanes { padding: 10px 18px 4px; }
.art-lanes svg { display: block; }

/* 08 — one hot node and the nodes it has already reached */

.art-spread { padding: 10px 18px 6px; }
.art-spread svg { display: block; }

/* 09 — two payment notifications, one going out, one coming in */

.art-pay {
  justify-content: center;
  gap: 6px;
  padding: 12px 18px 8px;
}

.pay-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px;
  border-radius: 9px;
  background: var(--panel-lift);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
}

.pay-row-dim { opacity: 0.45; }

.pay-arrow {
  flex: none;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.pay-out { background: rgba(255, 45, 120, 0.22); color: var(--hot); }
.pay-in { background: rgba(0, 229, 192, 0.2); color: var(--volt); }

.pay-txt {
  color: var(--paper);
  overflow: hidden;
  text-overflow: ellipsis;
}

.pay-pin {
  margin-left: 2px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--volt);
}

/* 10 — a block that jumps lower the more it is stacked with. The two dashed
   arcs are the whole idea: the jump it had, and the jump it has now. */

.art-carry { padding: 8px 18px 4px; }
.art-carry svg { display: block; }

/* 11 — the two distance bars, to one scale. The short bar is thinking time,
   the long one is the brakes, and the overrun past the hazard line is the
   part that is always a surprise. Drawn to the same scale on purpose. */

.art-brake { padding: 10px 18px 4px; }
.art-brake svg { display: block; }

/* 12 — a reel stopped one slot short of the prize, with the exit sitting
   quietly beside it the whole time. */

.art-reel { padding: 6px 18px 2px; }
.art-reel svg { display: block; }

/* ---------- straight talk ----------
 *
 * Paper, not plastic. Flat, hairline-ruled, no accent bar, no arrow, and the
 * whole thing sits slightly inset from the cabinets above it.
 */

.note {
  display: block;
  margin-top: 10px;
  padding: 20px 20px 18px;
  border-radius: 6px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--dim);
  background: rgba(255, 255, 255, 0.022);
  color: inherit;
  text-decoration: none;
  transition: background 0.18s;
}

.note:hover { background: rgba(255, 255, 255, 0.05); }

.note-tag {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
}

.note-name {
  margin: 10px 0 0;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--paper);
}

.note-line {
  margin: 9px 0 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--dim);
  max-width: 36ch;
}

.note-go {
  margin: 14px 0 0;
  font-size: 13.5px;
  color: var(--paper);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--line);
}

.note:hover .note-go { text-decoration-color: var(--paper); }

/* ---------- foot ---------- */

.foot {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.foot p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--dim);
}

/* ---------- the one load moment ----------
 *
 * The crossing sweeps open under the wordmark and the shelf rises once as a
 * single block. Deliberately not per-card: a staggered fade-up on every card
 * is the tell of a page nobody art-directed.
 */

.wrap .shelf,
.wrap .foot {
  opacity: 0;
  transform: translateY(10px);
}

.wrap.ready .shelf,
.wrap.ready .foot {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s var(--ease-out) 0.26s,
              transform 0.5s var(--ease-out) 0.26s;
}

.wrap.ready .wm-zebra {
  transform: scaleX(1);
  transition: transform 0.62s var(--ease-out) 0.08s;
}

/* ---------- wide ---------- */

@media (min-width: 720px) {
  .wrap { max-width: 860px; padding-top: 92px; }

  .masthead { margin-bottom: 46px; }
  .wordmark { font-size: clamp(96px, 12vw, 132px); }
  .wm-word { -webkit-text-stroke-width: 3px; }

  .standfirst { font-size: 18px; max-width: 42ch; }

  .shelf { grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; }

  .cab { display: flex; flex-direction: column; }
  .cab-body { flex: 1; }

  /* The lead runs the full width of the shelf, art left, words right, so the
     flagship reads as a marquee instead of a slightly bigger tile. */
  .cab-lead {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    grid-template-rows: 1fr auto;
    padding-bottom: 0;
  }

  .cab-lead .art {
    grid-row: 1 / -1;
    height: auto;
    min-height: 210px;
    padding: 26px 22px;
  }

  .cab-lead .art svg { height: 100%; }
  .cab-lead .cab-body { align-self: end; padding: 26px 26px 0; }
  .cab-lead .cab-name { font-size: 46px; }
  .cab-lead .cab-line { max-width: 34ch; }
  .cab-lead .cab-go { margin: 16px 26px 24px; }

  /* The note spans both columns and stays visually apart from the shelf. */
  .note { grid-column: 1 / -1; margin-top: 16px; }
  .note-line { max-width: 56ch; }

  .foot p { max-width: 62ch; }
}

/* 04 — a row of eyes. Four are open and one is mid-blink, so the strip reads
   as a room of people looking rather than as a pattern. */

.art-eyes {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.eye {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 2.5px solid var(--line);
  position: relative;
  flex: none;
}

.eye::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 999px;
  background: var(--accent);
}

/* the pupils do not all look the same way */
.eye:nth-child(2)::after { transform: translateX(3px); }
.eye:nth-child(4)::after { transform: translateX(-3px); }
.eye:nth-child(5)::after { transform: translateY(2px); }

/* one is blinking */
.eye:nth-child(3) {
  height: 4px;
  border-width: 0 0 2.5px 0;
  border-radius: 0;
}

.eye:nth-child(3)::after { display: none; }

.cab:hover .eye::after { background: var(--accent); }

/* For You — a feed narrowing. The rows start as a mixed stack and collapse
   into one colour repeated, which is the whole game in one picture. */
.art-feed {
  justify-content: center;
  gap: 6px;
  padding-top: 0;
}

.art-feed .row {
  height: 11px;
  border-radius: 3px;
  background: var(--line);
  transition: background 0.3s var(--ease-out), width 0.3s var(--ease-out);
}

.art-feed .row:nth-child(1) { width: 78%; }
.art-feed .row:nth-child(2) { width: 54%; }
.art-feed .row:nth-child(3) { width: 88%; background: var(--accent); }
.art-feed .row:nth-child(4) { width: 46%; }
.art-feed .row:nth-child(5) { width: 70%; background: var(--accent); }

/* On hover the feed has made up its mind. */
.cab:hover .art-feed .row { background: var(--accent); width: 84%; }
.cab:hover .art-feed .row:nth-child(2) { width: 84%; }
.cab:hover .art-feed .row:nth-child(4) { width: 84%; }

@media (prefers-reduced-motion: reduce) {
  .art-feed .row { transition: none; }
}

/* 00 — the dog. The only card on the shelf that is not teaching anything,
   so its art is just a warm evening and a small animal enjoying herself. */

.art-zoya {
  padding: 0;
  justify-content: stretch;
  align-items: stretch;
}

/* The SVG carries its own sky, so it fills the art box edge to edge rather
   than floating in the card's background with a margin around it. */
.art-zoya svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
