/* ============================================================================
   SESAME front page: a key-cutting shop.

   WayneUI 2.0.8 is the floor (tokens, Lato, buttons, table, skip link,
   sr-only). On top: a cream shop floor, a perforated pegboard, brass and
   nickel keys, a green service counter, and Bungee for the shop signs.

   Motion lives behind html.motion, which the <head> script adds only when the
   system has no reduced-motion request. Without it, every key is already cut,
   every door is already open, and every word is on the page at first paint.

   Sections: 1. tokens  2. base  3. header  4. hero  5. counter  6. pegboard
             7. lock  8. duplicator  9. doorways  10. rules  11. cross-ref
             12. key ring  13. footer  14. toast  15. motion
   ========================================================================== */

/* -------------------------------------------------------------- 1. tokens */
@font-face {
  font-family: "Bungee";
  src: url("fonts/bungee-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --green: #0c5449;          /* Wayne State green, the family tie */
  --green-deep: #08352f;
  --gold: #ffcc33;           /* Wayne State gold, light and signed things */
  --cream: #f4f1ea;          /* the shop floor, from the board */
  --paper: #fbf9f4;
  --ink: #1d2b27;            /* body text on cream: 13.9:1 */
  --ink-muted: #46554f;      /* 7.0:1 on cream */
  --slate: #314842;          /* Slate Ink, the board's accent */
  --peg: #e7dfcc;            /* pegboard */
  --peg-hole: #b6a98b;
  --brass: #d6a73c;
  --brass-dark: #8a6a1e;
  --nickel: #ccd3d0;
  --nickel-dark: #66736e;
  --tag: #fffaf0;
  --shadow: 0 1px 0 rgba(29, 43, 39, .06), 0 10px 24px -12px rgba(29, 43, 39, .35);
  --sign: "Bungee", "Lato", "Arial Black", sans-serif;
  --mono: var(--wsu-font-family-mono);
  --ease-swing: cubic-bezier(.34, 1.56, .64, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
}

/* ---------------------------------------------------------------- 2. base */
html { scroll-behavior: auto; }
.motion { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--wsu-font-family-body);
  line-height: 1.55;
  overflow-x: clip;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px);
  box-sizing: border-box;
}
code { font-family: var(--mono); font-size: .92em; }
p code, li code, td code, dd code {
  background: rgba(12, 84, 73, .08);
  padding: .05em .35em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}
a { color: var(--green); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.t-dim { opacity: .65; }

h1, h2, h3 { margin: 0; }
h2, .sign-type {
  font-family: var(--sign);
  font-weight: 400;
  letter-spacing: .01em;
  line-height: 1.05;
}
h2 { font-size: clamp(1.9rem, 4.4vw, 3.1rem); color: var(--green); }
h3 { font-size: 1.2rem; font-weight: 900; }

.section { padding: clamp(64px, 9vw, 120px) 0; position: relative; overflow-x: clip; }
.head { max-width: 46rem; margin-bottom: clamp(32px, 5vw, 56px); }
.head p:last-child { font-size: 1.125rem; color: var(--ink-muted); margin: .9rem 0 0; }
.head--light h2 { color: var(--cream); }
.head--light p:last-child { color: #e9e4d8; }
.head--light p code { background: rgba(255, 255, 255, .12); }
.kicker {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .78rem;
  font-weight: 700;
  color: var(--slate);
  margin: 0 0 .7rem;
  display: inline-flex;
  align-items: center;
  gap: .6em;
}
.kicker::before {
  content: "";
  width: 26px; height: 12px; flex: none;
  /* a tiny key: ring bow, blade, two teeth */
  background:
    radial-gradient(circle at 6px 6px, transparent 2.2px, currentColor 2.6px 5.6px, transparent 6px),
    linear-gradient(currentColor, currentColor) 11px 4.5px / 15px 3px no-repeat,
    linear-gradient(currentColor, currentColor) 18px 7px / 2.5px 4px no-repeat,
    linear-gradient(currentColor, currentColor) 23px 7px / 2.5px 3px no-repeat;
}
.head--light .kicker { color: #e9e4d8; }
.kicker--gold, .head--light .kicker--gold { color: var(--gold); }

/* -------------------------------------------------------------- 3. header */
.shop-head {
  background: var(--cream);
  border-bottom: 2px solid var(--slate);
  position: relative;
  z-index: 5;
}
.shop-head__row { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--green); }
.brand img { border-radius: 8px; }
.brand__name { font-family: var(--sign); font-size: 1.25rem; }
.shop-nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.shop-nav a {
  font-weight: 700; font-size: .92rem; color: var(--ink);
  text-decoration: none; padding: 6px 10px; border-radius: 999px;
}
.shop-nav a:hover { background: var(--peg); }
.open-sign {
  position: relative; display: block; width: 76px; height: 64px;
  align-self: flex-start; text-decoration: none; flex: none;
}
.open-sign__strings {
  position: absolute; left: 50%; top: 2px; width: 44px; height: 20px; translate: -50% 0;
  background:
    linear-gradient(to bottom right, transparent calc(50% - 1px), var(--slate) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) left / 50% 100% no-repeat,
    linear-gradient(to bottom left, transparent calc(50% - 1px), var(--slate) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) right / 50% 100% no-repeat;
}
.open-sign__face {
  position: absolute; left: 50%; top: 20px; translate: -50% 0;
  background: var(--green); color: var(--gold);
  font-family: var(--sign); font-size: .9rem; padding: 4px 10px 3px;
  border-radius: 6px; border: 2px solid var(--gold);
  transform-origin: 50% -18px;
  box-shadow: var(--shadow);
}
.open-sign:hover .open-sign__face, .open-sign:focus-visible .open-sign__face { background: var(--green-deep); }

@media (max-width: 860px) { .shop-nav { display: none; } .open-sign { margin-left: auto; } }

/* ---------------------------------------------------------------- 4. hero */
.hero { position: relative; overflow-x: clip; padding-top: clamp(28px, 5vw, 64px); }
.hero__grid { padding-bottom: clamp(40px, 6vw, 72px); }
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
}
.stamp {
  display: inline-block; margin: 0 0 18px;
  font-family: var(--mono); font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--slate); border: 2px dashed var(--slate); border-radius: 6px; padding: 6px 10px;
}
.stamp code { background: none; padding: 0; text-transform: none; letter-spacing: 0; font-size: 1em; }
.hero__title {
  font-family: var(--sign); font-weight: 400; color: var(--green);
  font-size: clamp(3.4rem, 11vw, 7.6rem); line-height: .9; letter-spacing: .01em;
}
.punch { display: inline-flex; }
.punch > span { display: inline-block; }

.key-tag { position: relative; display: inline-block; margin: 6px 0 22px 18px; max-width: min(100%, 31rem); }
.key-tag__string {
  position: absolute; left: 0; top: -16px; width: 26px; height: 30px;
  border-left: 2px solid var(--brass-dark); border-top: 2px solid var(--brass-dark);
  border-radius: 14px 0 0 0;
}
.key-tag__card {
  position: relative; margin: 0;
  background: var(--tag); color: var(--ink);
  font-family: var(--mono); font-size: clamp(.9rem, 1.6vw, 1.02rem); font-weight: 400; line-height: 1.45;
  padding: 10px 18px 10px 42px;
  border: 2px solid var(--brass-dark);
  /* a paper key tag: square on the right, a clipped point on the left */
  clip-path: polygon(16px 0, 100% 0, 100% 100%, 16px 100%, 0 50%);
  border-radius: 0 8px 8px 0;
  transform-origin: 0 50%;
}
.key-tag__card::before { /* the left edge border, which the clip would cut */
  content: ""; position: absolute; inset: -2px auto -2px -2px; width: 18px;
  background:
    linear-gradient(to bottom right, transparent calc(50% - 1.5px), var(--brass-dark) calc(50% - 1.5px) calc(50% + 1.5px), transparent calc(50% + 1.5px)) top / 100% 50% no-repeat,
    linear-gradient(to top right, transparent calc(50% - 1.5px), var(--brass-dark) calc(50% - 1.5px) calc(50% + 1.5px), transparent calc(50% + 1.5px)) bottom / 100% 50% no-repeat;
}
.key-tag__hole {
  position: absolute; left: 20px; top: 50%; width: 10px; height: 10px; translate: 0 -50%;
  border-radius: 50%; background: var(--cream); box-shadow: inset 0 0 0 2px var(--brass-dark);
}
.hero__tagline {
  font-family: var(--sign); color: var(--slate);
  font-size: clamp(1.25rem, 2.6vw, 1.7rem); margin: 0 0 14px; line-height: 1.15;
}
.hero__blurb { font-size: 1.1rem; max-width: 36rem; margin: 0 0 24px; color: var(--ink); }

.cutline {
  display: flex; align-items: stretch; max-width: 32rem;
  background: var(--slate); border-radius: 10px; overflow: hidden;
  box-shadow: var(--shadow);
}
.cutline--wide { max-width: 40rem; }
.cutline__code {
  flex: 1 1 auto; min-width: 0; color: #f4f1ea; padding: 14px 16px;
  font-size: .95rem; overflow-wrap: anywhere; background: none;
}
.copy-btn {
  flex: none; border: 0; cursor: pointer; font: inherit; font-weight: 900;
  background: var(--gold); color: #14201d; padding: 0 20px; min-width: 88px;
  transition: background-color .15s;
}
.copy-btn:hover { background: #ffd65c; }
.copy-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: -6px; box-shadow: inset 0 0 0 3px var(--slate); }

.hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin: 26px 0 0; }
.tag-btn { position: relative; padding-left: 2.4em; border-radius: 6px 999px 999px 6px; }
.tag-btn::before {
  content: ""; position: absolute; left: 1em; top: 50%; width: .6em; height: .6em; translate: 0 -50%;
  border-radius: 50%; background: var(--cream); box-shadow: inset 0 0 0 2px var(--green-deep);
}
.hero__link { font-weight: 700; }

.hero__art { position: relative; aspect-ratio: 1 / 1.02; min-width: 0; }
.peg-wall {
  position: absolute; inset: 0 0 6% 4%;
  background-color: var(--peg);
  background-image: radial-gradient(circle, var(--peg-hole) 0 3px, transparent 3.6px);
  background-size: 26px 26px;
  background-position: 13px 13px;
  border-radius: 18px;
  box-shadow: inset 0 0 0 2px #d6ccb4, var(--shadow);
}
.hero__door {
  position: absolute; left: 22%; top: 11%; width: 52%;
}
.hero__mark {
  position: relative; z-index: 2; display: block; width: 100%; height: auto;
  border-radius: 22%;
  box-shadow: 0 24px 40px -20px rgba(8, 53, 47, .7);
}
.hero__glow {
  position: absolute; inset: -12%; z-index: 1; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 204, 51, .55), rgba(255, 204, 51, 0));
}
/* The gold wedge of the mark, carried on as light across the counter. */
.hero__spill {
  position: absolute; z-index: 1; left: 50%; top: 88%; width: 140%; height: 52%;
  translate: -50% 0;
  background: linear-gradient(to bottom, rgba(255, 204, 51, .75), rgba(255, 204, 51, 0));
  clip-path: polygon(45% 0, 55% 0, 100% 100%, 0 100%);
  transform-origin: 50% 0;
}
.hang { position: absolute; width: 11%; z-index: 3; transform-origin: 50% 6%; }
.hang svg { display: block; width: 100%; height: auto; filter: drop-shadow(2px 5px 3px rgba(29, 43, 39, .3)); }
.hang__hook {
  position: absolute; left: 50%; top: -6%; width: 6px; height: 18%; translate: -50% 0;
  background: #7f8a86; border-radius: 3px;
}
.hang--a { left: 6%; top: 18%; --k: var(--brass); --kd: var(--brass-dark); }
.hang--b { right: 3%; top: 26%; --k: var(--nickel); --kd: var(--nickel-dark); }
.hang--c { right: 15%; top: 56%; width: 9%; --k: #eef1ef; --kd: #8d9894; }

/* Key art: the sprite reads these. */
.k-body { fill: var(--k, var(--brass)); stroke: var(--kd, var(--brass-dark)); stroke-width: 2.5; stroke-linejoin: round; }
.k-hole { fill: var(--hole, var(--peg)); stroke: var(--kd, var(--brass-dark)); stroke-width: 2.5; }
.k-groove { stroke: var(--kd, var(--brass-dark)); stroke-width: 2; opacity: .45; fill: none; }
.k-stamp { font-family: var(--sign); font-size: 12px; fill: var(--kd, var(--brass-dark)); opacity: .85; letter-spacing: .5px; }

/* ------------------------------------------------------------- 5. counter */
.counter {
  position: relative; z-index: 4;
  background: var(--green);
  border-top: 6px solid var(--gold);
  box-shadow: 0 -2px 0 var(--green-deep) inset;
}
.counter__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.counter__note { margin: 0; color: #eaf1ef; font-family: var(--mono); font-size: .85rem; letter-spacing: .04em; }
.bell {
  flex: none; background: none; border: 0; padding: 6px; cursor: pointer; border-radius: 10px;
  margin-top: -34px; /* it sits on the counter top */
}
.bell svg { width: 52px; height: auto; display: block; overflow: visible; }
.bell__dome { fill: var(--gold); stroke: #8a6a1e; stroke-width: 2; }
.bell__base { fill: #2a3c37; }
.bell__knob { fill: #8a6a1e; }
.bell:focus-visible { outline-color: var(--gold); }

/* ------------------------------------------------------------ 6. pegboard */
.section--keys { background: var(--cream); }
.shop {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: clamp(24px, 4vw, 48px); align-items: start;
}
.board {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px;
  padding: 26px 18px 22px;
  background-color: var(--peg);
  background-image: radial-gradient(circle, var(--peg-hole) 0 3px, transparent 3.6px);
  background-size: 26px 26px; background-position: 13px 13px;
  border-radius: 16px; box-shadow: inset 0 0 0 2px #d6ccb4, var(--shadow);
}
.peg {
  position: relative; display: flex; flex-direction: column; align-items: center;
  background: none; border: 0; padding: 14px 4px 6px; cursor: pointer; font: inherit; color: var(--ink);
  border-radius: 12px; min-width: 0;
  --k: var(--brass); --kd: var(--brass-dark);
}
.peg[data-driver="gateway"] { --k: var(--nickel); --kd: var(--nickel-dark); }
.peg[data-driver="fake"] { --k: #5b7a72; --kd: #23352f; --hole: var(--peg); }
.peg--blank { --k: #eef1ef; --kd: #8d9894; }
.peg__hook {
  position: absolute; top: 0; left: 50%; width: 6px; height: 34px; translate: -50% 0;
  background: #7f8a86; border-radius: 3px; z-index: 2;
}
.peg__key {
  width: min(64px, 100%); height: auto; display: block;
  transform-origin: 50% 9%;
  filter: drop-shadow(2px 5px 3px rgba(29, 43, 39, .28));
  transition: transform .4s var(--ease-swing);
}
.peg__tag {
  margin-top: 10px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--tag); border: 2px solid var(--slate); border-radius: 8px; padding: 6px 6px 7px;
  width: 100%; box-sizing: border-box; max-width: 112px;
}
.peg__name { font-family: var(--mono); font-weight: 700; font-size: .92rem; overflow-wrap: anywhere; }
.peg__status {
  font-size: .72rem; font-weight: 900; text-transform: uppercase; letter-spacing: .06em;
  background: var(--green); color: #fff; border-radius: 999px; padding: 1px 8px;
}
.peg__status--later { background: var(--slate); color: #fff; }
.peg__status--local { background: #fff; color: var(--slate); box-shadow: inset 0 0 0 1.5px var(--slate); }
.peg:hover .peg__key { transform: rotate(6deg); }
.peg[aria-pressed="true"] .peg__tag { background: var(--gold); border-color: var(--green-deep); }
.peg[aria-pressed="true"] .peg__key { transform: translateY(-6px); }
.peg:focus-visible { outline-offset: 0; }

/* --------------------------------------------------------------- 7. lock */
.lock { display: grid; gap: 22px; justify-items: start; }
.door {
  position: relative; width: 200px; height: 270px; margin-right: 110px;
  background: var(--slate); border-radius: 8px 8px 0 0; padding: 8px 8px 0;
  box-sizing: border-box; perspective: 900px;
  box-shadow: var(--shadow);
}
.door__light {
  position: absolute; inset: 8px 8px 0;
  background: linear-gradient(#ffe38a, var(--gold));
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  padding-left: 18px; box-sizing: border-box;
  font-family: var(--sign); color: var(--green-deep);
}
.door__who { font-family: var(--mono); font-weight: 700; font-size: 1.45rem; }
.door__in { font-size: 1rem; }
.door__leaf {
  position: absolute; inset: 8px 8px 0;
  background: var(--green); border-radius: 2px;
  transform-origin: 100% 50%;
  transform-style: preserve-3d;
  transition: transform .9s var(--ease-out);
  box-shadow: inset 0 0 0 2px var(--green-deep);
}
.door__plate {
  position: absolute; top: 16px; left: 50%; translate: -50% 0; white-space: nowrap;
  font-family: var(--sign); font-size: .8rem; color: var(--gold);
  border: 2px solid var(--gold); border-radius: 4px; padding: 2px 8px 1px;
}
.door__panel {
  position: absolute; left: 16px; right: 16px; height: 34%;
  border: 2px solid rgba(255, 204, 51, .35); border-radius: 3px;
}
.door__panel:nth-of-type(2) { top: 26%; }
.door__panel:nth-of-type(3) { bottom: 8%; }
.door__escutcheon {
  position: absolute; left: 14px; top: 62%; width: 22px; height: 22px; translate: 0 -50%;
  border-radius: 50%; background: var(--brass); box-shadow: inset 0 0 0 2px var(--brass-dark);
}
.door__escutcheon::after {
  content: ""; position: absolute; left: 50%; top: 5px; width: 6px; height: 11px; translate: -50% 0;
  background: #1d2b27; border-radius: 3px 3px 1px 1px;
}
/* The key sits in the keyhole and sticks out to the left of the door. */
.door__key {
  position: absolute; right: calc(100% - 25px); top: 62%; width: 120px; translate: 0 -50%;
  transition: transform .45s var(--ease-out), opacity .3s;
  --k: var(--brass); --kd: var(--brass-dark); --hole: var(--cream);
}
.door__key svg { display: block; width: 100%; height: auto; overflow: visible; }
.door__key svg use { transform-origin: 50% 50%; transition: transform .35s ease; }
.lock[data-driver="gateway"] .door__key { --k: var(--nickel); --kd: var(--nickel-dark); }
.lock[data-driver="fake"] .door__key { --k: #5b7a72; --kd: #23352f; }
.lock[data-driver="saml"] .door__key, .lock[data-driver="oauth2"] .door__key { --k: #eef1ef; --kd: #8d9894; }

.lock:not(.is-in) .door__key { transform: translateX(-46px); opacity: 0; }
.lock.is-turned .door__key svg use { transform: scaleY(.32); }
.lock.is-open .door__leaf { transform: rotateY(-82deg); }
.lock.is-open .door__key { opacity: 0; }
.lock.is-stuck .door__key { animation: jiggle .5s ease-in-out; }

.readout {
  width: 100%; max-width: 26rem; box-sizing: border-box;
  background: var(--paper); border: 2px solid var(--slate); border-radius: 10px;
  padding: 14px 16px; box-shadow: var(--shadow);
}
.readout__label { margin: 0; font-family: var(--mono); font-size: .78rem; color: var(--ink-muted); }
.readout__line { margin: 4px 0 10px; }
.readout__line code {
  display: inline-block; background: var(--slate); color: var(--gold);
  padding: 6px 10px; border-radius: 6px; font-size: 1rem; font-weight: 700; overflow-wrap: anywhere;
}
.readout__line code.is-uncut { background: #fff; color: var(--slate); box-shadow: inset 0 0 0 2px var(--slate); font-weight: 400; }
.readout__note { margin: 0; color: var(--ink); }

/* --------------------------------------------------------- 8. duplicator */
.section--dup { background: var(--slate); padding-bottom: 0; }
.section--dup .head h2 { color: var(--gold); }
.dup { position: relative; }
.dup__stage { padding: 0 0 clamp(64px, 9vw, 110px); }
.dup__grid {
  margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 20rem);
  gap: clamp(20px, 3vw, 40px); align-items: center;
}
.dup__svg {
  display: block; width: 100%; height: auto; max-height: 74vh;
  background: var(--cream); border-radius: 18px;
  box-shadow: 0 0 0 6px var(--green-deep), 0 30px 60px -30px rgba(0, 0, 0, .6);
}
.m-plate { fill: var(--slate); }
.m-rail { fill: #1d2b27; }
.m-label { font-family: var(--sign); font-size: 17px; fill: var(--gold); letter-spacing: .5px; }
.m-jaw { fill: #1d2b27; }
.m-bolt { fill: var(--brass); }
.m-cap { font-family: var(--mono); font-size: 17px; fill: #e9e4d8; }
.m-arm { fill: #7f8a86; }
.m-tracer { fill: var(--gold); stroke: #8a6a1e; stroke-width: 2; }
.m-teeth { fill: none; stroke: #c9cfcc; stroke-width: 9; stroke-dasharray: 5 4; }
.m-disc { fill: #9aa4a0; stroke: #e5e9e7; stroke-width: 2; }
.m-hub { fill: var(--slate); }
.m-chip { fill: var(--brass); opacity: 0; }
.m-slot { fill: #16211e; stroke: #4e6862; stroke-width: 2; }
.m-config { font-family: var(--mono); font-size: 25px; font-weight: 700; fill: var(--gold); }
.k--brass { --k: var(--brass); --kd: var(--brass-dark); --hole: var(--slate); }
.k--nickel { --k: var(--nickel); --kd: var(--nickel-dark); --hole: var(--slate); }
.k-blade { fill: var(--k); stroke: var(--kd); stroke-width: 2.5; stroke-linejoin: round; }
.k-blade--cut { fill: #dfe4e2; }
.d-floor { stroke: var(--slate); stroke-width: 3; opacity: .5; }
.d-ticket rect { fill: var(--tag); stroke: var(--brass-dark); stroke-width: 2.5; }
.d-ticket-hole { fill: var(--cream); stroke: var(--brass-dark); stroke-width: 2.5; }
.d-ticket-no { font-family: var(--sign); font-size: 16px; fill: var(--green); }
.d-ticket-line { font-family: var(--mono); font-size: 21px; fill: var(--ink); white-space: pre; }
.d-ticket-line--small { font-size: 17px; fill: var(--ink-muted); }
.d-spill { fill: url(#dup-spill); }
.d-frame { fill: var(--slate); }
.d-in { font-family: var(--mono); font-weight: 700; font-size: 32px; fill: var(--green-deep); }
.d-in--small { font-family: var(--sign); font-weight: 400; font-size: 20px; }
.d-leaf-face { fill: var(--green); stroke: var(--green-deep); stroke-width: 3; }
.d-panel { fill: none; stroke: rgba(255, 204, 51, .4); stroke-width: 2.5; }
.d-plate { font-family: var(--sign); font-size: 17px; fill: var(--gold); }
.d-escutcheon { fill: var(--brass); stroke: var(--brass-dark); stroke-width: 2; }
.d-keyhole { fill: #1d2b27; }
.d-open { font-family: var(--sign); font-size: 46px; fill: var(--green); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: none; }
.step {
  display: flex; gap: 14px; align-items: flex-start;
  color: #e9e4d8; padding: 12px 14px; border-radius: 12px;
  border: 2px solid rgba(233, 228, 216, .22);
  transition: background-color .3s, border-color .3s, color .3s, transform .3s var(--ease-out);
}
.step__n {
  flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--sign); font-size: .95rem; background: rgba(233, 228, 216, .14); color: var(--cream);
}
.step__t { min-width: 0; }
.step strong { color: #fff; }
.step code { background: rgba(255, 255, 255, .12); color: var(--gold); padding: .05em .35em; border-radius: 4px; overflow-wrap: anywhere; }
.step.is-now { background: var(--cream); border-color: var(--gold); color: var(--ink); }
.step.is-now strong { color: var(--green); }
.step.is-now code { background: var(--slate); color: var(--gold); }
.step.is-now .step__n { background: var(--gold); color: var(--ink); }

/* ------------------------------------------------------------ 9. doorways */
.section--start { background: var(--cream); }
.install { margin-bottom: 40px; }
.install__label { font-weight: 900; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.install__os { font-weight: 400; color: var(--ink-muted); font-size: .95rem; }
.tickets { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(18px, 2.4vw, 28px); }
.ticket {
  position: relative; background: var(--paper);
  padding: 30px 22px 22px; border-radius: 4px;
  box-shadow: var(--shadow);
  /* a tear-off job ticket: punched edge across the top */
  -webkit-mask: radial-gradient(circle 7px at 50% 0, transparent 98%, #000) top / 22px 100% repeat-x;
          mask: radial-gradient(circle 7px at 50% 0, transparent 98%, #000) top / 22px 100% repeat-x;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); column-gap: clamp(20px, 3vw, 40px); row-gap: 10px;
  align-content: start; min-width: 0;
}
.ticket > * { grid-column: 1; }
.ticket > .ticket__code { grid-column: 2; grid-row: 1 / span 4; align-self: center; }
.ticket::before {
  content: ""; position: absolute; left: 0; right: 0; top: 18px; border-top: 2px dashed rgba(49, 72, 66, .35);
}
.ticket__no {
  margin: 6px 0 0; font-family: var(--mono); font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--slate);
}
.ticket h3 { font-family: var(--sign); font-weight: 400; font-size: 1.3rem; color: var(--green); }
.ticket p { margin: 0; }
.ticket__code, .testbench__code {
  margin: 4px 0; background: var(--slate); color: #f4f1ea; border-radius: 8px;
  padding: 14px; font-size: .82rem; line-height: 1.55; overflow-x: auto; white-space: pre;
}
.ticket__code code, .testbench__code code { font-size: 1em; }
.ticket__foot { color: var(--ink-muted); font-size: .95rem; }
.testbench {
  margin-top: clamp(32px, 5vw, 56px);
  display: grid; grid-template-columns: minmax(0, 16rem) minmax(0, 1fr); gap: 24px; align-items: center;
  border-top: 2px solid var(--slate); padding-top: 28px;
}
.testbench h3 { font-family: var(--sign); font-weight: 400; color: var(--green); }
.testbench p { margin: 8px 0 0; color: var(--ink-muted); }

/* --------------------------------------------------------------- 10. rules */
.section--rules {
  background-color: var(--peg);
  background-image: radial-gradient(circle, var(--peg-hole) 0 3px, transparent 3.6px);
  background-size: 26px 26px; background-position: 13px 13px;
}
.rules__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 17rem); gap: clamp(24px, 4vw, 56px); align-items: start; }
.rules-sign {
  position: relative; background: var(--green); color: #f4f1ea;
  border-radius: 18px; padding: clamp(28px, 4vw, 48px);
  box-shadow: inset 0 0 0 4px var(--green), inset 0 0 0 7px var(--gold), 0 24px 40px -24px rgba(8, 53, 47, .8);
}
.rules-sign h2 { color: var(--gold); margin-bottom: 22px; }
.screw {
  position: absolute; width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f0f3f2, #9aa4a0);
  transition: transform .6s var(--ease-out);
}
.screw::after { content: ""; position: absolute; left: 2px; right: 2px; top: 6px; height: 2px; background: #55615d; }
.screw--tl { left: 18px; top: 18px; } .screw--tr { right: 18px; top: 18px; }
.screw--bl { left: 18px; bottom: 18px; } .screw--br { right: 18px; bottom: 18px; }
.rules-sign:hover .screw { transform: rotate(90deg); }
.rules { margin: 0; padding: 0; list-style: none; counter-reset: rule; display: grid; gap: 14px; }
.rules li {
  counter-increment: rule; position: relative; padding-left: 52px; font-size: 1.05rem;
}
.rules li::before {
  content: counter(rule); position: absolute; left: 0; top: -2px;
  width: 36px; height: 36px; display: grid; place-items: center;
  font-family: var(--sign); font-size: 1rem; color: var(--green-deep); background: var(--gold);
  border-radius: 50%;
}
.rules strong { color: #fff; }
.rules code { background: rgba(255, 255, 255, .12); color: #ffe08a; }
.rules__more { margin: 26px 0 0; }
.rules__more a { color: var(--gold); font-weight: 700; }

.hours { position: relative; padding-top: 40px; }
.hours__string {
  position: absolute; left: 50%; top: 0; width: 70%; height: 46px; translate: -50% 0;
  background:
    linear-gradient(to bottom right, transparent calc(50% - 1px), var(--slate) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) left / 50% 100% no-repeat,
    linear-gradient(to bottom left, transparent calc(50% - 1px), var(--slate) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)) right / 50% 100% no-repeat;
}
.hours__string::before {
  content: ""; position: absolute; left: 50%; top: -6px; width: 12px; height: 12px; translate: -50% 0;
  border-radius: 50%; background: #7f8a86;
}
.hours__card {
  background: var(--paper); border: 3px solid var(--slate); border-radius: 12px; padding: 20px;
  box-shadow: var(--shadow); transform-origin: 50% -40px;
}
.hours h3 { font-family: var(--sign); font-weight: 400; font-size: 1.6rem; color: var(--green); text-align: center; }
.hours__list { margin: 14px 0; display: grid; gap: 8px; }
.hours__list div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed rgba(49, 72, 66, .4); padding-bottom: 6px; }
.hours__list dt { font-weight: 700; }
.hours__list dd { margin: 0; font-family: var(--mono); font-weight: 700; color: var(--green); }
.hours__note { margin: 0; font-size: .92rem; color: var(--ink-muted); }

/* ------------------------------------------------------------ 11. xref */
.section--xref { background: var(--cream); }
.xref {
  background: var(--paper); border: 2px solid var(--slate); border-radius: 12px;
  box-shadow: var(--shadow); overflow-x: auto;
}
.xref__table { width: 100%; border-collapse: collapse; margin: 0; }
.xref__table th {
  text-align: left; font-family: var(--mono); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase;
  background: var(--slate); color: #f4f1ea; padding: 12px 18px;
}
.xref__table td { padding: 12px 18px; border-top: 1px solid rgba(49, 72, 66, .2); vertical-align: top; }
.xref__table td:first-child { width: 42%; position: relative; }
.xref__table td:first-child::after {
  content: "→"; position: absolute; right: 6px; top: 12px; color: var(--brass-dark); font-weight: 900;
  transition: transform .25s var(--ease-swing);
}
.xref__table tbody tr { transition: background-color .2s; }
.xref__table tbody tr:hover { background: #fff3c7; }
.xref__table tbody tr:hover td:first-child::after { transform: translateX(5px); }

/* ------------------------------------------------------------ 12. ring */
.section--ring { background: var(--green); }
.hand {
  list-style: none; margin: 0 0 clamp(40px, 6vw, 64px); padding: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr) 40px minmax(0, 1fr) 40px minmax(0, 1fr);
  align-items: start;
}
.hand__stop { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; color: #e9e4d8; min-width: 0; }
.hand__stop img, .hand__tile { width: 64px; height: 64px; border-radius: 16px; }
.hand__tile { display: grid; place-items: center; background: var(--green-deep); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25); }
.hand__tile img { width: 40px; height: 40px; border-radius: 0; }
.hand__stop strong { display: block; color: #fff; font-family: var(--sign); font-weight: 400; font-size: .95rem; }
.hand__stop span { font-size: .92rem; overflow-wrap: anywhere; }
.hand__stop--here img { box-shadow: 0 0 0 3px var(--gold); }
/* Connectors run only in the gaps, level with the icons' middles. */
.hand__gap { height: 64px; position: relative; }
.hand__gap::before {
  content: ""; position: absolute; left: 4px; right: 4px; top: 50%; height: 4px; translate: 0 -50%;
  background: repeating-linear-gradient(90deg, var(--gold) 0 8px, transparent 8px 13px);
  border-radius: 2px;
}
.ring {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 208px), 1fr)); gap: 18px 14px;
}
.ring__tag {
  position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr); grid-template-rows: auto auto;
  column-gap: 12px; align-items: center;
  background: var(--tag); color: var(--ink);
  border-radius: 10px 10px 10px 28px; padding: 12px 14px 12px 16px;
  box-shadow: 0 10px 20px -14px rgba(0, 0, 0, .6);
  transform-origin: 50% -10px;
  transition: transform .45s var(--ease-swing);
}
.ring__tag:hover { transform: rotate(-3deg); }
.ring__mark { grid-row: 1 / span 2; width: 48px; height: 48px; border-radius: 12px; }
.ring__mark--tile { display: grid; place-items: center; background: var(--green); }
.ring__mark--tile img { width: 32px; height: 32px; }
.ring__name { font-weight: 900; }
.ring__role { font-size: .88rem; color: var(--ink-muted); line-height: 1.3; }
.ring__tag--here { background: var(--gold); }
.ring__tag--here .ring__role { color: #2a2611; }
.ring__tag--new::after {
  content: "new"; position: absolute; top: -8px; right: 10px;
  font-size: .7rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em;
  background: var(--slate); color: #fff; border-radius: 999px; padding: 1px 8px;
}
/* The names on the ring and in the hand are links to their own front pages.
   They keep the tag's look: inherited colour, no underline, and a focus
   outline that reads on the section's green. */
.ring__link { color: inherit; text-decoration: none; }
.hand__link { display: block; color: inherit; text-decoration: none; }
.hand__link:focus-visible { outline-color: var(--gold); }

/* ---------------------------------------------------------- 13. footer */
.shop-foot { background: var(--green-deep); color: #e9e4d8; padding: 36px 0; border-top: 6px solid var(--gold); }
.shop-foot__row { display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; align-items: center; }
.shop-foot p { margin: 0; }
.shop-foot__brand { display: flex; align-items: center; gap: 12px; font-family: var(--sign); color: #fff; }
.shop-foot__brand img { border-radius: 10px; }
.shop-foot__joke { font-family: var(--mono); color: var(--gold); text-align: right; }
.shop-foot__links a { color: #fff; }
.shop-foot__org { text-align: right; font-size: .9rem; }
.shop-foot a:focus-visible { outline-color: var(--gold); }

/* ----------------------------------------------------------- 14. toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50; translate: -50% 0;
  max-width: calc(100vw - 32px); box-sizing: border-box;
  background: var(--slate); color: #fff; border: 2px solid var(--gold); border-radius: 10px;
  padding: 10px 16px; font-weight: 700; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.toast:empty { display: none; }
.toast.is-up { opacity: 1; }

/* ------------------------------------------------------- responsive */
@media (max-width: 980px) {
  .shop { grid-template-columns: minmax(0, 1fr); }
  .lock { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
  .dup__grid { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ticket { grid-template-columns: minmax(0, 1fr); }
  .ticket > .ticket__code { grid-column: 1; grid-row: auto; }
  .rules__grid { grid-template-columns: minmax(0, 1fr); }
  .hours { max-width: 20rem; }
}
@media (max-width: 760px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); }
  .hero__art { max-width: 420px; width: 100%; justify-self: center; order: -1; aspect-ratio: 1 / .86; }
  .hero__door { top: 8%; width: 46%; left: 27%; }
  .peg-wall { inset: 0 0 4% 0; }
  .lock { grid-template-columns: minmax(0, 1fr); }
  .door { width: 160px; height: 220px; margin-left: 96px; margin-right: 0; }
  .door__key { width: 100px; }
  .board { grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 22px 8px 16px; gap: 2px; }
  .peg { padding-inline: 0; }
  .peg__name { font-size: .78rem; }
  .peg__status { font-size: .62rem; padding: 1px 5px; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .step { padding: 8px 10px; font-size: .9rem; gap: 10px; }
  .step__n { width: 26px; height: 26px; font-size: .8rem; }
  .testbench { grid-template-columns: minmax(0, 1fr); }
  .hand { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .hand__stop { max-width: 18rem; }
  .hand__gap { height: 32px; width: 4px; }
  .hand__gap::before {
    left: 0; right: 0; top: 4px; bottom: 4px; height: auto; translate: 0 0;
    background: repeating-linear-gradient(180deg, var(--gold) 0 8px, transparent 8px 13px);
  }
  .shop-foot__row { grid-template-columns: minmax(0, 1fr); }
  .shop-foot__joke, .shop-foot__org { text-align: left; }
  .counter__note { font-size: .78rem; }
}
@media (max-width: 380px) {
  .door { margin-left: 84px; width: 150px; }
  .peg__status { font-size: .56rem; letter-spacing: .02em; }
  .copy-btn { min-width: 72px; padding: 0 12px; }
}

/* ------------------------------------------------------------ 15. motion */
@keyframes jiggle {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px) rotate(-2deg); }
  40% { transform: translateX(3px) rotate(2deg); }
  60% { transform: translateX(-3px) rotate(-1deg); }
  80% { transform: translateX(2px); }
}
@keyframes punch-in {
  0% { transform: translateY(-40%) scale(1.25); opacity: 0; }
  60% { transform: translateY(4%) scale(.96); opacity: 1; }
  100% { transform: none; opacity: 1; }
}
@keyframes tag-swing {
  0% { transform: rotate(-14deg); opacity: 0; }
  30% { opacity: 1; }
  55% { transform: rotate(5deg); }
  78% { transform: rotate(-2deg); }
  100% { transform: rotate(0); }
}
@keyframes knock {
  0%, 100% { transform: none; }
  12% { transform: rotate(-2.2deg); }
  24% { transform: rotate(1.6deg); }
  36% { transform: none; }
  52% { transform: rotate(-2.2deg); }
  64% { transform: rotate(1.6deg); }
  76% { transform: none; }
}
@keyframes spill-open { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
@keyframes glow-up { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
@keyframes sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes sign-swing { 0% { transform: rotate(0); } 25% { transform: rotate(9deg); } 50% { transform: rotate(-6deg); } 75% { transform: rotate(3deg); } 100% { transform: rotate(0); } }
@keyframes ding { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-12deg); } 40% { transform: rotate(9deg); } 60% { transform: rotate(-5deg); } 80% { transform: rotate(2deg); } }
@keyframes chip-fall {
  0% { opacity: 0; transform: translate(0, 0); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc((var(--c) - 2) * 9px), 54px) rotate(160deg); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes hang-drop { 0% { opacity: 0; transform: translateY(-30px) rotate(-10deg); } 60% { opacity: 1; transform: translateY(0) rotate(5deg); } 100% { transform: rotate(0); } }

.motion .punch > span { animation: punch-in .6s var(--ease-out) both; animation-delay: calc(.08s * var(--i) + .1s); }
.motion .key-tag__card { animation: tag-swing 1.3s var(--ease-out) .65s both; }
.motion .hero__mark { animation: knock 1s ease-in-out .55s both; }
.motion .hero__spill { animation: spill-open 1.1s var(--ease-out) 1.55s both; }
.motion .hero__glow { animation: glow-up 1.2s var(--ease-out) 1.45s both; }
.motion .hang { animation: hang-drop 1s var(--ease-out) both, sway 5s ease-in-out 1.8s infinite; }
.motion .hang--a { animation-delay: .9s, 1.9s; }
.motion .hang--b { animation-delay: 1.1s, 2.6s; animation-duration: 1s, 6s; }
.motion .hang--c { animation-delay: 1.3s, 3.1s; animation-duration: 1s, 5.5s; }
.motion .hero__door:hover .hero__mark { transform: rotate(-2deg) scale(1.02); transition: transform .4s var(--ease-swing); }
.motion .hero__door:hover .hero__spill { filter: brightness(1.12); }
.motion .open-sign:hover .open-sign__face, .motion .open-sign:focus-visible .open-sign__face { animation: sign-swing .9s ease-out; }
.motion .bell:hover svg, .motion .bell.is-ringing svg { animation: ding .6s ease-out; transform-origin: 50% 90%; }
.motion .peg:hover .peg__key { animation: sway 1.4s ease-in-out infinite; }
.motion .hours:hover .hours__card { animation: sign-swing 1.2s ease-out; }

/* Scroll reveals: only things that JS will reveal start hidden. */
.motion .reveal { opacity: 0; transform: translateY(26px); }
.motion .reveal.is-seen { animation: rise .7s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 90ms); }

/* The duplicator runs on scroll, pinned in place. */
.motion .dup { height: 300vh; }
.motion .dup__stage {
  position: sticky; top: 0; height: 100vh; box-sizing: border-box;
  display: flex; align-items: center; padding: 16px 0;
}
.motion .dup__svg { max-height: calc(100vh - 60px); }
.motion .m-wheel.is-spinning { animation: spin .5s linear infinite; }
.motion .m-chips.is-cutting .m-chip { animation: chip-fall .7s ease-in infinite; animation-delay: calc(var(--c) * .13s); }
@media (max-width: 980px) {
  .motion .dup { height: 280vh; }
  .motion .dup__svg { max-height: 52vh; width: auto; max-width: 100%; justify-self: center; }
}

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

/* Say the magic words: the door knocks and opens again. */
@keyframes knock-again { 0%, 100% { transform: none; } 15% { transform: rotate(-3deg) scale(1.03); } 35% { transform: rotate(2deg) scale(1.03); } 55% { transform: none; } }
@keyframes spill-again { 0% { transform: scaleY(.2); opacity: .3; } 100% { transform: scaleY(1); opacity: 1; } }
.motion .hero__door.is-magic .hero__mark { animation: knock-again .9s ease-in-out both; }
.motion .hero__door.is-magic .hero__spill { animation: spill-again 1s var(--ease-out) .5s both; }

/* WayneUI's buttons live in a cascade layer, so the page's plain link colour
   would win over them. Put the button colours back. */
a.tag-btn, a.tag-btn:hover { color: #fff; text-decoration: none; }
a.tag-btn:hover { background: var(--green-deep); }
.hero__spill { background: linear-gradient(to bottom, rgba(255, 204, 51, .95), rgba(255, 204, 51, .05)); }

/* The cross-reference chart, folded for phones: one card per part. */
@media (max-width: 600px) {
  .xref__table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .xref__table tr { display: block; padding: 12px 14px; border-top: 1px solid rgba(49, 72, 66, .2); }
  .xref__table tbody tr:first-child { border-top: 0; }
  .xref__table td { display: block; border: 0; padding: 0; width: auto !important; }
  .xref__table td:first-child::after { content: none; }
  .xref__table td:nth-child(2) { margin-top: 6px; padding-left: 22px; position: relative; }
  .xref__table td:nth-child(2)::before { content: "↳"; position: absolute; left: 2px; color: var(--brass-dark); font-weight: 900; }
}

/* A door shuts faster than it swings open, so a new key never sees the old visitor. */
.lock:not(.is-open) .door__leaf { transition-duration: .3s; }

/* A part's mark and name are one link: the name's link stretches over its
   whole entry, so the mark is clickable too and the entry takes the focus
   ring. No underline on these; the mark brightens (and, with motion allowed,
   lifts) on hover instead. Prose links elsewhere keep their underline. */
li.ring__tag,
li.hand__stop { position: relative; }
li.ring__tag .part-link,
li.hand__stop .part-link { color: inherit; text-decoration: none; }
li.ring__tag .part-link::after,
li.hand__stop .part-link::after { content: ""; position: absolute; inset: 0; }
li.ring__tag .part-link:focus-visible,
li.hand__stop .part-link:focus-visible { outline: none; box-shadow: none; }
li.ring__tag:has(.part-link:focus-visible),
li.hand__stop:has(.part-link:focus-visible) { outline: 3px solid currentColor; outline-offset: -3px; }
li.ring__tag:has(.part-link:hover) img,
li.hand__stop:has(.part-link:hover) img { filter: brightness(1.12) saturate(1.1); }
@media (prefers-reduced-motion: no-preference) {
li.ring__tag img,
li.hand__stop img { transition: transform 160ms ease, filter 160ms ease; }
li.ring__tag:has(.part-link:hover) img,
li.hand__stop:has(.part-link:hover) img { transform: translateY(-2px); }
}
