/* ============================================================
   SOULS IN DEVELOPMENT — unified content layout
   Load after core.css (if used) or standalone.
   Each page keeps its own hero, visual layer, and colour vars.
   This sheet unifies: sections, cards, typography, grids, tables.
============================================================ */

/* Theme-aware overrides — pages set --hemi and --hemi-2 */
.info-layout {
  --il-accent: var(--hemi, var(--gold, #c9b16a));
  --il-accent-2: var(--hemi-2, var(--gold, #c9b16a));
}

/* ── Sections ── */
.content-section {
  position: relative;
  z-index: 2;
  padding: clamp(4rem, 10vh, 8rem) clamp(1.5rem, 6vw, 4rem);
}
.content-section:first-of-type { padding-top: 6rem; }

/* Base: unified scaffolding — consistent width, rhythm, scroll reveal,
   and a neutral dark scrim so body text stays legible over live backgrounds.
   This is the legibility screen, NOT a decorative box — Education's green
   glass (.glass-panels) is its own distinct signature. */
.content-inner {
  max-width: min(1100px, 92vw);
  margin-left: auto;
  margin-right: auto;
  position: relative;
  background: linear-gradient(180deg, rgba(8, 10, 16, 0.74), rgba(8, 10, 16, 0.62));
  backdrop-filter: blur(7px) saturate(1.05);
  -webkit-backdrop-filter: blur(7px) saturate(1.05);
  border: 1px solid rgba(237, 233, 216, 0.06);
  border-top-color: color-mix(in srgb, var(--hemi, #c9b16a) 22%, transparent);
  border-radius: 14px;
  padding: clamp(2rem, 4vw, 3.4rem) clamp(1.5rem, 3.5vw, 3rem);
  box-shadow: 0 24px 70px -30px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transform: translateY(34px);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.content-inner.visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .content-inner { transform: none; transition: opacity 0.5s ease; }
}

/* Education's signature layout — the green glass panel */
.glass-panels .content-inner {
  margin-left: clamp(1.5rem, 6vw, 5rem);
  margin-right: auto;
  border-top-color: rgba(140, 191, 159, 0.1);
  background: rgba(3, 13, 7, 0.72);
  backdrop-filter: blur(20px) saturate(1.1);
  -webkit-backdrop-filter: blur(20px) saturate(1.1);
  border: 1px solid rgba(140, 191, 159, 0.1);
  border-radius: 20px;
  padding: clamp(2.4rem, 5vw, 4rem);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.45);
}

/* ── Section-marker rail — the unified layout spine ── */
.sec-marker {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  margin: 0 0 clamp(26px, 4vw, 42px);
  font-family: "JetBrains Mono", "SF Mono", "IBM Plex Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--hemi, var(--gold, #c9b16a));
}
.sec-marker .sec-num { opacity: .55; flex-shrink: 0; }
.sec-marker .sec-inscription {
  flex-shrink: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.sec-marker .sec-rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, currentColor, transparent);
  opacity: .3;
  min-width: 40px;
}
.sec-marker-absorbed { display: none !important; }
.content-section { border-top: 1px solid rgba(237, 233, 216, .05); }
.glass-panels .content-section { border-top: none; }

/* ── No-orphan card rows ──
   auto-fit grids leave the last card stuck alone on the left ("3 then 1").
   Inside content panels, lay cards out as a centred flow so any incomplete
   last row sits centred and reads as intentional. Scoped to .content-inner
   so it wins over each page's own .card-grid rule on specificity. */
.content-inner .card-grid,
.content-inner .spec-grid,
.content-inner .creature-grid,
.content-inner .problem-grid,
.content-inner .start-grid,
.content-inner .roles-grid,
.content-inner .status-grid,
.content-inner .properties-grid,
.content-inner .tiers-grid,
.content-inner .criteria-grid,
.content-inner .integration-grid,
.content-inner .seal-grid,
.content-inner .unlock-grid,
.content-inner .pillars-inner {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
}
.content-inner .card-grid > *,
.content-inner .spec-grid > *,
.content-inner .creature-grid > *,
.content-inner .problem-grid > *,
.content-inner .start-grid > *,
.content-inner .roles-grid > *,
.content-inner .status-grid > *,
.content-inner .properties-grid > *,
.content-inner .tiers-grid > *,
.content-inner .criteria-grid > *,
.content-inner .integration-grid > *,
.content-inner .seal-grid > *,
.content-inner .unlock-grid > *,
.content-inner .pillars-inner > * {
  flex: 1 1 var(--card-basis, 280px);
  max-width: var(--card-max, 360px);
}
/* Four-count grids balance to 2×2 instead of 3 + orphan.
   Pages can opt in with .four. Emergency pages also auto-balance
   their operational card/status rows without changing unique layouts. */
.content-inner .problem-grid > *,
.content-inner .card-grid.four > *,
.content-inner .spec-grid.four > *,
.emergency-layout .content-inner :is(
  .card-grid,
  .status-grid
):has(> :nth-child(4):last-child) > * {
  flex: 1 1 44%;
  max-width: 520px;
}

/* Centred variants (prelude, CTA, footer) */
.prelude .content-inner,
.cta-section .content-inner,
footer .content-inner {
  margin-left: auto;
  margin-right: auto;
}
.prelude .content-inner { max-width: 800px; }

/* ── Typography ── */
.section-label {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold, #c9b16a);
  opacity: 0.65;
  margin-bottom: 0.8rem;
}

h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  line-height: 1.1;
  font-size: clamp(2.4rem, 5vw, 3.2rem);
  max-width: 22ch;
}
h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
}

p {
  color: rgba(210, 230, 210, 0.88);
  font-size: 1.05rem;
  line-height: 1.75;
  max-width: 70ch;
}
p + p { margin-top: 1rem; }

.pull {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  color: var(--gold, #c9b16a);
  font-style: italic;
  margin: 1.8rem 0;
  line-height: 1.4;
}

/* ── Glass containers ── */
.glass {
  background: rgba(4, 13, 8, 0.55);
  border: 1px solid rgba(140, 191, 159, 0.1);
  border-radius: 16px;
  padding: 2.4rem;
  margin-top: 2rem;
}

/* ── Spec cards ── */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 2px;
  background: rgba(216, 212, 204, 0.04);
  margin-top: 2rem;
}
.spec-card {
  background: rgba(4, 13, 8, 0.55);
  border: 1px solid rgba(140, 191, 159, 0.08);
  border-radius: 14px;
  padding: 1.8rem;
  position: relative;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.spec-card:hover {
  background: rgba(4, 13, 8, 0.7);
  border-color: rgba(140, 191, 159, 0.2);
  transform: translateY(-3px);
}
.spec-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  opacity: 0.6;
}
.spec-card.gold::before {
  background: linear-gradient(90deg, var(--gold, #c9b16a), #e0c068);
}
.spec-card.teal::before {
  background: linear-gradient(90deg, #5eead4, #7ad08a);
}
.spec-card.rose::before {
  background: linear-gradient(90deg, #c87070, #e09090);
}
.spec-card.moss::before {
  background: linear-gradient(90deg, var(--moss, #8cbf9f), #a8d8b8);
}
.spec-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: rgba(216, 212, 204, 0.25);
  margin-bottom: 16px;
}
.spec-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 18px;
  background: rgba(216, 212, 204, 0.03);
  border: 1px solid rgba(216, 212, 204, 0.06);
}
.spec-icon.gold {
  color: var(--gold, #c9b16a);
  border-color: rgba(200, 164, 77, 0.15);
  background: rgba(200, 164, 77, 0.08);
}
.spec-icon.teal {
  color: #5eead4;
  border-color: rgba(94, 234, 212, 0.12);
  background: rgba(94, 234, 212, 0.06);
}
.spec-icon.rose {
  color: #c87070;
  border-color: rgba(200, 112, 112, 0.12);
  background: rgba(200, 112, 112, 0.06);
}
.spec-icon.moss {
  color: var(--moss, #8cbf9f);
  border-color: rgba(140, 191, 159, 0.12);
  background: rgba(140, 191, 159, 0.06);
}
.spec-name {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 10px;
}
.spec-body {
  font-size: 14px;
  color: rgba(210, 230, 210, 0.7);
  line-height: 1.7;
  font-weight: 300;
}
.spec-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: rgba(210, 230, 210, 0.3);
  margin-top: 16px;
  letter-spacing: 0.05em;
  opacity: 0;
  transition: opacity 0.3s;
}
.spec-card:hover .spec-meta { opacity: 1; }

/* ── Creature grid ── */
.creature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: rgba(216, 212, 204, 0.04);
  margin-top: 2rem;
}
.creature-card {
  background: rgba(4, 13, 8, 0.55);
  border: 1px solid rgba(140, 191, 159, 0.08);
  border-radius: 14px;
  padding: 36px 28px;
  text-align: center;
  position: relative;
  transition: all 0.3s;
}
.creature-card:hover {
  background: rgba(4, 13, 8, 0.7);
  border-color: rgba(140, 191, 159, 0.15);
}
.creature-card::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--gold, #c9b16a);
  transition: width 0.4s;
}
.creature-card:hover::before { width: 60px; }
.creature-type {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold, #c9b16a);
  margin-bottom: 16px;
}
.creature-icon {
  font-size: 36px;
  color: var(--gold, #c9b16a);
  opacity: 0.25;
  margin-bottom: 16px;
}
.creature-name {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 700;
  font-size: 20px;
  margin-bottom: 10px;
}
.creature-body {
  font-size: 13px;
  color: rgba(210, 230, 210, 0.6);
  line-height: 1.6;
  font-weight: 300;
}
.creature-learning {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--moss, #8cbf9f);
  margin-top: 16px;
  letter-spacing: 0.05em;
}

/* ── Tables ── */
.data-table,
.tier-table,
.laws-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  font-size: 0.95rem;
}
.data-table th,
.tier-table th,
.laws-table th {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold, #c9b16a);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(201, 177, 106, 0.25);
}
.data-table td,
.tier-table td,
.laws-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(140, 191, 159, 0.08);
  color: rgba(210, 230, 210, 0.7);
  line-height: 1.5;
}
.data-table td:first-child,
.tier-table td:first-child,
.laws-table td:first-child {
  font-weight: 600;
  color: var(--paper, var(--cream, #e6f2e8));
}
.data-table tr:hover td,
.tier-table tr:hover td,
.laws-table tr:hover td {
  background: rgba(140, 191, 159, 0.04);
}
.tier-table .tier-price {
  color: var(--gold, #c9b16a);
  font-size: 16px;
}
.laws-table .law-num {
  color: var(--gold, #c9b16a);
  font-size: 11px;
  opacity: 0.5;
}
.laws-table .law-name {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--paper, var(--cream, #e6f2e8));
}

/* ── CTA ── */
.cta-section {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 3.5rem 2rem;
  background: rgba(3, 13, 7, 0.9);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(140, 191, 159, 0.07);
}
.cta-head {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 700;
  font-size: clamp(2.6rem, 5vw, 3.6rem);
  line-height: 1.05;
  color: #fff;
}
.cta-sub {
  font-size: 1.15rem;
  color: var(--moss, #8cbf9f);
  margin-top: 1rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.cta-btn {
  display: inline-block;
  padding: 1rem 2.6rem;
  background: rgba(30, 55, 40, 0.5);
  border: 1.5px solid var(--moss, #8cbf9f);
  color: var(--moss, #8cbf9f);
  text-decoration: none;
  border-radius: 4px;
  font-weight: 500;
  transition: all 0.3s ease;
  margin: 0.4rem;
  backdrop-filter: blur(4px);
  font-size: 1rem;
}
.cta-btn:hover {
  background: var(--moss, #8cbf9f);
  color: var(--ink, #030d07);
  box-shadow: 0 0 20px rgba(90, 158, 111, 0.35);
  transform: translateY(-2px);
}

/* ── Footer ── */
footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 3.5rem 2rem;
  color: rgba(200, 223, 200, 0.28);
  font-size: 0.88rem;
  background: rgba(3, 13, 7, 0.9);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(140, 191, 159, 0.07);
}
footer a {
  color: rgba(200, 223, 200, 0.38);
  text-decoration: none;
  margin: 0 0.5rem;
  transition: color 0.2s;
}
footer a:hover { color: var(--moss, #8cbf9f); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .glass-panels .content-inner { margin-left: auto; margin-right: auto; }
  .creature-grid { grid-template-columns: 1fr; }
  .spec-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .content-inner .card-grid.four > *,
  .content-inner .spec-grid.four > *,
  .emergency-layout .content-inner :is(
    .card-grid,
    .status-grid
  ):has(> :nth-child(4):last-child) > * {
    flex-basis: 100%;
    max-width: none;
  }
  .data-table,
  .tier-table,
  .laws-table,
  .rejected-table,
  .remoteness-table,
  .earning-table,
  .vault-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
@media (max-width: 640px) {
  .content-section { padding: 2.5rem 1rem; }
  .glass-panels .content-inner { padding: 1.8rem; margin-left: auto; margin-right: auto; }
  .sec-marker {
    align-items: flex-start;
    gap: 8px 10px;
    letter-spacing: .16em;
  }
  .sec-marker .sec-rule {
    flex-basis: 100%;
    min-width: 0;
  }
  .creature-grid { grid-template-columns: 1fr; }
  .spec-grid { grid-template-columns: 1fr; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .content-inner {
    transition: none;
    opacity: 1;
    transform: none;
  }
}
