/* ============================================================
   CIRCA · Design Kit — shared editorial styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Inter+Tight:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Paper & ink */
  --paper:    #FBF6EC;
  --cream:    #F5EDE2;
  --oat:      #EFE5D6;
  --oat-deep: #E6DBC7;
  --ink:      #1A1410;
  --ink-2:    #4A413A;
  --mute:     #8B7F73;
  --hairline: rgba(26,20,16,0.16);
  --hairline-soft: rgba(26,20,16,0.08);

  /* Cherry */
  --cherry:       #B5202B;
  --cherry-deep:  #8C1820;
  --cherry-soft:  #F4D9D9;
  --ticket:       #F5DDD8;

  /* Sage / Pine */
  --sage:  #CFD9C4;
  --pine:  #4F6B4A;

  /* Stickers */
  --blush:    #F2D9D2;
  --blush-2:  #EAC8BE;
  --peach:    #F4C9AD;
  --powder:   #C9D6E2;
  --powder-2: #B8CADB;
  --oat-chip: #EFE6D2;

  /* Type */
  --serif: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --sans:  "Inter Tight", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Geometry */
  --grid: 4px;
  --r-stub: 4px;
  --r-note: 12px;
  --r-card: 18px;
  --r-sheet: 28px;

  /* Layout */
  --gutter: clamp(24px, 4vw, 64px);
  --page-max: 1320px;
}

@media (max-width: 640px) {
  :root {
    --gutter: 20px;
    --r-card: 14px;
    --r-sheet: 20px;
  }
}

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

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(181,32,43,0.04), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(201,214,226,0.18), transparent 60%),
    var(--paper);
  background-attachment: fixed;
}

/* Subtle paper grain — pure CSS, no images */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image:
    radial-gradient(rgba(74,65,58,0.05) 1px, transparent 1.4px),
    radial-gradient(rgba(74,65,58,0.04) 1px, transparent 1.4px);
  background-size: 3px 3px, 7px 7px;
  background-position: 0 0, 1px 2px;
}

/* ====== Masthead (top chrome on every page) ====== */
.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}
.masthead-rule {
  height: 1px;
  background: var(--ink);
  opacity: 0.95;
}
.masthead-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 14px var(--gutter);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 24px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.masthead-left   { display: flex; gap: 18px; align-items: baseline; }
.masthead-center { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 18px; letter-spacing: 0.01em; text-transform: none; }
.masthead-right  { display: flex; gap: 18px; align-items: baseline; justify-content: flex-end; }
.masthead-right .folio { font-family: var(--mono); font-weight: 500; letter-spacing: 0.02em; }

.masthead a { color: inherit; text-decoration: none; }
.masthead a:hover { color: var(--cherry); }

/* ====== Section nav (the index strip) ====== */
.section-nav {
  background: var(--cream);
  border-bottom: 1px solid var(--hairline);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.section-nav-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 10px var(--gutter);
  display: flex;
  gap: 28px;
  overflow-x: auto;
  align-items: center;
  scrollbar-width: none;
}
.section-nav-inner::-webkit-scrollbar { display: none; }
.section-nav a {
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  padding: 4px 0;
  border-bottom: 0;
  transition: color .2s;
}
.section-nav a:hover { color: var(--ink); }
.section-nav a.is-current {
  color: var(--cherry);
}
.section-nav a .n {
  color: var(--mute);
  margin-right: 6px;
  font-feature-settings: "tnum";
}

/* ====== Page shell ====== */
main.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--gutter) 96px;
}

/* ====== Section opener (the №-numeral spread) ====== */
.opener {
  padding: 80px 0 48px;
  border-bottom: 1px solid var(--ink);
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 3fr;
  gap: 40px;
  align-items: end;
}
.opener .numeral {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(96px, 14vw, 200px);
  line-height: 0.88;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.opener .numeral .symbol {
  font-style: normal;
  color: var(--mute);
  font-size: 0.45em;
  vertical-align: super;
  margin-right: 0.1em;
}
.opener .title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(48px, 7vw, 96px);
  line-height: 0.96;
  letter-spacing: -0.015em;
  margin: 0 0 16px;
}
.opener .lede {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 56ch;
  margin: 0;
}
.opener .kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cherry);
  margin: 0 0 18px;
}

/* ====== Spreads (the magazine sections) ====== */
.spread {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 3fr;
  gap: 40px;
  padding: 56px 0;
  border-bottom: 1px solid var(--hairline);
}
.spread:last-of-type { border-bottom: 0; }
.spread .col-label .tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
  display: block;
  margin-bottom: 8px;
}
.spread .col-label h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-style: italic;
  font-size: 32px;
  line-height: 1.18;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}
.spread .col-label p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0 0 12px;
  max-width: 32ch;
}

/* ====== Footer rail ====== */
.colophon-rail {
  border-top: 1px solid var(--ink);
  margin-top: 32px;
  padding: 28px 0 18px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 24px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--mute);
  text-transform: uppercase;
}
.colophon-rail .center {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--ink);
}
.colophon-rail a { color: inherit; text-decoration: none; border-bottom: 0; }
.colophon-rail a:hover { color: var(--cherry); }
.colophon-rail .right { text-align: right; display: flex; gap: 16px; justify-content: flex-end; }

/* ====== Reusable atoms ====== */
.hr-hair { height: 1px; background: var(--hairline); border: 0; margin: 0; }
.hr-ink  { height: 1px; background: var(--ink);      border: 0; margin: 0; }

.tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mute);
}
.eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--mute);
}
.dot-row { display: inline-flex; align-items: center; gap: 6px; }
.dot-row::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cherry);
  display: inline-block;
}

/* The globe-heart mark, drawn in SVG inline elsewhere */
.mark-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--ink);
}

/* Buttons */
.btn {
  text-decoration: none;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  padding: 14px 22px;
  border-radius: 14px;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform .12s ease, background .18s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn--cherry {
  background: var(--cherry);
  color: var(--paper);
  border-color: var(--cherry);
}
.btn--cherry:hover { background: var(--cherry-deep); border-color: var(--cherry-deep); }
.btn--ghost {
  background: transparent;
  border-color: var(--hairline);
}

/* Pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 6px;
  border-radius: 999px;
  background: var(--cream);
  border: 1px solid var(--hairline);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}
.pill--live { background: var(--cherry); color: var(--paper); border-color: var(--cherry); }
.pill--live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--paper); }
.pill--soon { background: var(--peach); border-color: transparent; }
.pill--upcoming { background: var(--oat-chip); border-color: var(--hairline); }

/* Hairline cards */
.card {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  padding: 20px;
}
.card--cream  { background: var(--cream); }
.card--oat    { background: var(--oat); }
.card--ticket {
  background: var(--ticket);
  border-style: dashed;
  border-color: rgba(140,24,32,0.35);
}

/* Sticker */
.sticker {
  --sk-size: 64px;
  width: var(--sk-size);
  height: var(--sk-size);
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 500;
  font-size: calc(var(--sk-size) * 0.36);
  color: var(--ink);
  position: relative;
  box-shadow: 0 1px 0 rgba(26,20,16,0.06), 0 6px 14px -8px rgba(26,20,16,0.18);
  user-select: none;
  cursor: pointer;
  transition: transform .14s ease;
}
.sticker:hover { transform: rotate(-3deg) translateY(-2px); }
.sticker--selected { background: var(--cherry); color: var(--paper); border-color: var(--cherry); }
.sticker--custom {
  border-style: dashed;
  font-family: var(--sans);
  font-size: calc(var(--sk-size) * 0.18);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
/* Corner peel */
.sticker::after {
  content: "";
  position: absolute;
  right: 6px; top: 6px;
  width: 10px; height: 10px;
  border-radius: 0 50% 0 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.6), rgba(0,0,0,0.04));
  box-shadow: -1px 1px 0 rgba(26,20,16,0.12);
  opacity: 0.5;
}

/* Mono token chip */
.token {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: all;
}
.token .copy-icon {
  font-family: var(--sans);
  color: var(--mute);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity .18s;
}
.token:hover .copy-icon { opacity: 1; }
.token.copied .copy-icon { opacity: 1; color: var(--cherry); }

/* Footnote / caption */
.cap {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mute);
}

/* Plate (photo placeholder) */
.plate {
  background:
    repeating-linear-gradient(45deg, rgba(26,20,16,0.05) 0 1px, transparent 1px 14px),
    var(--cream);
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  aspect-ratio: 4/5;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 16px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}

/* Responsive */
@media (max-width: 760px) {
  .opener,
  .spread { grid-template-columns: 1fr; gap: 18px; }
  .opener { padding: 48px 0 32px; }
  .opener .numeral { font-size: 88px; }
  .opener .title { font-size: 44px; }
  .colophon-rail { grid-template-columns: 1fr; gap: 10px; text-align: center; }
  .colophon-rail .right { justify-content: center; }
}

/* Reveal on load */
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rise > * { opacity: 0; animation: rise .7s cubic-bezier(.2,.7,.1,1) forwards; }
.rise > *:nth-child(1) { animation-delay: .05s; }
.rise > *:nth-child(2) { animation-delay: .15s; }
.rise > *:nth-child(3) { animation-delay: .25s; }
.rise > *:nth-child(4) { animation-delay: .35s; }
.rise > *:nth-child(5) { animation-delay: .45s; }
.rise > *:nth-child(6) { animation-delay: .55s; }
.rise > *:nth-child(7) { animation-delay: .65s; }
.rise > *:nth-child(8) { animation-delay: .75s; }
.rise > *:nth-child(9) { animation-delay: .85s; }
