/* =========================================================================
   THE NINTH SKY — The Charted Survey
   A serialized science-fantasy web-story theme for Ghost.
   Gold = the strange physics bleeding from the wrecks.
   Cyan = the dead machine it used to be.
   ========================================================================= */

/* ---------- Tokens ---------- */
:root {
  --ink:        #13110b;   /* primary page */
  --ink-2:      #0c0b07;   /* atlas / deep panels */
  --paper:      #e8ddc4;   /* body text */
  --paper-hi:   #f3ead2;   /* headings */
  --gold:       #cda24a;
  --gold-soft:  rgba(205,162,74,.5);
  --cyan:       #6fb6bd;
  --cyan-hi:    #9fd6db;
  --muted:      #9c9270;
  --dim:        #8f8a72;
  --faint:      #6f6a5a;
  --line:       rgba(205,162,74,.18);
  --line-soft:  rgba(205,162,74,.10);

  --serif:    'EB Garamond', Georgia, serif;
  --display:  'Bodoni Moda', 'Times New Roman', serif;
  --initial:  'Gloock', Georgia, serif;
  --mono:     'Space Mono', ui-monospace, 'SFMono-Regular', monospace;

  --measure: 720px;
  --page-x: 42px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--serif);
  color: var(--paper);
  background-color: var(--ink);
  background-image:
    radial-gradient(120% 80% at 50% -10%, rgba(205,162,74,.06), transparent 56%),
    repeating-linear-gradient(0deg,  rgba(205,162,74,.02) 0 1px, transparent 1px 36px),
    repeating-linear-gradient(90deg, rgba(205,162,74,.02) 0 1px, transparent 1px 36px);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
::selection { background: rgba(205,162,74,.3); color: var(--paper-hi); }

.site { min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1 0 auto; }
.wrap { max-width: 1156px; margin: 0 auto; padding: 0 var(--page-x); }

/* ---------- Decorative divider ---------- */
.rule {
  display: flex; align-items: center; gap: 16px;
  margin: 26px 0;
}
.rule::before, .rule::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-soft));
}
.rule::after { background: linear-gradient(90deg, var(--gold-soft), transparent); }
.rule span { color: var(--gold); font-size: 12px; letter-spacing: .1em; }

/* =========================================================================
   SITE HEAD / NAV
   ========================================================================= */
.site-head { border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
.site-head-inner {
  max-width: 1156px; margin: 0 auto; padding: 16px var(--page-x);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.site-brand {
  font-family: var(--display); font-variant: small-caps; letter-spacing: .16em;
  font-size: 16px; color: var(--paper-hi); text-decoration: none; white-space: nowrap; flex: none;
}
.site-brand-sub { color: var(--muted); }
.site-nav { min-width: 0; }
.nav { list-style: none; display: flex; flex-wrap: nowrap; gap: 26px; margin: 0; padding: 0; align-items: center; }
.nav li { flex: none; }
.nav a {
  font-family: var(--display); font-variant: small-caps; letter-spacing: .12em;
  font-size: 15px; color: #b3aa90; text-decoration: none; white-space: nowrap; transition: color .2s ease;
}
.nav a:hover, .nav li.nav-current a { color: var(--paper-hi); }
.nav-cta {
  font-family: var(--display) !important; font-variant: small-caps; letter-spacing: .12em;
  color: var(--gold) !important; border-bottom: 1px solid var(--gold-soft); padding-bottom: 2px;
}
.nav-cta:hover { border-bottom-color: var(--gold); }
/* free up room for a longer menu before the mobile breakpoint */
@media (max-width: 1100px) {
  .site-brand-sub { display: none; }
  .nav { gap: 20px; }
  .nav a { letter-spacing: .08em; }
}
.nav-toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 1.5px; background: var(--gold); margin: 4px 0; transition: transform .25s ease, opacity .2s ease; }

/* survey strip (under nav, shows on listing/atlas) */
.survey-strip {
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--cyan);
}
.survey-strip .wrap { display: flex; justify-content: space-between; padding-top: 9px; padding-bottom: 9px; }
.survey-strip .coord { color: var(--dim); }

/* =========================================================================
   MASTHEAD (home)
   ========================================================================= */
/* home layout: left survey rail + body */
.home { max-width: 1156px; margin: 0 auto; display: flex; align-items: stretch; }
.survey-rail {
  flex: none; width: 76px; align-self: stretch;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(205,162,74,.08), transparent 60%);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 24px 0; min-height: 560px;
}
.survey-rail .rail-mark { color: var(--gold); font-size: 15px; }
.survey-rail .rail-name {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-family: var(--display); font-variant: small-caps; letter-spacing: .3em;
  font-size: 14px; color: var(--gold); white-space: nowrap;
}
.survey-rail .rail-coord-group {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.survey-rail .rail-coord {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-family: var(--mono); font-size: 9px; letter-spacing: .18em; color: var(--cyan); white-space: nowrap;
}
.survey-rail .rail-dia { color: var(--cyan); font-size: 12px; }
.home-body { flex: 1; min-width: 0; }
/* inside home, masthead + log are full-width of the body column */
.home .masthead, .home .log { max-width: none; margin: 0; }
.home .masthead { padding-left: 32px; padding-right: 32px; }
.home .log { padding-left: 32px; padding-right: 32px; }
.home .rule { margin-left: 32px; margin-right: 32px; }

.masthead { padding: 50px var(--page-x) 6px; max-width: 1156px; margin: 0 auto; position: relative; }
.masthead-grid { display: flex; gap: 24px; align-items: flex-start; }
.masthead-main { flex: 1; min-width: 0; position: relative; z-index: 2; animation: floatUp .8s ease both; }
.masthead-kicker { font-family: var(--mono); font-size: 11px; letter-spacing: .2em; color: var(--cyan); margin-bottom: 18px; }
.masthead-title {
  font-family: var(--display); font-weight: 600; font-size: clamp(60px, 7vw, 96px);
  line-height: .92; letter-spacing: .005em; margin: 0; color: var(--paper-hi);
  text-shadow: 0 0 44px rgba(205,162,74,.16);
}
.masthead-lede { margin-top: 30px; max-width: 580px; position: relative; }
.masthead-lede-text {
  font-family: var(--serif); font-style: italic; font-size: 21px; line-height: 1.5; color: #cabd9e; margin: 0 0 14px;
}
.masthead-lede-text::first-letter {
  font-family: var(--initial); font-style: normal; font-size: 86px; line-height: .7; float: left;
  padding: 8px 16px 0 0; color: var(--gold); text-shadow: 0 0 28px rgba(205,162,74,.32);
}
/* cyan signature lines live in the JS-built split layout below */
.masthead-lede.is-split { display: flex; gap: 22px; align-items: stretch; max-width: 580px; }
.masthead-lede.is-split .masthead-lede-text::first-letter {
  font-size: inherit; font-family: inherit; line-height: inherit; float: none; padding: 0; color: inherit; text-shadow: none;
}
.masthead-initial {
  flex: none; align-self: flex-start; position: relative; font-family: var(--initial); font-size: 86px; line-height: .7;
  color: var(--gold); text-shadow: 0 0 28px rgba(205,162,74,.32);
}
/* two cyan signature lines, just below the cap (em-based so they track the glyph) */
.masthead-initial .ci { position: absolute; left: .05em; height: 1px; background: var(--cyan); pointer-events: none; }
.masthead-initial .ci1 { top: .82em; width: .46em; opacity: .6; }
.masthead-initial .ci2 { top: .93em; width: .30em; opacity: .4; }
.masthead-lede-col { flex: 1; min-width: 0; }

.masthead-open { display: inline-flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--dim); text-decoration: none; }
.masthead-open .tick { width: 30px; height: 1px; background: var(--gold-soft); }
.masthead-open .go { color: var(--gold); transition: letter-spacing .2s ease; }
.masthead-open:hover .go { letter-spacing: .14em; }

/* survey-chart plate */
.plate { flex: none; width: 296px; height: 296px; position: relative; margin: -4px 0 0 0; opacity: .94; animation: driftSlow 12s ease-in-out infinite; }
.plate i { position: absolute; display: block; }
.plate .ring  { inset: 0;     border: 1px solid rgba(205,162,74,.32); border-radius: 50%; }
.plate .ring2 { inset: 40px;  border: 1px solid rgba(205,162,74,.2);  border-radius: 50%; }
.plate .ring3 { inset: 84px;  border: 1px dashed rgba(232,221,196,.16); border-radius: 50%; }
.plate .dia   { inset: 62px;  border: 1px solid rgba(205,162,74,.42); transform: rotate(45deg); }
.plate .dia2  { inset: 108px; border: 1px solid rgba(111,182,189,.45); transform: rotate(45deg); }
.plate .cross-h { left: 0; right: 0; top: 50%; height: 1px; background: rgba(232,221,196,.08); }
.plate .cross-v { top: 0; bottom: 0; left: 50%; width: 1px; background: rgba(232,221,196,.08); }
.plate .ray { left: 50%; top: 50%; width: 118px; height: 1px; transform-origin: left; transform: rotate(32deg); background: repeating-linear-gradient(90deg, rgba(205,162,74,.6) 0 5px, transparent 5px 10px); }
.plate .core { left: 50%; top: 50%; width: 9px; height: 9px; background: var(--cyan); border-radius: 50%; transform: translate(-50%,-50%); box-shadow: 0 0 14px var(--cyan); }
.plate .pt-a { left: 79%; top: 31%; width: 7px; height: 7px; background: var(--gold); border-radius: 50%; box-shadow: 0 0 0 4px rgba(205,162,74,.16); }
.plate .pt-b { left: 21%; top: 65%; width: 6px; height: 6px; border: 1px solid var(--cyan); border-radius: 50%; }
.plate .pt-c { left: 64%; top: 80%; width: 5px; height: 5px; background: var(--gold); border-radius: 50%; }
.plate .plate-cap { position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%); font-family: var(--mono); font-size: 9px; letter-spacing: .14em; color: var(--dim); white-space: nowrap; }

/* =========================================================================
   THE LOG (listing)
   ========================================================================= */
.log { max-width: 1156px; margin: 0 auto; padding: 6px var(--page-x) 30px; }
.log-head {
  display: flex; align-items: baseline; justify-content: space-between;
  border-bottom: 1px solid rgba(205,162,74,.22); padding-bottom: 10px; margin-bottom: 4px;
}
.log-head .ttl { font-family: var(--display); font-variant: small-caps; letter-spacing: .18em; font-size: 15px; color: var(--paper-hi); }
.log-head .cols { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; color: var(--dim); }
.survey-group-head {
  font-family: var(--display); font-variant: small-caps; letter-spacing: .18em; font-size: 14px;
  color: var(--muted); border-bottom: 1px solid rgba(205,162,74,.2); padding-bottom: 9px; margin: 18px 0 2px;
}

.log-rows { display: flex; flex-direction: column-reverse; }
.log-rows-asc { display: block; }
.log-item {
  display: flex; align-items: baseline; gap: 16px; padding: 15px 8px;
  border-bottom: 1px solid var(--line-soft); text-decoration: none; color: inherit;
  transition: background .2s ease, padding-left .2s ease;
}
.log-item:hover { background: rgba(205,162,74,.06); padding-left: 16px; }
.log-dot { width: 6px; height: 6px; border-radius: 50%; border: 1px solid var(--faint); align-self: center; flex: none; }
.log-item.is-current .log-dot { width: 9px; height: 9px; background: var(--gold); border: 0; box-shadow: 0 0 10px rgba(205,162,74,.6); }
.log-no { font-family: var(--display); font-variant: small-caps; letter-spacing: .06em; font-size: 15px; color: var(--muted); width: 92px; flex: none; }
.log-item.is-current .log-no { color: var(--gold); }
.log-coord { font-family: var(--mono); font-size: 11px; color: var(--dim); width: 178px; flex: none; }
.log-title { font-family: var(--display); font-weight: 600; font-size: 23px; color: var(--paper); }
.log-item.is-current .log-title { color: var(--paper-hi); }
.log-fill { flex: 1; border-bottom: 1px dotted rgba(232,221,196,.26); margin: 0 6px 6px; }
.log-note { font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--muted); white-space: nowrap; }
.log-more { display: flex; justify-content: flex-end; margin-top: 14px; }
.log-more a { font-family: var(--display); font-variant: small-caps; letter-spacing: .12em; font-size: 14px; color: var(--gold); text-decoration: none; border-bottom: 1px solid var(--gold-soft); padding-bottom: 2px; }

/* uncharted rows */
.log-item.is-locked { opacity: .45; pointer-events: none; }
.log-item.is-locked .log-dot { border-style: dashed; }

/* pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 30px 0; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--dim); }
.pagination a { color: var(--gold); text-decoration: none; }

/* =========================================================================
   CHAPTER READER (post + page)
   ========================================================================= */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: rgba(232,221,196,.08); z-index: 50; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--gold)); position: relative; transition: width .1s linear; }
.progress-bar::after { content: ""; position: absolute; right: -3px; top: 50%; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px var(--gold); transform: translateY(-50%); animation: glowPulse 2.8s ease-in-out infinite; }

.post { max-width: 860px; margin: 0 auto; padding: 0 var(--page-x); }
.post-topbar { display: flex; align-items: center; justify-content: space-between; padding: 24px 0 0; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--dim); }
.post-topbar a { text-decoration: none; color: inherit; }
.post-topbar a:hover { color: var(--gold); }

.post-header { text-align: center; padding: 40px 0 0; }
.post-kicker { font-family: var(--display); font-variant: small-caps; letter-spacing: .2em; font-size: 14px; color: var(--cyan); margin-bottom: 18px; }
.post-title { font-family: var(--display); font-weight: 600; font-size: clamp(34px, 5vw, 54px); line-height: 1.04; margin: 0 0 18px; color: var(--paper-hi); text-shadow: 0 0 34px rgba(205,162,74,.16); }
.post-byline { font-family: var(--mono); font-size: 11px; letter-spacing: .05em; color: var(--dim); }
.post-feature { margin: 34px 0 8px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }

/* body typography */
.post-content { font-size: 19px; line-height: 1.8; color: #cdc3a8; padding: 8px 0 16px; }
.post-content > p { margin: 0 0 28px; }
.post-content > p:first-of-type { color: #ddd2b8; }
.post-content > p:first-of-type::first-letter {
  font-family: var(--initial); font-size: 80px; line-height: .7; float: left;
  padding: 10px 16px 0 0; color: var(--gold); text-shadow: 0 0 22px rgba(205,162,74,.4);
}
.post-content h2, .post-content h3 { font-family: var(--display); font-weight: 600; color: var(--paper-hi); line-height: 1.15; margin: 38px 0 16px; }
.post-content h2 { font-size: 30px; }
.post-content h3 { font-size: 24px; }
.post-content a { color: var(--cyan-hi); text-decoration: underline; text-decoration-color: rgba(111,182,189,.4); text-underline-offset: 3px; }
.post-content strong { color: var(--paper); font-weight: 600; }
.post-content blockquote {
  border-left: 2px solid var(--gold); margin: 0 0 28px; padding: 4px 0 4px 26px;
  font-family: var(--display); font-style: italic; font-size: 23px; line-height: 1.5; color: #ece2c8;
}
.post-content blockquote cite, .post-content blockquote footer { display: block; font-family: var(--mono); font-style: normal; font-size: 10.5px; letter-spacing: .08em; color: var(--dim); margin-top: 10px; }
.post-content hr {
  border: 0; height: 28px; margin: 12px 0 34px; position: relative;
}
.post-content hr::after {
  content: "✦"; color: var(--gold); font-size: 12px; position: absolute; left: 50%; top: 50%;
  transform: translate(-50%,-50%); background: var(--ink); padding: 0 14px;
}
.post-content hr::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-soft) 30%, var(--gold-soft) 70%, transparent);
}
.post-content ul, .post-content ol { padding-left: 1.2em; margin: 0 0 28px; }
.post-content li { margin-bottom: 8px; }
.post-content img, .post-content .kg-card { margin: 8px 0 30px; border-radius: 6px; }
.post-content figcaption { text-align: center; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; color: var(--dim); margin-top: 10px; }

/* Koenig editor — required width classes for wide / full-bleed cards */
.gh-content .kg-width-wide {
  position: relative; width: min(1100px, 92vw);
  margin-left: 50%; transform: translateX(-50%);
}
.gh-content .kg-width-full {
  position: relative; width: 100vw; max-width: 100vw;
  margin-left: 50%; transform: translateX(-50%); border-radius: 0;
}
.gh-content .kg-width-full img { border-radius: 0; width: 100%; }
.gh-content .kg-image, .gh-content .kg-width-wide img { border-radius: 6px; }

/* margin note — author wraps a note in <aside class="note"> (see README) */
.post-content aside.note {
  font-family: var(--serif); font-style: italic; font-size: 14px; line-height: 1.5; color: var(--muted);
  border: 1px solid rgba(111,182,189,.22); border-radius: 6px; background: rgba(111,182,189,.04);
  padding: 14px 16px; margin: 0 0 28px;
}
.post-content aside.note::before {
  content: "NOTE"; display: block; font-family: var(--mono); font-style: normal;
  font-size: 9px; letter-spacing: .14em; color: var(--cyan); margin-bottom: 6px;
}
@media (min-width: 1100px) {
  .post-content aside.note { float: right; width: 240px; margin: 4px -288px 24px 28px; }
}

/* prev / next */
.post-nav { display: flex; gap: 16px; padding: 26px 0 56px; }
.post-nav a { flex: 1; padding: 20px 22px; border: 1px solid rgba(205,162,74,.16); border-radius: 6px; text-decoration: none; color: inherit; transition: border-color .2s ease, background .2s ease; }
.post-nav a:hover { border-color: rgba(205,162,74,.4); background: rgba(205,162,74,.05); }
.post-nav .label { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--dim); margin-bottom: 7px; }
.post-nav .ttl { font-family: var(--display); font-weight: 600; font-size: 19px; color: var(--paper); }
.post-nav .next { text-align: right; border-color: rgba(205,162,74,.3); background: rgba(205,162,74,.05); }
.post-nav .next .label { color: var(--gold); }

/* =========================================================================
   ABOUT-style page content
   ========================================================================= */
.page-hero { text-align: center; max-width: 860px; margin: 0 auto; padding: 46px var(--page-x) 26px; }
.page-hero .kicker { font-family: var(--mono); font-size: 11px; letter-spacing: .2em; color: var(--cyan); margin-bottom: 18px; }
.page-hero h1 { font-family: var(--display); font-weight: 600; font-size: clamp(36px, 5vw, 48px); line-height: 1.05; margin: 0 0 20px; color: var(--paper-hi); }
.page-hero .lede { font-family: var(--serif); font-style: italic; font-size: 21px; line-height: 1.6; color: #cabd9e; max-width: 560px; margin: 0 auto; }
.page-body { max-width: 760px; margin: 0 auto; padding: 8px var(--page-x) 40px; font-size: 18px; line-height: 1.75; color: #cdc3a8; }
.page-body h2 { font-family: var(--display); font-weight: 600; font-size: 28px; color: var(--paper-hi); margin: 32px 0 12px; }

/* subscribe block */
.subscribe { max-width: 760px; margin: 12px auto 50px; padding: 0 var(--page-x); }
.subscribe-inner { border: 1px solid rgba(205,162,74,.3); border-radius: 8px; background: rgba(205,162,74,.04); padding: 28px 30px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.subscribe h3 { font-family: var(--display); font-weight: 600; font-size: 24px; color: var(--paper-hi); margin: 0 0 6px; }
.subscribe p { font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--muted); margin: 0; }
.subscribe form { display: flex; gap: 10px; flex: none; }
.subscribe input { font-family: var(--mono); font-size: 12px; color: var(--paper); background: transparent; border: 1px solid rgba(205,162,74,.25); border-radius: 6px; padding: 12px 16px; min-width: 180px; }
.subscribe input::placeholder { color: var(--faint); }
.subscribe button { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; color: var(--ink); background: var(--gold); border: 0; border-radius: 6px; padding: 12px 22px; font-weight: 700; cursor: pointer; }

/* =========================================================================
   ATLAS
   - desktop: 2-D survey star-chart (.atlas-chart, built by JS)
   - mobile / no-JS: vertical survey route (.atlas-route)
   ========================================================================= */
.atlas-wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--page-x) 44px; }
.atlas-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding: 30px 0 16px; }
.atlas-kicker { font-family: var(--mono); font-size: 11px; letter-spacing: .2em; color: var(--cyan); margin-bottom: 12px; }
.atlas-title { font-family: var(--display); font-weight: 600; font-size: clamp(40px, 6vw, 50px); line-height: 1; margin: 0; color: var(--paper-hi); }
.atlas-legend { flex: none; text-align: right; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; color: var(--dim); line-height: 1.85; }
.atlas-legend .lg-fix { color: var(--gold); }
.atlas-legend .lg-cur { color: var(--cyan); }
.atlas-legend .lg-unc { color: var(--faint); }
.atlas-intro { max-width: none; padding-left: 0; padding-right: 0; margin-bottom: 8px; }

.atlas-chart {
  position: relative; height: 560px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
  background-color: #0a0906;
  background-image:
    radial-gradient(80% 120% at 80% 10%, rgba(111,182,189,.07), transparent 60%),
    radial-gradient(70% 90% at 15% 85%, rgba(205,162,74,.07), transparent 60%),
    repeating-linear-gradient(0deg, rgba(232,221,196,.04) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(90deg, rgba(232,221,196,.04) 0 1px, transparent 1px 40px);
}
.atlas-chart .sector { position: absolute; font-family: var(--mono); font-size: 10px; letter-spacing: .16em; color: #5f5b4e; }
.atlas-chart .sector-tl { left: 24px; top: 18px; }
.atlas-chart .sector-tr { right: 24px; top: 18px; }
.atlas-chart .sector-bl { left: 24px; bottom: 16px; }
.atlas-chart .sector-br { right: 24px; bottom: 16px; }
.atlas-stars span { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #cfc6ad; }
.atlas-path { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.atlas-nodes { position: absolute; inset: 0; }
.chart-node { position: absolute; transform: translate(-50%, -50%); text-align: center; text-decoration: none; color: inherit; z-index: 1; }
.chart-node .dot { display: block; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px rgba(205,162,74,.5); margin: 0 auto; }
.chart-node .lbl { font-family: var(--mono); font-size: 9.5px; color: var(--dim); display: block; margin-top: 7px; letter-spacing: .04em; white-space: nowrap; transition: color .2s ease; }
.chart-node:hover .lbl { color: var(--paper-hi); }
.chart-node:hover .dot { box-shadow: 0 0 14px rgba(205,162,74,.85); }
.chart-node.is-current { z-index: 2; }
.chart-node.is-current .dot {
  width: 16px; height: 16px; background: none; border: 1px solid var(--cyan); box-shadow: none; position: relative;
  animation: nodePulse 2.6s ease-in-out infinite;
}
.chart-node.is-current .dot::after { content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 14px var(--cyan); }
.chart-node.is-current .lbl { color: var(--cyan-hi); }
.chart-node.is-current .sub { font-family: var(--mono); font-size: 8.5px; color: var(--cyan); display: block; letter-spacing: .1em; margin-top: 2px; }
.chart-node.is-locked .dot { width: 9px; height: 9px; background: none; border: 1px dashed var(--faint); box-shadow: none; }
.chart-node.is-locked .lbl { color: #5f5b4e; }

/* show chart on desktop, route on mobile; both hidden gracefully without the other */
.atlas-route { display: none; }
.no-js .atlas-chart { display: none; }
.no-js .atlas-route { display: block; }

/* =========================================================================
   ATLAS — vertical survey route (mobile / fallback)
   ========================================================================= */
.atlas { max-width: 860px; margin: 0 auto; padding: 28px var(--page-x) 30px; }
.atlas-kicker { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; color: var(--cyan); margin-bottom: 12px; }
.atlas h1 { font-family: var(--display); font-weight: 600; font-size: clamp(40px, 6vw, 50px); line-height: 1; margin: 0 0 24px; color: var(--paper-hi); }
.atlas-route { position: relative; padding-left: 0; }
.atlas-route::before { content: ""; position: absolute; left: 11px; top: 10px; bottom: 26px; width: 1px; background: repeating-linear-gradient(180deg, var(--gold-soft) 0 4px, transparent 4px 9px); }
.atlas-node { position: relative; display: flex; align-items: flex-start; gap: 18px; padding: 11px 0; text-decoration: none; color: inherit; }
.atlas-node .marker { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px rgba(205,162,74,.55); flex: none; margin: 6px 0 0 7px; }
.atlas-node .ttl { font-family: var(--display); font-weight: 600; font-size: 19px; color: var(--paper); }
.atlas-node:hover .ttl { color: var(--paper-hi); }
.atlas-node .coord { font-family: var(--mono); font-size: 9.5px; color: var(--dim); letter-spacing: .04em; }
.atlas-node.is-current .marker { width: 16px; height: 16px; background: none; border: 1px solid var(--cyan); margin: 3px 0 0 3px; box-shadow: none; animation: nodePulse 2.6s ease-in-out infinite; position: relative; }
.atlas-node.is-current .marker::after { content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.atlas-node.is-current .ttl { color: var(--cyan-hi); }
.atlas-node.is-current .coord { color: var(--cyan); }
.atlas-node.is-locked { opacity: .5; }
.atlas-node.is-locked .marker { background: none; border: 1px dashed var(--faint); box-shadow: none; }
.atlas-node.is-locked .ttl { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--faint); }

/* Koenig callout card */
.post-content .kg-callout-card {
  display: flex; gap: 14px; align-items: flex-start;
  margin: 8px 0 30px; padding: 18px 22px;
  border: 1px solid var(--line); border-left: 2px solid var(--gold);
  border-radius: 6px; background: rgba(205,162,74,.05);
}
.post-content .kg-callout-emoji { font-size: 20px; line-height: 1.5; flex: none; }
.post-content .kg-callout-text { font-family: var(--serif); font-size: 17px; line-height: 1.6; color: var(--paper); margin: 0; }
.post-content .kg-callout-card-grey   { border-left-color: var(--dim);  background: rgba(232,221,196,.04); }
.post-content .kg-callout-card-blue   { border-left-color: var(--cyan);  background: rgba(111,182,189,.06); }
.post-content .kg-callout-card-green  { border-left-color: #6fae7a;      background: rgba(111,174,122,.06); }
.post-content .kg-callout-card-yellow { border-left-color: var(--gold);  background: rgba(205,162,74,.06); }
.post-content .kg-callout-card-red    { border-left-color: #c2694f;      background: rgba(194,105,79,.06); }
.post-content .kg-callout-card-pink   { border-left-color: #c27fa6;      background: rgba(194,127,166,.06); }
.post-content .kg-callout-card-purple { border-left-color: #9b86c9;      background: rgba(155,134,201,.06); }

/* =========================================================================
   FOOTER
   ========================================================================= */
.site-foot { border-top: 1px solid var(--line); margin-top: 20px; }
.site-foot-inner { max-width: 1156px; margin: 0 auto; padding: 18px var(--page-x); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-foot .by { font-family: var(--display); font-variant: small-caps; letter-spacing: .14em; font-size: 13px; color: var(--dim); }
.site-foot .meta { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; color: var(--faint); }
.site-foot a { color: inherit; text-decoration: none; }
.site-foot a:hover { color: var(--gold); }

/* =========================================================================
   KEYFRAMES
   ========================================================================= */
@keyframes floatUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes driftSlow { 0%,100% { transform: translate(0,0); } 50% { transform: translate(0,-8px); } }
@keyframes glowPulse { 0%,100% { opacity: .5; transform: translateY(-50%) scale(1); } 50% { opacity: 1; transform: translateY(-50%) scale(1.18); } }
@keyframes nodePulse { 0%,100% { opacity: .6; transform: scale(1); } 50% { opacity: 1; transform: scale(1.18); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 1024px) {
  :root { --page-x: 28px; }
  .plate { display: none; }
  .masthead-lede { max-width: none; }
}

@media (max-width: 768px) {
  .nav-toggle { display: block; order: 3; }
  .site-nav { display: none; }
  .site-head.is-open .site-nav {
    display: block; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--ink); border-bottom: 1px solid var(--line); z-index: 30;
  }
  .site-head.is-open .nav { flex-direction: column; align-items: flex-start; gap: 0; padding: 8px var(--page-x) 16px; }
  .site-head.is-open .nav li { width: 100%; }
  .site-head.is-open .nav a { display: block; padding: 12px 0; font-size: 18px; }
  .site-head.is-open .nav-toggle span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
  .site-head.is-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .site-head.is-open .nav-toggle span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

  .masthead { padding-top: 36px; }
  .masthead-lede-text { font-size: 18px; }
  .masthead-lede-text::first-letter { font-size: 64px; padding: 6px 12px 0 0; }

  /* collapse the home rail into a top strip */
  .home { display: block; }
  .survey-rail {
    width: auto; min-height: 0; flex-direction: row; align-items: center; justify-content: space-between;
    border-right: 0; border-bottom: 1px solid var(--line-soft); padding: 9px var(--page-x);
  }
  .survey-rail .rail-mark { display: none; }
  .survey-rail .rail-name, .survey-rail .rail-coord {
    writing-mode: horizontal-tb; transform: none; flex-direction: row; gap: 8px;
  }
  .survey-rail .rail-coord-group { flex-direction: row; align-items: center; gap: 8px; }
  .survey-rail .rail-name { letter-spacing: .14em; font-size: 12px; }
  .survey-rail .rail-dia { transform: none; }
  .home .masthead, .home .log, .home .rule { padding-left: var(--page-x); padding-right: var(--page-x); margin-left: 0; margin-right: 0; }
  .masthead { padding-top: 32px; }
  .masthead-title { font-size: clamp(40px, 11vw, 56px); line-height: .92; }
  /* mobile matches the design: no drop-cap, plain lede, filled button */
  .masthead-lede-text::first-letter { font-size: inherit; font-family: inherit; line-height: inherit; float: none; padding: 0; color: inherit; text-shadow: none; }
  .masthead-lede-text { font-size: 17px; }
  .masthead-kicker .k-coord { display: none; }
  .masthead-open { background: var(--gold); border-radius: 6px; padding: 11px 18px; }
  .masthead-open .open-no, .masthead-open .tick { display: none; }
  .masthead-open .go { color: var(--ink); font-weight: 700; }

  /* mobile survey strip: small mono, no diamond (matches design) */
  .survey-rail .rail-name { font-family: var(--mono); font-variant: normal; text-transform: uppercase; letter-spacing: .1em; font-size: 9.5px; color: var(--cyan); }
  .survey-rail .rail-coord { font-size: 9.5px; color: var(--dim); }
  .survey-rail .rail-dia { display: none; }

  /* ledger rows stack: dot + log-no + coord on top, then title, then note */
  .log-item { flex-wrap: wrap; align-items: center; column-gap: 9px; row-gap: 5px; padding: 14px 6px; }
  .log-item:hover { padding-left: 6px; }
  .log-dot { order: 1; }
  .log-no { order: 2; width: auto; font-size: 13px; }
  .log-coord { order: 3; width: auto; font-size: 9.5px; }
  .log-title { order: 4; width: 100%; font-size: 21px; line-height: 1.12; }
  .log-fill { display: none; }
  .log-note { order: 5; white-space: normal; font-size: 13px; width: 100%; }
  .log-head .cols { display: none; }

  /* reader */
  .post-content { font-size: 17px; line-height: 1.75; }
  .post-content > p:first-of-type::first-letter { font-size: 62px; padding: 8px 12px 0 0; }
  .post-content blockquote { font-size: 20px; padding-left: 20px; }
  .post-nav { flex-direction: column; }
  .post-nav .next { text-align: left; }

  .subscribe-inner { flex-direction: column; align-items: stretch; }
  .subscribe form { flex-direction: column; }
  .subscribe input { min-width: 0; }

  .atlas-node .ttl { font-size: 17px; }
  /* mobile: hide the star-chart, show the vertical route */
  .atlas-chart { display: none; }
  .atlas-route { display: block; }
  .atlas-head { display: block; }
  .atlas-legend { display: none; }
}

@media (max-width: 480px) {
  :root { --page-x: 20px; }
  .site-brand-sub { display: none; }
  .post-feature { margin: 24px 0 8px; }
}

/* =========================================================================
   THE RECKONING — field primer (page-reckoning.hbs)
   Static 3-D tetrahedral fix diagram + correction stack + two clocks.
   ========================================================================= */
.rk-wrap { max-width: 1240px; margin: 0 auto; padding: 0 var(--page-x) 56px; }
.rk-head { text-align: center; padding: 46px 0 30px; border-bottom: 1px solid var(--line-soft); }
.rk-kicker { font-family: var(--mono); font-size: 11px; letter-spacing: .2em; color: var(--cyan); margin-bottom: 16px; }
.rk-title { font-family: var(--display); font-weight: 600; font-size: clamp(44px, 6vw, 62px); line-height: 1.02; margin: 0 0 16px; color: var(--paper-hi); text-shadow: 0 0 40px rgba(205,162,74,.16); }
.rk-lede { font-family: var(--serif); font-style: italic; font-size: 21px; line-height: 1.6; color: #cabd9e; max-width: 680px; margin: 0 auto; }

.rk-plate-row { display: flex; gap: 40px; align-items: stretch; padding-top: 34px; }
.rk-plate { position: relative; flex: none; width: 600px; max-width: 100%; margin: 0; aspect-ratio: 600 / 520; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background-color: #0a0906;
  background-image:
    radial-gradient(70% 100% at 28% 22%, rgba(111,182,189,.08), transparent 60%),
    radial-gradient(80% 90% at 80% 85%, rgba(205,162,74,.07), transparent 60%),
    repeating-linear-gradient(0deg, rgba(232,221,196,.04) 0 1px, transparent 1px 40px),
    repeating-linear-gradient(90deg, rgba(232,221,196,.04) 0 1px, transparent 1px 40px); }
.rk-plate svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.rk-plate-tag { position: absolute; left: 18px; top: 14px; z-index: 2; font-family: var(--mono); font-size: 10px; letter-spacing: .16em; color: var(--faint); }

.rk-anchors { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 22px; padding-top: 4px; }
.rk-anchors p { font-family: var(--serif); font-size: 17px; line-height: 1.7; color: #cdc3a8; margin: 0; }
.rk-anchors p strong { color: var(--paper); font-weight: 600; }
.rk-eyebrow { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; margin-bottom: 8px; }
.rk-eyebrow--gold { color: var(--gold); }
.rk-eyebrow--cyan { color: var(--cyan); }
.rk-rule { height: 1px; }
.rk-rule--gold { background: linear-gradient(90deg, rgba(205,162,74,.3), transparent); }
.rk-rule--cyan { background: linear-gradient(90deg, rgba(111,182,189,.3), transparent); }
.rk-cards { display: flex; gap: 14px; }
.rk-card { flex: 1; border-radius: 6px; padding: 14px 16px; }
.rk-card--gold { border: 1px solid rgba(205,162,74,.22); background: rgba(205,162,74,.03); }
.rk-card--cyan { border: 1px solid rgba(111,182,189,.22); background: rgba(111,182,189,.03); }
.rk-card-tag { font-family: var(--mono); font-size: 9px; letter-spacing: .14em; color: var(--muted); margin-bottom: 6px; }
.rk-card-big { font-family: var(--display); font-weight: 600; font-size: 19px; color: var(--paper-hi); }
.rk-card-sub { font-family: var(--serif); font-style: italic; font-size: 13px; color: var(--muted); margin-top: 3px; }

.rk-intro { padding-top: 36px; }

.rk-divider { display: flex; align-items: center; gap: 16px; padding: 30px 0 8px; }
.rk-divider span { flex: 1; height: 1px; }
.rk-divider span:first-child { background: linear-gradient(90deg, transparent, rgba(205,162,74,.4)); }
.rk-divider span:last-child  { background: linear-gradient(90deg, rgba(205,162,74,.4), transparent); }
.rk-divider b { color: var(--gold); font-size: 12px; font-weight: 400; }

.rk-stack-head { padding-top: 14px; }
.rk-stack-head h2 { font-family: var(--display); font-weight: 600; font-variant: small-caps; letter-spacing: .12em; font-size: 24px; color: var(--paper); margin: 0 0 4px; }
.rk-stack-head p { font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--muted); margin: 0 0 20px; }
.rk-stack { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; margin: 0; padding: 0; }
.rk-stack li { padding: 0 18px; border-right: 1px solid var(--line-soft); }
.rk-stack li:first-child { padding-left: 0; }
.rk-stack li:last-child  { padding-right: 0; border-right: none; }
.rk-n { display: block; font-family: var(--initial); font-size: 34px; line-height: 1; color: var(--gold); margin-bottom: 8px; }
.rk-n--cyan { color: var(--cyan); }
.rk-n--cyanhi { color: var(--cyan-hi); }
.rk-stack b { display: block; font-family: var(--display); font-weight: 600; font-size: 16px; color: var(--paper); margin-bottom: 5px; }
.rk-stack .rk-solve { color: var(--cyan-hi); }
.rk-stack span:last-child { display: block; font-family: var(--serif); font-size: 13.5px; line-height: 1.5; color: var(--muted); }

.rk-clocks { margin-top: 28px; border: 1px solid rgba(205,162,74,.24); border-radius: 8px; background: rgba(205,162,74,.03); padding: 26px 30px; display: flex; align-items: center; gap: 34px; }
.rk-clocks-copy { flex: 1; }
.rk-clocks-copy h3 { font-family: var(--display); font-weight: 600; font-size: 24px; color: var(--paper-hi); margin: 8px 0 8px; }
.rk-clocks-copy p { font-family: var(--serif); font-size: 16px; line-height: 1.7; color: #cdc3a8; margin: 0; }
.rk-clocks-glyphs { flex: none; display: flex; gap: 22px; align-items: center; }
.rk-clocks-glyphs > div { text-align: center; }
.rk-clocks-glyphs span { font-family: var(--initial); font-size: 46px; line-height: 1; }
.rk-clocks-glyphs small { display: block; font-family: var(--mono); font-size: 9px; letter-spacing: .1em; color: var(--dim); margin-top: 8px; }
.rk-neq { font-family: var(--initial); font-size: 30px; color: var(--faint); }
.rk-tau { color: var(--cyan-hi); }
.rk-t { color: var(--gold); }

@media (max-width: 860px) {
  .rk-plate-row { flex-direction: column; }
  .rk-plate { width: 100%; }
  .rk-stack { grid-template-columns: repeat(2, 1fr); gap: 22px 18px; }
  .rk-stack li { border-right: none; padding: 0; }
  .rk-clocks { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
  .rk-cards { flex-direction: column; }
  .rk-stack { grid-template-columns: 1fr; }
}
