:root {
  --bg: #07090c;
  --bg-elev: #0e1318;
  --bg-soft: #121820;
  --line: #222b36;
  --line-strong: #314052;
  --text: #ebe7df;
  --muted: #9aa3ae;
  --accent: #9fb4a5;
  --accent-deep: #6f8a7a;
  --font-display: "Instrument Serif", "Times New Roman", serif;
  --font-body: "Sora", "Segoe UI", sans-serif;
  --shell: min(1120px, calc(100% - 2.5rem));
  --narrow: min(720px, calc(100% - 2.5rem));
  --radius: 12px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 10% -10%, rgba(159, 180, 165, 0.12), transparent 55%),
    radial-gradient(900px 600px at 100% 0%, rgba(80, 110, 140, 0.1), transparent 50%),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--text); }
h1, h2, h3 { line-height: 1.15; font-weight: 500; letter-spacing: -0.02em; }
h2 { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3rem); margin: 0 0 1rem; }
h3 { font-size: 1.15rem; margin: 0 0 0.55rem; font-weight: 600; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #0b100e;
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.shell { width: var(--shell); margin-inline: auto; }
.narrow { width: var(--narrow); margin-inline: auto; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(7, 9, 12, 0.72);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, background 0.25s ease;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.logo {
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  border: 1px solid var(--line-strong);
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--bg-soft);
}
.logo:hover { border-color: var(--accent); color: var(--text); }
.site-nav {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.15rem;
  align-items: center;
}
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  padding: 0.35rem 0;
}
.site-nav a:hover,
.site-nav a.active { color: var(--text); }
.nav-toggle {
  display: none;
  margin-left: auto;
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0.45rem 0.8rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

/* Hero */
.hero {
  position: relative;
  min-height: min(100vh, 920px);
  display: grid;
  align-items: end;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.hero-photo {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(56vw, 680px);
  height: 100%;
  max-height: 100%;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  animation: fade-in 1.2s ease both;
}
.hero-photo picture,
.hero-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 16%;
}
.hero-photo img {
  filter: saturate(0.7) contrast(1.08) brightness(0.96);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 28%),
                      linear-gradient(180deg, #000 55%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 0%, #000 28%),
              linear-gradient(180deg, #000 55%, transparent 100%);
  mask-composite: intersect;
}
.hero-veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(7, 9, 12, 0.15) 0%, rgba(7, 9, 12, 0.4) 48%, rgba(7, 9, 12, 0.94) 100%),
    linear-gradient(90deg, rgba(7, 9, 12, 0.92) 0%, rgba(7, 9, 12, 0.7) 36%, rgba(7, 9, 12, 0.15) 68%, rgba(7, 9, 12, 0.4) 100%);
  pointer-events: none;
}
.hero-content {
  position: relative;
  z-index: 3;
  padding: 7rem 0 4.5rem;
  width: min(var(--shell), 560px);
  margin-left: max(calc((100% - min(1120px, calc(100% - 2.5rem))) / 2), 1.25rem);
  margin-right: auto;
  animation: rise 0.9s ease both;
}
.hero-brand {
  margin: 0 0 0.85rem;
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--text);
}
.hero-title {
  margin: 0 0 1.1rem;
  font-family: var(--font-body);
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.01em;
}
.hero-lead {
  margin: 0 0 1.75rem;
  max-width: 38rem;
  color: var(--muted);
  font-size: 1.05rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.7rem 1.15rem;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  color: var(--text);
  text-decoration: none;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.btn:hover { border-color: var(--accent); color: var(--text); }
.btn-primary {
  background: var(--accent);
  border-color: transparent;
  color: #0b100e;
}
.btn-primary:hover {
  background: #b7c9bd;
  color: #0b100e;
  border-color: transparent;
}
.btn-ghost { background: transparent; }

/* Sections */
.section {
  padding: clamp(4rem, 8vw, 6.5rem) 0;
}
.section-alt {
  background: linear-gradient(180deg, rgba(18, 24, 32, 0.55), rgba(7, 9, 12, 0.2));
  border-block: 1px solid var(--line);
}
.section-head { margin-bottom: 2rem; max-width: 40rem; }
.section-sub { color: var(--muted); margin: 0; }
.eyebrow {
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-deep);
}
.prose p { color: var(--muted); font-size: 1.05rem; }
.prose p:last-child { margin-bottom: 0; }

.pullquote {
  margin: 2rem 0 0;
  padding: 1.25rem 0 0;
  border-top: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  line-height: 1.35;
  color: var(--text);
  font-style: italic;
}

/* Projects — list panels, not heavy cards */
.project-list {
  display: grid;
  gap: 1rem;
}
.project {
  padding: 1.35rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(14, 19, 24, 0.65);
  transition: border-color 0.2s ease, transform 0.25s ease;
}
.project:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}
.project-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.55rem;
}
.project p { color: var(--muted); margin-bottom: 0.9rem; }
.status {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid rgba(159, 180, 165, 0.35);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  white-space: nowrap;
}
.tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tags li {
  font-size: 0.74rem;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0.22rem 0.5rem;
  border-radius: 6px;
  background: rgba(7, 9, 12, 0.45);
}

/* Timeline */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line-strong);
}
.timeline li {
  position: relative;
  padding: 0 0 1.75rem 1.35rem;
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 0.45rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(159, 180, 165, 0.15);
}
.timeline p { color: var(--muted); margin: 0; }

/* Interests */
.interest-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.interest-grid article {
  padding: 1.2rem 1.25rem;
  border-top: 1px solid var(--line-strong);
}
.interest-grid p { color: var(--muted); margin: 0; font-size: 0.95rem; }

.learning { text-align: left; }
.learning-line {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin: 0 0 0.65rem;
  line-height: 1.25;
}
.learning-sub { color: var(--muted); margin: 0 0 1.5rem; }
.loop {
  margin: 0;
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(159, 180, 165, 0.35);
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}
.contact-links a {
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  padding: 0.7rem 1rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
}
.contact-links a:hover { border-color: var(--accent); }
.contact-fallback { margin: 0; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 3rem;
}
.footer-inner { display: grid; gap: 0.75rem; }
.footer-brand { margin: 0; font-weight: 600; }
.footer-disclaimer,
.footer-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  max-width: 42rem;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 900px) {
  .interest-grid { grid-template-columns: 1fr 1fr; }
  .hero-photo { width: min(78vw, 520px); opacity: 0.9; }
}
@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 64px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1.25rem 1rem;
    background: rgba(7, 9, 12, 0.96);
    border-bottom: 1px solid var(--line);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
  .interest-grid { grid-template-columns: 1fr; }
  .hero { min-height: 100svh; align-items: end; }
  .hero-photo {
    width: 100%;
    left: 0;
    right: 0;
    opacity: 0.5;
  }
  .hero-photo img {
    object-position: center 12%;
    -webkit-mask-image: linear-gradient(180deg, transparent 5%, #000 40%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 5%, #000 40%, transparent 100%);
  }
  .hero-veil {
    background:
      linear-gradient(180deg, rgba(7, 9, 12, 0.35) 0%, rgba(7, 9, 12, 0.55) 35%, rgba(7, 9, 12, 0.96) 100%),
      linear-gradient(90deg, rgba(7, 9, 12, 0.7) 0%, rgba(7, 9, 12, 0.45) 100%);
  }
  .hero-content { padding: 5.5rem 0 3.25rem; max-width: none; }
  .project-top { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .hero-content, .hero-photo { opacity: 1; transform: none; animation: none; transition: none; }
  .project:hover { transform: none; }
}
