/* The Brasswells — warm storybook visual system
   ─────────────────────────────────────────────── */

:root {
  /* Paper + ink */
  --paper:        #f3e7cf;
  --paper-deep:   #ead8b3;
  --paper-card:   #fbf3e0;
  --ink:          #2a1d12;
  --ink-soft:     #5b4a36;
  --ink-mute:     #8a7558;
  --rule:         rgba(42, 29, 18, 0.18);

  /* Seasonal accents (Summer default) */
  --sky:          #8cb9d0;
  --sky-deep:     #5b8fac;
  --grass:        #729a4a;
  --sun:          #e6a836;
  --brass:        #b8773a;
  --brass-deep:   #8a5722;

  /* Character signatures */
  --c-plum:       #6e4a87;
  --c-persimmon:  #d65e2f;
  --c-cobalt:     #2563a8;
  --c-navy:       #1f2a44;
  --c-teal:       #2d8e8c;
  --c-saffron:    #e8b738;
  --c-rose:       #d97aa3;

  /* Type */
  --f-display: "Young Serif", "Sorts Mill Goudy", Georgia, serif;
  --f-body:    "Newsreader", "Lora", Georgia, serif;
  --f-hand:    "Caveat", "Patrick Hand", cursive;

  /* Rhythm */
  --measure: 1180px;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.55;
  font-feature-settings: "kern", "liga", "onum";
}

/* Paper grain — subtle SVG fiber */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' seed='4'/><feColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.11  0 0 0 0 0.07  0 0 0 .085 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.7;
  mix-blend-mode: multiply;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(255, 240, 200, 0.35), transparent 55%),
    radial-gradient(80% 60% at 100% 100%, rgba(184, 119, 58, 0.10), transparent 60%);
}
#root { position: relative; z-index: 1; }

/* Type */
h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 400;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(44px, 6vw, 88px); line-height: 0.98; }
h2 { font-size: clamp(32px, 3.4vw, 48px); line-height: 1.05; }
h3 { font-size: clamp(20px, 1.6vw, 26px); line-height: 1.15; }
p  { text-wrap: pretty; }

.hand {
  font-family: var(--f-hand);
  font-weight: 600;
  letter-spacing: 0.005em;
}

.eyebrow {
  font-family: var(--f-body);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--ink-soft);
}

.shell {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 28px;
}

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: linear-gradient(180deg, rgba(243, 231, 207, 0.92) 70%, rgba(243, 231, 207, 0));
  backdrop-filter: blur(6px);
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px 16px;
  max-width: var(--measure);
  margin: 0 auto;
}
.wordmark {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--f-display);
  font-size: 22px;
  color: var(--ink);
  letter-spacing: 0.005em;
  text-decoration: none;
}
.wordmark .amp {
  font-family: var(--f-hand);
  color: var(--brass);
  font-size: 28px;
  line-height: 0;
  position: relative;
  top: 2px;
}
.wordmark .mark {
  width: 18px;
  height: 22px;
}
nav.primary {
  display: flex;
  gap: 22px;
  align-items: center;
}
nav.primary a {
  font-family: var(--f-body);
  font-weight: 500;
  font-size: 14px;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 6px 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
nav.primary a:hover { color: var(--ink); border-bottom-color: var(--brass); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  font-family: var(--f-body);
  font-weight: 500;
  font-size: 15px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s, color 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 0 rgba(255, 248, 224, 0.4) inset, 0 6px 14px rgba(42, 29, 18, 0.18);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255, 248, 224, 0.4) inset, 0 10px 22px rgba(42, 29, 18, 0.22); }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
  box-shadow: none;
}
.btn.ghost:hover { background: rgba(42, 29, 18, 0.06); }
.btn.brass {
  background: var(--brass);
  border-color: var(--brass-deep);
  color: #fff8e3;
}
.btn.brass:hover { background: var(--brass-deep); }
.btn .ico { width: 16px; height: 16px; flex: none; }

/* Rule + divider */
.rule {
  height: 1px;
  background: var(--rule);
  margin: 0;
}
.section { padding: 88px 0 72px; position: relative; }
.section + .section { border-top: 1px solid var(--rule); }

/* Section heading with squiggle */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 36px;
}
.section-head h2 { display: flex; flex-direction: column; gap: 6px; }
.section-head .eyebrow { color: var(--brass); }
.section-head .meta {
  font-family: var(--f-body);
  font-size: 14px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 12px;
}
.squiggle {
  display: block;
  margin-top: 6px;
  color: var(--brass);
}

/* Hero */
.hero { padding: 28px 0 56px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 8px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: rgba(251, 243, 224, 0.7);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.hero-eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--c-persimmon);
  box-shadow: 0 0 0 3px rgba(214, 94, 47, 0.18);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}
.hero h1 { margin: 18px 0 10px; }
.hero h1 .accent {
  font-family: var(--f-hand);
  color: var(--brass);
  font-weight: 700;
  display: inline-block;
  transform: translateY(2px) rotate(-2deg);
  margin: 0 4px;
}
.hero .lede {
  font-size: 20px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 36ch;
  margin: 0 0 28px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 22px;
  font-size: 13px;
  color: var(--ink-soft);
}
.hero-meta .pip {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink-mute);
  display: inline-block;
}
.progress-track {
  width: 220px;
  height: 6px;
  background: rgba(42, 29, 18, 0.1);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brass), var(--c-persimmon));
  border-radius: 999px;
}
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: 6px;
  letter-spacing: 0.02em;
}

/* Hero cover frame */
.cover-wrap {
  position: relative;
  display: flex;
  justify-content: center;
}
.cover-card {
  position: relative;
  background: #fbf3e0;
  padding: 18px 18px 22px;
  border-radius: 4px;
  box-shadow:
    0 2px 0 rgba(42, 29, 18, 0.04),
    0 30px 60px -20px rgba(42, 29, 18, 0.35),
    0 12px 24px -12px rgba(42, 29, 18, 0.2);
  transform: rotate(-1.4deg);
  max-width: 460px;
  width: 100%;
}
.cover-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(42, 29, 18, 0.08);
  border-radius: 4px;
  pointer-events: none;
}
.cover-card img {
  width: 100%;
  display: block;
  border-radius: 2px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}
.cover-tape {
  position: absolute;
  top: -14px;
  left: 50%;
  width: 110px;
  height: 26px;
  background: rgba(232, 183, 56, 0.55);
  transform: translateX(-50%) rotate(-3deg);
  border-radius: 1px;
  box-shadow: 0 4px 10px rgba(42, 29, 18, 0.1);
  mix-blend-mode: multiply;
}
.cover-tape::before, .cover-tape::after {
  content: "";
  position: absolute;
  top: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(45deg, transparent 25%, rgba(232, 183, 56, 0.55) 25%) repeat-x;
}
.cover-caption {
  position: absolute;
  bottom: -34px;
  right: -10px;
  font-family: var(--f-hand);
  font-size: 22px;
  color: var(--brass-deep);
  transform: rotate(-3deg);
}

/* Family section */
.family-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 14px;
}
.fam-card {
  position: relative;
  padding: 18px 16px 20px;
  background: var(--paper-card);
  border: 1px solid rgba(42, 29, 18, 0.1);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  cursor: default;
  min-height: 240px;
}
.fam-card:hover {
  transform: translateY(-4px) rotate(-0.5deg);
  box-shadow: 0 14px 28px -10px rgba(42, 29, 18, 0.25);
}
.fam-card .swatch {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--c, var(--brass));
  box-shadow:
    inset -8px -8px 16px rgba(0, 0, 0, 0.18),
    inset 6px 6px 12px rgba(255, 255, 255, 0.22);
  position: relative;
}
.fam-card .swatch::before {
  /* eyes */
  content: "";
  position: absolute;
  inset: 18px 10px auto 10px;
  height: 16px;
  background:
    radial-gradient(circle at 35% 50%, #fff 0 2px, transparent 3px),
    radial-gradient(circle at 65% 50%, #fff 0 2px, transparent 3px),
    radial-gradient(ellipse at 30% 50%, #1a1208 0 5px, transparent 6px),
    radial-gradient(ellipse at 70% 50%, #1a1208 0 5px, transparent 6px),
    rgba(0,0,0,0.15);
  border-radius: 30px;
}
.fam-card .swatch::after {
  /* antenna */
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 1.5px;
  height: 12px;
  background: var(--ink);
  transform: translateX(-50%);
  box-shadow: 0 -1px 0 0 var(--c-persimmon), 0 -3px 0 0 var(--c-persimmon);
}
.fam-card h3 {
  font-family: var(--f-display);
  font-size: 22px;
}
.fam-card .role {
  font-family: var(--f-hand);
  color: var(--brass-deep);
  font-size: 17px;
  line-height: 1.1;
}
.fam-card .bio {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
  flex: 1;
}
.fam-card .trait {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.fam-card .trait::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--c, var(--brass));
}

/* Library */
.library-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.lib-card {
  background: var(--paper-card);
  border: 1px solid rgba(42, 29, 18, 0.1);
  border-radius: 4px;
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: transform 0.18s, box-shadow 0.18s;
}
.lib-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 26px -12px rgba(42, 29, 18, 0.22);
}
.lib-card .num {
  font-family: var(--f-display);
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
  text-transform: uppercase;
}
.lib-card .thumb {
  aspect-ratio: 4 / 3;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  background: var(--bg, linear-gradient(135deg, var(--sky), var(--grass)));
}
.lib-card .thumb svg { width: 100%; height: 100%; display: block; }
.lib-card h3 { font-size: 20px; }
.lib-card .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--ink-mute);
  margin-top: auto;
}
.lib-card .meta .read {
  font-family: var(--f-hand);
  color: var(--brass);
  font-size: 16px;
}
.lib-card.locked .thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, rgba(42, 29, 18, 0.2) 0 2px, transparent 2px 14px), rgba(243, 231, 207, 0.65);
}
.lib-card.locked h3, .lib-card.locked .num { opacity: 0.55; }
.lib-card .lock-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(42, 29, 18, 0.85);
  color: var(--paper);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Reachy callout */
.reachy {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 48px;
  align-items: center;
  padding: 56px;
  background:
    radial-gradient(120% 80% at 20% 20%, rgba(140, 185, 208, 0.4), transparent 60%),
    radial-gradient(80% 80% at 100% 100%, rgba(232, 183, 56, 0.35), transparent 60%),
    var(--paper-card);
  border: 1px solid rgba(42, 29, 18, 0.12);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}
.reachy h2 { font-size: clamp(28px, 2.6vw, 40px); }
.reachy .lede { font-size: 17px; color: var(--ink-soft); max-width: 42ch; }
.reachy .reachy-art {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 240px;
}
.reachy-art svg { width: 100%; max-width: 380px; height: auto; }

/* Shop */
.shop-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 22px;
}
.shop-card {
  position: relative;
  background: var(--paper-card);
  border: 1px solid rgba(42, 29, 18, 0.1);
  border-radius: 4px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform 0.18s, box-shadow 0.18s;
}
.shop-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 28px -12px rgba(42, 29, 18, 0.25);
}
.shop-card.feature { grid-row: span 1; padding: 28px; }
.shop-card .swatch-bar {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.shop-card .swatch-bar i {
  width: 18px; height: 18px;
  border-radius: 50%;
  display: block;
  box-shadow: inset -3px -3px 6px rgba(0,0,0,.2);
}
.shop-card .price {
  font-family: var(--f-display);
  font-size: 20px;
  margin-top: auto;
}
.shop-card .price small {
  font-family: var(--f-body);
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: 0.04em;
}
.shop-card .visual {
  aspect-ratio: 4 / 3;
  border-radius: 4px;
  background: var(--bg, linear-gradient(135deg, var(--sky), var(--c-persimmon)));
  position: relative;
  overflow: hidden;
}
.shop-card .visual svg { width: 100%; height: 100%; display: block; }
.shop-card .tag {
  position: absolute;
  top: 14px; right: 14px;
  background: var(--ink);
  color: var(--paper);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.shop-out {
  font-size: 12px;
  color: var(--brass);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
}

/* Footer */
footer.foot {
  padding: 64px 0 56px;
  border-top: 1px solid var(--rule);
  background:
    radial-gradient(60% 60% at 50% 0%, rgba(184, 119, 58, 0.08), transparent 60%);
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 36px;
  align-items: start;
}
.foot h4 {
  font-family: var(--f-body);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 14px;
}
.foot a {
  display: block;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  padding: 4px 0;
}
.foot a:hover { color: var(--ink); }
.foot .dispatch {
  font-family: var(--f-body);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 36ch;
}
.foot .dispatch-form {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  background: var(--paper-card);
  padding: 6px 6px 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(42, 29, 18, 0.15);
  max-width: 360px;
}
.foot .dispatch-form input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  font: inherit;
  color: var(--ink);
  font-size: 14px;
}
.foot-mark {
  margin-top: 32px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  font-size: 12px;
  color: var(--ink-mute);
}
.foot-mark .by {
  font-family: var(--f-hand);
  font-size: 17px;
  color: var(--brass);
}

/* Responsive */
@media (max-width: 1080px) {
  .family-row { grid-template-columns: repeat(4, 1fr); }
  .library-grid { grid-template-columns: repeat(2, 1fr); }
  .shop-grid { grid-template-columns: 1fr 1fr; }
  .reachy { grid-template-columns: 1fr; padding: 36px; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .cover-wrap { order: -1; }
}
@media (max-width: 680px) {
  .family-row { grid-template-columns: repeat(2, 1fr); }
  .library-grid, .shop-grid, .foot-grid { grid-template-columns: 1fr; }
  nav.primary { display: none; }
  .section { padding: 60px 0 48px; }
}
