/* Ayce of Space — iconic encyclopedic story
   Paper / ink / gold. Mobile-first. Simple. Clean. */

:root {
  --bg: #f7f5f0;
  --bg-paper: #fffcf7;
  --bg-soft: #efeae1;
  --bg-infobox: #faf8f4;
  --text: #1a1a1a;
  --text-body: #2c2c2c;
  --text-muted: #5a5a5a;
  --text-dim: #8a8a8a;
  --accent: #8b7355;
  --accent-deep: #6b5740;
  --accent-light: #c4a574;
  --line: #d4cfc4;
  --line-strong: #b8b0a0;
  --link: #0645ad;
  --link-visited: #0b0080;
  --radius: 2px;
  --radius-card: 4px;
  --pad-x: 1.25rem;
  --max: 960px;
  --max-article: 720px;
  --font-display: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --font-ui: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 56px;
  --shadow-soft: 0 1px 3px rgba(26, 26, 26, 0.06);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text-body);
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.65;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--link);
  text-decoration: none;
}
a:hover { text-decoration: underline; }
a:visited { color: var(--link-visited); }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  margin: 0 0 0.6em;
}

h1 {
  font-size: clamp(2rem, 5vw, 2.65rem);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.35em;
  letter-spacing: -0.01em;
}
h2 {
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.3em;
  margin-top: 0;
}
h3 { font-size: 1.1rem; font-weight: 700; border: none; margin-bottom: 0.45em; }

p { margin: 0 0 1em; color: var(--text-body); }
p:last-child { margin-bottom: 0; }

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}
.container-wide { max-width: 1040px; }
.prose { max-width: var(--max-article); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px; top: 0; z-index: 100;
  background: var(--accent-deep);
  color: #fff;
  padding: 0.6rem 1rem;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* —— Masthead —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 245, 240, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  min-height: var(--header-h);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.brand-block {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text) !important;
  text-decoration: none !important;
}
.brand-mark {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--accent-deep) !important;
  text-decoration: none !important;
  font-weight: 500;
}
.brand-sep { color: var(--text-dim); font-size: 0.85rem; }
.header-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.95rem;
  font-size: 0.88rem;
  font-weight: 500;
}
.header-nav a {
  color: var(--text-muted) !important;
  text-decoration: none !important;
}
.header-nav a:hover { color: var(--text) !important; }
.header-nav a[aria-current="page"] {
  color: var(--text) !important;
  border-bottom: 2px solid var(--accent-light);
  padding-bottom: 1px;
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.55rem;
}

/* —— Lead + Infobox —— */
.lead-section {
  padding: 2.35rem 0 2rem;
  background: var(--bg-paper);
  border-bottom: 1px solid var(--line);
}
.lead-layout {
  display: grid;
  gap: 1.75rem;
}
@media (min-width: 820px) {
  .lead-layout {
    grid-template-columns: 1fr minmax(250px, 290px);
    align-items: start;
    gap: 2.25rem;
  }
}
.aka {
  margin: -0.35em 0 1.15em;
  color: var(--text-muted);
  font-size: 1.05rem;
}
.lead-para {
  font-size: 1.05rem;
  line-height: 1.72;
  max-width: 42em;
}
.lead-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.35rem;
  margin-bottom: 0;
}

.infobox {
  background: var(--bg-infobox);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  font-size: 0.86rem;
  overflow: hidden;
}
.infobox-head {
  background: linear-gradient(180deg, var(--bg-soft) 0%, #e8e2d6 100%);
  border-bottom: 1px solid var(--line-strong);
  padding: 0.7rem 0.85rem;
  font-family: var(--font-display);
  font-weight: 700;
  text-align: center;
  color: var(--text);
  letter-spacing: 0.01em;
}
.infobox-dl { margin: 0; padding: 0.3rem 0; }
.infobox-dl > div {
  display: grid;
  grid-template-columns: 36% 64%;
  gap: 0.3rem 0.55rem;
  padding: 0.38rem 0.85rem;
  border-bottom: 1px solid var(--line);
}
.infobox-dl > div:last-child { border-bottom: none; }
.infobox-dl dt {
  margin: 0;
  font-weight: 600;
  color: var(--text);
  font-size: 0.8rem;
}
.infobox-dl dd {
  margin: 0;
  color: var(--text-body);
}

/* —— Sections —— */
.section { padding: 2.35rem 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-lede {
  color: var(--text-muted);
  max-width: 40em;
  margin-bottom: 1.5rem;
}

.upbringing p { max-width: 40em; }

/* —— Chronology —— */
.chrono {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
  background: var(--bg-paper);
  border: 1px solid var(--line);
  margin-bottom: 0.25rem;
}
.chrono th,
.chrono td {
  padding: 0.7rem 0.95rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.chrono thead th {
  background: var(--bg-soft);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--line-strong);
}
.chrono tbody th {
  font-family: var(--font-display);
  font-weight: 700;
  width: 5.5rem;
  white-space: nowrap;
  color: var(--text);
  background: var(--bg-infobox);
}
.chrono tbody tr:last-child th,
.chrono tbody tr:last-child td { border-bottom: none; }
.chrono tbody tr:hover td { background: rgba(196, 165, 116, 0.06); }
.chrono-next th,
.chrono-next td {
  background: var(--bg-soft);
  font-weight: 500;
}
.chrono-next th { color: var(--accent-deep); }


/* —— OPEN / founder frames —— */
.open-mark {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-deep);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.1em 0.45em;
  vertical-align: middle;
}
.chrono-open td,
.chrono-empty td { color: var(--text-muted); }
.chrono-empty td.founder-frame {
  font-style: normal;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 6px,
    rgba(212, 207, 196, 0.35) 6px,
    rgba(212, 207, 196, 0.35) 7px
  );
}
.founder-frame em { color: var(--text-dim); font-style: italic; }
.draft-note {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* —— Access map (sparse) —— */
.access-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (min-width: 720px) {
  .access-grid { grid-template-columns: repeat(4, 1fr); }
}
.access-node {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--bg-paper);
  padding: 1rem 0.85rem;
  min-height: 5.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.access-node.access-empty {
  background: var(--bg-soft);
  border-style: dashed;
  color: var(--text-dim);
}
.access-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}
.access-empty .access-label { color: var(--text-muted); }
.access-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* —— Showcase —— */
.cinema-band { background: var(--bg-paper); }
.cinema-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}
@media (min-width: 720px) {
  .cinema-grid { grid-template-columns: repeat(4, 1fr); gap: 1rem; }
}
.cinema-card {
  display: block;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: #111;
  text-decoration: none !important;
  color: #fff !important;
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.cinema-card:hover {
  box-shadow: 0 6px 20px rgba(26, 26, 26, 0.12);
  transform: translateY(-2px);
}
.cinema-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  opacity: 0.92;
}
.cinema-cap {
  display: block;
  padding: 0.5rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--bg-infobox);
  color: var(--text);
  border-top: 1px solid var(--line);
}


/* —— AI / 3D advocacy —— */
.advocacy-section { background: var(--bg-paper); }
.advocacy-section .prose p { max-width: 40em; }
.advocacy-cta {
  margin-top: 0.35rem;
  font-weight: 500;
  color: var(--text-muted);
}
.advocacy-cta a { font-weight: 600; }

/* —— Builds —— */
.builds-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
@media (min-width: 700px) {
  .builds-grid { grid-template-columns: repeat(3, 1fr); gap: 1.15rem; }
}
.build-card {
  background: var(--bg-paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 1.15rem 1.2rem 1.25rem;
  box-shadow: var(--shadow-soft);
}
.build-card h3 {
  color: var(--accent-deep);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.4em;
  margin-bottom: 0.65em;
}
.build-card p {
  font-size: 0.95rem;
  margin: 0;
  color: var(--text-body);
}
.builds-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0;
}

/* —— Next / See also —— */
.see-also {
  margin: 0 0 1.5rem;
  padding-left: 1.25rem;
  color: var(--text-body);
}
.see-also li { margin-bottom: 0.4rem; }
.closing-draft {
  margin: 0 0 1.35rem;
  padding: 1.1rem 1.25rem;
  border-left: 3px solid var(--accent-light);
  background: var(--bg-soft);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.08rem;
  color: var(--text);
}
.closing-draft p { color: var(--text); margin: 0; }
.next-cta { margin-top: 0.35rem; }

.btn-primary {
  display: inline-block;
  background: var(--accent-deep);
  color: #fff !important;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-card);
  text-decoration: none !important;
  transition: background 0.2s var(--ease);
}
.btn-primary:hover { background: var(--text); text-decoration: none !important; }
.btn-primary:visited { color: #fff !important; }

.btn-ghost {
  display: inline-block;
  background: transparent;
  color: var(--accent-deep) !important;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-card);
  border: 1px solid var(--line-strong);
  text-decoration: none !important;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.btn-ghost:hover {
  border-color: var(--accent);
  background: var(--bg-soft);
  text-decoration: none !important;
}
.btn-ghost:visited { color: var(--accent-deep) !important; }

/* —— Footer —— */
.site-footer {
  border-top: 1px solid var(--line-strong);
  padding: 1.75rem 0 2.5rem;
  background: var(--bg-soft);
  font-size: 0.92rem;
}
.site-footer a { color: var(--accent-deep) !important; font-weight: 600; }
.footer-meta {
  margin-top: 0.5rem;
  color: var(--text-dim);
  font-size: 0.82rem;
}
.footer-meta a { color: var(--text-muted) !important; font-weight: 500; }

/* —— Roots page —— */
.roots-page .hero-roots {
  padding: 2.5rem 0 1.5rem;
  text-align: center;
  background: var(--bg-paper);
  border-bottom: 1px solid var(--line);
}
.roots-avatar {
  width: 64px; height: 64px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 2px solid var(--accent-light);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--accent-deep);
}
.roots-page .lede {
  max-width: 28em;
  margin: 0 auto;
  color: var(--text-muted);
}
.roots-links {
  list-style: none;
  margin: 1.75rem 0;
  padding: 0;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}
.roots-links li { margin-bottom: 0.65rem; }
.roots-link {
  display: block;
  padding: 0.95rem 1.1rem;
  background: var(--bg-paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  text-align: center;
  color: var(--text) !important;
  text-decoration: none !important;
  font-weight: 600;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.roots-link:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-soft);
}
.roots-link small {
  display: block;
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}
.roots-open-slot {
  padding: 0.85rem 1rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius-card);
  text-align: center;
  color: var(--text-dim);
  font-size: 0.88rem;
  background: transparent;
}
.roots-open-slot strong {
  display: block;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  .cinema-grid { grid-template-columns: 1fr; }
  .infobox-dl > div { grid-template-columns: 1fr; gap: 0.12rem; }
  .chrono th,
  .chrono td { padding: 0.6rem 0.7rem; }
}
