/* ==========================================================================
   components.css  |  Reference implementation. Requires tokens.css.
   Adapt class names to the existing site; keep the visual rules.
   ========================================================================== */

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--text-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  padding-inline: var(--gutter);
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--wrap); margin-inline: auto; }
.wrap--wide { max-width: var(--wrap-wide); }

/* Headings */
h1, h2, h3 { margin: 0; font-weight: var(--fw-semibold); text-wrap: balance; }
h1 { font-size: var(--text-display); line-height: var(--lh-tight); letter-spacing: var(--track-display); }
h2 { font-size: var(--text-2xl); line-height: var(--lh-tight); letter-spacing: var(--track-heading); }
h3 { font-size: var(--text-lg); line-height: var(--lh-snug); font-weight: var(--fw-semibold); }
p  { margin: 0; max-width: 65ch; }

.label {
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ink-muted);
}
.lede { font-size: var(--text-lg); line-height: var(--lh-snug); color: var(--ink-muted); max-width: 52ch; }

/* Links: ink text, accent underline */
a { color: var(--ink); text-decoration-line: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: var(--radius-s); }

/* Nav */
.nav { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); justify-content: space-between; align-items: center; padding-block: var(--space-5); font-size: var(--text-sm); }
.nav__name { font-weight: var(--fw-semibold); text-decoration: none; }
.nav ul { display: flex; flex-wrap: wrap; gap: var(--space-5); align-items: center; list-style: none; margin: 0; padding: 0; }
.nav a:not(.button) { text-decoration: none; color: var(--ink-muted); padding-bottom: 2px; border-bottom: 2px solid transparent; }
.nav a:not(.button):hover, .nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* Button: accent fill, one primary per view */
.button { display: inline-block; background: var(--accent); color: var(--on-accent); font: inherit; font-size: var(--text-sm); font-weight: var(--fw-semibold); text-decoration: none; padding: 0.65rem 1.15rem; border-radius: var(--radius-m); border: 0; cursor: pointer; transition: filter var(--dur) var(--ease); }
.button:hover { filter: brightness(1.08); }
.button--quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.button--quiet:hover { filter: none; background: var(--surface); }

/* Tag */
.tag { display: inline-block; font-size: var(--text-xs); font-weight: var(--fw-medium); color: var(--ink-muted); border: var(--rule) solid var(--line); padding: 2px 10px; border-radius: var(--radius-s); white-space: nowrap; }

/* Pull quote */
.quote { margin: 0; padding: var(--space-5); background: var(--surface); border-radius: var(--radius-m); font-size: var(--text-lg); line-height: var(--lh-snug); max-width: 60ch; }
.quote cite { display: block; margin-top: var(--space-3); font-size: var(--text-sm); font-style: normal; color: var(--ink-muted); }

/* Case row: the main portfolio / experience unit */
.case { display: grid; grid-template-columns: 8rem 1fr; gap: var(--space-1) var(--space-5); padding-block: var(--space-4); border-top: var(--rule) solid var(--line); }
.case:last-child { border-bottom: var(--rule) solid var(--line); }
.case__meta { padding-top: 4px; }
.case__title { font-size: var(--text-lg); font-weight: var(--fw-semibold); line-height: var(--lh-snug); }
.case__body { color: var(--ink-muted); font-size: var(--text-sm); }
@media (max-width: 560px) { .case { grid-template-columns: 1fr; } }

/* Footer, with the illustration sitting on the footer rule */
.footer { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); justify-content: space-between; padding-block: var(--space-4) var(--space-6); border-top: var(--rule) solid var(--line); font-size: var(--text-xs); color: var(--ink-muted); }

/* Illustration (inline SVG, see DESIGN.md) */
.skyline { display: block; width: 100%; height: auto; }
.skyline .b { fill: var(--bg); stroke: var(--illustration); stroke-width: var(--stroke); stroke-linejoin: round; stroke-linecap: round; }
.skyline .g { fill: none; stroke: var(--illustration); stroke-width: var(--stroke); stroke-linecap: round; }
.skyline .h { fill: none; stroke: var(--illustration); stroke-width: .8; opacity: .4; }

/* ==========================================================================
   Site additions. Everything below is tokens only; the reference above is
   untouched. Used by more than one page; page-only CSS lives in each page.
   ========================================================================== */

[id] { scroll-margin-top: var(--space-5); }

/* Vertical rhythm: gap instead of per-element margins */
.stack { display: flex; flex-direction: column; gap: var(--stack-gap, var(--space-4)); }

/* Buttons */
.button--small { padding: 0.3rem 0.8rem; font-size: var(--text-xs); }

/* Tags: a row, and anchors that look like tags */
.tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }
a.tag { text-decoration: none; }
a.tag:hover { color: var(--ink); border-color: var(--ink-muted); }

/* Quiet text-style button (pause / play) */
.text-button { font: inherit; font-size: var(--text-xs); font-weight: var(--fw-medium); color: var(--ink-muted); background: none; border: 0; padding: var(--space-1) 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.text-button:hover { color: var(--ink); text-decoration-color: var(--ink); }

/* Section divider: hairlines with a small sprig between, generous space around */
.divider { display: flex; align-items: center; gap: var(--space-4); margin-block: var(--space-9); }
.divider::before, .divider::after { content: ""; flex: 1; height: var(--rule); background: var(--line); }
.divider svg { flex: none; width: 14px; height: 21px; color: var(--illustration); opacity: .8; }
@media (max-width: 680px) { .divider { margin-block: var(--space-8); } }

/* Page headings on inner pages (the home hero uses the display size) and section headings */
h1.page-title { font-size: var(--text-2xl); }
.section h2 { font-size: var(--text-xl); }

/* Footer: small muted line, sprigs at both ends */
.footer { justify-content: center; align-items: center; gap: var(--space-3); margin-top: var(--space-7); text-align: center; }
.footer p { max-width: none; }
.sprig-footer { flex: none; width: 12px; height: 18px; color: var(--illustration); opacity: .7; }

/* Print: the resume prints in the light palette, without chrome */
@media print {
  body { background: none; padding-inline: 0; font-size: 12pt; }
  .nav, .footer, .divider, .no-print { display: none; }
  .wrap { max-width: none; }
  .case { break-inside: avoid; }
}

/* Plain list with quiet markers */
.bullets { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.bullets li { position: relative; padding-left: var(--space-4); max-width: 65ch; }
.bullets li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 5px; height: 5px; border-radius: 50%; background: var(--ink-muted); }

/* Skyline animation (<skyline-evolution>, see skyline-evolution.js).
   The component reads these custom properties; they map the drawing onto
   the site tokens so it follows light and dark. */
skyline-evolution {
  display: block; width: 100%; aspect-ratio: 16 / 9;
  --sk-bg: var(--bg);
  --sk-ink: var(--illustration);
  --sk-ink-2: color-mix(in srgb, var(--illustration) 62%, var(--bg));
  --sk-ink-3: color-mix(in srgb, var(--illustration) 32%, var(--bg));
  --sk-accent: var(--accent);
  --sk-text: var(--ink);
  --sk-text-muted: var(--ink-muted);
}
skyline-evolution .se-kicker { font-family: var(--font); font-weight: var(--fw-medium); font-size: 34px; letter-spacing: var(--track-label); fill: var(--sk-text-muted); font-variant-numeric: tabular-nums; }
skyline-evolution .se-title { font-family: var(--font); font-weight: var(--fw-semibold); font-size: 88px; letter-spacing: var(--track-display); fill: var(--sk-text); }
/* The coordinates are too small to read on phones; the city name stays. */
@media (max-width: 560px) { skyline-evolution .se-kicker { display: none; } }

/* Theme toggle: shows the moon in light mode and the sun in dark mode */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; padding: 0; background: none; border: 0; border-radius: var(--radius-m); color: var(--ink-muted); cursor: pointer; }
.theme-toggle:hover { color: var(--ink); background: var(--surface); }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle[data-mode="dark"] .theme-toggle__moon, .theme-toggle:not([data-mode="dark"]) .theme-toggle__sun { display: none; }
/* On phones the nav links fill the row, so the toggle sits at the top right beside the name. */
@media (max-width: 560px) {
  .nav { position: relative; }
  .nav .theme-toggle { position: absolute; top: calc(var(--space-5) - 0.5rem); right: 0; }
}
@media print { .theme-toggle { display: none; } }
