:root {
  --ink: #10151f;
  --paper: #f7f5f1;
  --steel: #3a506b;
  --brass: #b08968;
  --line: #d8d4cb;
  --muted: #6b7280;

  --bg: var(--paper);
  --fg: var(--ink);
  --panel: #ffffff;
  --border: var(--line);
  --accent: var(--brass);
  --max-width: 760px;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", monospace;
}

html[data-theme="dark"] {
  --bg: var(--ink);
  --fg: var(--paper);
  --panel: #1a2130;
  --border: #2c3547;
  --muted: #9aa3b2;
  --accent: #c9a479;
}

* {
  box-sizing: border-box;
}

html,
body {
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  line-height: 1.6;
  transition: background 0.25s ease, color 0.25s ease;
}

/* Top bar */

.topbar {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 20;
}

.topbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--accent);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1rem;
  color: var(--fg);
  letter-spacing: 0.01em;
}

#theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 2.25rem;
  height: 2.25rem;
  cursor: pointer;
  font-size: 1rem;
  color: var(--fg);
  line-height: 1;
}

/* Main */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 5rem 1.5rem 2rem;
}

section {
  margin-bottom: 5.5rem;
}

/* Hero */

.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 1.25rem;
}

.tagline {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 34ch;
  margin: 0;
}

/* Section headings */

h2 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

/* Structure diagram — pure CSS connectors, no SVG overflow risk */

.diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.node-parent {
  display: inline-flex;
  align-items: center;
  padding: 0.85rem 1.5rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.node-parent .node-label {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.05rem;
}

.trunk {
  width: 1px;
  height: 2rem;
  background: var(--border);
}

.node-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  position: relative;
  padding-top: 1.5rem;
}

.node-row::before {
  content: "";
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 1px;
  background: var(--border);
}

.branch {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 0 0.75rem;
}

.branch::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 1.5rem;
  background: var(--border);
}

.node-child {
  margin-top: 1.5rem;
  width: 100%;
  max-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1.25rem 1.5rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  text-decoration: none;
  color: var(--fg);
  text-align: left;
  transition: border-color 0.2s ease;
}

.node-child:hover {
  border-color: var(--accent);
}

.node-child .node-label {
  font-weight: 600;
  font-size: 1.05rem;
}

.node-child .node-url {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
}

/* About */

.about p {
  max-width: 56ch;
  font-size: 1.05rem;
}

/* Partners */

.partner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.partner h3 {
  font-family: var(--font-display);
  font-weight: 500;
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
}

.partner p {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.partner a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.partner a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Footer */

footer {
  border-top: 1px solid var(--border);
  background: var(--panel);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}

.footer-email {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 0.1rem;
}

.footer-email:hover {
  color: var(--accent);
}

.footer-meta {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

@media (max-width: 480px) {
  .node-row {
    grid-template-columns: 1fr;
    padding-top: 0;
    gap: 2rem;
  }

  .node-row::before {
    display: none;
  }

  .branch::before {
    display: none;
  }

  .node-child {
    margin-top: 0;
    max-width: 100%;
  }
}
