@import url('https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,300;0,400;0,500;1,300&family=Barlow+Condensed:wght@400;500;600&family=JetBrains+Mono:wght@400&family=Playfair+Display:ital,wght@0,700;1,700&display=swap');

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

:root {
  /* ── Background & surface ───────────────────────────── */
  --bg:             #FAFAFC;

  /* ── Legacy tokens (migrated to cool palette) ───────── */
  --text:           #1A1830;
  --muted:          #9A98B8;
  --border:         rgba(155, 135, 210, 0.18);
  --hover:          rgba(155, 127, 212, 0.06);
  --thumb:          #C4BEDC;
  --rail:           #9A98B8;
  --body-text:      #4A4868;
  --content-border: rgba(155, 135, 210, 0.22);

  /* ── New palette ────────────────────────────────────── */
  --lav-primary:    #9B7FD4;
  --lav-light:      #B0A0E8;
  --lav-faint:      rgba(155, 127, 212, 0.13);
  --ink:            #1A1830;
  --text-secondary: #4A4868;
  --text-muted:     #9A98B8;
  --surface:        rgba(155, 127, 212, 0.07);
  --surface-border: rgba(155, 127, 212, 0.18);
}

html, body {
  height: 100%;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Barlow', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background-image:
    linear-gradient(rgba(148, 138, 192, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 138, 192, 0.07) 1px, transparent 1px);
  background-size: 36px 36px;
}

/* ── Topographic texture (static, bottom-right) ─────── */
.topo-texture {
  position: fixed;
  bottom: 0;
  right: 0;
  width: 520px;
  height: 520px;
  pointer-events: none;
  z-index: 1;
}

/* Base stroke for all rings (overridden per-ring below) */
.topo-texture circle,
.topo-texture line {
  stroke: rgba(148, 138, 192, 0.13);
}

/* Static page rings — 4 iridescent colors cycling outer→inner */
.topo-texture circle[r="360"] { stroke: rgba(155, 127, 212, 0.13); }
.topo-texture circle[r="300"] { stroke: rgba(122, 188, 220, 0.13); }
.topo-texture circle[r="244"] { stroke: rgba(212, 159, 204, 0.12); }
.topo-texture circle[r="190"] { stroke: rgba(155, 127, 212, 0.10); }
.topo-texture circle[r="140"] { stroke: rgba(155, 127, 212, 0.13); }
.topo-texture circle[r="94"]  { stroke: rgba(122, 188, 220, 0.13); }
.topo-texture circle[r="54"]  { stroke: rgba(212, 159, 204, 0.12); }
.topo-texture circle[r="22"]  { stroke: rgba(155, 127, 212, 0.10); }

/* ── Nav ─────────────────────────────────────────────── */
nav {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 48px;
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
}

.nav-links a {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

/* ── Page wrap (default: 780px) ──────────────────────── */
.page-wrap {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
  padding: 64px 48px 96px;
}

/* ── Eyebrow label ───────────────────────────────────── */
.eyebrow {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

/* ── Section label ───────────────────────────────────── */
.section-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

/* ── HR divider ──────────────────────────────────────── */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 48px 0;
}

/* ── Coordinate footer ───────────────────────────────── */
.coord-footer {
  margin-top: 80px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #B0A0E8;
}

/* ── Status badges ───────────────────────────────────── */
.badge {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: 100px;
  border: 1px solid;
  white-space: nowrap;
}

.badge-shipped {
  color: #6B9E7A;
  border-color: #6B9E7A;
  background: rgba(107, 158, 122, 0.06);
}

.badge-inflight {
  color: #7B9FD4;
  border-color: #7B9FD4;
  background: rgba(123, 159, 212, 0.06);
}

.badge-living {
  color: #9B7FD4;
  border-color: rgba(155, 127, 212, 0.35);
  background: transparent;
}

/* ── Case study: back link ───────────────────────────── */
.back-link {
  display: inline-block;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rail);
  text-decoration: none;
  margin-bottom: 28px;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--muted);
}

/* ── Case study: tags row ────────────────────────────── */
.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.tag {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid;
}

.tag-default {
  color: var(--muted);
  border-color: var(--border);
  background: transparent;
}

/* ── Case study: meta row ────────────────────────────── */
.meta-row {
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: start;
  gap: 0;
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.meta-item {
  padding-right: 40px;
}

.meta-value {
  font-family: 'Barlow', sans-serif;
  font-weight: 500;
  font-size: 15px;
  color: var(--text);
  display: block;
  margin-bottom: 4px;
}

.meta-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rail);
  display: block;
}

/* ── Case study: body layout ─────────────────────────── */
.body-section {
  display: grid;
  grid-template-columns: 140px 1fr;
  margin-bottom: 52px;
}

.section-rail {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rail);
  text-align: right;
  padding-right: 24px;
  padding-top: 2px;
  line-height: 1.5;
}

.section-content {
  border-left: 1px solid var(--content-border);
  padding-left: 24px;
}

.body-text {
  font-family: 'Barlow', sans-serif;
  font-weight: 300;
  font-size: 15px;
  line-height: 1.9;
  color: var(--body-text);
  max-width: 560px;
  margin-bottom: 20px;
}

.body-text:last-child {
  margin-bottom: 0;
}

/* ── Password gate ───────────────────────────────────── */
#gate {
  position: fixed;
  inset: 0;
  background-color: var(--bg);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.gate-box {
  max-width: 380px;
  width: 100%;
}

.gate-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.gate-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.2;
}

.gate-sub {
  font-family: 'Barlow', sans-serif;
  font-weight: 300;
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 28px;
  line-height: 1.6;
}

.gate-input-row {
  display: flex;
  gap: 10px;
}

.gate-input {
  flex: 1;
  font-family: 'Barlow', sans-serif;
  font-weight: 400;
  font-size: 15px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border);
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s ease;
  border-radius: 0;
  -webkit-appearance: none;
}

.gate-input:focus {
  border-color: var(--muted);
}

.gate-input.error {
  border-color: #B04040;
}

.gate-btn {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bg);
  background-color: var(--text);
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.gate-btn:hover {
  background-color: #2D2B46;
}

.gate-error {
  font-family: 'Barlow', sans-serif;
  font-weight: 300;
  font-size: 12px;
  color: #B04040;
  margin-top: 10px;
  display: none;
}

.gate-error.visible {
  display: block;
}

#protected-content {
  display: none;
}

/* ── Mobile ──────────────────────────────────────────── */
@media (max-width: 768px) {
  nav {
    padding: 20px 24px;
  }

  .nav-links {
    gap: 20px;
  }

  .page-wrap {
    padding: 48px 24px 72px;
  }

  .topo-texture {
    width: 300px;
    height: 300px;
  }

  .meta-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 0;
  }

  .body-section {
    grid-template-columns: 1fr;
    margin-bottom: 40px;
  }

  .section-rail {
    text-align: left;
    padding-right: 0;
    padding-bottom: 10px;
    border-left: 1px solid var(--content-border);
    padding-left: 24px;
  }
}

@media (max-width: 480px) {
  .nav-links {
    gap: 14px;
  }

  .nav-links a {
    font-size: 12px;
  }

  .meta-row {
    grid-template-columns: 1fr 1fr;
  }
}
