@import url("/fonts/montserrat.css?v=20260724-all1");

:root {
  color-scheme: dark;
  --bg: #071018;
  --surface: #0d1822;
  --surface-2: #111f2b;
  --line: rgba(210, 229, 240, .16);
  --ink: #f4f7f5;
  --muted: #9aaab5;
  --r: #db00cc;
  --c: #5ee0d8;
  --d: #ffff00;
  --danger: #ff6a70;
  --good: #68e89c;
  --orange: #ff9b4a;
  --font-brand: "Montserrat", sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  font-family: "Montserrat", sans-serif;
  background:
    radial-gradient(circle at 12% 7%, rgba(94, 224, 216, .11), transparent 28rem),
    radial-gradient(circle at 88% 19%, rgba(219, 0, 204, .09), transparent 30rem),
    linear-gradient(180deg, #071018 0%, #09131c 55%, #060d13 100%);
}

code,
.token-glyphs {
  font-family: "Montserrat", sans-serif;
}

a { color: inherit; }

.proposal-topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 74px;
  padding: 12px max(22px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 24, .88);
  backdrop-filter: blur(18px);
}

.proposal-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.proposal-brand img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
}

.proposal-brand span {
  display: grid;
  gap: 1px;
}

.proposal-brand small,
.proposal-brand strong {
  line-height: 1.15;
}

.proposal-brand small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.proposal-brand strong { font-size: 17px; }

.proposal-badge {
  border: 1px solid rgba(94, 224, 216, .36);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--c);
  font: 800 11px/1 "Montserrat", sans-serif;
  letter-spacing: .08em;
}

main,
footer {
  width: min(1240px, calc(100% - 44px));
  margin-inline: auto;
}

.proposal-hero {
  padding: clamp(64px, 9vw, 118px) 0 clamp(54px, 8vw, 96px);
  border-bottom: 1px solid var(--line);
}

.rfc-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  max-width: 930px;
  margin-top: 30px;
  border: 1px solid rgba(94, 224, 216, .28);
  padding: 15px 17px;
  background: rgba(94, 224, 216, .045);
}

.rfc-note > strong {
  padding-top: 3px;
  color: var(--c);
  font: 800 10px/1.2 "Montserrat", sans-serif;
  letter-spacing: .1em;
  white-space: nowrap;
}

.rfc-note p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.rfc-note code { color: var(--ink); }

.eyebrow,
.step-number {
  margin: 0 0 14px;
  color: var(--c);
  font: 800 12px/1.2 "Montserrat", sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1,
h2,
p { margin-top: 0; }

h1 {
  max-width: 850px;
  margin-bottom: 0;
  font-family: var(--font-brand);
  font-size: clamp(2.5rem, 4.5vw, 3.5rem);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.1;
  background: linear-gradient(90deg, var(--r), var(--c));
  background-clip: text;
  color: transparent;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h1 em {
  font-style: italic;
}

.hero-copy {
  max-width: 750px;
  margin-bottom: 34px;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.55;
}

.hero-rule {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  max-width: 880px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .025);
}

.hero-rule span {
  display: grid;
  gap: 9px;
  padding: 18px 20px;
}

.hero-rule code {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: clamp(15px, 2vw, 20px);
}

.hero-rule b {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.hero-rule i {
  display: grid;
  place-items: center;
  padding: 14px;
  border-inline: 1px solid var(--line);
  color: var(--orange);
  font: 900 12px/1 "Montserrat", sans-serif;
  text-transform: uppercase;
}

.diagram-section {
  padding: clamp(52px, 7vw, 88px) 0;
  border-bottom: 1px solid var(--line);
}

.face-section,
.token-section {
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(460px, 1.2fr);
  align-items: center;
  gap: clamp(36px, 7vw, 92px);
}

h2 {
  margin-bottom: 18px;
  font-family: var(--font-brand);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.1;
  background: linear-gradient(90deg, var(--r), var(--c));
  background-clip: text;
  color: transparent;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-copy > p:not(.step-number),
.move-intro > p:not(.step-number) {
  max-width: 680px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.face-figure {
  margin: 0;
  padding: clamp(18px, 3vw, 34px);
  border: 1px solid var(--line);
  background:
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px),
    var(--surface);
  background-size: 28px 28px;
}

.net-stage svg {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, .3));
}

.face-figure figcaption {
  max-width: 590px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.state-example {
  display: grid;
  gap: 9px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.state-example > span {
  color: var(--c);
  font: 800 10px/1.2 "Montserrat", sans-serif;
  letter-spacing: .1em;
}

.state-example code {
  display: block;
  border: 1px solid var(--line);
  padding: 13px 14px;
  background: rgba(7, 16, 24, .78);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.65;
  overflow-wrap: normal;
  white-space: normal;
  word-break: normal;
  user-select: all;
}

.face-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 25px 0;
}

.face-legend span {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  border: 1px solid var(--line);
  padding: 7px 10px;
  color: var(--muted);
  font-size: 13px;
}

.face-legend b {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: #25323d;
  color: var(--ink);
  font: 900 12px/1 "Montserrat", sans-serif;
}

.face-reading-rule {
  display: grid;
  gap: 10px;
  margin: 0 0 20px;
  border: 1px solid rgba(94, 224, 216, .3);
  padding: 15px;
  background: rgba(94, 224, 216, .045);
}

.face-reading-rule > span {
  color: var(--c);
  font: 900 10px/1 "Montserrat", sans-serif;
  letter-spacing: .1em;
}

.face-reading-rule p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.face-reading-rule strong { color: var(--ink); }

.face-reading-order {
  display: grid;
  gap: 4px;
  width: max-content;
  border-left: 3px solid var(--c);
  padding: 7px 12px;
  background: rgba(7, 16, 24, .72);
}

.face-reading-order code {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .05em;
}

.notation-note {
  border-left: 3px solid var(--c);
  padding-left: 13px;
  font-size: 13px !important;
}

.notation-note code { color: var(--ink); }

.move-intro {
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(360px, 1.2fr);
  column-gap: clamp(36px, 7vw, 92px);
  align-items: end;
  margin-bottom: 35px;
}

.move-intro .step-number { grid-column: 1 / -1; }
.move-intro h2 { margin-bottom: 0; }
.move-intro p:last-child { margin-bottom: 0; }

.family-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.family-card {
  --family: var(--ink);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), transparent 34%), var(--surface);
}

.family-r { --family: var(--r); }
.family-c { --family: var(--c); }
.family-d { --family: var(--d); }

.family-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--family);
  content: "";
}

.family-card > header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 70px;
  padding: 13px 15px 12px 18px;
  border-bottom: 1px solid var(--line);
}

.family-letter {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid color-mix(in srgb, var(--family) 75%, transparent);
  color: var(--family);
  font: 900 23px/1 "Montserrat", sans-serif;
}

.family-card header > span:nth-child(2) { display: grid; gap: 2px; }
.family-card header strong { font-size: 13px; letter-spacing: .07em; }
.family-card header small { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.family-card header code { color: var(--family); font-size: 12px; }

.cube-diagram {
  position: relative;
  min-height: 276px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(rgba(255, 255, 255, .022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .022) 1px, transparent 1px),
    #071018;
  background-size: 26px 26px;
}

.cube-diagram-stage {
  position: absolute;
  inset: 0;
}

.cube-diagram-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.index-guide {
  position: absolute;
  z-index: 2;
  color: var(--muted);
  font: 800 10px/1 "Montserrat", sans-serif;
}

.index-guide span {
  display: grid;
  place-items: center;
  min-width: 28px;
  min-height: 24px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(7, 16, 24, .78);
  transition: color .16s ease, border-color .16s ease, background-color .16s ease;
}

.family-card[data-selected-index="1"] .index-guide span:nth-of-type(1),
.family-card[data-selected-index="2"] .index-guide span:nth-of-type(2),
.family-card[data-selected-index="3"] .index-guide span:nth-of-type(3) {
  border-color: var(--family);
  background: color-mix(in srgb, var(--family) 16%, rgba(7, 16, 24, .9));
  color: var(--family);
}

.guide-r {
  left: 12px;
  top: 52px;
  display: grid;
  gap: 15px;
}

.guide-c {
  left: 50%;
  bottom: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  translate: -50% 0;
}

.guide-d {
  top: 12px;
  right: 12px;
  left: 12px;
  display: grid;
  grid-template-columns: auto repeat(3, minmax(28px, 1fr)) auto;
  align-items: center;
  justify-items: center;
  gap: 6px;
}

.guide-d::before {
  position: absolute;
  z-index: -1;
  top: 50%;
  right: 38px;
  left: 42px;
  height: 1px;
  background: linear-gradient(90deg, var(--family), rgba(255, 255, 255, .18));
  content: "";
}

.guide-d b {
  color: var(--ink);
  font-size: 8px;
  letter-spacing: .08em;
}

.family-route {
  margin: 16px 17px 8px !important;
  color: var(--family) !important;
  font: 900 14px/1.2 "Montserrat", sans-serif;
  letter-spacing: .06em;
}

.family-card > p:not(.family-route):not(.family-direction) {
  flex: 1;
  margin: 0 17px 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.family-card p strong { color: var(--ink); }

.family-direction {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 17px 12px;
  border: 1px solid color-mix(in srgb, var(--family) 28%, var(--line));
  padding: 8px 10px;
  background: color-mix(in srgb, var(--family) 7%, transparent);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.family-direction code,
.family-direction span {
  color: var(--family);
  font-weight: 900;
}

.family-direction strong { color: var(--ink); }
.family-direction span { margin-left: auto; font-size: 16px; }

.tape-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  padding: 0 17px 17px;
}

.tape-selector button {
  min-height: 38px;
  border: 1px solid color-mix(in srgb, var(--family) 35%, var(--line));
  border-radius: 0;
  background: color-mix(in srgb, var(--family) 8%, transparent);
  color: var(--ink);
  font: 800 11px/1 "Montserrat", sans-serif;
  cursor: pointer;
}

.tape-selector button:hover,
.tape-selector button:focus-visible,
.tape-selector button[aria-pressed="true"] {
  border-color: var(--family);
  outline: none;
}

.tape-selector button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--family) 18%, transparent);
  color: var(--family);
}

.cube-unavailable .cube-diagram-stage {
  display: grid;
  place-items: center;
  color: var(--danger);
  font-size: 12px;
}

.direction-rule {
  margin: 20px 0 0;
  border: 1px solid var(--line);
  padding: 15px 17px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.direction-rule strong { color: var(--ink); }
.direction-rule code { color: var(--orange); }

.token-anatomy {
  border: 1px solid var(--line);
  padding: clamp(22px, 4vw, 42px);
  background: var(--surface-2);
}

.token-glyphs,
.token-labels {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.token-glyphs span {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 104px;
  border: 1px solid var(--line);
  border-right: 0;
  background: #071018;
  font-size: clamp(43px, 7vw, 76px);
  font-weight: 900;
}

.token-glyphs span:last-child { border-right: 1px solid var(--line); }
.token-glyphs .part-family { color: var(--r); }

.token-labels span {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
  text-align: center;
}

.token-labels b {
  color: var(--ink);
  font: 800 10px/1 "Montserrat", sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.token-reading {
  margin: 22px 0 0;
  color: var(--muted);
  text-align: center;
}

.token-reading strong { color: var(--ink); }

.live-example-section {
  display: grid;
  grid-template-columns: minmax(280px, .72fr) minmax(620px, 1.28fr);
  align-items: center;
  gap: clamp(36px, 6vw, 74px);
}

.live-example-copy > p:not(.step-number) {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.worked-moves {
  display: grid;
  gap: 8px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

.worked-moves li {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .025);
}

.worked-moves code {
  display: grid;
  place-items: center;
  align-self: stretch;
  border-right: 1px solid var(--line);
  color: var(--c);
  font-size: 12px;
  font-weight: 900;
}

.worked-moves span {
  padding: 8px 11px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.live-replay-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  border: 1px solid var(--c);
  padding: 10px 15px;
  background: rgba(94, 224, 216, .1);
  color: var(--ink);
  font-family: var(--font-brand);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.live-replay-link span {
  color: var(--c);
  font-size: 17px;
}

.live-replay-link:hover,
.live-replay-link:focus-visible {
  background: rgba(94, 224, 216, .18);
  outline: 2px solid rgba(94, 224, 216, .24);
  outline-offset: 3px;
}

.worked-transition {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.worked-state {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  padding: 14px;
  background:
    linear-gradient(rgba(255, 255, 255, .02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .02) 1px, transparent 1px),
    var(--surface);
  background-size: 22px 22px;
}

.worked-state-after { border-color: rgba(94, 224, 216, .36); }

.worked-state-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
}

.worked-state-head span {
  color: var(--c);
  font: 800 10px/1 "Montserrat", sans-serif;
  letter-spacing: .1em;
}

.worked-state-head b {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.worked-net svg {
  display: block;
  width: 100%;
  height: auto;
}

.worked-algorithm {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.worked-algorithm > span {
  display: grid;
  gap: 5px;
}

.worked-algorithm code {
  border: 1px solid var(--line);
  padding: 5px 7px;
  background: var(--bg);
  color: var(--ink);
  font-size: 10px;
  font-weight: 900;
}

.worked-algorithm b {
  color: var(--c);
  font-size: 30px;
}

.contrast-summary {
  padding-top: clamp(52px, 7vw, 88px);
}

.contrast-summary .hero-copy {
  margin-bottom: 26px;
}

.final-contrast {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 28px 0 clamp(52px, 7vw, 88px);
  border: 1px solid var(--line);
  background: var(--line);
}

.final-contrast > div {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 10px 18px;
  padding: clamp(22px, 4vw, 42px);
  background: var(--surface);
}

.final-contrast span {
  align-self: end;
  font: 900 10px/1 "Montserrat", sans-serif;
  letter-spacing: .1em;
}

.invalid-example span { color: var(--danger); }
.valid-example span { color: var(--good); }

.final-contrast code {
  grid-row: 1 / 3;
  align-self: center;
  font-size: clamp(34px, 5vw, 64px);
  font-weight: 900;
}

.invalid-example code { color: var(--danger); text-decoration: line-through; text-decoration-thickness: 2px; }
.valid-example code { color: var(--good); }

.final-contrast p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.final-contrast p b { color: var(--ink); }

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 25px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

footer p { margin: 0; }
footer a { color: var(--c); font-weight: 800; text-decoration: none; }

.notation-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 18px;
}

.notation-footer-links a,
.notation-footer-links .cookie-manage-btn {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--c);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.notation-footer-links a:hover,
.notation-footer-links a:focus-visible,
.notation-footer-links .cookie-manage-btn:hover,
.notation-footer-links .cookie-manage-btn:focus-visible {
  color: var(--ink);
  text-decoration: underline;
  outline: none;
}

@media (max-width: 960px) {
  .face-section,
  .token-section,
  .live-example-section { grid-template-columns: 1fr; }
  .move-intro { grid-template-columns: 1fr; align-items: start; }
  .move-intro h2 { margin-bottom: 18px; }
  .family-grid { grid-template-columns: 1fr; }
  .family-card { display: grid; grid-template-columns: minmax(280px, .9fr) minmax(270px, 1.1fr); }
  .family-card > header { grid-column: 1 / -1; }
  .cube-diagram { grid-row: 2 / 6; min-height: 330px; }
  .family-route { margin-top: 24px !important; }
  .tape-selector { align-self: end; }
  .worked-transition { max-width: 760px; }
}

@media (max-width: 680px) {
  main,
  footer { width: min(100% - 28px, 1240px); }
  .proposal-topbar { min-height: 66px; padding: 10px 14px; }
  .proposal-brand img { width: 36px; height: 36px; }
  .proposal-badge { padding: 6px 8px; font-size: 9px; }
  .proposal-hero { padding-top: 54px; }
  h1 { font-size: 2rem; }
  .rfc-note { grid-template-columns: 1fr; gap: 8px; }
  .hero-rule { grid-template-columns: 1fr; }
  .hero-rule i { border: 0; border-block: 1px solid var(--line); }
  .face-legend { grid-template-columns: 1fr 1fr; }
  .family-card { display: flex; }
  .cube-diagram { min-height: 300px; }
  .token-glyphs span { min-height: 76px; font-size: 42px; }
  .token-labels span { font-size: 9px; }
  .token-labels b { font-size: 8px; }
  .worked-transition { grid-template-columns: 1fr; }
  .worked-algorithm { grid-template-columns: 1fr auto; justify-content: center; }
  .worked-algorithm > span { grid-template-columns: repeat(3, auto); }
  .worked-algorithm b { rotate: 90deg; }
  .final-contrast { grid-template-columns: 1fr; }
  footer { flex-direction: column; }
  .notation-footer-links { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
