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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink-soft);
  font: 400 1.04rem/1.7 var(--font-sans);
  overflow-x: hidden;
  position: relative;
}

/* Subtle cotton paper tooth overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");
}

::selection {
  background: var(--sienna);
  color: var(--paper-card);
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--paper-warm); }
::-webkit-scrollbar-thumb {
  background: rgba(20, 21, 20, 0.28);
  border: 2px solid var(--paper-warm);
}
::-webkit-scrollbar-thumb:hover { background: var(--sienna); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 1.05rem;
  max-width: 62ch;
}

a {
  color: inherit;
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
}

:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 3px;
}

img { display: block; max-width: 100%; height: auto; }

.wrap {
  width: var(--wrap);
  margin-inline: auto;
}

.hand-note {
  font-family: var(--font-hand);
  font-size: 1.38rem;
  line-height: 1.38;
  color: var(--cobalt);
}

.mono-spec {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.45;
  letter-spacing: 0.02em;
  color: var(--graphite);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(247, 248, 245, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.9rem 0;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--graphite);
  white-space: nowrap;
}

.site-nav ul {
  display: flex;
  list-style: none;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
}

.site-nav a {
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 0.45rem 0;
  position: relative;
  transition: color 0.2s var(--ease-ink);
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--sienna);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.26s var(--ease-ink);
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--ink);
}

.site-nav a:hover::after,
.site-nav a.active::after {
  transform: scaleX(1);
}

.burger {
  display: none;
  background: var(--paper-card);
  border: 1px solid var(--rule-strong);
  color: var(--ink);
  font: 500 0.9rem var(--font-mono);
  padding: 0.5rem 0.95rem;
  min-height: 44px;
  cursor: pointer;
}

/* Tactile Ink Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1.5rem;
  min-height: 44px;
  font: 600 0.94rem var(--font-sans);
  text-decoration: none;
  border: 1.5px solid var(--ink);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: background-color 0.24s var(--ease-ink), color 0.24s var(--ease-ink), transform 0.2s var(--ease-ink), border-color 0.24s var(--ease-ink);
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-ink {
  background: var(--ink);
  color: var(--paper-card);
}
.btn-ink:hover {
  background: var(--sienna);
  border-color: var(--sienna);
}

.btn-outline:hover {
  background: var(--paper-warm);
}

.btn-cobalt {
  border-color: var(--cobalt);
  color: var(--cobalt);
}
.btn-cobalt:hover {
  background: var(--cobalt);
  color: var(--paper-card);
}

/* Pinned physical photo effect */
.pin-frame {
  position: relative;
  background: var(--paper-card);
  padding: 12px 12px 22px;
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-pin);
}

.pin-frame::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 78px;
  height: 22px;
  transform: translateX(-50%) rotate(-2deg);
  background: var(--tape);
  border-inline: 1px dashed rgba(20, 21, 20, 0.16);
  box-shadow: 0 1px 3px rgba(20, 21, 20, 0.08);
  pointer-events: none;
}

.pin-frame img {
  width: 100%;
  display: block;
}

.pin-frame figcaption {
  margin-top: 0.75rem;
  font-family: var(--font-hand);
  font-size: 1.26rem;
  line-height: 1.38;
  color: var(--ink-soft);
}

/* Section spacing & dividers */
.band-section {
  padding: clamp(4.2rem, 8vw, 6.5rem) 0;
  border-top: 1px solid var(--rule);
}

.band-blueprint {
  background: var(--blueprint);
  color: #E7EEF4;
  border-top: 1px solid var(--blueprint-deep);
}

.band-blueprint h2,
.band-blueprint h3 {
  color: #FFFFFF;
}

.sec-head {
  margin-bottom: clamp(2rem, 4vw, 3.2rem);
}

.sec-head h2 {
  font-size: clamp(2.1rem, 4.3vw, 3.4rem);
  max-width: 19ch;
  margin-bottom: 0.9rem;
}

.sec-head .lead {
  font-size: 1.12rem;
  color: var(--ink-soft);
  max-width: 56ch;
}

.band-blueprint .sec-head .lead {
  color: #DCE7F0;
}

.ink-stroke {
  display: block;
  width: 112px;
  height: 12px;
  margin-bottom: 1.1rem;
}

/* Stamp / Tag */
.stamp {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.4;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--rule-strong);
  color: var(--ink-soft);
  background: var(--paper-card);
}

.stamp.sienna {
  border-color: rgba(179, 61, 25, 0.55);
  color: var(--sienna);
  background: rgba(179, 61, 25, 0.06);
}

.stamp.cobalt {
  border-color: rgba(22, 73, 110, 0.48);
  color: var(--cobalt);
  background: rgba(22, 73, 110, 0.06);
}

/* Honest margin note callout */
.margin-callout {
  border-left: 1px solid var(--sienna);
  padding: 0.85rem 1.2rem;
  background: rgba(179, 61, 25, 0.05);
  color: var(--ink);
  max-width: 56ch;
}

/* Lightbox */
.lb {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(20, 21, 20, 0.92);
  display: none;
  place-items: center;
  padding: 1.5rem;
  cursor: zoom-out;
}

.lb.open { display: grid; }

.lb figure {
  margin: 0;
  max-width: min(980px, 94vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.lb img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  background: var(--paper-card);
  padding: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.lb figcaption {
  color: var(--paper);
  font-family: var(--font-hand);
  font-size: 1.4rem;
  line-height: 1.4;
  text-align: center;
}

.lb-close {
  position: fixed;
  top: 1.2rem;
  right: 1.4rem;
  background: var(--paper-card);
  border: 1px solid var(--ink);
  color: var(--ink);
  font: 500 0.9rem var(--font-mono);
  padding: 0.55rem 1.1rem;
  min-height: 44px;
  cursor: pointer;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--rule-strong);
  padding: 2.2rem 0 2.8rem;
  background: var(--paper-warm);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.92rem;
}

@media (max-width: 840px) {
  .brand { flex-direction: column; gap: 0.1rem; }
  .burger { display: inline-flex; align-items: center; }
  .site-nav {
    position: fixed;
    inset: 66px 0 0 0;
    background: var(--paper);
    border-top: 1px solid var(--rule);
    padding: 2rem 1.5rem;
    display: none;
    overflow-y: auto;
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav a {
    display: block;
    font-family: var(--font-display);
    font-size: 1.65rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--rule);
  }
  body.menu-open { overflow: hidden; }
}

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