:root {
  --ink: #0a0a0b;
  --paper: #f4f1eb;
  --whisper: #c8a55a;
  --whisper-dim: #c8a55a33;
  --whisper-glow: #c8a55a18;
  --smoke: #8a8680;
  --charcoal: #141311;
  --border-subtle: #f4f1eb08;
  --border-light: #f4f1eb0a;
  --border-dashed: #f4f1eb15;
  --msg-bg: #1e1d1a;
  --card-hover: #1a1815;
  --nav-bg: #0a0a0bcc;

  /* Status colors */
  --red: #cc7a7a;
  --red-dim: #c45a5a44;
  --green: #7acc8a;
  --green-dim: #5ac86a44;

  /* Z-index scale */
  --z-grain: 1000;
  --z-nav: 100;
}

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

/* --- SKIP LINK (Accessibility) --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--whisper);
  color: var(--ink);
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  z-index: 9999;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 1rem;
}

html {
  scroll-behavior: smooth;
  background: var(--ink);
}

body {
  font-family: 'Instrument Sans', sans-serif;
  background: var(--ink);
  color: var(--paper);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* --- GRAIN OVERLAY --- */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: var(--z-grain);
}

/* --- NAV --- */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-nav);
  padding: 1.5rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(20px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-logo {
  font-family: 'DM Serif Display', serif;
  font-size: 1.25rem;
  color: var(--paper);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-logo span {
  color: var(--whisper);
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.nav-links a {
  color: var(--smoke);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.3s;
}

.nav-links a:hover { color: var(--paper); }
.nav-links a.active { color: var(--whisper); }

.btn-install {
  background: var(--whisper);
  color: var(--ink);
  padding: 0.6rem 1.5rem;
  border-radius: 2px;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.3s;
}

.btn-install:hover {
  background: var(--paper);
  box-shadow: 0 0 30px var(--whisper-dim);
}

/* --- HERO --- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 8rem 2rem 4rem;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--whisper-glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--whisper);
  margin-bottom: 2.5rem;
  padding: 0.5rem 1.2rem;
  border: 1px solid var(--whisper-dim);
  display: inline-block;
  animation: fadeSlideIn 1s ease-out 0.2s both;
}

.hero h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(3.5rem, 9vw, 8rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  animation: fadeSlideIn 1s ease-out 0.4s both;
}

.hero h1 .line2 {
  display: block;
  font-style: italic;
  color: var(--whisper);
}

/* --- REDACTION EFFECT --- */
.redact-on-scroll {
  position: relative;
  display: inline-block;
}

.redact-on-scroll::after {
  content: '';
  position: absolute;
  top: 0.1em;
  left: -0.05em;
  right: -0.05em;
  bottom: 0;
  background: rgba(244, 241, 235, 0.85);
  transform: scaleX(0);
  transform-origin: left;
}

.redact-on-scroll.redacted-active::after {
  animation: redact 0.4s ease-out forwards;
}

@keyframes redact {
  0% { transform: scaleX(0); }
  100% { transform: scaleX(1); }
}

.hero-sub {
  font-size: 1.2rem;
  color: var(--smoke);
  max-width: 520px;
  line-height: 1.7;
  margin: 1.5rem auto 3rem;
  animation: fadeSlideIn 1s ease-out 0.6s both;
}

.hero-cta {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  animation: fadeSlideIn 1s ease-out 0.8s both;
}

.btn-primary {
  background: var(--whisper);
  color: var(--ink);
  padding: 1rem 2.5rem;
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.btn-primary:hover {
  background: var(--paper);
  box-shadow: 0 4px 40px var(--whisper-dim);
  transform: translateY(-1px);
}

.btn-secondary {
  color: var(--smoke);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 1rem 0;
  border-bottom: 1px solid var(--smoke);
  transition: all 0.3s;
}

.btn-secondary:hover {
  color: var(--paper);
  border-color: var(--paper);
}

.hero-scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  animation: fadeSlideIn 1s ease-out 1.2s both, float 3s ease-in-out infinite 2s;
}

.hero-scroll svg {
  width: 20px;
  stroke: var(--smoke);
  opacity: 0.5;
}

/* --- DEMO SECTION --- */
.demo-section {
  padding: 6rem 2rem;
  display: flex;
  justify-content: center;
}

.demo-container {
  max-width: 700px;
  width: 100%;
}

.demo-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--smoke);
  margin-bottom: 1.5rem;
}

.chat-window {
  background: var(--charcoal);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  overflow: hidden;
}

.chat-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--whisper-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--whisper);
}

.chat-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.chat-status {
  font-size: 0.7rem;
  color: var(--whisper);
  font-family: 'JetBrains Mono', monospace;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.chat-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--whisper);
}

.chat-messages {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 280px;
}

.msg {
  max-width: 80%;
  padding: 0.8rem 1.1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  line-height: 1.5;
  position: relative;
}

.msg-sent {
  align-self: flex-end;
  background: var(--whisper);
  color: var(--ink);
}

.msg-received {
  align-self: flex-start;
  background: var(--msg-bg);
  color: var(--paper);
}

.msg-time {
  font-size: 0.6rem;
  opacity: 0.5;
  margin-top: 0.3rem;
  font-family: 'JetBrains Mono', monospace;
}

.msg-lock {
  display: inline;
  font-size: 0.65rem;
  margin-left: 0.3rem;
}

.msg-encrypted {
  align-self: flex-start;
  background: var(--msg-bg);
  color: var(--smoke);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  border: 1px dashed var(--border-dashed);
  word-break: break-all;
  line-height: 1.7;
}

.msg-encrypted .msg-prefix {
  color: var(--whisper);
  font-weight: 500;
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.75rem;
}

/* --- PRINCIPLES SECTION --- */
.principles {
  padding: 8rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--whisper);
  margin-bottom: 3rem;
}

.principles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

.principle-card {
  background: var(--charcoal);
  padding: 2.5rem;
  border: 1px solid var(--border-subtle);
  transition: all 0.4s;
  position: relative;
  overflow: hidden;
}

.principle-card:hover {
  border-color: var(--whisper-dim);
  background: var(--card-hover);
}

.principle-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--whisper);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s;
}

.principle-card:hover::before {
  transform: scaleX(1);
}

.principle-number {
  font-family: 'DM Serif Display', serif;
  font-size: 2.5rem;
  color: var(--whisper);
  opacity: 0.3;
  margin-bottom: 1rem;
}

.principle-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.35rem;
  margin-bottom: 0.8rem;
  letter-spacing: -0.01em;
}

.principle-text {
  font-size: 0.88rem;
  color: var(--smoke);
  line-height: 1.7;
}

/* --- HOW IT WORKS --- */
.how-it-works {
  padding: 8rem 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.hiw-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  list-style: none;
}

.hiw-step {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 2rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--border-subtle);
  align-items: start;
}

.hiw-step:last-child {
  border-bottom: 1px solid var(--border-subtle);
}

.hiw-num {
  font-family: 'DM Serif Display', serif;
  font-size: 3rem;
  color: var(--whisper);
  opacity: 0.4;
  line-height: 1;
}

.hiw-content h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.3rem;
  margin-bottom: 0.6rem;
}

.hiw-content p {
  font-size: 0.9rem;
  color: var(--smoke);
  line-height: 1.7;
}

.hiw-content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  background: var(--charcoal);
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
  color: var(--whisper);
}

/* --- PROTOCOL --- */
.protocol {
  padding: 6rem 2rem 8rem;
  max-width: 800px;
  margin: 0 auto;
}

.protocol-box {
  background: var(--charcoal);
  border: 1px solid var(--border-subtle);
  padding: 3rem;
  position: relative;
}

.protocol-box::before {
  content: '"';
  font-family: 'DM Serif Display', serif;
  font-size: 8rem;
  color: var(--whisper);
  opacity: 0.1;
  position: absolute;
  top: -1rem;
  left: 1.5rem;
  line-height: 1;
}

.protocol-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.5rem;
  margin-bottom: 2rem;
}

.protocol-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
}

.proto-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #0a0a0b;
  border-left: 2px solid var(--whisper-dim);
}

.proto-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--smoke);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
}

.proto-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--whisper);
  margin: 0;
}

/* --- DENIABILITY --- */
.deniability {
  padding: 8rem 2rem;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.deniability h2 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.deniability h2 em {
  color: var(--whisper);
  font-style: italic;
}

.deniability-text {
  font-size: 1.05rem;
  color: var(--smoke);
  line-height: 1.8;
  max-width: 600px;
  margin: 0 auto 3rem;
}

.redacted-demo {
  display: inline-flex;
  flex-direction: column;
  gap: 0.6rem;
  text-align: left;
  padding: 2rem 2.5rem;
  background: var(--charcoal);
  border: 1px solid var(--border-subtle);
}

.redacted-line {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--paper);
  line-height: 1.6;
}

.redacted {
  background: var(--paper);
  color: var(--paper);
  padding: 0.1em 0.3em;
  border-radius: 1px;
  transition: all 0.5s;
  cursor: pointer;
  user-select: none;
}

.redacted:hover,
.redacted:focus {
  background: var(--whisper);
  color: var(--ink);
  outline: none;
}

.redacted-hint {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  color: var(--smoke);
  opacity: 0.5;
  text-align: center;
  margin-top: 0.5rem;
}

/* --- CTA --- */
.final-cta {
  padding: 8rem 2rem 10rem;
  text-align: center;
  position: relative;
}

.final-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 80px;
  background: linear-gradient(to bottom, transparent, var(--whisper-dim));
}

.final-cta h2 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.final-cta h2 span {
  color: var(--whisper);
  font-style: italic;
}

.final-sub {
  color: var(--smoke);
  font-size: 1rem;
  margin-bottom: 3rem;
}

.final-cta .btn-primary {
  font-size: 0.95rem;
  padding: 1.2rem 3.5rem;
}

/* --- FOOTER --- */
footer {
  position: relative;
  z-index: 10;
  padding: 3rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
  background: var(--ink);
}

.footer-left {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--smoke);
  letter-spacing: 0.05em;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--smoke);
  text-decoration: none;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.3s;
}

.footer-links a:hover { color: var(--whisper); }

/* --- ANIMATIONS --- */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.cursor-blink {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--whisper);
  margin-left: 2px;
  animation: blink 1s infinite;
  vertical-align: text-bottom;
}

/* --- PROTOCOL PAGE LAYOUT --- */
.protocol-page {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 3rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 8rem 2rem 4rem;
}

.protocol-sidebar {
  position: sticky;
  top: 6rem;
  height: fit-content;
  max-height: calc(100vh - 8rem);
  overflow-y: auto;
}

.protocol-content {
  min-width: 0;
}

/* --- TABLE OF CONTENTS --- */
.toc {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toc a {
  color: var(--smoke);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.3s;
  padding: 0.25rem 0;
}

.toc a:hover {
  color: var(--paper);
}

.toc a.active {
  color: var(--whisper);
}

.toc-sub {
  padding-left: 1rem;
  font-size: 0.8rem;
}

.toc-divider {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 0.75rem 0;
}

/* --- SPEC VERSION BAR --- */
.spec-version {
  display: flex;
  gap: 2rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--smoke);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.spec-version span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.spec-version .label {
  color: var(--whisper);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- ADMONITION BOXES --- */
.admonition {
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--charcoal);
  border-left: 3px solid var(--whisper);
  border-radius: 0 4px 4px 0;
}

.admonition-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  color: var(--whisper);
}

.admonition p {
  font-size: 0.9rem;
  color: var(--paper);
  line-height: 1.6;
  margin: 0;
}

.admonition.security {
  border-left-color: var(--green);
}

.admonition.security .admonition-title {
  color: var(--green);
}

.admonition.warning {
  border-left-color: var(--red);
}

.admonition.warning .admonition-title {
  color: var(--red);
}

.admonition.note {
  border-left-color: var(--smoke);
}

.admonition.note .admonition-title {
  color: var(--smoke);
}

/* --- PROPERTY BADGES --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.badge-yes {
  background: var(--green-dim);
  color: var(--green);
}

.badge-no {
  background: var(--red-dim);
  color: var(--red);
}

.badge-partial {
  background: var(--whisper-dim);
  color: var(--whisper);
}

/* --- WIRE FORMAT BLOCKS --- */
.wire-format {
  background: var(--charcoal);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  overflow: hidden;
  margin: 1.5rem 0;
}

.wire-header {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--whisper-dim);
  border-bottom: 1px solid var(--border-subtle);
}

.wire-header span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--whisper);
}

.wire-row {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.wire-row:last-child {
  border-bottom: none;
}

.wire-field {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--whisper);
}

.wire-type {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--smoke);
}

.wire-desc {
  font-size: 0.85rem;
  color: var(--paper);
  line-height: 1.5;
}

/* --- FLOW DIAGRAMS --- */
.flow-diagram {
  background: var(--charcoal);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  overflow-x: auto;
}

.flow-diagram pre {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--paper);
  margin: 0;
  white-space: pre;
}

.flow-diagram .actor {
  color: var(--whisper);
  font-weight: 600;
}

.flow-diagram .arrow {
  color: var(--smoke);
}

.flow-diagram .label {
  color: var(--green);
}

.flow-diagram .note {
  color: var(--smoke);
  font-style: italic;
}

/* --- CODE BLOCKS WITH SYNTAX HIGHLIGHTING --- */
.code-block {
  background: var(--charcoal);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  overflow-x: auto;
}

.code-block pre {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--paper);
  margin: 0;
}

.code-block .kw {
  color: var(--whisper);
}

.code-block .val {
  color: var(--green);
}

.code-block .op {
  color: var(--paper);
}

.code-block .cmt {
  color: var(--smoke);
  font-style: italic;
}

.code-block .type {
  color: var(--red);
}

.code-block .str {
  color: var(--green);
}

.code-block .num {
  color: var(--whisper);
}

/* --- SPEC TABLES --- */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.spec-table th {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--whisper);
  text-align: left;
  padding: 0.75rem 1rem;
  background: var(--charcoal);
  border-bottom: 1px solid var(--border-subtle);
}

.spec-table td {
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--paper);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

.spec-table tr:hover td {
  background: var(--charcoal);
}

.spec-table td:first-child {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--whisper);
}

/* --- SECTION RULES --- */
.section-rule {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 3rem 0;
}

/* --- PROTOCOL PAGE TYPOGRAPHY --- */
.protocol-content h2 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.75rem;
  color: var(--paper);
  margin: 2.5rem 0 1rem;
  letter-spacing: -0.02em;
}

.protocol-content h2:first-child {
  margin-top: 0;
}

.protocol-content h3 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.25rem;
  color: var(--paper);
  margin: 2rem 0 0.75rem;
}

.protocol-content h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--whisper);
  margin: 1.5rem 0 0.5rem;
}

.protocol-content p {
  font-size: 0.95rem;
  color: var(--smoke);
  line-height: 1.8;
  margin: 0 0 1rem;
}

.protocol-content ul,
.protocol-content ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

.protocol-content li {
  font-size: 0.95rem;
  color: var(--smoke);
  line-height: 1.8;
  margin-bottom: 0.5rem;
}

.protocol-content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  background: var(--charcoal);
  padding: 0.15rem 0.4rem;
  border-radius: 2px;
  color: var(--whisper);
}

.protocol-content a {
  color: var(--whisper);
  text-decoration: underline;
  text-decoration-color: var(--whisper-dim);
  transition: text-decoration-color 0.3s;
}

.protocol-content a:hover {
  text-decoration-color: var(--whisper);
}

/* --- REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
  .redact-on-scroll.redacted-active::after {
    animation: none;
    transform: scaleX(1);
  }

  .hero-badge,
  .hero h1,
  .hero-sub,
  .hero-cta,
  .hero-scroll {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
  .protocol-page {
    grid-template-columns: 1fr;
    padding: 6rem 1.5rem 3rem;
  }

  .protocol-sidebar {
    position: relative;
    top: 0;
    max-height: none;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 1.5rem;
  }

  .toc {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
  }

  .toc-sub {
    padding-left: 0;
  }

  .toc-divider {
    display: none;
  }

  .wire-header,
  .wire-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .wire-type {
    font-size: 0.7rem;
  }
}

@media (max-width: 768px) {
  nav { padding: 1rem 1.5rem; }
  .nav-links { gap: 1.2rem; }
  .nav-links a:not(.btn-install) { display: none; }
  .principles-grid { grid-template-columns: 1fr; }
  .hiw-step { grid-template-columns: 50px 1fr; gap: 1rem; }
  .hiw-num { font-size: 2rem; }
  .hero-cta { flex-direction: column; }
  .protocol-box { padding: 2rem 1.5rem; }
  footer { flex-direction: column; gap: 1.5rem; text-align: center; }

  .spec-version {
    flex-direction: column;
    gap: 0.5rem;
  }

  .spec-table {
    font-size: 0.8rem;
  }

  .spec-table th,
  .spec-table td {
    padding: 0.5rem 0.75rem;
  }
}
