/* slughorn site — shared styles */

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

:root {
  --bg:       #1e1e1e;
  --surface:  #252526;
  --surface2: #2d2d30;
  --text:     #d4d4d4;
  --dim:      #858585;
  --link:     #8ab4f8;
  --accent:   #4a6fa5;
  --gold:     #c98215;
  --gold-hi:  #ffd85a;
  --gold-lo:  #8d4f06;
  --border:   #3e3e42;
  --radius:   8px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ── Nav ─────────────────────────────────────────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(30, 30, 30, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 2.5rem;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px;
}
.nav-brand {
  font-weight: 700; font-size: 1.05rem; letter-spacing: 0.06em;
  color: var(--gold-hi); text-decoration: none;
}
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
  color: var(--dim); text-decoration: none; font-size: 0.88rem;
  font-weight: 600; letter-spacing: 0.02em;
  transition: color 0.18s;
}
.nav-links a:hover { color: var(--text); }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center;
  padding: 7rem 2rem 6rem;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
}
.hero-logo {
  width: min(360px, 78vw);
  margin-bottom: 3rem;
  filter: drop-shadow(0 0 40px rgba(201, 130, 21, 0.4));
}
.hero h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.9rem);
  font-weight: 700; letter-spacing: -0.015em;
  color: #fff; margin-bottom: 1.1rem;
}
.hero h1 em { font-style: normal; color: var(--gold-hi); }
.hero p {
  max-width: 580px; font-size: 1.1rem;
  color: var(--dim); margin-bottom: 2.75rem;
  line-height: 1.75;
}
.hero-ctas { display: flex; gap: 0.85rem; flex-wrap: wrap; justify-content: center; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius);
  font-family: inherit; font-size: 0.92rem; font-weight: 600;
  text-decoration: none; cursor: pointer; border: none;
  transition: all 0.2s; white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold-lo) 0%, var(--gold) 55%, var(--gold-hi) 100%);
  color: #1a0f00; letter-spacing: 0.01em;
}
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--gold); color: var(--gold-hi); }

/* ── Section wrapper ─────────────────────────────────────────────────────── */
section { padding: 5.5rem 2.5rem; }
.container { max-width: 1080px; margin: 0 auto; }

.section-label {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--gold);
  margin-bottom: 0.5rem;
}
.section-title {
  font-size: clamp(1.5rem, 3vw, 1.9rem); font-weight: 700;
  color: #fff; margin-bottom: 0.6rem;
}
.section-intro {
  color: var(--dim); font-size: 1rem;
  margin-bottom: 3rem; max-width: 560px; line-height: 1.7;
}
.gold-rule {
  display: block; width: 52px; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-hi));
  border-radius: 2px; margin-bottom: 2rem;
}

.section-header-row {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 0.6rem;
}
.view-all-link {
  font-size: 0.88rem; font-weight: 700; letter-spacing: 0.02em;
  color: var(--gold); text-decoration: none;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.view-all-link:hover { color: var(--gold-hi); border-bottom-color: var(--gold-hi); }

/* ── Links / resource cards ──────────────────────────────────────────────── */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.2rem;
}
.link-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.5rem 1.3rem;
  text-decoration: none; color: var(--text);
  display: flex; flex-direction: column; gap: 0.55rem;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  position: relative;
}
.link-card--featured {
  border-color: var(--gold);
  background: linear-gradient(150deg, rgba(201, 130, 21, 0.07) 0%, var(--surface) 65%);
  box-shadow: 0 0 0 1px rgba(201, 130, 21, 0.12), 0 4px 20px rgba(201, 130, 21, 0.06);
}
.link-card--featured:hover {
  box-shadow: 0 4px 28px rgba(201, 130, 21, 0.2);
}
.link-card-badge {
  position: absolute; top: 0.75rem; right: 0.85rem;
  padding: 0.18rem 0.55rem;
  border-radius: 99px;
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase;
  background: rgba(201, 130, 21, 0.15);
  color: var(--gold-hi);
  border: 1px solid rgba(201, 130, 21, 0.35);
}
.link-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 4px 24px rgba(201, 130, 21, 0.1);
}
.link-card-icon { font-size: 1.5rem; line-height: 1; }
.link-card-title { font-weight: 700; font-size: 1rem; color: #fff; }
.link-card-desc { font-size: 0.875rem; color: var(--dim); line-height: 1.55; }

/* ── Demo / Examples ─────────────────────────────────────────────────────── */
.demo-section-bg { background: var(--surface); }

.demo-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
  margin-bottom: 2rem;
}
@media (max-width: 760px) { .demo-block { grid-template-columns: 1fr; } }

/* Standalone example pages get a wider, taller code panel */
.demo-block--full {
  grid-template-columns: 3fr 2fr;
}
@media (max-width: 900px) { .demo-block--full { grid-template-columns: 1fr; } }

.demo-panel {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
}

/* ── Tab widget ──────────────────────────────────────────────────────────── */
.demo-panel-header {
  padding: 0 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem; color: var(--dim);
  font-family: 'JetBrains Mono', monospace;
  display: flex; align-items: stretch; gap: 0;
  flex-shrink: 0; height: 36px;
}
.demo-panel-header .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold); flex-shrink: 0;
  align-self: center; margin-right: 0.4rem;
}
.demo-panel-header .dot.green { background: #4ec9b0; }
.demo-panel-header .header-label {
  align-self: center;
}

.tab-btn {
  background: none; border: none; cursor: pointer;
  padding: 0 0.85rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem; color: var(--dim);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  height: 100%;
}
.tab-btn.active { color: var(--gold-hi); border-bottom-color: var(--gold); }
.tab-btn:hover:not(.active) { color: var(--text); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* code panel */
.demo-code pre { margin: 0; }
.demo-code pre code.hljs {
  background: transparent !important;
  padding: 1.1rem 1.25rem;
  font-size: 0.8rem; line-height: 1.58;
  font-family: 'JetBrains Mono', monospace;
}

/* output panel */
.demo-output-body {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 1.75rem;
}
.demo-svg-preview {
  width: 100%; max-width: 340px;
  border-radius: 6px; overflow: hidden;
  box-shadow: 0 2px 16px rgba(0,0,0,0.4);
}
.demo-img-preview {
  width: 100%; border-radius: 6px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.4);
}

.demo-caption {
  font-size: 0.9rem; color: var(--dim); line-height: 1.7;
  border-left: 3px solid var(--gold);
  padding-left: 1rem; margin-top: 0.5rem;
}
.demo-caption code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82em;
  color: var(--link);
  background: var(--surface2);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

/* ── Example page header ─────────────────────────────────────────────────── */
.example-header {
  padding: 3rem 2.5rem 0;
  max-width: 1080px; margin: 0 auto;
}
.example-breadcrumb {
  font-size: 0.82rem; color: var(--dim); margin-bottom: 1.25rem;
}
.example-breadcrumb a { color: var(--gold); text-decoration: none; }
.example-breadcrumb a:hover { color: var(--gold-hi); }

/* ── Example navigation pills ────────────────────────────────────────────── */
.example-nav {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-bottom: 1.75rem;
}
.example-nav-item {
  padding: 0.28rem 0.85rem;
  border-radius: 99px;
  font-size: 0.8rem; font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border);
  color: var(--dim);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.example-nav-item:hover {
  border-color: var(--gold); color: var(--gold-hi);
}
.example-nav-item.active {
  border-color: var(--gold);
  color: var(--gold-hi);
  background: rgba(201, 130, 21, 0.1);
}

.example-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700;
  color: #fff; margin-bottom: 0.5rem;
}
.example-desc {
  color: var(--dim); font-size: 1rem; max-width: 620px; line-height: 1.7;
  margin-bottom: 0;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 3.5rem 2.5rem;
}
.footer-inner {
  max-width: 1080px; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 2.5rem;
  align-items: flex-start; justify-content: space-between;
}
.footer-brand { display: flex; flex-direction: column; gap: 0.65rem; max-width: 360px; }
.footer-brand-name {
  font-weight: 700; font-size: 1.05rem; letter-spacing: 0.06em;
  color: var(--gold-hi);
}
.footer-brand p { color: var(--dim); font-size: 0.88rem; line-height: 1.65; }
.footer-links { display: flex; flex-direction: column; gap: 0.4rem; }
.footer-links a {
  color: var(--dim); text-decoration: none; font-size: 0.88rem;
  transition: color 0.18s;
}
.footer-links a:hover { color: var(--gold-hi); }
.footer-company { display: flex; flex-direction: column; gap: 0.3rem; }
.footer-company-name { font-weight: 700; color: var(--text); font-size: 0.95rem; }
.footer-company p { color: var(--dim); font-size: 0.82rem; }
.footer-copy {
  width: 100%; color: var(--dim); font-size: 0.8rem;
  border-top: 1px solid var(--border);
  padding-top: 1.5rem; margin-top: 0.25rem;
}
