/* ─────────────────────────────────────────────────────────────
   Creativity Is Everywhere — shared shell
   ───────────────────────────────────────────────────────────── */

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

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

body {
  background: var(--carbon);
  color: var(--bone);
  font-family: var(--sans);
  font-weight: 400;
  font-size: var(--text-body);
  line-height: var(--leading-body);
  letter-spacing: var(--track-body);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;   /* belt-and-braces; every child is also width-safe */
}

::selection { background: var(--coral); color: var(--carbon); }

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 3px;
}

img, svg, canvas { display: block; max-width: 100%; }

/* ── Layout ───────────────────────────────────────────────── */
.wrap {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}
.section { padding-block: var(--gap-major); }
.section--tight { padding-block: var(--gap-section); }
.stack > * + * { margin-top: var(--s-16); }
.prose { max-width: var(--measure); }

/* ── Type roles ───────────────────────────────────────────── */
.display {
  font-size: var(--text-display);
  line-height: var(--leading-display);
  letter-spacing: var(--track-display);
  text-wrap: balance;
}
.heading {
  font-size: var(--text-heading);
  line-height: var(--leading-heading);
  letter-spacing: var(--track-heading);
  text-wrap: balance;
}
.sub  { font-size: var(--text-sub); line-height: 1.35; letter-spacing: -0.02em; }
.lede { font-size: var(--text-sub); line-height: 1.5;  letter-spacing: -0.02em; }
.meta {
  font-size: var(--text-caption);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--iron);
}
.dim { color: var(--iron); }
.coral { color: var(--coral); }

/* Channel's signature: a 1px coral rule under a key heading. */
.rule-coral {
  border: 0;
  border-top: 1px solid var(--coral);
  margin-block: var(--s-19) var(--s-40);
}
.rule-quiet {
  border: 0;
  border-top: 1px solid var(--rule-faint);
  margin-block: var(--s-40);
}

/* A section label: small, iron, sits above a heading. */
.label {
  font-size: var(--text-caption);
  letter-spacing: -0.02em;
  color: var(--iron);
  margin-bottom: var(--s-13);
}

/* ── Arrow link — the system's only "button" ──────────────── */
.arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: var(--text-body);
  min-height: 44px;          /* touch target; the text itself stays 15px */
  transition: color 140ms linear;
}
.arrow::after { content: '→'; transition: transform 200ms ease-out; }
.arrow:hover { color: #ffffff; }
.arrow:hover::after { transform: translateX(4px); }
.arrow--lead { font-size: var(--text-sub); }

/* ── Navigation — a text block, not a bar ─────────────────── */
.nav {
  padding-top: var(--s-20);
  padding-bottom: var(--s-40);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-19) var(--s-20);
  justify-content: space-between;
}
.nav__mark { font-size: var(--text-sub); letter-spacing: -0.03em; }
.nav__mark b { font-weight: 400; color: var(--coral); }
.nav__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-19);
  list-style: none;
}
.nav__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--text-caption);
  color: var(--iron);
  transition: color 140ms linear;
}
.nav__links a:hover { color: var(--bone); }
.nav__links a[aria-current='page'] { color: var(--bone); }

/* ── Card grid — used by every index page ─────────────────── */
.grid {
  display: grid;
  gap: 1px;                       /* the gap IS the rule: ground shows through */
  background: var(--rule-faint);
  border-block: 1px solid var(--rule-faint);
  grid-template-columns: 1fr;
}
@media (min-width: 640px)  { .grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 640px)  { .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--carbon);
  padding: var(--s-20);
  display: flex;
  flex-direction: column;
  gap: var(--s-13);
  min-width: 0;                   /* lets long strings wrap instead of pushing */
}
a.card { transition: background-color 160ms linear; }
a.card:hover { background: #111111; }
.card__title { font-size: var(--text-sub); letter-spacing: -0.03em; color: var(--coral); }
.card__body { font-size: var(--text-body); line-height: 1.5; color: var(--bone); }
.card__stack { font-size: var(--text-caption); color: var(--iron); line-height: 1.4; }
.card__foot { margin-top: auto; padding-top: var(--s-10); }

/* Status pill — no background, no radius. A rule and a word. */
.status {
  font-size: var(--text-caption);
  color: var(--iron);
  border-left: 1px solid var(--rule);
  padding-left: var(--s-10);
}
.status--live { color: var(--bone); border-left-color: var(--coral); }

/* ── Playable tile — the canvas stage ─────────────────────── */
.tile { padding: 0; }
.tile__stage {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--carbon);
  border-bottom: 1px solid var(--rule-faint);
  overflow: hidden;
  touch-action: pan-y;            /* let the page scroll; drawing is pointer-only */
}
.tile__stage canvas { width: 100%; height: 100%; }
.tile__text { padding: var(--s-20); display: flex; flex-direction: column; gap: var(--s-10); }

/* ── Stat block — the one component borrowed from Studio Oker.
      Label over value, no box, no rule. Typography does the structuring. */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--s-40) var(--s-20);
}
.stat dt { font-size: var(--text-body); color: var(--iron); }
.stat dd { font-size: var(--text-body); color: var(--bone); }

/* ── Bare list — raw stacked strings, no bullets ──────────── */
.bare { list-style: none; }
.bare li { font-size: var(--text-body); line-height: 1.5; }

/* ── Footer ───────────────────────────────────────────────── */
.foot {
  margin-top: var(--gap-footer);
  border-top: 1px solid var(--rule-faint);
  padding-block: var(--s-40);
}
.foot__row {
  display: flex;
  flex-wrap: wrap;               /* the bug that shipped to 9 pages of the
                                    portfolio was a missing wrap here */
  gap: var(--s-19) var(--s-40);
  justify-content: space-between;
  align-items: flex-start;
}
.foot__links { display: flex; flex-wrap: wrap; gap: var(--s-19); list-style: none; }
.foot a { font-size: var(--text-caption); color: var(--iron); }
.foot a:hover { color: var(--bone); }

.skip {
  position: absolute; left: -9999px;
  background: var(--carbon); color: var(--bone);
  padding: var(--s-13); border: 1px solid var(--coral);
}
.skip:focus { left: var(--pad-x); top: var(--s-10); z-index: 10; }

/* ── Motion ───────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* With JavaScript off the canvas never paints, so the stage would be an empty
   black rectangle. The canvas is opaque and covers this the moment it does. */
.tile__stage {
  background-image: repeating-linear-gradient(
    -45deg, transparent 0 7px, rgba(202,202,202,0.045) 7px 8px);
}
