/* ==========================================================================
   Design system — cinematic editorial (deep navy / paper) inspired by
   data-storytelling landing pages: serif display type, tracked-out
   uppercase labels, thin hairline borders, subtle grain texture.
   ========================================================================== */

:root {
  --font-heading: 'Fraunces', 'Inter', serif;
  --font-body: 'Inter', sans-serif;

  --cream: #f1eee6;
  --paper: #fbfaf6;
  --paper-solid: #ffffff;
  --ink: #1a2430;
  --ink-soft: #4c5a6b;
  --ink-faint: #8996a6;
  --line: rgba(20, 30, 45, 0.14);
  --line-strong: rgba(20, 30, 45, 0.38);
  --accent: #4d7ea8;
  --accent-ink: #ffffff;
  --shadow: 0 20px 44px rgba(20, 30, 45, 0.10);
  --grain-opacity: 0.05;

  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

[data-theme="dark"] {
  --cream: #10151d;
  --paper: #161d27;
  --paper-solid: #161d27;
  --ink: #eef2f6;
  --ink-soft: #a7b3c2;
  --ink-faint: #6c7889;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.3);
  --accent: #7fa8cf;
  --accent-ink: #0e131a;
  --shadow: 0 24px 54px rgba(0, 0, 0, 0.45);
  --grain-opacity: 0.035;
}

/* Reset ------------------------------------------------------------------ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
  background-repeat: repeat;
  background-size: 180px 180px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; font-family: var(--font-body); font-weight: 700; }
.hero-title, .page-header h1, .section-header h2, .bio-copy h2, .resume-panel h2, .not-found-panel h1 {
  font-family: var(--font-heading);
  font-weight: 500;
  letter-spacing: -0.01em;
}
p { margin: 0; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

mark, .highlight {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0 5px;
  border-radius: 4px;
  font-weight: 600;
}

/* Paper primitive ---------------------------------------------------------- */
.paper {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  position: relative;
}

.tilt { transition: transform 0.15s ease; will-change: transform; }
.tilt::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.35), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
[data-theme="dark"] .tilt::after {
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.08), transparent 60%);
}
.tilt:hover::after { opacity: 1; }

/* Reveal-on-scroll ---------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* Buttons -------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  letter-spacing: 0.01em;
}
.btn:not(.btn-sm)::before { content: "→"; }
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--ink);
  color: var(--cream);
  box-shadow: 0 10px 24px rgba(20, 30, 45, 0.25);
}
[data-theme="dark"] .btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { box-shadow: 0 14px 30px rgba(20, 30, 45, 0.32); }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink);
}
.btn-ghost:hover { background: rgba(20, 30, 45, 0.05); }
[data-theme="dark"] .btn-ghost:hover { background: rgba(255, 255, 255, 0.06); }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

/* Header ----------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 16px;
  z-index: 50;
  max-width: 1080px;
  margin: 16px auto 0;
  border-radius: var(--radius-md);
  padding: 12px 18px;
  overflow: visible;
  transition: box-shadow 0.3s ease;
}
.site-header.scrolled { box-shadow: 0 16px 40px rgba(20, 30, 45, 0.2); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { font-weight: 700; font-size: 1.05rem; text-decoration: none; color: var(--ink); }
.main-nav { display: flex; gap: 26px; }
.nav-link {
  color: var(--ink-soft); text-decoration: none; font-size: 0.8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  position: relative; padding: 4px 2px;
}
.nav-link.active, .nav-link:hover { color: var(--ink); }
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--ink);
  font-size: 14px;
}
html[data-theme="dark"] .icon-moon { display: none; }
html[data-theme="light"] .icon-sun { display: none; }
.nav-toggle { display: none; flex-direction: column; gap: 4px; }
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; }

/* Hero -------------------------------------------------------------------------- */
.hero { padding: 100px 20px 24px; }
.hero-panel {
  max-width: 1080px; margin: 0 auto; padding: 64px 56px;
  display: flex; align-items: center; justify-content: space-between; gap: 40px; flex-wrap: wrap;
}
.hero-copy { flex: 1 1 420px; min-width: 280px; }
.eyebrow {
  display: inline-block;
  font-size: 0.76rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 18px;
}
.hero-title { font-size: clamp(2.4rem, 5.5vw, 4rem); line-height: 1.08; margin: 0 0 22px; max-width: 16ch; }
.hero-tagline { color: var(--ink-soft); font-size: 1.1rem; line-height: 1.6; max-width: 46ch; margin-bottom: 34px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.scroll-hint {
  margin-top: 56px;
  display: flex; align-items: center; gap: 8px;
  color: var(--ink-faint);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* Hero globe --------------------------------------------------------------------- */
.hero-globe {
  position: relative;
  width: 380px;
  height: 340px;
  flex: 0 0 auto;
}
.globe-sphere {
  position: absolute;
  top: 50%; left: 50%;
  width: 210px; height: 210px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.4), transparent 55%),
    radial-gradient(circle at 68% 74%, rgba(0, 0, 0, 0.3), transparent 60%),
    radial-gradient(circle at 50% 50%, var(--accent) 0%, var(--ink) 78%);
  box-shadow: 0 0 70px rgba(79, 126, 168, 0.35), inset -12px -12px 34px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  z-index: 2;
}
.globe-sphere::before {
  content: "";
  position: absolute;
  inset: -30% -60%;
  background-image:
    repeating-linear-gradient(96deg, rgba(255, 255, 255, 0.1) 0 2px, transparent 2px 16px),
    repeating-linear-gradient(18deg, rgba(255, 255, 255, 0.06) 0 3px, transparent 3px 20px);
  mix-blend-mode: overlay;
  animation: globe-spin 16s linear infinite;
}
@keyframes globe-spin {
  from { transform: translateX(0); }
  to { transform: translateX(-200px); }
}
.globe-ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 280px; height: 76px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}
.orbit-dot {
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  z-index: 3;
  transition: opacity 0.3s ease;
}
.orbit-dot .dot {
  position: absolute;
  top: 0; left: 0;
  transform: translate(-50%, -50%);
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 126, 168, 0.2);
}
.orbit-dot .label {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  font-size: 0.64rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  color: var(--ink-soft);
  background: var(--paper-solid);
  border: 1px solid var(--line-strong);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  padding: 3px 9px;
  border-radius: 999px;
}
.orbit-dot.label-left .label {
  left: auto;
  right: 12px;
}
.orbit-dot.behind { z-index: 0; }

@media (prefers-reduced-motion: reduce) {
  .globe-sphere::before { animation: none; }
}
@media (max-width: 900px) {
  .hero-globe { display: none; }
}

/* Sections ----------------------------------------------------------------------- */
.section { padding: 56px 0; }
.section-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 26px; }
.section-header h2 { font-size: 1.6rem; }
.section-kicker { font-size: 0.76rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); display: block; margin-bottom: 8px; }
.link-arrow { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.85rem; border-bottom: 1px solid var(--line-strong); padding-bottom: 2px; text-transform: uppercase; letter-spacing: 0.05em; }

.page-header { padding: 100px 20px 8px; }
.page-header-inner { max-width: 1080px; margin: 0 auto; }
.page-header h1 { font-size: 2.4rem; margin-bottom: 10px; }
.page-header p { color: var(--ink-soft); max-width: 50ch; }

/* Cards ------------------------------------------------------------------------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.card { padding: 0; display: flex; flex-direction: column; transition: transform 0.3s ease; overflow: hidden; }
.card:hover { transform: translateY(-5px); }
.card-media {
  height: 160px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20, 30, 45, 0.035);
  border-bottom: 1px solid var(--line);
}
[data-theme="dark"] .card-media { background: rgba(255, 255, 255, 0.03); }
.card-media svg { width: 56px; height: 56px; stroke: var(--ink); }
.card-body { padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.card-body h3 { font-size: 1.1rem; font-weight: 700; }
.card-body p { color: var(--ink-soft); font-size: 0.92rem; line-height: 1.55; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-pill {
  font-size: 0.7rem; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--ink-soft); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.card-links { display: flex; gap: 10px; margin-top: 6px; }

/* Filter bar --------------------------------------------------------------------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.filter-chip {
  padding: 8px 18px; border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s ease;
}
.filter-chip.active, .filter-chip:hover {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}
[data-theme="dark"] .filter-chip.active, [data-theme="dark"] .filter-chip:hover {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
}

/* About / bio --------------------------------------------------------------------- */
.bio-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 44px; align-items: center; padding: 48px; }
.bio-copy h2 { font-size: 1.9rem; margin-bottom: 18px; }
.bio-copy p { color: var(--ink-soft); font-size: 1rem; line-height: 1.7; margin-bottom: 16px; }
.polaroid {
  background: var(--paper-solid);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 10px 22px;
  box-shadow: var(--shadow);
  transform: rotate(3deg);
  max-width: 280px;
  margin: 0 auto;
}
.polaroid-photo {
  aspect-ratio: 4 / 5;
  background: rgba(20, 30, 45, 0.05);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-faint);
  font-size: 0.85rem;
}
[data-theme="dark"] .polaroid-photo { background: rgba(255, 255, 255, 0.05); }

.facts-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 20px; padding: 30px 48px; border-top: 1px solid var(--line); }
.fact dt { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-faint); margin-bottom: 6px; }
.fact dd { margin: 0; font-size: 0.95rem; color: var(--ink); }

/* Timeline (resume) ---------------------------------------------------------------- */
.resume-panel { padding: 40px 48px; margin-top: 24px; }
.resume-panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 14px; }
.resume-panel h2 { font-size: 1.4rem; }
.timeline { display: flex; flex-direction: column; }
.timeline-item { position: relative; padding-left: 26px; border-left: 2px solid var(--line); padding-bottom: 24px; }
.timeline-item:last-child { padding-bottom: 0; border-left: 2px solid transparent; }
.timeline-dot {
  position: absolute; left: -6px; top: 4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
}
.timeline-head h3 { font-size: 1rem; margin-bottom: 3px; font-weight: 700; }
.timeline-sub { color: var(--ink-faint); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.timeline-desc { color: var(--ink-soft); font-size: 0.9rem; line-height: 1.6; margin-top: 8px; }

/* Contact ----------------------------------------------------------------------------- */
.contact-panel { padding: 44px 48px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; margin-top: 24px; }
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.06em; }
.form-row input, .form-row textarea {
  padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.95rem;
  resize: vertical;
}
.form-row input:focus, .form-row textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.contact-alt { display: flex; flex-direction: column; justify-content: center; gap: 12px; border-left: 1px solid var(--line); padding-left: 32px; }
.contact-alt p { color: var(--ink-soft); font-size: 0.9rem; }

/* 404 ----------------------------------------------------------------------------------- */
.not-found { display: flex; justify-content: center; padding: 130px 20px; }
.not-found-panel { padding: 56px; text-align: center; }
.not-found-panel h1 { font-size: 4.5rem; color: var(--ink); }
.not-found-panel p { display: block; margin: 12px 0 24px; color: var(--ink-soft); }

/* Footer ----------------------------------------------------------------------------------- */
.site-footer { padding: 40px 20px 60px; max-width: 1080px; margin: 0 auto; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; padding: 18px 26px; flex-wrap: wrap; gap: 14px; border-radius: var(--radius-md); }
.footer-inner p { color: var(--ink-faint); font-size: 0.85rem; }
.social-links { display: flex; gap: 16px; }
.social-links a { color: var(--ink-soft); text-decoration: none; font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.social-links a:hover { color: var(--ink); }

/* Responsive ----------------------------------------------------------------------------------- */
@media (max-width: 820px) {
  .main-nav {
    position: fixed;
    top: 70px; left: 16px; right: 16px;
    flex-direction: column;
    background: var(--paper-solid);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 20px;
    gap: 14px;
    box-shadow: var(--shadow);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
  }
  .main-nav.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-toggle { display: flex; }
  .bio-grid { grid-template-columns: 1fr; padding: 36px 28px; text-align: center; }
  .polaroid { order: -1; }
  .contact-panel { grid-template-columns: 1fr; padding: 32px 28px; }
  .contact-alt { border-left: none; border-top: 1px solid var(--line); padding-left: 0; padding-top: 20px; }
  .resume-panel, .facts-row { padding: 28px; }
}

@media (max-width: 520px) {
  .hero-panel { padding: 44px 26px; }
  .not-found-panel { padding: 36px; }
}
