/* ============================================
   Alex Dinsenmeyer — Personal Site
   Minimal & modern shared stylesheet
   ============================================ */

:root {
  --bg: #fafaf9;
  --bg-elevated: #ffffff;
  --text: #18181b;
  --text-muted: #71717a;
  --border: #e4e4e7;
  --accent: #18181b;
  --accent-soft: #f4f4f5;
  --link: #2563eb;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
  --radius: 12px;
  --max-w: 1100px;
  --content-w: 720px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Apple Garamond", Georgia, "Times New Roman", serif;
  --transition: 180ms cubic-bezier(.2,.7,.2,1);
}

html[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-elevated: #141414;
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --border: #27272a;
  --accent: #f4f4f5;
  --accent-soft: #1c1c1e;
  --link: #60a5fa;
  --shadow: 0 1px 2px rgba(0,0,0,0.2), 0 8px 24px rgba(0,0,0,0.25);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background var(--transition), color var(--transition);
}

a {
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition), opacity var(--transition);
}

a:hover { opacity: 0.65; }

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

h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }

.muted { color: var(--text-muted); }

/* ===== Layout ===== */

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--narrow {
  max-width: var(--content-w);
}

main { padding: 4rem 0 6rem; }

section { margin-bottom: 4rem; }

/* ===== Nav ===== */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid var(--border);
}

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

.nav__brand {
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 1rem;
}

.nav__brand span { color: var(--text-muted); font-weight: 400; }

.nav__links {
  display: flex;
  gap: 1.75rem;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav__links a {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.nav__links a.active,
.nav__links a:hover { color: var(--text); opacity: 1; }

.theme-toggle {
  appearance: none;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  transition: background var(--transition), border-color var(--transition);
}

.theme-toggle:hover { background: var(--border); }

.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .sun { display: none; }
html[data-theme="dark"] .theme-toggle .sun { display: block; }
html[data-theme="dark"] .theme-toggle .moon { display: none; }

/* ===== Hero / landing ===== */

.hero {
  padding: 5rem 0 4rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4rem;
}

.hero__eyebrow {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero h1 { margin-bottom: 1rem; }

.hero__lede {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
}

.hero__actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

/* ===== Buttons ===== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), border-color var(--transition);
}

.btn:hover { background: var(--accent-soft); opacity: 1; transform: translateY(-1px); }

.btn--primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.btn--primary:hover { opacity: 0.88; }

/* ===== Cards / Posts ===== */

.posts {
  display: grid;
  gap: 1.5rem;
}

.post-card {
  display: block;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.post-card:hover {
  border-color: color-mix(in srgb, var(--text) 25%, var(--border));
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  opacity: 1;
}

.post-card__meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.post-card h3 { margin-bottom: 0.4rem; }

.post-card p { color: var(--text-muted); margin: 0; }

/* ===== Section header ===== */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

.section-head h2 { margin: 0; }

.section-head a { font-size: 0.9rem; color: var(--text-muted); }

/* ===== Gallery (woodworking) ===== */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.gallery__item {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--accent-soft);
  transition: transform var(--transition);
}

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

.gallery__item svg {
  width: 100%;
  height: 100%;
  display: block;
}

.gallery__caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 1rem;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  color: #fff;
  font-size: 0.9rem;
}

.gallery__caption strong { display: block; font-weight: 600; }
.gallery__caption span { opacity: 0.8; font-size: 0.8rem; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 100;
  cursor: zoom-out;
}

.lightbox.open { display: flex; }
.lightbox__content {
  max-width: 900px;
  width: 100%;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.lightbox__content svg { width: 100%; max-height: 70vh; }
.lightbox__caption { margin-top: 1rem; }

/* ===== Resume ===== */

.resume-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3rem;
}

.resume-header h1 { margin: 0; }

.resume-section { margin-bottom: 2.5rem; }

.resume-section > h2 {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
}

.role {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 1rem;
  margin-bottom: 1.75rem;
}

.role h3 { margin: 0; font-size: 1.05rem; }
.role .role__org { color: var(--text-muted); font-size: 0.95rem; }
.role .role__date { color: var(--text-muted); font-size: 0.9rem; white-space: nowrap; }
.role p { grid-column: 1 / -1; margin: 0.4rem 0 0; color: var(--text-muted); }
.role ul { grid-column: 1 / -1; margin: 0.4rem 0 0; padding-left: 1.1rem; color: var(--text-muted); }
.role ul li { margin-bottom: 0.25rem; }

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill {
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
}

/* ===== Timeline (resume) ===== */

.timeline {
  position: relative;
  margin: 1rem 0 2rem;
  padding-left: 0;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(
    to bottom,
    var(--border) 0%,
    var(--border) 92%,
    transparent 100%
  );
  border-radius: 2px;
}

.tl-item {
  position: relative;
  padding-left: 3rem;
  padding-bottom: 2.25rem;
}

.tl-item:last-child { padding-bottom: 0; }

.tl-item::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 8px;
  width: 16px;
  height: 16px;
  background: var(--bg);
  border: 2px solid var(--text);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--bg);
  transition: background var(--transition), transform var(--transition);
  z-index: 1;
}

.tl-item:hover::before {
  background: var(--text);
  transform: scale(1.15);
}

.tl-item--current::before {
  background: var(--text);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 7px color-mix(in srgb, var(--text) 18%, transparent);
}

.tl-item--current::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 14px;
  width: 4px;
  height: 4px;
  background: var(--bg);
  border-radius: 50%;
  z-index: 2;
  animation: pulse-dot 2.2s ease-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.tl-date {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  padding: 0.2rem 0.6rem;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.tl-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.tl-item:hover .tl-card {
  border-color: color-mix(in srgb, var(--text) 25%, var(--border));
  transform: translateX(2px);
  box-shadow: var(--shadow);
}

.tl-card h3 {
  margin: 0 0 0.15rem;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.tl-card .tl-org {
  display: block;
  color: var(--te