/* Formation Package — Shared Styles
   Techne aesthetic: dark forced, EB Garamond + Inter, copper accent */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #0a0a0a;
  --bg-card: #141412;
  --bg-card-hover: #1a1a18;
  --bg-table-alt: #161614;
  --text: #e8e4df;
  --text-dim: #9a9590;
  --text-faint: #5a5550;
  --accent: #c4956a;
  --accent-dim: #8a6a4a;
  --accent-bright: #d4a57a;
  --green: #6a9a6a;
  --green-dim: #4a7a4a;
  --red: #c46a6a;
  --blue: #6a8ac4;
  --rule: #2a2520;
  --serif: 'EB Garamond', 'Georgia', serif;
  --sans: 'Inter', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 17px; scroll-behavior: smooth; background: var(--bg); }
body { font-family: var(--serif); color: var(--text); background: var(--bg); line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-bright); text-decoration: underline; }

.container { max-width: 900px; margin: 0 auto; padding: 0 2rem; }

/* Hero */
.hero { min-height: 40vh; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 4rem 2rem; text-align: center; position: relative; }
.hero::after { content: ''; position: absolute; bottom: 0; left: 10%; right: 10%; height: 1px; background: linear-gradient(90deg, transparent, var(--accent-dim), transparent); }
.hero .ql { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.2em; color: var(--accent); text-transform: uppercase; margin-bottom: 1.5rem; }
.hero h1 { font-family: var(--serif); font-size: 2.2rem; font-weight: 500; color: var(--text); margin-bottom: 0.5rem; }
.hero .sub { font-family: var(--serif); font-size: 1.15rem; font-style: italic; color: var(--text-dim); margin-bottom: 2rem; max-width: 36em; }
.hero .meta { font-family: var(--sans); font-size: 0.75rem; color: var(--text-faint); letter-spacing: 0.05em; }
.hero .meta span { margin: 0 0.75rem; }

/* Breadcrumb */
.breadcrumb { font-family: var(--sans); font-size: 0.75rem; color: var(--text-faint); padding: 1.5rem 0 0; }
.breadcrumb a { color: var(--text-faint); }
.breadcrumb a:hover { color: var(--accent); text-decoration: none; }

/* Sections */
section { padding: 2.5rem 0; border-top: 1px solid var(--rule); }
h2 { font-family: var(--serif); font-size: 1.5rem; font-weight: 500; color: var(--text); margin-bottom: 0.25rem; }
h2 .n { font-family: var(--mono); font-size: 0.8rem; color: var(--accent); margin-right: 0.5rem; }
.ss { font-family: var(--sans); font-size: 0.7rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 1.5rem; }
h3 { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; color: var(--text); margin: 2rem 0 0.75rem; }
h4 { font-family: var(--sans); font-size: 0.85rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; margin: 1.5rem 0 0.5rem; }
p { margin-bottom: 1rem; color: var(--text-dim); }
p.lead { font-size: 1.05rem; color: var(--text); font-style: italic; }
blockquote { border-left: 3px solid var(--accent-dim); padding: 0.75rem 1.25rem; margin: 1.25rem 0; background: var(--bg-card); border-radius: 0 6px 6px 0; font-style: italic; color: var(--text-dim); }

/* Tables */
table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: 0.9rem; }
thead th { font-family: var(--sans); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--rule); }
thead th.num { text-align: right; }
tbody td { padding: 0.6rem 0.75rem; border-bottom: 1px solid rgba(42,37,32,0.5); color: var(--text-dim); }
tbody td.num { text-align: right; font-family: var(--mono); font-size: 0.85rem; }
tbody td.name { color: var(--text); }
tbody tr:nth-child(even) { background: var(--bg-table-alt); }
tbody tr:hover { background: var(--bg-card-hover); }
tfoot td { padding: 0.75rem; border-top: 2px solid var(--accent-dim); font-weight: 600; color: var(--text); }
tfoot td.num { font-family: var(--mono); color: var(--accent-bright); }

/* Cards */
.card { background: var(--bg-card); border: 1px solid var(--rule); border-radius: 8px; padding: 1.5rem; margin: 1rem 0; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.card-link { display: block; background: var(--bg-card); border: 1px solid var(--rule); border-radius: 8px; padding: 1.5rem; text-decoration: none; transition: border-color 0.2s, transform 0.15s; }
.card-link:hover { border-color: var(--accent-dim); transform: translateY(-2px); text-decoration: none; }
.card-link .card-num { font-family: var(--mono); font-size: 0.7rem; color: var(--accent); display: block; margin-bottom: 0.25rem; }
.card-link .card-title { font-family: var(--serif); font-size: 1.05rem; color: var(--text); display: block; margin-bottom: 0.35rem; }
.card-link .card-desc { font-family: var(--sans); font-size: 0.8rem; color: var(--text-faint); display: block; line-height: 1.5; }

/* Tags / Status */
.tag { display: inline-block; font-family: var(--sans); font-size: 0.65rem; padding: 0.1rem 0.5rem; border-radius: 3px; letter-spacing: 0.05em; text-transform: uppercase; }
.tag.open { background: rgba(196,149,106,0.15); color: var(--accent); border: 1px solid rgba(196,149,106,0.3); }
.tag.done { background: rgba(106,154,106,0.15); color: var(--green); border: 1px solid rgba(106,154,106,0.3); }
.tag.blocker { background: rgba(196,106,106,0.15); color: var(--red); border: 1px solid rgba(196,106,106,0.3); }
.tag.high { background: rgba(196,149,106,0.2); color: var(--accent-bright); border: 1px solid rgba(196,149,106,0.4); }
.tag.medium { background: rgba(106,138,196,0.15); color: var(--blue); border: 1px solid rgba(106,138,196,0.3); }
.tag.low { background: rgba(90,85,80,0.2); color: var(--text-faint); border: 1px solid rgba(90,85,80,0.4); }
.status { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 3px; font-family: var(--sans); font-size: 0.7rem; background: rgba(106,154,106,0.15); color: var(--green); border: 1px solid rgba(106,154,106,0.3); }

/* Entity rows */
.entity-card { background: var(--bg-card); border: 1px solid var(--rule); border-radius: 8px; padding: 1.5rem; margin: 1.5rem 0; }
.entity-row { display: flex; padding: 0.4rem 0; border-bottom: 1px solid rgba(42,37,32,0.3); }
.entity-row:last-child { border-bottom: none; }
.entity-key { font-family: var(--sans); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); width: 160px; flex-shrink: 0; padding-top: 0.15rem; }
.entity-value { font-size: 0.95rem; color: var(--text); }

/* Checklist */
.checklist { margin: 1rem 0; }
.check-item { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.6rem 0.75rem; border-bottom: 1px solid rgba(42,37,32,0.3); }
.check-item:hover { background: var(--bg-card); }
.check-box { font-family: var(--mono); font-size: 0.85rem; color: var(--text-faint); flex-shrink: 0; width: 1.5rem; }
.check-box.done { color: var(--green); }
.check-text { flex: 1; font-size: 0.9rem; color: var(--text-dim); }
.check-ref { font-family: var(--mono); font-size: 0.7rem; color: var(--accent); flex-shrink: 0; }

/* Open items */
.open-item { padding: 0.75rem 1rem; margin-bottom: 0.5rem; background: var(--bg-card); border-radius: 6px; display: flex; align-items: flex-start; gap: 0.75rem; }
.open-item .content { flex: 1; }
.open-item .item-title { font-size: 0.9rem; color: var(--text); }
.open-item .item-desc { font-size: 0.8rem; color: var(--text-faint); margin-top: 0.15rem; }

/* Footer */
.page-footer { padding: 3rem 0; text-align: center; border-top: 1px solid var(--rule); margin-top: 2rem; }
.page-footer p { font-family: var(--sans); font-size: 0.75rem; color: var(--text-faint); }
.page-footer .back { font-family: var(--sans); font-size: 0.8rem; color: var(--accent); display: inline-block; margin-bottom: 1rem; }

/* Summary cards */
.summary-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; padding: 2rem 0 1.5rem; }
.summary-card { background: var(--bg-card); border: 1px solid var(--rule); border-radius: 8px; padding: 1.25rem; text-align: center; }
.summary-card .value { font-family: var(--mono); font-size: 1.4rem; font-weight: 500; color: var(--accent-bright); display: block; margin-bottom: 0.25rem; }
.summary-card .label { font-family: var(--sans); font-size: 0.7rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.1em; }

/* Lists */
ul, ol { margin: 0.75rem 0 1rem 1.5rem; color: var(--text-dim); }
li { margin-bottom: 0.4rem; }
li strong { color: var(--text); }

/* Critical path diagram */
.critical-path { background: var(--bg-card); border: 1px solid var(--rule); border-radius: 8px; padding: 1.5rem; margin: 1.5rem 0; font-family: var(--mono); font-size: 0.8rem; color: var(--text-dim); line-height: 2; white-space: pre-wrap; }
.critical-path .highlight { color: var(--accent); }

/* Symbols */
.sym { font-size: 1.1em; color: var(--accent); margin-right: 0.4rem; font-weight: normal; }
h2 .sym { font-size: 0.9em; }
.card-sym { font-family: var(--mono); font-size: 1.1rem; color: var(--accent); display: block; margin-bottom: 0.15rem; letter-spacing: 0.05em; }

/* Symbol Key */
.symbol-key { background: var(--bg-card); border: 1px solid var(--rule); border-radius: 8px; padding: 1.25rem 1.5rem; margin: 1.5rem 0; }
.symbol-key-title { font-family: var(--sans); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--text-faint); margin-bottom: 0.75rem; }
.symbol-key-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.35rem 1.5rem; }
.symbol-key-item { display: flex; align-items: center; gap: 0.6rem; padding: 0.25rem 0; }
.symbol-key-glyph { font-family: var(--serif); font-size: 1.15rem; color: var(--accent); width: 1.5rem; text-align: center; flex-shrink: 0; }
.symbol-key-label { font-family: var(--sans); font-size: 0.8rem; color: var(--text-dim); }

@media (max-width: 600px) {
  .symbol-key-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Diagrams — shared containers */
.diagram { background: var(--bg-card); border: 1px solid var(--rule); border-radius: 8px; padding: 1.5rem; margin: 1.5rem 0; overflow-x: auto; display: flex; justify-content: center; }
.diagram svg { max-width: 100%; height: auto; }
.diagram svg text { font-family: var(--sans); }

/* Timeline */
.timeline { position: relative; padding: 1rem 0 1rem 2.5rem; margin: 1.5rem 0; }
.timeline::before { content: ''; position: absolute; left: 0.75rem; top: 0; bottom: 0; width: 2px; background: linear-gradient(180deg, var(--accent-dim), var(--accent), var(--accent-dim)); }
.timeline-node { position: relative; padding: 0.5rem 0 1.25rem; }
.timeline-node::before { content: ''; position: absolute; left: -2.05rem; top: 0.7rem; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); box-shadow: 0 0 0 2px var(--accent-dim); }
.timeline-node .tl-label { font-family: var(--sans); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); display: block; margin-bottom: 0.15rem; }
.timeline-node .tl-event { font-size: 0.9rem; color: var(--text-dim); }
.timeline-node .tl-event strong { color: var(--text); }

/* Bar visualization */
.bar-viz { margin: 1.5rem 0; }
.bar-row { display: flex; align-items: center; margin-bottom: 0.6rem; }
.bar-label { font-family: var(--sans); font-size: 0.8rem; color: var(--text); width: 100px; flex-shrink: 0; }
.bar-track { flex: 1; height: 24px; background: rgba(42,37,32,0.5); border-radius: 4px; position: relative; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent-dim), var(--accent)); transition: width 0.3s ease; }
.bar-value { font-family: var(--mono); font-size: 0.75rem; color: var(--text); position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%); }

/* Priority legend */
.priority-legend { display: flex; gap: 1.5rem; flex-wrap: wrap; margin: 1rem 0 1.5rem; padding: 0.75rem 1rem; background: var(--bg-card); border: 1px solid var(--rule); border-radius: 6px; }
.priority-legend .legend-item { display: flex; align-items: center; gap: 0.4rem; font-family: var(--sans); font-size: 0.75rem; color: var(--text-dim); }
.priority-legend .legend-dot { width: 8px; height: 8px; border-radius: 2px; }

/* Health Indicators — Ecosystem Pulse */
.health-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; padding: 2rem 0 1rem; max-width: 640px; margin: 0 auto; }
.health-card { background: var(--bg-card); border: 1px solid var(--rule); border-radius: 10px; padding: 1.25rem 1.5rem; position: relative; overflow: hidden; }
.health-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.health-card.homeostasis::before { background: linear-gradient(90deg, var(--green), var(--green-dim)); }
.health-card.growth::before { background: linear-gradient(90deg, var(--accent), var(--accent-dim)); }
.health-card.circulation::before { background: linear-gradient(90deg, var(--blue), #4a6a9a); }
.health-card.symbiosis::before { background: linear-gradient(90deg, #9a6ac4, #6a4a8a); }
.health-label { font-family: var(--sans); font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: 0.6rem; display: flex; align-items: center; gap: 0.5rem; }
.health-card.homeostasis .health-label { color: var(--green); }
.health-card.growth .health-label { color: var(--accent); }
.health-card.circulation .health-label { color: var(--blue); }
.health-card.symbiosis .health-label { color: #9a6ac4; }
.health-pulse { width: 6px; height: 6px; border-radius: 50%; animation: pulse 2s ease-in-out infinite; }
.health-card.homeostasis .health-pulse { background: var(--green); box-shadow: 0 0 6px var(--green); }
.health-card.growth .health-pulse { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.health-card.circulation .health-pulse { background: var(--blue); box-shadow: 0 0 6px var(--blue); }
.health-card.symbiosis .health-pulse { background: #9a6ac4; box-shadow: 0 0 6px #9a6ac4; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.health-value { font-family: var(--serif); font-size: 1.05rem; color: var(--text); line-height: 1.4; margin-bottom: 0.4rem; }
.health-detail { font-family: var(--sans); font-size: 0.75rem; color: var(--text-faint); line-height: 1.5; }
.health-signals { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.health-signals li { font-family: var(--sans); font-size: 0.72rem; color: var(--text-dim); padding: 0.2rem 0; padding-left: 1rem; position: relative; }
.health-signals li::before { content: ''; position: absolute; left: 0; top: 0.55rem; width: 4px; height: 4px; border-radius: 50%; }
.health-card.homeostasis .health-signals li::before { background: var(--green); }
.health-card.growth .health-signals li::before { background: var(--accent); }
.health-card.circulation .health-signals li::before { background: var(--blue); }
.health-card.symbiosis .health-signals li::before { background: #9a6ac4; }

/* Health sub-cards */
.health-subcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.5rem; margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid rgba(42,37,32,0.4); }
.health-subcard { display: block; background: rgba(10,10,10,0.5); border: 1px solid rgba(42,37,32,0.5); border-radius: 6px; padding: 0.6rem 0.75rem; text-decoration: none; transition: border-color 0.2s; }
.health-subcard:hover { border-color: var(--accent-dim); text-decoration: none; }
.health-subcard .hsc-label { font-family: var(--mono); font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.1em; display: block; margin-bottom: 0.15rem; }
.health-card.growth .health-subcard .hsc-label { color: var(--accent); }
.health-card.homeostasis .health-subcard .hsc-label { color: var(--green); }
.health-card.circulation .health-subcard .hsc-label { color: var(--blue); }
.health-card.symbiosis .health-subcard .hsc-label { color: #9a6ac4; }
.health-subcard .hsc-value { font-family: var(--serif); font-size: 0.85rem; color: var(--text); display: block; line-height: 1.3; }
.health-subcard .hsc-meta { font-family: var(--sans); font-size: 0.6rem; color: var(--text-faint); display: block; margin-top: 0.1rem; }

/* Ecosystem timestamp */
.ecosystem-ts { font-family: var(--mono); font-size: 0.65rem; color: var(--text-faint); text-align: center; padding: 0.5rem 0 1.5rem; letter-spacing: 0.05em; }

/* Responsive */
@media (max-width: 600px) {
  .hero h1 { font-size: 1.7rem; }
  .entity-row { flex-direction: column; }
  .entity-key { width: auto; margin-bottom: 0.1rem; }
  .card-grid { grid-template-columns: 1fr; }
  .summary-cards { grid-template-columns: repeat(2, 1fr); }
  table { font-size: 0.8rem; }
  thead th, tbody td { padding: 0.4rem 0.5rem; }
}
