/* ─── CSS Variables ─────────────────────────────────── */
:root {
  --bg:        #F5F2EC;
  --bg-dark:   #141210;
  --fg:        #141210;
  --fg-muted:  #6B6560;
  --fg-light:  #F5F2EC;
  --accent:    #C4985A;
  --accent-2:  #8B4513;
  --border:    rgba(20,18,16,0.12);
  --border-light: rgba(245,242,236,0.12);

  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans:  'Outfit', sans-serif;
  --font-mono:  'DM Mono', 'Courier New', monospace;

  --nav-h: 72px;
  --max-w: 1100px;
}

/* ─── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  overflow-x: hidden;
  cursor: none;
}
img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ─── Noise ──────────────────────────────────────────── */
.noise {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
}

/* ─── Cursor ─────────────────────────────────────────── */
.cursor, .cursor-follower {
  position: fixed;
  pointer-events: none;
  z-index: 10000;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease, opacity 0.3s ease;
}
.cursor {
  width: 8px; height: 8px;
  background: var(--accent);
}
.cursor-follower {
  width: 36px; height: 36px;
  border: 1.5px solid var(--accent);
  opacity: 0.5;
  transition: transform 0.35s cubic-bezier(.17,.67,.38,1.1), opacity 0.3s, width 0.3s, height 0.3s;
}
body:has(a:hover) .cursor-follower,
body:has(button:hover) .cursor-follower {
  width: 56px; height: 56px;
  opacity: 0.25;
}

/* ─── Typography Helpers ─────────────────────────────── */
.mono { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
em { font-family: var(--font-serif); font-style: italic; }

/* ─── Navigation ─────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background 0.4s, border-color 0.4s;
}
.nav.scrolled {
  background: rgba(245,242,236,0.9);
  backdrop-filter: blur(12px);
  border-color: var(--border);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--fg);
}
.nav-links {
  display: flex;
  gap: 2.2rem;
}
.nav-link {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
  position: relative;
  transition: color 0.25s;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width 0.3s ease;
}
.nav-link:hover { color: var(--fg); }
.nav-link:hover::after { width: 100%; }
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: none;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 24px; height: 1.5px;
  background: var(--fg);
  transition: transform 0.3s, opacity 0.3s;
}
.hamburger.open span:first-child { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:last-child  { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem 2rem;
  gap: 1.2rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s;
}
.mobile-menu.open {
  display: flex;
  max-height: 400px;
}
.mobile-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

/* ─── Reveal Animation ───────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal:nth-child(3) { transition-delay: 0.16s; }
.reveal:nth-child(4) { transition-delay: 0.24s; }
.reveal:nth-child(5) { transition-delay: 0.32s; }

/* ─── Hero ───────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-h) + 4rem) 2rem 4rem;
  position: relative;
}
.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--fg-muted);
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}
.dot { color: var(--accent); }

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(5rem, 14vw, 11rem);
  font-weight: 300;
  line-height: 0.88;
  letter-spacing: -0.02em;
  margin-bottom: 2.5rem;
  display: flex;
  flex-direction: column;
}
.hero-title .line { display: block; }
.hero-title .italic {
  font-style: italic;
  color: var(--accent);
  padding-left: clamp(2rem, 8vw, 8rem);
}

.hero-rule {
  width: 60px;
  height: 1px;
  background: var(--accent);
  margin-bottom: 2rem;
}

.hero-description {
  font-size: 1.1rem;
  line-height: 1.75;
  color: var(--fg-muted);
  max-width: 500px;
  margin-bottom: 2.5rem;
}
.hero-description em {
  color: var(--fg);
  font-style: italic;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  margin-bottom: 4rem;
  flex-wrap: wrap;
}
.btn-primary {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.9rem 2rem;
  background: var(--fg);
  color: var(--bg);
  border: none;
  cursor: none;
  transition: background 0.3s, color 0.3s;
}
.btn-primary:hover { background: var(--accent); }
.btn-ghost {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.9rem 2rem;
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
  cursor: none;
  transition: border-color 0.3s, color 0.3s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  max-width: 600px;
}
.stat {
  display: flex;
  flex-direction: column;
  padding: 1.2rem 1.5rem;
  background: var(--bg);
  gap: 0.2rem;
}
.stat-num {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--fg);
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.hero-scroll {
  position: absolute;
  bottom: 2.5rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  color: var(--fg-muted);
}
.scroll-line {
  width: 1px;
  height: 50px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2s ease infinite;
}
@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.15); }
}

/* ─── Section Base ───────────────────────────────────── */
.section {
  padding: 7rem 2rem;
  background: var(--bg);
}
.section-dark {
  background: var(--bg-dark);
  color: var(--fg-light);
}
.section-dark .mono { color: var(--accent); }
.section-dark .section-title em { color: var(--accent); }

.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}
.section-label {
  margin-bottom: 3.5rem;
  color: var(--accent);
}
.section-dark .section-label { color: var(--accent); }
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 300;
  line-height: 0.95;
  margin-bottom: 4rem;
  letter-spacing: -0.02em;
}
.section-title em { color: var(--accent); }

/* ─── About ──────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 5rem;
  margin-bottom: 4rem;
  align-items: start;
}
.about-heading h2 {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 300;
  line-height: 0.95;
  letter-spacing: -0.02em;
  position: sticky;
  top: calc(var(--nav-h) + 2rem);
}
.about-heading h2 em { color: var(--accent); }
.about-text {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--fg-muted);
  margin-bottom: 1.5rem;
}
.about-info {
  margin-top: 2.5rem;
  border-top: 1px solid var(--border);
}
.info-row {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
}
.info-key {
  min-width: 110px;
  color: var(--fg-muted);
  font-size: 0.68rem;
}
.info-val {
  font-size: 0.95rem;
  color: var(--fg);
}
.coursework {
  padding-top: 3rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 2.5rem;
  flex-wrap: wrap;
}
.coursework-label { color: var(--fg-muted); margin-top: 0.3rem; flex-shrink: 0; }
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chips span {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  transition: border-color 0.25s, color 0.25s;
}
.chips span:hover { border-color: var(--accent); color: var(--fg); }

/* ─── Timeline ───────────────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 2rem; }
.timeline-item {
  display: grid;
  grid-template-columns: 180px 40px 1fr;
  gap: 0;
  align-items: start;
}
.timeline-left { padding-top: 0.3rem; text-align: right; color: var(--accent); padding-right: 1.5rem; }
.timeline-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  padding-top: 0.5rem;
}
.timeline-line::after {
  content: '';
  position: absolute;
  top: 1.2rem; bottom: -2rem; left: 50%;
  width: 1px;
  background: var(--border-light);
  transform: translateX(-50%);
}
.timeline-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 3px rgba(196,152,90,0.2);
}
.timeline-right { padding-left: 1.5rem; }
.timeline-right h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--fg-light);
  margin-bottom: 0.3rem;
}
.timeline-company {
  color: var(--accent);
  margin-bottom: 1rem;
}
.timeline-right ul li {
  font-size: 0.92rem;
  line-height: 1.75;
  color: rgba(245,242,236,0.65);
  padding-left: 1rem;
  position: relative;
  margin-bottom: 0.4rem;
}
.timeline-right ul li::before {
  content: '—';
  position: absolute;
  left: -0.2rem;
  color: var(--accent);
}

/* ─── Projects ───────────────────────────────────────── */
.projects-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}
.project-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 2rem;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
  position: relative;
}
.project-item::before {
  content: '';
  position: absolute;
  left: -2rem; right: -2rem; top: 0; bottom: 0;
  background: transparent;
  transition: background 0.3s;
  pointer-events: none;
}
.project-item:hover::before { background: rgba(196,152,90,0.03); }

.project-index {
  color: var(--fg-muted);
  font-size: 0.68rem;
  padding-top: 0.25rem;
}
.project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}
.project-body h3 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 400;
  transition: color 0.25s;
}
.project-item:hover .project-body h3 { color: var(--accent); }
.project-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  color: var(--fg-muted);
}
.badge.featured {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.project-body p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--fg-muted);
  max-width: 650px;
  margin-bottom: 1.2rem;
}
.project-links {
  display: flex;
  gap: 1.5rem;
}
.project-link {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  position: relative;
  transition: opacity 0.25s;
}
.project-link::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.project-link:hover::after { transform: scaleX(1); }
.project-link.muted { color: var(--fg-muted); }
.project-link.muted::after { background: var(--fg-muted); }

/* ─── Skills ─────────────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: var(--border-light);
  border: 1px solid var(--border-light);
}
.skill-block {
  background: var(--bg-dark);
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.skill-block-label {
  color: var(--accent);
  font-size: 0.68rem;
}
.skill-items {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.skill-items span {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 300;
  color: rgba(245,242,236,0.8);
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-light);
  transition: color 0.25s;
}
.skill-items span:last-child { border-bottom: none; }
.skill-items span:hover { color: var(--accent); }

/* ─── Contact ────────────────────────────────────────── */
.contact-section {
  min-height: 75vh;
  display: flex;
  align-items: center;
}
.contact-top {
  margin-bottom: 3rem;
  color: var(--accent);
}
.contact-title {
  font-family: var(--font-serif);
  font-size: clamp(3.5rem, 9vw, 7rem);
  font-weight: 300;
  line-height: 0.92;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
}
.contact-title em { color: var(--accent); }
.contact-desc {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--fg-muted);
  margin-bottom: 3.5rem;
}
.contact-links {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}
.contact-link {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.25s;
  position: relative;
  overflow: hidden;
}
.contact-link::before {
  content: '';
  position: absolute;
  left: -2rem; top: 0; bottom: 0;
  width: 4px;
  background: var(--accent);
  transform: translateX(-4px);
  transition: transform 0.3s;
}
.contact-link:hover::before { transform: translateX(0); }
.contact-link:hover .contact-value { color: var(--accent); }
.contact-type { color: var(--fg-muted); min-width: 80px; font-size: 0.65rem; }
.contact-value {
  font-size: 1rem;
  color: var(--fg);
  transition: color 0.25s;
}

/* ─── Footer ─────────────────────────────────────────── */
.footer {
  padding: 1.8rem 2rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--fg-muted);
}

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }

  .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .about-heading h2 { position: static; }

  .timeline-item { grid-template-columns: 1fr; gap: 0.5rem; }
  .timeline-left { text-align: left; padding-right: 0; }
  .timeline-line { display: none; }
  .timeline-right { padding-left: 0; }
  .timeline-line::after { display: none; }

  .skills-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .hero-title { font-size: clamp(3.5rem, 16vw, 5.5rem); }
  .project-item { grid-template-columns: 1fr; gap: 0.5rem; }
  .project-index { display: none; }
  .project-header { flex-direction: column; }
  .contact-link { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
  .footer-inner { flex-direction: column; gap: 0.5rem; text-align: center; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .coursework { flex-direction: column; gap: 1rem; }
}

@media (max-width: 400px) {
  .hero-stats { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  body {
    cursor: auto;
  }

  .cursor,
  .cursor-follower {
    display: none;
  }
}

/* ─── Scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 0; }
