/* ============================================================
   Richie Hastings — richiehastings.com
   Shared design system
   ============================================================ */

:root {
  --bg: #0e1015;
  --bg-alt: #14171f;
  --surface: #1a1e28;
  --surface-2: #20242f;
  --border: #2b303c;
  --text: #edeff3;
  --text-dim: #a6acbb;
  --text-faint: #6f7686;

  --gold: #d9a441;
  --gold-soft: rgba(217, 164, 65, 0.14);

  --pillar-econ: #d9a441;   /* economics & energy */
  --pillar-music: #b98bd1;  /* music & composition */
  --pillar-film: #d1615f;   /* film & narratology */
  --pillar-media: #5fb3b3;  /* media & speaking */

  --serif: "Fraunces", "Iowan Old Style", "Georgia", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --maxw: 1120px;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

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

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Header / Nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(14, 16, 21, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 20px;
}

.brand {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand small {
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}

.site-nav {
  display: flex;
  gap: 2px;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar { display: none; }

.site-nav a {
  font-size: 0.84rem;
  color: var(--text-dim);
  padding: 8px 12px;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.site-nav a:hover { color: var(--text); background: var(--surface); }
.site-nav a.active { color: var(--bg); background: var(--gold); font-weight: 600; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 10px;
  font-size: 1rem;
}

@media (max-width: 980px) {
  .site-nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 10px 16px 18px;
    gap: 2px;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 10px; border-radius: 8px; }
  .nav-toggle { display: inline-block; }
}

/* ---------- Hero ---------- */

.hero {
  padding: 88px 0 56px;
  text-align: center;
}

.hero .eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.hero .lede {
  max-width: 640px;
  margin: 18px auto 0;
  font-size: 1.08rem;
  color: var(--text-dim);
}

/* ---------- Tree / hub diagram ---------- */

.tree-section { padding: 20px 0 70px; }

.tree-wrap {
  max-width: 920px;
  margin: 0 auto;
}

.tree-wrap svg { width: 100%; height: auto; overflow: visible; }

.tree-node-link { cursor: pointer; }

.tree-node-circle {
  transition: r 0.18s ease, filter 0.18s ease;
}

.tree-node-link:hover .tree-node-circle {
  filter: brightness(1.2);
}

.tree-node-label {
  font-family: var(--sans);
  font-weight: 600;
  fill: var(--text);
}

.tree-node-sub {
  font-family: var(--sans);
  fill: var(--text-faint);
}

.tree-path {
  fill: none;
  stroke-width: 1.6;
  opacity: 0.55;
}

.tree-root-circle { fill: var(--gold); }
.tree-root-label { fill: var(--bg); font-family: var(--serif); font-weight: 700; }

/* mobile fallback: pillar cards */
.pillar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 48px;
}

.pillar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  border-top: 3px solid var(--card-color, var(--gold));
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.pillar-card:hover { transform: translateY(-3px); }

.pillar-card .tag {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--card-color, var(--gold));
  font-weight: 700;
  display: block;
  margin-bottom: 10px;
}

.pillar-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.pillar-card p { font-size: 0.88rem; margin: 0; }

@media (max-width: 900px) {
  .pillar-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .pillar-grid { grid-template-columns: 1fr; }
}

/* ---------- Page header (interior pages) ---------- */

.page-header {
  padding: 64px 0 40px;
  border-bottom: 1px solid var(--border);
}

.page-header .tag {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--pillar-color, var(--gold));
  margin-bottom: 14px;
  display: inline-block;
}

.page-header h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); max-width: 760px; }
.page-header .lede { max-width: 640px; font-size: 1.05rem; margin-top: 14px; }

/* ---------- Content sections ---------- */

.section { padding: 56px 0; }
.section + .section { border-top: 1px solid var(--border); }
.section h2 { font-size: 1.5rem; margin-bottom: 18px; }
.section-narrow { max-width: 760px; }

.two-col {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: start;
}

@media (max-width: 800px) {
  .two-col { grid-template-columns: 1fr; }
}

/* Timeline */
.timeline { border-left: 2px solid var(--border); margin-left: 6px; padding-left: 28px; }
.timeline-item { position: relative; padding-bottom: 30px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -34px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--pillar-color, var(--gold));
}
.timeline-item .when {
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 4px;
}
.timeline-item h4 { font-size: 1.02rem; margin-bottom: 4px; }
.timeline-item p { font-size: 0.92rem; }

/* Cards / lists */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 12px 0 8px;
}
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; text-align: center; }
.stat .num { font-family: var(--serif); font-size: 1.5rem; color: var(--pillar-color, var(--gold)); }
.stat .label { font-size: 0.74rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 4px; }

@media (max-width: 560px) {
  .stat-row { grid-template-columns: 1fr; }
}

/* Placeholder / editable callout */
.placeholder-note {
  border: 1.5px dashed var(--pillar-color, var(--gold));
  background: linear-gradient(180deg, rgba(217,164,65,0.06), transparent);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 18px 0;
}
.placeholder-note .label {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--pillar-color, var(--gold));
  margin-bottom: 6px;
  display: block;
}
.placeholder-note p { font-size: 0.9rem; margin: 0; color: var(--text-dim); }

/* Buttons / links */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gold);
  color: #14161c;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 12px 22px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
}
.btn.outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }

.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li {
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.link-list li:first-child { padding-top: 0; }
.link-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
  font-weight: 500;
}
.link-list a:hover { color: var(--gold); }
.link-list .meta { font-size: 0.8rem; color: var(--text-faint); font-weight: 400; }

/* Dashboard embed placeholder */
.embed-frame {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  aspect-ratio: 16/10;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
.embed-frame .inner { color: var(--text-faint); font-size: 0.9rem; max-width: 320px; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 44px 0 60px;
  margin-top: 40px;
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.site-footer .foot-links { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { color: var(--text-dim); font-size: 0.86rem; }
.site-footer a:hover { color: var(--gold); }
.site-footer .copyright { font-size: 0.8rem; color: var(--text-faint); }

/* Utility */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
