/* =========================================================================
   Cartograph - cartograph.tools
   Aesthetic: editorial astrolabe. Deep void, warm-paper typography,
   silver C-arc + comet-trail of stars from the logo as the only punctuation.
   ========================================================================= */

@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght,SOFT,WONK@0,9..144,300..900,0..100,0..1;1,9..144,300..900,0..100,0..1&family=Spectral:ital,wght@0,300;0,400;0,500;0,600;1,400;1,500&family=JetBrains+Mono:wght@400;500;700&display=swap");

:root {
  /* --- void (the night sky) --- */
  --ink:        #0a0b10;
  --ink-soft:   #11131a;
  --ink-edge:   #161823;

  /* --- paper / silver (the chart) --- */
  --paper:      #f0e7d3;
  --paper-dim:  #b1ab9b;
  --paper-soft: #6e6a5e;
  --silver-1:   #ffffff;
  --silver-2:   #e4e4e7;
  --silver-3:   #a1a1aa;

  /* --- stars (the comet trail) --- */
  --star-1:     #FFEA00;
  --star-2:     #FFC300;
  --star-3:     #FF9500;

  /* --- rules / borders --- */
  --rule:       rgba(240, 231, 211, 0.10);
  --rule-strong:rgba(240, 231, 211, 0.18);

  /* --- type --- */
  --serif:    "Spectral", "Iowan Old Style", Georgia, serif;
  --display:  "Fraunces", "Spectral", Georgia, serif;
  --mono:     "JetBrains Mono", ui-monospace, "Cascadia Mono", "Menlo", monospace;

  --col:        min(72ch, calc(100vw - 3rem));
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* The sky: a faint starfield + a warm horizon glow bottom-right.
   Pure CSS, no images. */
body {
  min-height: 100vh;
  background:
    radial-gradient(1px 1px at 12% 18%,  rgba(255,234,0,.55), transparent 60%),
    radial-gradient(1px 1px at 78% 22%,  rgba(255,234,0,.40), transparent 60%),
    radial-gradient(1px 1px at 33% 42%,  rgba(228,228,231,.45), transparent 60%),
    radial-gradient(1px 1px at 88% 64%,  rgba(255,195,0,.35), transparent 60%),
    radial-gradient(1px 1px at 22% 76%,  rgba(228,228,231,.30), transparent 60%),
    radial-gradient(1px 1px at 62% 88%,  rgba(255,149,0,.30), transparent 60%),
    radial-gradient(2px 2px at 47% 12%,  rgba(255,255,255,.30), transparent 60%),
    radial-gradient(1.5px 1.5px at 8% 55%,rgba(255,255,255,.18), transparent 60%),
    radial-gradient(1200px 600px at 110% 105%, rgba(255,149,0,.10), transparent 70%),
    radial-gradient(900px 500px at -10% -10%,  rgba(228,228,231,.05), transparent 70%),
    var(--ink);
  background-attachment: fixed;
}

/* Fine film-grain layer (subtle SVG noise via data URL) */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* Top hairline rule */
body::after {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--star-1), transparent);
  opacity: .35;
  pointer-events: none;
  z-index: 1;
}

/* =========================================================================
   Header
   ========================================================================= */

header.site {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.75rem 1rem;
}

header.site .brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper);
}

header.site .brand a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

header.site .brand img {
  width: 32px;
  height: 32px;
  display: block;
  filter: drop-shadow(0 0 18px rgba(255, 195, 0, 0.18));
  transition: transform .6s ease, filter .6s ease;
}
header.site .brand a:hover img {
  transform: rotate(-8deg) scale(1.05);
  filter: drop-shadow(0 0 24px rgba(255, 234, 0, 0.45));
}

header.site .meridian {
  height: 1px;
  background: linear-gradient(90deg, var(--rule-strong), transparent 70%);
}

header.site nav {
  display: flex;
  gap: 1.6rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

header.site nav a {
  color: var(--paper-dim);
  text-decoration: none;
  position: relative;
  padding-bottom: 2px;
  transition: color .25s ease;
}

header.site nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 1px; width: 0;
  background: var(--star-1);
  transition: width .35s ease;
}

header.site nav a:hover { color: var(--silver-1); }
header.site nav a:hover::after { width: 100%; }

/* =========================================================================
   Main column
   ========================================================================= */

main {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 1.75rem 6rem;
}

/* the editorial reading column, offset slightly left for asymmetry */
.col {
  width: var(--col);
  max-width: 720px;
}

/* --- Hero --- */

.hero {
  position: relative;
  padding-top: 2.5rem;
  padding-bottom: 4rem;
  border-bottom: 1px solid var(--rule);
}

.hero .motto {
  font-family: var(--display);
  font-style: italic;
  font-weight: 300;
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144;
  font-size: clamp(2.6rem, 7.5vw, 5.4rem);
  line-height: 0.96;
  letter-spacing: -0.018em;
  color: var(--silver-1);
  margin: 0 0 1.4rem;
  background: linear-gradient(180deg, var(--silver-1) 0%, var(--silver-2) 60%, var(--silver-3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: rise 1.2s ease both;
}

.hero .motto .ad {
  font-style: italic;
}

.hero .motto .astra {
  font-style: italic;
  color: var(--star-1);
  -webkit-text-fill-color: var(--star-1);
  background: none;
  text-shadow: 0 0 28px rgba(255, 234, 0, 0.30);
}

.hero .marker {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--paper-soft);
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 2rem;
  animation: rise .9s .05s ease both;
}

.hero .marker::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--star-1);
}

.hero .lede {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 1.9vw, 1.25rem);
  line-height: 1.55;
  color: var(--paper);
  max-width: 38em;
  margin: 0 0 2.4rem;
  animation: rise 1.1s .15s ease both;
}

.hero .lede em {
  font-style: italic;
  color: var(--silver-1);
}

.hero .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  align-items: center;
  animation: rise 1.2s .25s ease both;
}

/* the comet trail floating in hero corner */
.hero .comet {
  position: absolute;
  top: 1.2rem;
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  opacity: .9;
  animation: comet-drift 14s ease-in-out infinite alternate;
}
.hero .comet i {
  display: block;
  border-radius: 3px;
}
.hero .comet i.s1 { width: 14px; height: 14px; background: var(--star-1); box-shadow: 0 0 24px rgba(255,234,0,.55); }
.hero .comet i.s2 { width: 10px; height: 10px; background: var(--star-2); box-shadow: 0 0 18px rgba(255,195,0,.45); }
.hero .comet i.s3 { width:  6px; height:  6px; background: var(--star-3); box-shadow: 0 0 12px rgba(255,149,0,.45); }

@keyframes comet-drift {
  0%   { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(-18px, 6px) rotate(-2deg); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- CTAs / buttons --- */

.cta {
  --cta-bg: var(--star-1);
  --cta-fg: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.78rem 1.15rem 0.74rem;
  background: var(--cta-bg);
  color: var(--cta-fg);
  text-decoration: none;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: 1px solid var(--star-1);
  border-radius: 2px;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  box-shadow: 0 0 0 rgba(255, 234, 0, 0);
}

.cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(255, 234, 0, 0.22);
}

.cta::after {
  content: "→";
  display: inline-block;
  transition: transform .25s ease;
}
.cta:hover::after { transform: translateX(3px); }

.cta.ghost {
  --cta-bg: transparent;
  --cta-fg: var(--paper);
  border: 1px solid var(--rule-strong);
}
.cta.ghost:hover {
  --cta-fg: var(--star-1);
  border-color: var(--star-1);
  box-shadow: 0 8px 32px rgba(255, 195, 0, 0.10);
}

/* --- Sections --- */

section.bay {
  padding: 3.5rem 0 2.5rem;
  border-bottom: 1px solid var(--rule);
  position: relative;
}
section.bay:last-of-type { border-bottom: none; }

section.bay .label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--paper-soft);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 1.4rem;
}

section.bay .label .ord {
  color: var(--star-1);
}

section.bay h2 {
  font-family: var(--display);
  font-weight: 400;
  font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 80;
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
  line-height: 1.1;
  letter-spacing: -0.012em;
  margin: 0 0 1rem;
  color: var(--silver-1);
}

section.bay p {
  margin: 0 0 1rem;
  max-width: 38em;
}

section.bay p.muted {
  color: var(--paper-dim);
  font-style: italic;
}

/* --- Code / terminal --- */

pre.terminal,
code.terminal {
  font-family: var(--mono);
  font-size: 0.92rem;
  background: var(--ink-soft);
  color: var(--paper);
  padding: 1rem 1.1rem;
  border: 1px solid var(--rule);
  border-left: 2px solid var(--star-1);
  border-radius: 2px;
  display: block;
  margin: 1.2rem 0 0.5rem;
  position: relative;
  overflow-x: auto;
}

pre.terminal::before {
  content: "$";
  color: var(--star-1);
  margin-right: 0.65rem;
  user-select: none;
}

p > code, li > code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--ink-soft);
  border: 1px solid var(--rule);
  padding: 0.08em 0.4em;
  border-radius: 2px;
  color: var(--silver-1);
}

/* --- Pillars / cards (the "ledger" grid) --- */

.ledger {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0 0.5rem;
}

.ledger article {
  position: relative;
  padding: 1.4rem 1.3rem 1.5rem;
  border: 1px solid var(--rule);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
  border-radius: 2px;
  transition: border-color .3s ease, transform .3s ease;
}
.ledger article:hover {
  border-color: var(--rule-strong);
  transform: translateY(-2px);
}

.ledger article .num {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  color: var(--star-2);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  display: block;
}

.ledger article h3 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  margin: 0 0 0.45rem;
  color: var(--silver-1);
}

.ledger article p {
  margin: 0;
  color: var(--paper-dim);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* tiny star punctuation in card corner */
.ledger article::after {
  content: "";
  position: absolute;
  top: 1.1rem; right: 1.1rem;
  width: 6px; height: 6px;
  background: var(--star-1);
  border-radius: 1px;
  opacity: 0.0;
  transition: opacity .3s ease;
  box-shadow: 0 0 12px rgba(255, 234, 0, 0.5);
}
.ledger article:hover::after { opacity: 1; }

/* --- Inline links in body --- */

main a:not(.cta):not(.brand a):not(header a) {
  color: var(--star-1);
  text-decoration: none;
  background-image: linear-gradient(var(--star-1), var(--star-1));
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0 1px;
  transition: background-size .3s ease, color .25s ease;
  padding-bottom: 1px;
}
main a:not(.cta):not(.brand a):not(header a):hover {
  color: var(--star-2);
  background-size: 100% 1px;
}

/* --- Post list --- */

.post-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
}

.post-list li {
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1.4rem;
  align-items: baseline;
}
.post-list li:last-child { border-bottom: none; }

.post-list .date {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper-soft);
}

.post-list .kind {
  display: inline-block;
  margin-left: 0.6rem;
  padding: 1px 6px;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  border: 1px solid var(--rule-strong);
  color: var(--star-2);
  border-radius: 1px;
  text-transform: uppercase;
}

.post-list h3 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
  color: var(--silver-1);
}

.post-list p {
  margin: 0;
  color: var(--paper-dim);
  font-size: 0.95rem;
}

/* --- Blockquote / motto callout --- */

.callout {
  margin: 2.5rem 0;
  padding: 1.5rem 1.6rem 1.6rem;
  border: 1px solid var(--rule);
  border-left: 2px solid var(--star-1);
  background: rgba(255, 234, 0, 0.02);
  font-family: var(--display);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--silver-1);
}

/* =========================================================================
   Footer
   ========================================================================= */

footer.site {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.75rem 4rem;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--paper-soft);
}

footer.site .motto {
  font-family: var(--display);
  font-style: italic;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--paper-dim);
}

footer.site a {
  color: var(--paper-dim);
  text-decoration: none;
  transition: color .25s ease;
}
footer.site a:hover { color: var(--star-1); }

footer.site .coords {
  text-align: right;
}

/* =========================================================================
   Reduced motion
   ========================================================================= */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0s !important;
    transition-duration: 0s !important;
  }
}

/* =========================================================================
   Small screens
   ========================================================================= */

@media (max-width: 540px) {
  header.site { grid-template-columns: 1fr auto; }
  header.site .meridian { display: none; }
  .post-list li { grid-template-columns: 1fr; gap: 0.3rem; }
  .post-list .date { font-size: 0.7rem; }
  footer.site { grid-template-columns: 1fr; text-align: left; }
  footer.site .coords { text-align: left; }
  .hero .comet { top: auto; bottom: 1rem; right: 1rem; }
}
