:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --text: #efede8;
  --muted: #8f8b84;
  --line: #262420;
  --accent: #ff6a1a;
  --accent-ink: #0a0a0a;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --col: 44rem;
  --wide: 70rem;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #141414;
  --muted: #6b675f;
  --line: #e4e0d8;
  --accent: #d9480f;
  --accent-ink: #ffffff;
  color-scheme: light;
}
#space { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; letter-spacing: -0.01em; margin: 0; }
h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wide); margin-inline: auto; padding-inline: var(--gutter); }
.col { max-width: var(--col); }

/* Menu */
.menu {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.menu .wrap { display: flex; align-items: center; justify-content: space-between; height: 3.5rem; gap: 1rem; }
.menu nav { display: flex; gap: clamp(0.9rem, 3vw, 2rem); }
.menu nav a, .menu .back {
  color: var(--muted); text-decoration: none; font-size: 0.9rem; letter-spacing: 0.01em;
  padding: 0.25rem 0; border-bottom: 1px solid transparent; white-space: nowrap;
}
.menu nav a:hover, .menu .back:hover { color: var(--text); }
.menu nav a.active { color: var(--text); border-bottom-color: var(--accent); }
.menu .back { color: var(--text); }

.theme-toggle {
  background: none; border: 1px solid var(--line); color: var(--text);
  width: 2.1rem; height: 2.1rem; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; flex: none;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .moon { display: none; }
.theme-toggle .sun { display: block; }
:root[data-theme="light"] .theme-toggle .sun { display: none; }
:root[data-theme="light"] .theme-toggle .moon { display: block; }

/* Sections */
section { padding-block: clamp(5rem, 12vw, 9rem); }
.eyebrow { font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin: 0 0 1rem; }

/* Hero */
.hero { min-height: calc(100svh - 3.5rem); display: flex; align-items: center; position: relative; padding-block: 4rem 7rem; }
.hero h1 { font-size: clamp(3.2rem, 11vw, 7rem); line-height: 1; letter-spacing: -0.025em; }
.hero .role { font-family: var(--serif); font-size: clamp(1.35rem, 3.2vw, 2rem); margin: 1.25rem 0 0; color: var(--text); }
.hero .tagline { color: var(--muted); max-width: 32rem; margin: 1.75rem 0 0; font-size: 1.125rem; }
.cue {
  position: absolute; left: var(--gutter); bottom: 2rem; display: flex; align-items: center; gap: 0.75rem;
  color: var(--muted); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none;
}
.cue i { display: block; width: 1px; height: 3rem; background: var(--line); position: relative; overflow: hidden; }
.cue i::after { content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--accent); animation: drip 2.2s ease-in-out infinite; }
@keyframes drip { to { top: 100%; } }

/* What I do */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-top: 3rem; }
.cards .card { background: color-mix(in srgb, var(--bg) 78%, transparent); padding: 1.75rem; }
.cards svg { width: 1.9rem; height: 1.9rem; fill: none; stroke: var(--accent); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 1.1rem; }
.cards h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.cards p { margin: 0; color: var(--muted); font-size: 0.98rem; }
.about { margin-top: clamp(4rem, 8vw, 6rem); display: grid; gap: 1rem; }
.about h3 { font-size: 1.6rem; }
.about ul { padding-left: 1.2rem; margin: 0; }
.about li { margin-bottom: 0.5rem; }

/* Projects */
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: clamp(1.5rem, 3vw, 2.5rem); margin-top: 3rem; }
.project { display: block; text-decoration: none; color: inherit; border: 1px solid var(--line); background: var(--surface); transition: border-color 0.25s, transform 0.25s; }
.project:hover { border-color: var(--accent); transform: translateY(-3px); }
.project .shot { aspect-ratio: 16 / 10; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--bg); }
.project .shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.project .body { padding: 1.5rem; }
.project h3 { font-size: 1.6rem; margin-bottom: 0.5rem; }
.project p { color: var(--muted); margin: 0 0 1rem; }
.project .go { color: var(--accent); font-size: 0.9rem; }

/* Career */
.timeline { margin-top: 3rem; border-left: 1px solid var(--line); padding-left: clamp(1.25rem, 4vw, 2.5rem); display: grid; gap: 3rem; max-width: var(--col); }
.job { position: relative; }
.job::before { content: ""; position: absolute; left: calc(-1 * clamp(1.25rem, 4vw, 2.5rem) - 4.5px); top: 0.6rem; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.job .meta { color: var(--muted); font-size: 0.9rem; margin: 0.25rem 0 1rem; }
.job h3 { font-size: 1.5rem; }
.job ul { padding-left: 1.2rem; margin: 0; }
.job li { margin-bottom: 0.6rem; }
.actions { margin-top: 4rem; display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; }
.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); padding: 0.8rem 1.5rem; text-decoration: none; font-size: 0.95rem; border: 1px solid var(--accent); transition: background 0.2s, color 0.2s; }
.btn:hover { background: transparent; color: var(--accent); }
.contact { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; list-style: none; padding: 0; margin: 0; }
footer { border-top: 1px solid var(--line); padding-block: 2rem; color: var(--muted); font-size: 0.85rem; }

/* Project pages */
.article { padding-block: clamp(3rem, 8vw, 6rem) 6rem; }
.article h1 { font-size: clamp(2.6rem, 8vw, 4.5rem); margin-bottom: 1.25rem; }
.article .lede { font-size: 1.25rem; font-weight: 600; line-height: 1.5; }
.article .tag { font-family: var(--serif); font-style: italic; font-size: 1.5rem; color: var(--accent); margin-bottom: 0; }
.article h2 { font-size: 1.8rem; margin: 3.5rem 0 1rem; }
.article ul, .article ol { padding-left: 1.3rem; }
.article li { margin-bottom: 0.6rem; }
.article figure { margin: 2.5rem 0; }
.article figure img { border: 1px solid var(--line); width: 100%; }
.article figcaption { color: var(--muted); font-size: 0.88rem; margin-top: 0.6rem; }
.article table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.98rem; }
.article th, .article td { text-align: left; padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--line); }
.article th { font-weight: 600; color: var(--muted); font-size: 0.85rem; letter-spacing: 0.04em; }

/* Reveal */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.9s ease, transform 0.9s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .cue i::after { animation: none; }
  .project { transition: none; }
}
@media (max-width: 30rem) {
  body { font-size: 1rem; }
  .menu nav a { font-size: 0.82rem; }
  .cue { display: none; }
  .hero { padding-bottom: 4rem; }
}
