:root {
  --ink: #171714;
  --paper: #f2efe7;
  --accent: #ff5c35;
  --acid: #c7f36b;
  --line: rgba(23, 23, 20, 0.22);
  --muted: #6f6d65;
  --max: 1440px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Manrope", sans-serif;
  overflow-x: hidden;
}

button, a { color: inherit; }
button { font: inherit; }
a { text-decoration: none; }

.site-header, footer {
  width: min(calc(100% - 64px), var(--max));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header {
  width: 100%;
  padding-inline: max(32px, calc((100vw - var(--max)) / 2));
  height: 92px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(242, 239, 231, .94);
  backdrop-filter: blur(14px);
}
section { scroll-margin-top: 92px; }

.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 700; letter-spacing: -0.04em; }
.brand-mark { display: flex; align-items: end; gap: 2px; width: 22px; height: 22px; }
.brand-mark i { display: block; background: currentColor; width: 6px; }
.brand-mark i:nth-child(1) { height: 12px; }
.brand-mark i:nth-child(2) { height: 22px; }
.brand-mark i:nth-child(3) { height: 17px; }

nav { display: flex; align-items: center; gap: 40px; font: 500 12px/1 "DM Mono", monospace; text-transform: uppercase; letter-spacing: .08em; }
nav a { position: relative; }
nav a::after { content: ""; position: absolute; left: 0; bottom: -7px; width: 0; height: 1px; background: currentColor; transition: width .25s; }
nav a:hover::after { width: 100%; }
.header-controls { display: flex; align-items: center; gap: 22px; }
.sound-toggle { border: 0; background: none; display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 8px 0; text-transform: uppercase; letter-spacing: .08em; }
.toggle-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(255,92,53,.13); }
.sound-toggle[aria-pressed="false"] .toggle-dot { background: var(--muted); box-shadow: none; }
.menu-toggle { display: none; width: 42px; height: 42px; padding: 10px; border: 1px solid var(--ink); background: transparent; place-content: center; gap: 5px; }
.menu-toggle span { display: block; width: 20px; height: 1.5px; background: currentColor; transition: transform .2s, opacity .2s; }
.site-header.menu-open .menu-toggle span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.site-header.menu-open .menu-toggle span:nth-child(2) { opacity: 0; }
.site-header.menu-open .menu-toggle span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.hero {
  width: min(calc(100% - 64px), var(--max));
  min-height: 710px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.03fr .97fr;
  border-bottom: 1px solid var(--line);
}

.hero-copy { display: flex; flex-direction: column; justify-content: center; padding: 80px 6vw 90px 0; }
.eyebrow { margin: 0 0 36px; color: var(--muted); font: 500 11px/1.3 "DM Mono", monospace; text-transform: uppercase; letter-spacing: .13em; }
.eyebrow span { color: var(--accent); margin-right: 17px; }
h1, h2 { margin: 0; font-weight: 500; letter-spacing: -.065em; line-height: .93; }
h1 { font-size: clamp(64px, 7.1vw, 118px); }
h1 em, h2 em { color: var(--accent); font-family: Georgia, serif; font-weight: 400; }
.hero-intro { max-width: 520px; margin: 42px 0 38px; font-size: 16px; line-height: 1.65; color: var(--muted); }
.text-link { width: fit-content; font: 500 12px/1 "DM Mono", monospace; text-transform: uppercase; letter-spacing: .08em; padding-bottom: 8px; border-bottom: 1px solid; }
.text-link span { display: inline-block; margin-left: 24px; transition: transform .2s; }
.text-link:hover span { transform: translateY(4px); }

.hero-art { position: relative; overflow: hidden; background: var(--accent); min-height: 610px; }
.orbit { position: absolute; border: 1px solid rgba(23,23,20,.23); border-radius: 50%; }
.orbit-one { width: 560px; height: 560px; left: 10%; top: 8%; }
.orbit-two { width: 760px; height: 760px; left: 34%; top: -14%; }
.hero-triangle {
  position: absolute; left: 12%; top: 13%; width: 0; height: 0;
  border-left: 120px solid transparent; border-right: 120px solid transparent; border-bottom: 208px solid var(--ink);
  transform: rotate(-14deg); animation: drift 8s ease-in-out infinite;
}
.hero-circle { position: absolute; width: 210px; height: 210px; border-radius: 50%; background: var(--paper); right: 8%; top: 38%; animation: drift 9s ease-in-out -2s infinite; }
.hero-circle::after { content: ""; position: absolute; left: 50%; top: 0; height: 100%; border-left: 2px solid var(--ink); }
.hero-square { position: absolute; left: 24%; bottom: 5%; width: 170px; height: 170px; border: 2px solid var(--ink); background: var(--acid); transform: rotate(9deg); animation: drift 10s ease-in-out -4s infinite; }
.hero-square::before, .hero-square::after { content: ""; position: absolute; background: var(--ink); }
.hero-square::before { left: 50%; top: 0; width: 2px; height: 100%; }
.hero-square::after { left: 0; top: 50%; height: 2px; width: 100%; }
.hero-caption { position: absolute; right: 30px; bottom: 28px; writing-mode: vertical-rl; font: 500 10px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .14em; }
@keyframes drift { 0%,100% { transform: translateY(0) rotate(var(--r, 0deg)); } 50% { transform: translateY(-16px) rotate(var(--r, 0deg)); } }
.hero-triangle { --r: -14deg; }
.hero-square { --r: 9deg; }

.manifesto { width: min(calc(100% - 64px), var(--max)); margin: 0 auto; padding: 130px 0; display: grid; grid-template-columns: .9fr 1.1fr; gap: 8vw; }
.manifesto h2, .section-heading h2 { font-size: clamp(52px, 6vw, 92px); }
.rules { border-top: 1px solid var(--ink); }
.rules article { display: grid; grid-template-columns: 50px 145px 1fr; gap: 20px; align-items: start; padding: 28px 0; border-bottom: 1px solid var(--line); }
.rule-number { font: 500 11px "DM Mono", monospace; color: var(--accent); }
.rules h3 { margin: 0; font-size: 14px; }
.rules p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

.keyboard-section { background: var(--ink); color: var(--paper); padding: 120px max(32px, calc((100vw - var(--max)) / 2)); }
.keyboard-heading, .examples-heading { display: grid; grid-template-columns: 1fr 360px; gap: 8vw; align-items: end; margin-bottom: 70px; }
.keyboard-heading h2, .examples-heading h2 { font-size: clamp(58px, 7vw, 104px); }
.keyboard-heading > p, .examples-heading > p { margin: 0; color: #aaa79e; font-size: 14px; line-height: 1.7; }
.keyboard-heading .eyebrow { color: #aaa79e; }

.composer { border: 1px solid rgba(242,239,231,.28); background: var(--paper); color: var(--ink); margin-bottom: 16px; }
.composer-toolbar { min-height: 48px; padding: 0 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; font: 500 10px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.composer-toolbar button { border: 0; background: none; color: var(--ink); cursor: pointer; font: inherit; text-transform: uppercase; letter-spacing: inherit; padding: 10px 0; }
.symbol-output { min-height: 142px; padding: 22px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 12px 9px; }
.output-placeholder { margin: auto 0; color: #77756f; font: 400 12px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .08em; }
.output-token { display: inline-grid; justify-items: center; gap: 4px; min-width: 42px; color: var(--ink); }
.output-token svg { width: 42px; height: 42px; }
.output-token .token-label { font: 500 9px "DM Mono", monospace; }
.output-space { width: 24px; height: 48px; }

.keyboard { display: grid; gap: 8px; user-select: none; }
.keyboard-row { display: grid; gap: 8px; }
.keyboard-row.numbers { grid-template-columns: repeat(10, 1fr) 2fr; }
.keyboard-row.qwerty-top { grid-template-columns: repeat(10, 1fr); }
.keyboard-row.qwerty-home { grid-template-columns: repeat(9, 1fr); margin-inline: 4.5%; }
.keyboard-row.qwerty-bottom { grid-template-columns: repeat(7, 1fr); margin-inline: 13.5%; }
.symbol-key { position: relative; height: 92px; border: 1px solid rgba(242,239,231,.28); background: var(--paper); color: var(--ink); cursor: pointer; display: grid; place-items: center; transition: background .16s, transform .08s; }
.symbol-key:hover, .symbol-key:focus-visible { background: var(--acid); outline: 1px solid var(--ink); outline-offset: -1px; }
.symbol-key:active { transform: translateY(2px); }
.symbol-key svg { width: 48px; height: 48px; }
.symbol-key .key-label { position: absolute; top: 9px; left: 10px; color: #aaa79e; font: 500 10px "DM Mono", monospace; text-transform: uppercase; }
.symbol-key.backspace { display: flex; gap: 10px; padding: 0 16px; font: 500 10px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .06em; }
.symbol-key.backspace .backspace-icon { font-size: 20px; }
.keyboard-row.space-row { grid-template-columns: 1fr; }
.symbol-key.spacebar { height: 58px; margin-inline: 25%; }
.space-mark { font-size: 24px; font-weight: 300; }
.keyboard .outline, .keyboard .split, .symbol-output .outline, .symbol-output .split { fill: none; stroke: currentColor; stroke-width: 2.25; vector-effect: non-scaling-stroke; }
.keyboard .filled, .keyboard .accent-fill, .symbol-output .filled, .symbol-output .accent-fill { fill: currentColor; }

.examples-section { padding: 125px max(32px, calc((100vw - var(--max)) / 2)); }
.examples-heading > p { color: var(--muted); }
.word-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.word-group { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 22px; min-width: 0; }
.word-group-header { min-height: 55px; display: flex; justify-content: space-between; align-items: start; gap: 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.word-category { color: var(--accent); font: 500 9px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .1em; }
.word-group h3 { margin: 0; font-size: 15px; text-transform: capitalize; }
.symbolic-word { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 58px; border-bottom: 1px solid rgba(23,23,20,.1); }
.symbolic-word:last-child { border-bottom: 0; }
.mini-glyphs { display: flex; align-items: center; gap: 2px; min-width: 0; }
.mini-glyphs svg { width: 25px; height: 25px; flex: 0 1 25px; }
.mini-glyphs .outline, .mini-glyphs .split { fill: none; stroke: currentColor; stroke-width: 2.25; vector-effect: non-scaling-stroke; }
.mini-glyphs .filled, .mini-glyphs .accent-fill { fill: currentColor; }
.word-label { font: 500 9px "DM Mono", monospace; text-transform: uppercase; color: var(--muted); letter-spacing: .04em; }
body.labels-off .key-label, body.labels-off .token-label, body.labels-off .word-label { visibility: hidden; }

.alphabet-section { background: #e6e2d8; padding: 118px max(32px, calc((100vw - var(--max)) / 2)); }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 70px; }
.section-heading .eyebrow { margin-bottom: 24px; }
.filter-group { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; max-width: 600px; }
.filter { border: 1px solid var(--line); border-radius: 999px; padding: 12px 17px; background: transparent; cursor: pointer; font: 500 10px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .07em; transition: .2s; }
.filter sup { color: var(--muted); margin-left: 4px; }
.filter:hover, .filter.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.alphabet-grid { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.glyph-card { min-height: 300px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: transparent; padding: 20px; cursor: pointer; display: grid; grid-template-rows: auto 1fr auto; text-align: left; transition: background .25s, color .25s; }
.glyph-card:hover, .glyph-card:focus-visible { background: var(--paper); color: var(--ink); outline: none; }
.glyph-card.hidden { display: none; }
.glyph-meta { display: flex; justify-content: space-between; font: 500 10px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.glyph-card:hover .glyph-meta { color: var(--muted); }
.glyph-stage { display: grid; place-items: center; padding: 26px; }
.glyph-stage svg { width: 128px; height: 128px; overflow: visible; transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.glyph-card:hover .glyph-stage svg { transform: scale(1.08); }
.glyph-stage .outline, .detail-glyph .outline { fill: none; stroke: currentColor; stroke-width: 2.25; vector-effect: non-scaling-stroke; }
.glyph-stage .filled, .detail-glyph .filled { fill: currentColor; }
.glyph-stage .accent-fill, .detail-glyph .accent-fill { fill: currentColor; }
.glyph-stage .split, .detail-glyph .split { stroke: currentColor; stroke-width: 2.25; vector-effect: non-scaling-stroke; }
.glyph-footer { display: flex; align-items: end; justify-content: space-between; }
.letter-label { font: 600 21px/1 "Manrope", sans-serif; }
.glyph-index { font: 400 10px "DM Mono", monospace; color: var(--muted); }
body.labels-off .letter-label,
body.labels-off .detail-letter,
body.labels-off .detail-copy h2 { visibility: hidden; }

.closing { min-height: 560px; background: var(--ink); color: var(--paper); text-align: center; display: grid; place-content: center; justify-items: center; gap: 44px; }
.closing > p { font-size: 23px; letter-spacing: .5em; margin: 0; color: var(--acid); }
.closing h2 { font-size: clamp(68px, 9vw, 140px); }
.text-link.light { color: var(--paper); }

footer { min-height: 130px; font: 500 10px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .08em; }
.footer-brand { font: 700 18px "Manrope", sans-serif; text-transform: none; letter-spacing: -.04em; }
footer p { margin: 0; color: var(--muted); }

.panel-scrim { position: fixed; inset: 0; background: rgba(23,23,20,.35); z-index: 19; opacity: 0; pointer-events: none; transition: opacity .3s; backdrop-filter: blur(2px); }
.detail-panel { position: fixed; z-index: 20; top: 0; right: 0; width: min(580px, 100%); height: 100dvh; padding: 44px; background: var(--acid); transform: translateX(102%); transition: transform .45s cubic-bezier(.75,0,.2,1); display: grid; grid-template-rows: auto 1fr auto; }
.detail-panel.open { transform: translateX(0); }
.detail-panel.open + .panel-scrim { opacity: 1; pointer-events: auto; }
.panel-close { position: absolute; right: 30px; top: 26px; border: 0; background: none; font-size: 35px; font-weight: 300; cursor: pointer; }
.detail-glyph { display: grid; place-items: center; }
.detail-glyph svg { width: min(330px, 65vw); height: min(330px, 65vw); overflow: visible; }
.detail-copy { border-top: 1px solid var(--ink); padding-top: 26px; display: grid; grid-template-columns: 110px 1fr; gap: 28px; }
.detail-letter { font-size: 76px; font-weight: 500; line-height: .8; letter-spacing: -.07em; }
.detail-copy h2 { font: 600 16px "Manrope", sans-serif; letter-spacing: -.02em; margin-bottom: 12px; }
.detail-copy p { margin: 0; font-size: 13px; line-height: 1.6; max-width: 320px; }

@media (max-width: 1100px) {
  .site-header { height: 72px; padding-inline: 18px; }
  section { scroll-margin-top: 72px; }
  .site-header nav {
    position: absolute;
    display: none;
    top: calc(100% + 1px);
    right: 14px;
    width: min(330px, calc(100vw - 28px));
    padding: 10px 16px;
    grid-template-columns: 1fr;
    gap: 0;
    border: 1px solid var(--ink);
    background: var(--paper);
    box-shadow: 8px 8px 0 var(--ink);
  }
  .site-header.menu-open nav { display: grid; }
  .site-header nav a { padding: 14px 2px; border-bottom: 1px solid var(--line); }
  .site-header nav a:last-child { border-bottom: 0; }
  .site-header nav a::after { display: none; }
  .menu-toggle { display: grid; }
}

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { min-height: 650px; }
  .hero-art { min-height: 620px; }
  .manifesto { grid-template-columns: 1fr; }
  .alphabet-grid { grid-template-columns: repeat(3, 1fr); }
  .section-heading { align-items: start; gap: 40px; }
  .word-grid { grid-template-columns: repeat(2, 1fr); }
  .symbol-key { height: 78px; }
  .symbol-key svg { width: 40px; height: 40px; }
}

@media (max-width: 680px) {
  .site-header, footer, .hero, .manifesto { width: min(calc(100% - 36px), var(--max)); }
  .site-header { width: 100%; }
  .header-controls { gap: 12px; }
  .sound-toggle { font-size: 9px; }
  h1 { font-size: clamp(52px, 16vw, 72px); }
  .hero-copy { min-height: 580px; padding-right: 0; }
  .hero-art { min-height: 480px; }
  .hero-triangle { transform: scale(.7) rotate(-14deg); left: 0; }
  .hero-circle { width: 150px; height: 150px; }
  .hero-square { width: 130px; height: 130px; }
  .manifesto { padding: 90px 0; }
  .keyboard-section, .examples-section { padding: 86px 18px; }
  .keyboard-heading, .examples-heading { grid-template-columns: 1fr; gap: 30px; margin-bottom: 45px; }
  .symbol-output { min-height: 116px; }
  .keyboard { gap: 5px; overflow-x: auto; padding-bottom: 8px; }
  .keyboard-row { gap: 5px; min-width: 650px; }
  .symbol-key { height: 66px; }
  .symbol-key svg { width: 34px; height: 34px; }
  .symbol-key .key-label { top: 6px; left: 7px; font-size: 8px; }
  .rules article { grid-template-columns: 34px 1fr; }
  .rules p { grid-column: 2; }
  .alphabet-section { padding: 86px 18px; }
  .section-heading { flex-direction: column; margin-bottom: 45px; }
  .filter-group { justify-content: flex-start; }
  .alphabet-grid { grid-template-columns: repeat(2, 1fr); }
  .word-grid { grid-template-columns: 1fr; }
  .glyph-card { min-height: 240px; padding: 15px; }
  .glyph-stage { padding: 20px 10px; }
  .glyph-stage svg { width: 100px; height: 100px; }
  .detail-panel { padding: 32px 24px; }
  .detail-copy { grid-template-columns: 70px 1fr; }
  .detail-letter { font-size: 58px; }
  footer { flex-direction: column; justify-content: center; gap: 14px; }
}

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