/* =============================================================
   index.css — The Made Self · Homepage
   Requires shared.css to be loaded first.
   ============================================================= */

:root {
  --pad:   clamp(24px, 5vw, 80px);
  --max-w: 1280px;
}

/* ── Site wrapper ────────────────────────────────────────────── */
.site-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  border-left:  1px solid var(--border);
  border-right: 1px solid var(--border);
}

/* Constrain nav to match site-wrap on wide screens */
nav {
  max-width: var(--max-w);
}

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  min-height: calc(100dvh - 56px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0 var(--pad);
}

.hero-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px clamp(24px, 4vw, 60px) 80px 0;
  border-right: 1px solid var(--border);
}

.hero-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px 0 80px clamp(24px, 4vw, 60px);
}

.hero-eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 28px;
  opacity: 0;
  animation: fadeUp 0.8s 0.2s forwards;
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(56px, 7vw, 88px);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--text);
  opacity: 0;
  animation: fadeUp 0.8s 0.35s forwards;
}
.hero-title em { font-style: italic; color: var(--accent); }

.hero-body {
  font-family: var(--sans);
  font-size: clamp(15px, 1.4vw, 17px);
  font-weight: 400;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 40px;
  opacity: 0;
  animation: fadeUp 0.8s 0.5s forwards;
}
.hero-body em { color: var(--accent); font-weight: 400; }

/* ── Pull quote band ─────────────────────────────────────────── */
.quote-band {
  width: 100%;
  border-top: 1px solid var(--border);
  padding: 120px var(--pad);
  display: flex;
  justify-content: center;
}

.quote-inner {
  max-width: 700px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}


.quote-text {
  font-family: var(--sans);
  font-size: clamp(17px, 2vw, 24px);
  font-weight: 100;
  line-height: 1.65;
  color: var(--text);
  margin: 0;
}
.quote-text em {
  color: var(--accent);
}

.quote-line {
  width: 40px;
  height: 1px;
  background: var(--accent2);
  opacity: 0.5;
}

.hero-cta {
  margin-top: 1.5em;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent2);
  padding-bottom: 4px;
  width: fit-content;
  transition: gap 0.3s, color 0.3s;
  opacity: 0;
  animation: fadeUp 0.8s 0.65s forwards;
}
.hero-cta:hover { gap: 20px; color: var(--text); }
.hero-cta::after { content: '→'; }

/* ── Content bands ───────────────────────────────────────────── */
.band {
  width: 100%;
  border-top: 1px solid var(--border);
  padding: 100px var(--pad);
  display: grid;
  grid-template-columns: minmax(120px, 18%) 1fr;
  gap: 0 8vw;
  align-items: start;
}

.band-label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  padding-top: 6px;
  position: sticky;
  top: 48px;
}

.band-content {
  font-family: var(--sans);
  font-size: clamp(15px, 1.4vw, 17px);
  font-weight: 400;
  line-height: 1.85;
  color: var(--text);
}
.band-content p + p { margin-top: 1.4em; }
.band-content em     { font-style: italic; color: var(--accent); }

/* Prose lists (used inside .band-content) */
.band-content h4 {
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  font-weight: 600;
}
.band-content ul      { padding-left: 1.25rem; }
.band-content li      { margin-bottom: 0.4rem; }
.band-content li::marker { color: #888; font-size: 0.9em; }

/* ── TOC (homepage) ─────────────────────────────────────────── */
.toc {
  padding-left: var(--pad);
  padding-right: var(--pad);
  border-top: 1px solid var(--border);
  border-bottom: none;
}

/* ── Modules section ─────────────────────────────────────────── */
.modules-section {
  width: 100%;
  border-top: 1px solid var(--border);
  padding: 100px var(--pad);
}

.modules-header {
  display: grid;
  grid-template-columns: minmax(120px, 18%) 1fr;
  gap: 0 8vw;
  margin-bottom: 64px;
}

.modules-label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  padding-top: 6px;
}

.modules-intro {
  font-family: var(--sans);
  font-size: clamp(14px, 1.2vw, 16px);
  font-weight: 400;
  line-height: 1.8;
  color: var(--muted);
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

.module {
  background: var(--bg);
  padding: 36px 40px;
  transition: background var(--ease);
  cursor: default;
}
.module:hover { background: var(--bg2); }

.module-num {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.module-title {
  font-family: var(--sans);
  font-size: clamp(16px, 1.4vw, 19px);
  font-weight: 400;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.3;
}

.module-desc {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 20px;
}

.module-status {
  display: inline-block;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 2px 8px;
}
.module-status.live { color: var(--accent); border-color: var(--accent2); }

.module.final                { background: var(--bg2); }
.module.final .module-title  { font-style: italic; color: var(--accent); }
.module.final:hover          { background: var(--bg3); }

/* ── Strata visualization ────────────────────────────────────── */
.strata-stack {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

/* Individual stratum */
.stratum {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: background var(--ease), border-color var(--ease);
  cursor: pointer;
}

/* Live (readable) modules are visually elevated */
.stratum.live {
  background: var(--bg2);
  border-color: rgba(201, 169, 110, 0.14);
}

.stratum.live:hover,
.stratum.is-open {
  background: var(--bg3);
  border-color: rgba(201, 169, 110, 0.3);
}

/* Left-edge accent strip */
.stratum::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: transparent;
  transition: background var(--ease);
}
.stratum.live::before              { background: var(--accent2); }
.stratum.live:hover::before,
.stratum.is-open::before           { background: var(--accent); }

/* Collapsed row */
.stratum-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 0 24px 0 28px;
  height: 56px;
}

.stratum-num {
  font-family: var(--sans);
  font-size: 14px; font-weight: 400;
  color: var(--muted);
  opacity: 0.6;
  transition: color var(--ease), opacity var(--ease);
}
.stratum.live .stratum-num         { color: var(--accent); opacity: 1; }

.stratum-main { min-width: 0; }

.stratum-title {
  font-family: var(--sans);
  font-size: 16px; font-weight: 400;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text);
  opacity: 0.65;
  transition: opacity var(--ease);
}
.stratum.live .stratum-title       { opacity: 1; }

.stratum-thinker {
  font-family: var(--sans);
  font-size: 11px; color: var(--muted);
  margin-top: 2px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  opacity: 0.75;
  transition: color var(--ease), opacity var(--ease);
}
.stratum.live .stratum-thinker     { opacity: 0.8; }
.stratum.live:hover .stratum-thinker { opacity: 1; }

.stratum-meta {
  display: flex; flex-direction: column;
  align-items: flex-end; gap: 4px; flex-shrink: 0;
}

.stratum-date {
  font-family: var(--sans);
  font-size: 11px; color: var(--muted);
  white-space: nowrap;
}

.stratum-badge {
  font-family: var(--sans);
  font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); opacity: 0;
  transition: opacity var(--ease);
}
.stratum.live .stratum-badge       { opacity: 0.6; }
.stratum.live:hover .stratum-badge,
.stratum.is-open .stratum-badge    { opacity: 1; }

/* Expanded body */
.stratum-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.45s cubic-bezier(0.4,0,0.2,1);
}
.stratum.is-open .stratum-body     { max-height: 220px; }

.stratum-body-inner {
  padding: 0 28px 24px 28px;
  border-top: 1px solid var(--border);
}

.stratum-desc {
  font-family: var(--sans);
  font-size: 15px; line-height: 1.75;
  color: var(--text); padding-top: 20px;
}

.stratum-link {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 14px;
  font-family: var(--sans);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); text-decoration: none;
  transition: opacity 0.2s;
}
.stratum-link:hover { opacity: 0.65; }
.stratum-link::after { content: ' →'; }

/* Final module (XV) special treatment */
.stratum.final .stratum-title  { font-style: italic; color: var(--accent); }
.stratum.final .stratum-num    { color: var(--accent); opacity: 0.6; }


/* Canvas variant — full height on desktop, proportional on mobile
   min(100dvh, 140vw) means: on portrait phones the section shrinks
   to 140% of its width rather than the full screen height, keeping
   the ellipse compact instead of an extreme oval. */
.modules-section--canvas {
  padding: 0;
  height: min(100dvh, 140vw);
  overflow: hidden;
  display: block;
}
.modules-section--canvas #convergence-root {
  display: block;
  width: 100%;
  height: 100%;
}
.modules-section--canvas #convergence-root > div {
  width: 100% !important;
}
@media (max-width: 767px) {
  .modules-section--canvas {
    height: auto;
    overflow: visible;
    /* Give the section a floor so the browser has a stable scroll target
       before React mounts — without this, the anchor scroll (#construction)
       fires before the grid renders and lands near #resources instead. */
    min-height: 60vh;
  }
}

/* ── Footer ──────────────────────────────────────────────────── */
footer {
  width: 100%;
  border-top: 1px solid var(--border);
  padding: 40px var(--pad);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.footer-quote {
  font-family: var(--sans);
  font-size: clamp(14px, 1.3vw, 16px);
  font-weight: 400;
  color: var(--muted);
}

.footer-updated {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--muted);
  opacity: 0.5;
  text-transform: uppercase;
}

.footer-mark {
  color: var(--accent);
  opacity: 0.35;
  margin-bottom: 10px;
}

.footer-name {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 300;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.footer-note {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 300;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.modules-section--canvas {
  padding: 0;
  height: auto;          /* let content determine height */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.construction-intro {
  display: grid;
  grid-template-columns: minmax(120px, 18%) 1fr;
  gap: 0 8vw;
  padding: 100px var(--pad) 48px;
  flex-shrink: 0;
  position: relative;
}

.construction-intro::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: var(--pad);
  right: var(--pad);
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
}


.modules-section--canvas #convergence-root {
  flex: 1;
  min-height: min(100dvh, 140vw);
}



/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 0; }
  .hero-left { border-right: none; border-bottom: 1px solid var(--border); padding: 60px 0; }
  .hero-right { padding: 60px 0; }
  .band, .modules-header, .construction-intro { grid-template-columns: 1fr; gap: 24px 0; }
  .band-label, .modules-label { position: static; }
  .construction-hover-hint { display: none; }
  /* Strata: keep date visible on mobile */
  .stratum-row          { grid-template-columns: 44px 1fr auto; }
  .stratum-body-inner   { padding-left: 28px; }
  .stratum-date         { font-size: 10px; }
  .stratum-badge        { font-size: 8px; }
}

@media (max-width: 560px) {
  .module-grid { grid-template-columns: 1fr; }
  .module { padding: 28px 24px; }
}
