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

:root {
  --bg: #f8f9ff;
  --surface-low: #eff4ff;
  --surface-mid: #e6eeff;
  --surface-lowest: #ffffff;
  --surface-highest: #d3e4ff;
  --primary: #555f6f;
  --on-primary: #f6f7ff;
  --on-surface: #0c335a;
  --on-surface-muted: #40618a;
  --outline: #5c7da8;
  --outline-variant: #94b4e2;
  --primary-fixed: #d9e3f6;
}

html { scroll-behavior: smooth; font-size: 18px; }

body {
  background: var(--bg);
  color: var(--on-surface);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.65;
  text-align: justify;
  hyphens: auto;
}

a {
  color: var(--on-surface);
  text-decoration: none;
  border-bottom: 1px solid var(--outline-variant);
  transition: opacity 0.1s ease-in-out;
}
a:hover { opacity: 0.6; }

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 2rem;
  background: rgba(248, 249, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--surface-low);
  position: sticky;
  top: 0;
  z-index: 10;
}

.nav-mark {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--primary);
  border-bottom: none;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.nav-mark:hover { opacity: 0.7; border-bottom: none; }
.nav-mark .hex { font-size: 1.1rem; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-family: 'Space Grotesk', monospace;
  font-size: 0.825rem;
}

.nav-right a { color: var(--on-surface-muted); border-bottom: none; }
.nav-right a:hover { color: var(--on-surface); opacity: 1; }

.nav-version {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.72rem;
  color: var(--on-surface-muted);
  background: var(--surface-highest);
  padding: 0.2rem 0.6rem;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 2rem;
}

#hero { padding: 5rem 0 4rem; }

.hero-hex {
  font-size: 3rem;
  line-height: 1;
  display: inline-block;
}

h1 {
  font-family: 'Inter', sans-serif;
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--on-surface);
  display: inline;
}

#hero .hero-title {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  margin-bottom: 1.25rem;
}

.hero-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0;
  margin-top: 1.25rem;
}

.hero-nav a {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--on-surface-muted);
  border-bottom: none;
  padding: 0 0.1rem;
  transition: color 0.1s ease-in-out;
}

.hero-nav a:hover { color: var(--on-surface); opacity: 1; }

.hero-nav-break { display: none; }

.hero-nav-sep {
  color: var(--outline-variant);
  padding: 0 0.5rem;
  user-select: none;
  font-size: 0.75rem;
}

.doc-section { padding: 3.5rem 0; }

nav, h1, h2, h4, summary, .hero-nav, .example-hed, .ptag, .ltag, pre, code { text-align: left; }

h2 {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 1.75rem;
}

h4 {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--on-surface);
}

p { margin-bottom: 0.8rem; font-size: 1rem; }
p:last-child { margin-bottom: 0; }

blockquote {
  border-left: 2px solid var(--primary-fixed);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  color: var(--on-surface-muted);
  background: var(--surface-low);
}

code {
  font-family: 'Space Grotesk', ui-monospace, monospace;
  font-size: 0.83em;
  background: var(--surface-highest);
  padding: 0.15em 0.4em;
  color: var(--on-surface);
}

pre {
  background: var(--on-surface);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1rem 0;
  font-family: 'Space Grotesk', ui-monospace, monospace;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--primary-fixed);
}

pre code { background: none; padding: 0; font-size: inherit; color: inherit; }

.level-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: rgba(148, 180, 226, 0.2);
  list-style: none;
  margin: 1rem 0;
}

.level-list li {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem;
  background: var(--surface-lowest);
  font-size: 0.9rem;
  line-height: 1.55;
}

.ltag {
  font-family: 'Space Grotesk', ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  white-space: nowrap;
  display: inline-flex;
  align-self: flex-start;
}

.ltag-none    { background: #dcfce7; color: #15803d; }
.ltag-hint    { background: #ecfccb; color: #4d7c0f; }
.ltag-assist  { background: #fef9c3; color: #a16207; }
.ltag-pair    { background: #ffedd5; color: #c2410c; }
.ltag-copilot { background: #fee2e2; color: #b91c1c; }
.ltag-auto    { background: #ede9fe; color: #7c3aed; }

.level-desc { color: var(--on-surface-muted); }

.proc-list {
  list-style: none;
  margin: 1rem 0;
}

.proc-list li {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1.5rem;
  align-items: center;
  padding: 1rem 1.25rem;
  background: var(--surface-low);
  margin-bottom: 2px;
  font-size: 0.95rem;
  transition: background 0.1s ease;
}

.proc-list li:hover { background: var(--surface-mid); }

.ptag {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--outline-variant);
}

.proc-desc { color: var(--on-surface-muted); font-size: 0.875rem; }

.example-group { margin-top: 1.75rem; }
.example-group + .example-group { margin-top: 2rem; }

.example-hed {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--on-surface-muted);
  margin-bottom: 0.5rem;
}

.badge-list { list-style: none; margin: 1rem 0; }

.badge-list li {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.75rem 1rem;
  margin-bottom: 2px;
  background: var(--surface-lowest);
}

.badge-list img { height: 20px; flex-shrink: 0; }

.copy-btn {
  margin-left: auto;
  font-family: 'Space Grotesk', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--on-primary);
  background: var(--primary);
  border: none;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
  transition: opacity 0.1s ease-in-out;
  flex-shrink: 0;
}

.copy-btn:hover { opacity: 0.7; }
.copy-btn.copied { background: #15803d; }

details {
  border-left: 2px solid var(--primary-fixed);
  background: var(--surface-lowest);
  margin-bottom: 2px;
  padding: 0 1.5rem;
}

summary {
  padding: 1rem 0;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  color: var(--on-surface);
}

summary::-webkit-details-marker { display: none; }
summary::after { content: '−'; font-size: 1rem; color: var(--outline-variant); font-weight: 300; }
details:not([open]) summary::after { content: '+'; }

.faq-answer {
  padding-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--on-surface-muted);
  line-height: 1.75;
}

.faq-answer a { color: var(--outline); border-bottom: 1px solid var(--outline-variant); }
.faq-answer a:hover { opacity: 0.7; }

footer {
  background: var(--surface-low);
  margin-top: 3rem;
}

.footer-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 2rem;
  text-align: center;
}

.footer-sep {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.72rem;
  color: var(--outline-variant);
}

footer p {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-surface-muted);
  margin: 0;
}

footer a { color: var(--on-surface-muted); border-bottom: none; }
footer a:hover { color: var(--on-surface); opacity: 1; }

@media (max-width: 600px) {
  h1, .hero-hex { font-size: 2rem; }
  nav { padding: 1rem 1.25rem; }
  .wrap { padding: 0 1.25rem; }
  .nav-right .nav-version { display: none; }
  .level-list { grid-template-columns: 1fr; }
  .proc-list { display: grid; grid-template-columns: 1fr; gap: 2px; background: rgba(148, 180, 226, 0.2); }
  .proc-list li { display: flex; flex-direction: column; gap: 0.75rem; padding: 1.5rem; margin-bottom: 0; background: var(--surface-low); align-items: flex-start; }
  .hero-nav-break { display: block; flex-basis: 100%; height: 0; }
  .hero-nav-break + .hero-nav-sep { display: none; }
  .footer-inner { padding: 2rem 1.25rem; }
  .footer-sep { display: none; }
  .footer-item { display: block; margin-top: 0.35rem; }
}
