/* ==========================================================
   DESIGN TOKENS — evolved dev/IDE aesthetic
   Mint = code/work, Amber = achievement, Rose = love underneath.
   Font: Bricolage Grotesque (display), JetBrains Mono (soul),
   Fraunces (emotional), Caveat (handwritten).
========================================================= */
:root {
  --bg-deep: #05080b;
  --bg-panel: #0c1319;
  --bg-panel-2: #111a23;
  --bg-panel-3: #16202b;
  --line: rgba(94, 234, 212, 0.14);
  --line-soft: rgba(255, 255, 255, 0.06);

  --mint: #5eead4;
  --mint-dim: #2f8f80;
  --mint-glow: rgba(94, 234, 212, 0.25);
  --amber: #f5a623;
  --amber-dim: #a9761b;
  --amber-glow: rgba(245, 166, 35, 0.25);
  --rose: #fb7185;
  --rose-dim: #b34a5c;
  --rose-glow: rgba(251, 113, 133, 0.2);

  --cream: #f6f1e6;
  --cream-2: #efe6d3;
  --ink: #221c14;
  --ink-soft: #5a5040;

  --font-display: "Bricolage Grotesque", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --font-serif: "Fraunces", Georgia, serif;
  --font-script: "Caveat", cursive;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: 0.2s ease;
  --section-pad: clamp(60px, 12vh, 120px) clamp(16px, 5vw, 60px);
}

/* ==========================================================
   RESET + BASE
========================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg-deep);
  color: var(--mint);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* grain overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  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)'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

::selection {
  background: var(--mint);
  color: #04140f;
}
a {
  color: var(--mint);
  text-decoration: none;
}
code {
  font-family: var(--font-mono);
  background: var(--bg-panel-2);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--amber);
  font-size: 0.9em;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
  background: var(--mint-dim);
  border-radius: 3px;
}

/* focus visible */
:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
}

/* ==========================================================
   TYPOGRAPHY
========================================================= */
h1,
h2,
h3 {
  font-family: var(--font-display);
  color: #eef7f3;
  margin: 0;
  font-weight: 700;
  line-height: 1.2;
}
h1 {
  font-size: clamp(28px, 6vw, 48px);
}
h2 {
  font-size: clamp(22px, 4vw, 36px);
}

/* ==========================================================
   SHARED SECTION
========================================================= */
.section {
  min-height: 100vh;
  padding: var(--section-pad);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}
.section-head {
  max-width: 640px;
  margin-bottom: 34px;
}
.section-head.center {
  text-align: center;
  align-self: center;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--mint-dim);
  font-weight: 600;
}
.section-head h2 {
  margin-top: 8px;
}
.section-sub {
  margin-top: 10px;
  font-size: 13px;
  color: #9db3ad;
}
.section-sub code {
  background: var(--bg-panel-2);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--amber);
}

/* ==========================================================
   LOADER
========================================================= */
.loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg-deep);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  transition: opacity 0.5s ease;
}
.loader.done {
  opacity: 0;
  pointer-events: none;
}
.loader-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}
.loader-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  animation: pulse-dot 1s ease infinite;
}
@keyframes pulse-dot {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.4);
    opacity: 0.5;
  }
}
.loader-text {
  font-size: 13px;
  color: #9db3ad;
  font-family: var(--font-mono);
}
.loader-bar {
  width: 200px;
  height: 3px;
  background: rgba(94, 234, 212, 0.1);
  border-radius: 3px;
  overflow: hidden;
}
.loader-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--mint-dim), var(--mint));
  transition: width 0.15s linear;
}

/* ==========================================================
   SCROLL PROGRESS
========================================================= */
.progress-rail {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: 100;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--mint), var(--amber), var(--rose));
  transition: width 0.1s linear;
}

/* ==========================================================
   TOP NAV
========================================================= */
.topnav {
  position: fixed;
  top: 3px;
  left: 0;
  right: 0;
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px clamp(12px, 4vw, 40px);
  background: rgba(5, 8, 11, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
  font-size: 11px;
}
.topnav-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #9db3ad;
  white-space: nowrap;
  min-width: 0;
}
.brand-text strong {
  color: #eef7f3;
}
.topnav-tabs {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.topnav-tabs::-webkit-scrollbar {
  display: none;
}
.topnav-tabs a {
  color: #7f9791;
  text-decoration: none;
  white-space: nowrap;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
  transition:
    color var(--transition),
    border-color var(--transition);
}
.topnav-tabs a.active,
.topnav-tabs a:hover {
  color: var(--mint);
  border-color: var(--mint);
}

/* dots */
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.dot-r {
  background: #ff6b6b;
}
.dot-y {
  background: #f5c26b;
}
.dot-g {
  background: #5eead4;
}

/* ==========================================================
   HERO
========================================================= */
.hero {
  background: radial-gradient(
    circle at 50% 15%,
    #10201c 0%,
    var(--bg-deep) 62%
  );
}
.repo-card {
  max-width: 680px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(12, 18, 25, 0.6);
  padding: clamp(20px, 5vw, 36px);
  box-shadow: 0 0 80px rgba(94, 234, 212, 0.04);
}
.repo-path {
  font-size: 12px;
  color: #8fa7a0;
  margin-bottom: 14px;
}
.repo-path strong {
  color: #eef7f3;
}
.repo-title {
  line-height: 1.2;
}
.accent-amber {
  color: var(--amber);
}
.repo-desc {
  margin-top: 14px;
  color: #c7d6d1;
  font-size: 13px;
  line-height: 1.7;
}
.repo-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}
.badge {
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid;
  font-weight: 600;
}
.badge-mint {
  color: var(--mint);
  border-color: var(--mint-dim);
  background: rgba(94, 234, 212, 0.06);
}
.badge-amber {
  color: var(--amber);
  border-color: var(--amber-dim);
  background: rgba(245, 166, 35, 0.06);
}
.badge-rose {
  color: var(--rose);
  border-color: rgba(251, 113, 133, 0.4);
  background: rgba(251, 113, 133, 0.06);
}
.repo-stats {
  display: flex;
  gap: 18px;
  margin-top: 20px;
  font-size: 12px;
  color: #c7d6d1;
  flex-wrap: wrap;
}
.repo-stats .dim {
  color: #6f857f;
  font-size: 10px;
}
.hero-status {
  margin-top: 20px;
  font-size: 13px;
  color: #c7d6d1;
  min-height: 20px;
}
.ty-prefix {
  color: var(--amber);
}
.ty-body {
  color: var(--mint);
}
.ty-cursor {
  color: var(--mint);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}
.btn-run {
  margin-top: 22px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--mint-dim);
  background: linear-gradient(
    180deg,
    rgba(94, 234, 212, 0.16),
    rgba(94, 234, 212, 0.04)
  );
  color: #eafff8;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    background var(--transition);
}
.btn-run:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--mint-glow);
  background: linear-gradient(
    180deg,
    rgba(94, 234, 212, 0.22),
    rgba(94, 234, 212, 0.08)
  );
}
.btn-run:active {
  transform: translateY(0);
}
.hero-hint {
  margin-top: 12px;
  font-size: 10px;
  color: #5c716b;
}

/* ==========================================================
   TERMINAL WINDOWS (shared)
========================================================= */
.term-window,
.md-window {
  width: 100%;
  max-width: 680px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(12, 18, 25, 0.7);
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--bg-panel-2);
  border-bottom: 1px solid var(--line-soft);
}
.term-title {
  margin-left: 6px;
  font-size: 11px;
  color: #8fa7a0;
}
.term-body {
  padding: 18px;
  font-size: clamp(11px, 2.2vw, 13px);
  line-height: 1.75;
  min-height: 160px;
  white-space: pre-wrap;
  overflow-x: hidden;
}
.progress-wrap {
  height: 6px;
  margin: 0 18px 18px;
  background: rgba(94, 234, 212, 0.1);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--mint-dim), var(--mint));
  transition: width 0.15s linear;
}

/* ==========================================================
   GIT LOG
========================================================= */
.commits {
  background: linear-gradient(180deg, var(--bg-deep) 0%, #0a1512 100%);
}
.git-log {
  width: 100%;
  max-width: 640px;
  position: relative;
  padding-left: 26px;
}
.git-log::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--line);
}
.commit-row {
  position: relative;
  padding: 0 0 28px 20px;
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.5s ease;
}
.commit-row.show {
  opacity: 1;
  transform: translateX(0);
}
.commit-row::before {
  content: "";
  position: absolute;
  left: -25px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 2px solid var(--mint-dim);
}
.commit-row.tagged::before {
  border-color: var(--amber);
  background: var(--amber);
  box-shadow: 0 0 12px var(--amber-glow);
}
.commit-hash {
  color: var(--mint-dim);
  font-size: 11px;
  margin-right: 8px;
}
.commit-msg {
  color: #dfeee9;
  font-size: 13px;
}
.commit-meta {
  font-size: 10px;
  color: #5c716b;
  margin-top: 3px;
}
.commit-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(245, 166, 35, 0.14);
  color: var(--amber);
  border: 1px solid var(--amber-dim);
}

/* ==========================================================
   PR CARD
========================================================= */
.pr-card {
  width: 100%;
  max-width: 640px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  background: rgba(12, 18, 25, 0.7);
}
.pr-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.pr-status {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(94, 234, 212, 0.14);
  color: var(--mint);
  border: 1px solid var(--mint-dim);
}
.pr-status.merged {
  background: rgba(245, 166, 35, 0.16);
  color: var(--amber);
  border-color: var(--amber-dim);
}
.pr-title {
  font-family: var(--font-display);
  color: #eef7f3;
  font-size: 15px;
}
.pr-meta {
  margin-top: 6px;
  font-size: 11px;
  color: #8fa7a0;
}
.pr-meta code {
  color: var(--mint);
}
.pr-reviews {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.review {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.4s ease;
  padding: 7px 10px;
  background: var(--bg-panel-2);
  border-radius: var(--radius-sm);
}
.review.show {
  opacity: 1;
  transform: translateY(0);
}
.reviewer {
  color: #c7d6d1;
}
.review-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
}
.review-tag.approved {
  background: rgba(94, 234, 212, 0.14);
  color: var(--mint);
}
.review-tag.changes {
  background: rgba(251, 113, 133, 0.14);
  color: var(--rose);
}
.btn-merge {
  margin-top: 20px;
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--mint-dim);
  color: #04140f;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-merge:hover {
  background: var(--mint);
}
.btn-merge:disabled {
  opacity: 0.6;
  cursor: default;
}
.pr-footnote {
  margin-top: 10px;
  font-size: 11px;
  color: var(--amber);
  min-height: 14px;
}

/* ==========================================================
   PIPELINE
========================================================= */
.pipeline {
  background: linear-gradient(180deg, #0a1512 0%, var(--bg-deep) 100%);
}
.pipe-track {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 520px;
}
.pipe-stage {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
  background: rgba(12, 18, 25, 0.6);
  opacity: 0.45;
  transition: all 0.5s ease;
}
.pipe-stage.active {
  opacity: 1;
  border-color: var(--mint-dim);
  box-shadow: 0 0 24px rgba(94, 234, 212, 0.1);
}
.pipe-stage.done {
  border-color: var(--amber-dim);
}
.pipe-icon {
  font-size: 24px;
}
.pipe-label {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 12px;
  color: #eef7f3;
}
.pipe-status {
  margin-top: 5px;
  font-size: 10px;
  color: #5c716b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.pipe-stage.active .pipe-status {
  color: var(--mint);
}
.pipe-stage.done .pipe-status {
  color: var(--amber);
}

/* ==========================================================
   CONFUSION MATRIX
========================================================= */
.matrix {
  background: var(--bg-deep);
}
.matrix-wrap {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.matrix-grid {
  display: grid;
  grid-template-columns: 90px 1fr 1fr;
  width: 100%;
  gap: 5px;
}
.m-head {
  font-size: 10px;
  color: #8fa7a0;
  text-align: center;
  align-self: end;
  padding-bottom: 5px;
}
.m-side {
  font-size: 10px;
  color: #8fa7a0;
  display: flex;
  align-items: center;
}
.m-cell {
  position: relative;
  border-radius: var(--radius-sm);
  padding: 18px 6px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  cursor: default;
}
.m-tp {
  background: rgba(94, 234, 212, 0.18);
  color: var(--mint);
}
.m-fn,
.m-fp,
.m-tn {
  background: rgba(255, 255, 255, 0.03);
  color: #5c716b;
}
.m-cell-lbl {
  display: block;
  font-size: 8px;
  font-family: var(--font-mono);
  font-weight: 500;
  color: #8fa7a0;
  margin-top: 3px;
}
.m-cell::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translate(-50%, -8px);
  width: 180px;
  background: #0e151d;
  border: 1px solid var(--line);
  color: #dfeee9;
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 5;
  line-height: 1.4;
}
.m-cell:hover::after,
.m-cell.tip-open::after {
  opacity: 1;
}
.matrix-note {
  margin-top: 16px;
  font-size: 11px;
  color: #8fa7a0;
  text-align: center;
}

/* ==========================================================
   PRIDE FLIP-DECK (NEW)
========================================================= */
.pride {
  background: var(--bg-deep);
}
.deck-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 520px;
}
.deck-arrow {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--mint);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    border-color var(--transition),
    background var(--transition);
}
.deck-arrow:hover {
  border-color: var(--mint-dim);
  background: var(--bg-panel-2);
}
.deck-viewport {
  flex: 1;
  overflow: hidden;
  perspective: 800px;
  min-height: 220px;
}
.deck-card {
  display: none;
  width: 100%;
  min-height: 220px;
  cursor: pointer;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.deck-card.active {
  display: block;
}
.deck-card.flipped {
  transform: rotateY(180deg);
}
.card-front,
.card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--line);
}
.card-front {
  background: linear-gradient(
    135deg,
    var(--bg-panel) 0%,
    var(--bg-panel-2) 100%
  );
}
.card-back {
  background: linear-gradient(
    135deg,
    var(--bg-panel-2) 0%,
    var(--bg-panel-3) 100%
  );
  transform: rotateY(180deg);
  text-align: center;
}
.card-num {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 800;
  color: rgba(94, 234, 212, 0.12);
  position: absolute;
  top: 14px;
  right: 18px;
}
.card-cat {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: #eef7f3;
}
.card-back p {
  color: #c7d6d1;
  font-size: 14px;
  line-height: 1.7;
  font-family: var(--font-mono);
  margin: 0;
}
.deck-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 16px;
}
.deck-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(94, 234, 212, 0.2);
  transition: background var(--transition);
}
.deck-dot.active {
  background: var(--mint);
}

/* ==========================================================
   UNLOCK
========================================================= */
.unlock {
  background: radial-gradient(
    circle at 50% 55%,
    #10201c 0%,
    var(--bg-deep) 70%
  );
}
.charge-btn {
  position: relative;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
}
.charge-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ring-bg {
  fill: none;
  stroke: rgba(94, 234, 212, 0.12);
  stroke-width: 4;
}
.ring-fg {
  fill: none;
  stroke: var(--mint);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 339;
  stroke-dashoffset: 339;
  transition: stroke-dashoffset 0.05s linear;
}
.charge-label {
  position: relative;
  z-index: 2;
  font-size: 12px;
  color: #eafff8;
  text-align: center;
  line-height: 1.5;
  pointer-events: none;
}

/* ==========================================================
   REVEAL
========================================================= */
.reveal {
  background: linear-gradient(180deg, #0a1512 0%, var(--bg-deep) 100%);
  color: #eef7f3;
  text-align: center;
}
.reveal-card {
  width: 100%;
  max-width: 420px;
}
.pkg-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #9db3ad;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.pkg-version {
  background: #1c3a2a;
  color: #b7f3d1;
  padding: 2px 8px;
  border-radius: 12px;
}
.frame {
  padding: 12px 12px 28px;
  background: #fffdf8;
  border-radius: 6px;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  transform: rotate(-2deg) scale(0.9);
  opacity: 0;
  transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.frame.show {
  opacity: 1;
  transform: rotate(-2deg) scale(1);
}
.frame img {
  width: 100%;
  border-radius: 3px;
}
.frame-caption {
  font-family: var(--font-script);
  font-size: 20px;
  margin-top: 12px;
  color: #7a5230;
}
.frame-badge {
  display: inline-block;
  margin-top: 12px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 10px;
  letter-spacing: 0.5px;
  background: #1c3a2a;
  color: #b7f3d1;
  font-family: var(--font-mono);
}
.reveal-title {
  font-family: var(--font-serif);
  font-size: clamp(26px, 6vw, 44px);
  margin: 24px 0 6px;
}
.reveal-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #9db3ad;
}

/* ==========================================================
   SCRAPBOOK GALLERY (NEW)
========================================================= */
.gallery {
  background: var(--bg-deep);
}
.gallery .eyebrow {
  color: var(--amber-dim);
}
.gallery h2 {
  color: #eef7f3;
}
.gallery .section-sub {
  color: #9db3ad;
}
.scrap-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  width: 100%;
  max-width: 700px;
}
.scrap-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 10px 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transform: rotate(var(--tilt, 0deg));
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}
.scrap-card:nth-child(1) {
  --tilt: -0.8deg;
}
.scrap-card:nth-child(2) {
  --tilt: 1.2deg;
}
.scrap-card:nth-child(3) {
  --tilt: -0.5deg;
}
.scrap-card:hover {
  transform: rotate(0deg) scale(1.02);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}
.scrap-img-wrap {
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.scrap-img-wrap img {
  width: 100%;
  display: block;
}
.scrap-cap {
  font-family: var(--font-script);
  font-size: 16px;
  color: #c7d6d1;
  margin-top: 10px;
  text-align: center;
  padding: 0 4px;
}

/* ==========================================================
   ARCHITECTURE
========================================================= */
.architecture {
  background: var(--bg-deep);
}
.architecture .eyebrow {
  color: var(--amber-dim);
}
.architecture h2 {
  color: #eef7f3;
}
.arch-wrap {
  width: 100%;
  max-width: 800px;
}
.arch-svg {
  width: 100%;
  height: auto;
}
.node-group circle {
  fill: var(--bg-panel-2);
  stroke: var(--amber);
  stroke-width: 2;
}
.hidden-node circle {
  stroke: var(--rose);
}
.output-node circle {
  fill: var(--amber);
  stroke: var(--amber);
}
.node-label {
  font-family: var(--font-mono);
  font-size: 11px;
  fill: #9db3ad;
  text-anchor: end;
}
.output-label {
  text-anchor: middle;
  font-weight: 700;
  fill: #eef7f3;
  font-size: 12px;
}
.arch-edge {
  stroke: rgba(34, 28, 20, 0.15);
  stroke-width: 1.4;
  fill: none;
}
.arch-pulse {
  fill: var(--amber);
}

/* ==========================================================
   DISTANCE MAP (NEW)
========================================================= */
.distance {
  background: var(--bg-deep);
}
.dist-map {
  width: 100%;
  max-width: 600px;
}
.dist-svg {
  width: 100%;
  height: auto;
}
.dist-arc {
  fill: none;
  stroke: var(--rose);
  stroke-width: 2;
  stroke-dasharray: 8 6;
  opacity: 0.6;
}
.dist-heart {
  fill: var(--rose);
  opacity: 0;
  transition: opacity 0.5s ease;
}
.dist-heart.show {
  opacity: 1;
}
.dist-heart-text {
  font-size: 16px;
  text-anchor: middle;
  dominant-baseline: central;
}
.dist-node circle {
  fill: var(--bg-panel);
  stroke-width: 2;
}
.dist-node-p circle {
  stroke: var(--mint);
}
.dist-node-l circle {
  stroke: var(--amber);
}
.dist-label {
  font-family: var(--font-display);
  font-size: 13px;
  fill: #eef7f3;
  text-anchor: middle;
  font-weight: 700;
}
.dist-sublabel {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: #8fa7a0;
  text-anchor: middle;
}
.dist-km {
  font-family: var(--font-display);
  font-size: 22px;
  fill: #eef7f3;
  text-anchor: middle;
  font-weight: 700;
}
.dist-tagline {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: #8fa7a0;
  text-anchor: middle;
}

/* ==========================================================
   LETTER
========================================================= */
.letter {
  background: linear-gradient(
    180deg,
    #0a1512 0%,
    var(--bg-deep) 40%,
    #0a1512 100%
  );
  min-height: 120vh;
  padding: clamp(80px, 15vh, 160px) clamp(16px, 5vw, 60px);
}
.md-window {
  max-width: 760px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(12, 18, 25, 0.75);
  box-shadow:
    0 0 80px rgba(94, 234, 212, 0.04),
    0 40px 80px rgba(0, 0, 0, 0.3);
}
.md-window .term-bar {
  background: var(--bg-panel-2);
  border-bottom: 1px solid var(--line-soft);
}
.md-window .term-title {
  color: #8fa7a0;
}
.md-body {
  padding: clamp(28px, 6vw, 56px);
  color: #eef7f3;
  font-family: var(--font-serif);
  font-size: clamp(17px, 3.2vw, 24px);
  line-height: 2;
  white-space: pre-wrap;
  min-height: 360px;
}
.md-body .from {
  margin-top: 28px;
  font-family: var(--font-script);
  font-size: clamp(32px, 5vw, 44px);
  color: var(--rose);
  display: block;
}
.md-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--mint);
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}

/* ==========================================================
   DASHBOARD
========================================================= */
.dashboard {
  background: #0a1512;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 560px;
}
.stat-card {
  background: rgba(12, 18, 25, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 12px;
  text-align: center;
}
.stat-num {
  font-family: var(--font-display);
  font-size: clamp(22px, 5vw, 30px);
  color: var(--amber);
  font-weight: 700;
}
.stat-lbl {
  margin-top: 5px;
  font-size: 10px;
  color: #8fa7a0;
}
.chart-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
  width: 100%;
  max-width: 560px;
  justify-content: center;
}
.chart-card {
  flex: 1;
  min-width: 220px;
  background: rgba(12, 18, 25, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.chart-title {
  font-size: 10px;
  color: #8fa7a0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.chart-tag {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 10px;
}
.chart-tag.down {
  color: var(--mint);
  background: rgba(94, 234, 212, 0.1);
}
.chart-tag.up {
  color: var(--amber);
  background: rgba(245, 166, 35, 0.1);
}
.mini-chart {
  width: 100%;
  height: auto;
}
.mini-chart polyline {
  fill: none;
  stroke: var(--mint);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#chartPride {
  stroke: var(--amber);
}

/* ==========================================================
   STAR CONSTELLATION (NEW)
========================================================= */
.stars {
  background: #020408;
  overflow: hidden;
}
.stars .eyebrow {
  color: var(--rose-dim);
}
.star-canvas-wrap {
  width: 100%;
  max-width: 800px;
  height: clamp(200px, 40vh, 400px);
  position: relative;
}
.star-canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.stars-sub {
  margin-top: 14px;
  font-size: 11px;
  color: #8fa7a0;
  font-family: var(--font-mono);
}

/* ==========================================================
   QUIZ (NEW)
========================================================= */
.quiz {
  background: var(--bg-deep);
}
.quiz-card {
  width: 100%;
  max-width: 520px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  background: rgba(12, 18, 25, 0.7);
}
.quiz-progress {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}
.quiz-pip {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(94, 234, 212, 0.15);
  transition: background 0.3s ease;
}
.quiz-pip.done {
  background: var(--mint);
}
.quiz-pip.active {
  background: var(--amber);
}
.quiz-q {
  font-family: var(--font-display);
  font-size: 18px;
  color: #eef7f3;
  margin-bottom: 18px;
  line-height: 1.4;
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quiz-opt {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
  color: #c7d6d1;
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
  transition:
    border-color var(--transition),
    background var(--transition),
    color var(--transition);
  text-align: left;
}
.quiz-opt:hover {
  border-color: var(--mint-dim);
  background: var(--bg-panel-2);
}
.quiz-opt.picked {
  border-color: var(--amber);
  background: rgba(245, 166, 35, 0.1);
  color: var(--amber);
}
.quiz-feedback {
  margin-top: 14px;
  font-size: 12px;
  color: var(--mint);
  min-height: 18px;
  font-family: var(--font-mono);
}
.quiz-next {
  margin-top: 14px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--mint-dim);
  background: transparent;
  color: var(--mint);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.quiz-next:hover {
  background: rgba(94, 234, 212, 0.1);
}
.quiz-result {
  width: 100%;
  max-width: 520px;
  text-align: center;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(12, 18, 25, 0.7);
}
.quiz-score {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 800;
  color: var(--amber);
}
.quiz-verdict {
  margin-top: 10px;
  font-size: 13px;
  color: #c7d6d1;
}

/* ==========================================================
   CERTIFICATE (NEW)
========================================================= */
.certificate {
  background: var(--bg-deep);
}
.cert-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 24px;
}
.cert-input {
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
  color: #eafff8;
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
  width: 280px;
  max-width: 100%;
  transition: border-color var(--transition);
}
.cert-input:focus {
  border-color: var(--mint-dim);
}
.cert-preview {
  width: 100%;
  max-width: 600px;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}
.cert-preview canvas {
  width: 100%;
  height: auto;
  display: block;
}
.btn-download {
  margin-top: 16px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--amber-dim);
  background: rgba(245, 166, 35, 0.1);
  color: var(--amber);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-download:hover {
  background: rgba(245, 166, 35, 0.2);
}

/* ==========================================================
   TIME CAPSULE (NEW) — scroll-triggered 3-2-1 countdown
========================================================= */
.capsule {
  background: var(--bg-deep);
}
.capsule-body {
  width: 100%;
  max-width: 480px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(12, 18, 25, 0.7);
  padding: 36px 28px;
  text-align: center;
}
.capsule-icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.capsule-countdown {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  min-height: 80px;
}
.capsule-big-num {
  font-family: var(--font-display);
  font-size: 72px;
  font-weight: 800;
  color: var(--amber);
  opacity: 0;
  transform: scale(0.5);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}
.capsule-big-num.show {
  opacity: 1;
  transform: scale(1);
}
.capsule-big-num.hide {
  opacity: 0;
  transform: scale(1.5);
}
.capsule-date {
  font-size: 11px;
  color: #5c716b;
  margin-top: 8px;
}
.capsule-sealed .capsule-icon,
.capsule-sealed .capsule-date {
  transition: opacity 0.4s ease;
}
.capsule-sealed.counting .capsule-icon,
.capsule-sealed.counting .capsule-date {
  opacity: 0;
}
.capsule-note {
  font-family: var(--font-serif);
  font-size: clamp(14px, 2.5vw, 17px);
  line-height: 1.8;
  color: var(--ink);
  background: #fffdf8;
  padding: 24px 20px;
  border-radius: var(--radius);
  text-align: left;
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}
.capsule-note.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================
   GUESTBOOK (NEW)
========================================================= */
.guestbook {
  background: #0a1512;
}
.gb-form {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}
.gb-input {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
  color: #eafff8;
  font-family: var(--font-mono);
  font-size: 12px;
  outline: none;
  transition: border-color var(--transition);
}
.gb-input:focus {
  border-color: var(--mint-dim);
}
.gb-msg-row {
  position: relative;
}
.gb-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
  color: #eafff8;
  font-family: var(--font-mono);
  font-size: 12px;
  outline: none;
  resize: vertical;
  min-height: 60px;
  transition: border-color var(--transition);
}
.gb-textarea:focus {
  border-color: var(--mint-dim);
}
.gb-count {
  position: absolute;
  bottom: 8px;
  right: 10px;
  font-size: 10px;
  color: #5c716b;
}
.gb-entries {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gb-entry {
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
}
.gb-entry-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--amber);
}
.gb-entry-date {
  font-size: 9px;
  color: #5c716b;
  margin-left: 6px;
}
.gb-entry-text {
  margin-top: 5px;
  font-size: 12px;
  color: #c7d6d1;
  line-height: 1.5;
}

/* ==========================================================
   REACTIONS
========================================================= */
.reactions {
  background: linear-gradient(180deg, var(--bg-deep) 0%, #0d1310 100%);
}
.reaction-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.reaction-btn {
  border: 1px solid var(--line);
  background: rgba(12, 18, 25, 0.7);
  color: #eafff8;
  border-radius: 24px;
  padding: 9px 14px;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
  font-family: var(--font-mono);
}
.reaction-btn:hover {
  border-color: var(--mint-dim);
  transform: translateY(-2px);
}
.reaction-btn.pulsed {
  animation: pulse 0.3s ease;
}
@keyframes pulse {
  50% {
    transform: scale(1.15);
  }
}
.reaction-count {
  font-size: 11px;
  color: #8fa7a0;
}

/* ==========================================================
   TERMINAL SECTION
========================================================= */
.terminal-section {
  background: var(--bg-deep);
}
.live-term {
  max-width: 640px;
}
.live-term .term-body {
  max-height: 240px;
  overflow-y: auto;
}
.term-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--line-soft);
}
.prompt {
  color: var(--mint);
}
.term-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #eafff8;
  font-family: var(--font-mono);
  font-size: 13px;
  caret-color: var(--mint);
}
.term-line-cmd {
  color: var(--amber);
}
.term-line-out {
  color: #c7d6d1;
}

/* ==========================================================
   CLOSER
========================================================= */
.closer {
  background: var(--ink);
}
.changelog-card {
  width: 100%;
  max-width: 560px;
  text-align: center;
}
.changelog-version {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--amber);
  letter-spacing: 1px;
}
.changelog-title {
  font-family: var(--font-mono);
  color: var(--cream);
  font-size: 18px;
  margin-top: 6px;
}
.changelog-list {
  list-style: none;
  padding: 0;
  margin: 22px 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.changelog-list li {
  font-size: 13px;
  color: var(--cream-2);
  font-family: var(--font-mono);
}
.tag {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  margin-right: 6px;
}
.tag.added {
  background: rgba(94, 234, 212, 0.16);
  color: var(--mint);
}
.tag.fixed {
  background: rgba(251, 113, 133, 0.16);
  color: var(--rose);
}
.tag.improved {
  background: rgba(245, 166, 35, 0.16);
  color: var(--amber);
}
.tag.removed {
  background: rgba(255, 255, 255, 0.08);
  color: #c7d6d1;
}
.closer-line1 {
  font-family: var(--font-serif);
  font-size: clamp(20px, 4.5vw, 30px);
  color: var(--cream);
  margin-top: 18px;
}
.closer-line2 {
  margin-top: 10px;
  font-family: var(--font-script);
  font-size: 24px;
  color: var(--rose);
}
.btn-star {
  margin-top: 28px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--amber-dim);
  background: rgba(245, 166, 35, 0.1);
  color: var(--amber);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-star:hover {
  background: rgba(245, 166, 35, 0.2);
}
.closer-sig {
  margin-top: 32px;
  font-size: 10px;
  color: #6f6a5c;
  font-family: var(--font-mono);
}

/* ==========================================================
   FOOTER
========================================================= */
.footer {
  padding: 20px;
  text-align: center;
  font-size: 10px;
  color: #5c716b;
  background: var(--ink);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* ==========================================================
   AUDIO TOGGLE
========================================================= */
.audio-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 98;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(5, 8, 11, 0.85);
  backdrop-filter: blur(10px);
  color: var(--mint);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    border-color var(--transition),
    background var(--transition);
}
.audio-toggle:hover {
  border-color: var(--mint-dim);
  background: rgba(12, 18, 25, 0.95);
}
.audio-toggle.playing {
  color: var(--amber);
  border-color: var(--amber-dim);
}

/* ==========================================================
   RESPONSIVE — tablet+
========================================================= */
@media (min-width: 640px) {
  .scrap-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .scrap-card:first-child {
    grid-column: span 2;
  }
}
@media (min-width: 760px) {
  .pipe-track {
    flex-direction: row;
    max-width: 900px;
  }
}
@media (min-width: 1024px) {
  .matrix-grid {
    grid-template-columns: 120px 1fr 1fr;
  }
  .stat-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .capsule-countdown {
    gap: 12px;
  }
}

/* ==========================================================
   REDUCED MOTION
========================================================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}
