:root {
  --bg: #f5f2ea;
  --surface: #fbfaf6;
  --ink: #16201d;
  --muted: #68706c;
  --accent: #173f38;
  --accent-2: #d8dfd7;
  --line: #d9d8d1;
  --max: 1180px;
  --radius: 22px;
  --shadow: 0 18px 60px rgba(22,32,29,.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; line-height: 1.08; margin-top: 0; }
h1 { font-size: clamp(3rem, 7vw, 6.8rem); letter-spacing: -.055em; max-width: 900px; margin-bottom: 1.5rem; }
h2 { font-size: clamp(2.2rem, 4.2vw, 4.4rem); letter-spacing: -.04em; margin-bottom: 1rem; }
h3 { font-size: clamp(1.45rem, 2.2vw, 2.15rem); letter-spacing: -.025em; }
p { margin: 0 0 1rem; }
a { color: inherit; }

.container { width: min(var(--max), calc(100% - 40px)); margin-inline: auto; }
.section { padding: 110px 0; }
.section-tight { padding: 55px 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .13em; font-weight: 700; font-size: .78rem; color: var(--accent); margin-bottom: 1.2rem; }
.lead { font-size: clamp(1.2rem, 2vw, 1.55rem); max-width: 800px; color: #2f3a36; }
.prose { font-size: 1.08rem; color: #3d4542; }
.prose.large { font-size: 1.14rem; }
.split { display: grid; grid-template-columns: .9fr 1.1fr; gap: 80px; align-items: start; }
.section-heading { margin-bottom: 48px; }
.section-heading.narrow { max-width: 800px; }

.skip-link { position: fixed; left: 10px; top: 10px; transform: translateY(-160%); background: var(--ink); color: white; padding: 10px 14px; z-index: 999; }
.skip-link:focus { transform: none; }

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(245,242,234,.88); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(217,216,209,.8); }
.nav-wrap { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { font-family: Georgia, serif; font-weight: 700; text-decoration: none; font-size: 1.2rem; }
.nav { display: flex; gap: 24px; align-items: center; }
.nav a { text-decoration: none; font-size: .96rem; color: #3f4744; }
.nav a:hover { color: var(--accent); }
.nav-cta { border: 1px solid var(--accent); padding: 9px 14px; border-radius: 999px; }
.nav-toggle { display: none; border: 0; background: transparent; font: inherit; }

.hero { padding-top: 130px; min-height: 78vh; display: grid; align-items: center; }
.hero-grid { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 70px; align-items: end; }
.hero-context { max-width: 700px; color: var(--muted); font-size: 1.05rem; }
.hero-card { border: 1px solid var(--line); background: rgba(251,250,246,.72); padding: 28px; border-radius: var(--radius); display: grid; gap: 12px; box-shadow: var(--shadow); }
.hero-card span { padding-bottom: 12px; border-bottom: 1px solid var(--line); font-weight: 600; }
.hero-card span:last-child { border-bottom: 0; padding-bottom: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 18px; border-radius: 999px; text-decoration: none; font-weight: 700; border: 1px solid transparent; }
.button.primary { background: var(--accent); color: white; }
.button.primary:hover { filter: brightness(1.08); }
.button.secondary { border-color: var(--line); background: var(--surface); }

.intro-section { background: var(--surface); border-block: 1px solid var(--line); }
.stats { background: var(--accent); color: white; }
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 28px; }
.stat { display: grid; gap: 4px; }
.stat strong { font-family: Georgia, serif; font-size: 1.8rem; }
.stat span { color: rgba(255,255,255,.72); font-size: .95rem; }

.projects-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px; }
.project { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; box-shadow: 0 8px 30px rgba(22,32,29,.035); }
.project.featured { grid-column: 1 / -1; padding: 40px; }
.project-meta { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 28px; }
.project p { color: #46504c; }
.tags { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { border: 1px solid var(--line); background: #f4f3ee; padding: 6px 10px; border-radius: 999px; font-size: .8rem; color: #53605b; }
details { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 18px; }
summary { cursor: pointer; font-weight: 700; }
.details-body { padding-top: 18px; }

.timeline-section { background: var(--surface); border-block: 1px solid var(--line); overflow: hidden; }
.timeline {
  --timeline-progress: 0%;
  position: relative;
  display: grid;
  gap: 46px;
  padding: 20px 0 10px;
}
.timeline::before, .timeline::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 2px;
  transform: translateX(-50%);
  border-radius: 999px;
  pointer-events: none;
}
.timeline::before { height: 100%; background: var(--line); }
.timeline::after { height: var(--timeline-progress); background: var(--accent); transition: height .15s linear; z-index: 1; }
.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px minmax(0, 1fr);
  align-items: center;
  min-height: 220px;
}
.timeline-card {
  grid-column: 1;
  position: relative;
  padding: 30px 32px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 34px rgba(22,32,29,.045);
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.timeline-item:nth-child(even) .timeline-card { grid-column: 3; }
.timeline-card::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -13px;
  width: 24px;
  height: 24px;
  background: var(--bg);
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  transform: translateY(-50%) rotate(45deg);
}
.timeline-item:nth-child(even) .timeline-card::after {
  right: auto;
  left: -13px;
  transform: translateY(-50%) rotate(225deg);
}
.timeline-marker {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  position: relative;
  z-index: 3;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 9px var(--surface);
  display: grid;
  place-items: center;
  transition: transform .35s ease, box-shadow .35s ease, background-color .35s ease;
}
.timeline-marker span { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.timeline-item.is-visible .timeline-marker { transform: scale(1.08); box-shadow: 0 0 0 9px var(--surface), 0 0 0 10px rgba(23,63,56,.14); }
.timeline-card__top { display: flex; justify-content: space-between; gap: 18px; align-items: baseline; margin-bottom: 18px; }
.timeline-card time { color: var(--accent); font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; }
.timeline-step { font-family: Georgia, serif; font-size: 2.2rem; line-height: 1; color: rgba(23,63,56,.16); font-weight: 700; }
.timeline-card h3 { margin-bottom: 10px; font-size: clamp(1.65rem, 2.5vw, 2.35rem); }
.timeline-copy p { margin-bottom: 12px; color: #46504c; }
.timeline-keywords { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem; font-weight: 600; }
@media (hover:hover) and (pointer:fine) {
  .timeline-card:hover { transform: translateY(-5px); box-shadow: 0 20px 50px rgba(22,32,29,.085); border-color: rgba(23,63,56,.24); }
}

.skills-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; }
.skills-grid article { padding: 26px; border-top: 3px solid var(--accent); background: rgba(251,250,246,.62); }
.skills-grid h3 { font-size: 1.45rem; }
.skills-grid p { color: var(--muted); line-height: 1.8; }

.about-section blockquote { font-family: Georgia, serif; font-size: clamp(1.5rem, 2.6vw, 2.2rem); line-height: 1.35; border-left: 3px solid var(--accent); padding-left: 22px; margin: 34px 0 0; color: var(--accent); }

.contact-section { padding-top: 40px; }
.contact-card { background: var(--ink); color: white; border-radius: calc(var(--radius) + 6px); padding: 52px; display: flex; align-items: end; justify-content: space-between; gap: 50px; }
.contact-card .eyebrow { color: #b9d0c8; }
.contact-card p { color: rgba(255,255,255,.72); max-width: 650px; }
.contact-card .button.primary { background: white; color: var(--ink); }

.site-footer { padding: 28px 0 46px; }
.footer-wrap { display: flex; justify-content: space-between; gap: 24px; color: var(--muted); font-size: .88rem; }

@media (max-width: 900px) {
  .hero-grid, .split { grid-template-columns: 1fr; gap: 42px; }
  .hero-card { max-width: 560px; }
  .stats-grid, .skills-grid { grid-template-columns: repeat(2,1fr); }
  .projects-grid { grid-template-columns: 1fr; }
  .project.featured { grid-column: auto; }
  .contact-card { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 720px) {
  .section { padding: 78px 0; }
  .hero { padding-top: 95px; }
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: 72px; left: 20px; right: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; flex-direction: column; align-items: stretch; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .stats-grid, .skills-grid { grid-template-columns: 1fr; }
  .contact-card { padding: 34px 26px; }
  .footer-wrap { flex-direction: column; }
  h1 { font-size: clamp(2.85rem, 15vw, 4.8rem); }
}

/* Legal, accessibility and consent */
:focus-visible { outline: 3px solid #9b6d27; outline-offset: 3px; }
.footer-identity { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-legal { display: flex; align-items: center; justify-content: flex-end; gap: 16px; flex-wrap: wrap; }
.footer-legal a, .footer-link-button { color: var(--muted); font: inherit; font-size: .88rem; }
.footer-link-button { border: 0; padding: 0; background: transparent; text-decoration: underline; cursor: pointer; }
.footer-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; background: rgba(251,250,246,.7); }
.footer-chip strong { color: var(--accent); font-size: .72rem; letter-spacing: .08em; }
.footer-chip span { color: var(--ink); }

.legal-layout { display: grid; grid-template-columns: 280px minmax(0, 760px); gap: 80px; align-items: start; }
.legal-aside { position: sticky; top: 110px; }
.status-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--surface); display: grid; gap: 6px; }
.status-card span { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }
.status-card strong { font-family: Georgia, serif; font-size: 1.5rem; }
.legal-small, .legal-updated { color: var(--muted); font-size: .9rem; }
.legal-content { max-width: 800px; }
.legal-content--single { max-width: 820px; }
.legal-content h1 { font-size: clamp(2.8rem, 6vw, 5.5rem); }
.legal-content h2 { font-size: clamp(1.65rem, 3vw, 2.5rem); margin-top: 2.6rem; }
.legal-content ul { padding-left: 1.2rem; }
.legal-content li { margin-bottom: .55rem; }

.consent-banner[hidden], .consent-modal[hidden] { display: none !important; }
.consent-banner { position: fixed; z-index: 1000; left: 20px; right: 20px; bottom: 20px; }
.consent-banner__inner { width: min(1180px, 100%); margin: 0 auto; background: #17221f; color: white; border: 1px solid rgba(255,255,255,.13); border-radius: 22px; padding: 26px 28px; box-shadow: 0 24px 80px rgba(0,0,0,.25); display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 32px; align-items: end; }
.consent-copy h2 { font-size: clamp(1.6rem, 3vw, 2.35rem); margin-bottom: .7rem; }
.consent-copy p { color: rgba(255,255,255,.78); max-width: 760px; margin-bottom: .45rem; }
.consent-kicker { text-transform: uppercase; letter-spacing: .13em; font-size: .72rem; font-weight: 800; color: #b9d0c8 !important; }
.consent-note { font-size: .83rem; }
.consent-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.consent-actions .button { border-color: rgba(255,255,255,.35); background: transparent; color: white; cursor: pointer; }
.consent-actions .button.primary { background: white; color: #17221f; border-color: white; }

.consent-modal { position: fixed; inset: 0; z-index: 1100; display: grid; place-items: center; padding: 20px; }
.consent-modal__backdrop { position: absolute; inset: 0; background: rgba(10,16,14,.62); backdrop-filter: blur(5px); }
.consent-panel { position: relative; z-index: 1; width: min(680px, 100%); max-height: min(760px, calc(100vh - 40px)); overflow: auto; background: var(--surface); border-radius: 24px; padding: 34px; box-shadow: 0 28px 100px rgba(0,0,0,.28); }
.consent-panel h2 { font-size: clamp(2rem, 5vw, 3.2rem); }
.consent-close { position: absolute; right: 20px; top: 18px; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: transparent; font-size: 1.8rem; line-height: 1; cursor: pointer; }
.consent-row { display: grid; grid-template-columns: 1fr auto; gap: 22px; align-items: center; padding: 20px 0; border-top: 1px solid var(--line); }
.consent-row p { margin: .25rem 0 0; color: var(--muted); font-size: .9rem; }
.consent-required { font-size: .8rem; font-weight: 700; color: var(--accent); }
.consent-row--toggle { cursor: pointer; position: relative; }
.consent-row--toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-ui { width: 52px; height: 30px; border-radius: 999px; background: #d3d7d4; position: relative; transition: .2s ease; }
.toggle-ui::after { content: ''; position: absolute; width: 22px; height: 22px; border-radius: 50%; background: white; top: 4px; left: 4px; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: .2s ease; }
.consent-row--toggle input:checked + .toggle-ui { background: var(--accent); }
.consent-row--toggle input:checked + .toggle-ui::after { transform: translateX(22px); }
.consent-row--toggle input:focus-visible + .toggle-ui { outline: 3px solid #9b6d27; outline-offset: 3px; }
.consent-modal__actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.consent-modal__actions .button { cursor: pointer; border-color: var(--line); }
.consent-privacy-link { margin-top: 18px; font-size: .9rem; }
body.consent-open { overflow: hidden; }

@media (max-width: 900px) {
  .legal-layout { grid-template-columns: 1fr; gap: 38px; }
  .legal-aside { position: static; }
  .consent-banner__inner { grid-template-columns: 1fr; align-items: start; }
  .consent-actions { justify-content: flex-start; }
}
@media (max-width: 720px) {
  .footer-legal { justify-content: flex-start; }
  .consent-banner { left: 10px; right: 10px; bottom: 10px; }
  .consent-banner__inner { padding: 22px; border-radius: 18px; }
  .consent-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .consent-actions .button { width: 100%; }
  .consent-panel { padding: 28px 20px; }
  .consent-row { gap: 14px; }
}

/* V1.3 — Responsive refinement & subtle motion */
.nav-toggle {
  color: var(--accent);
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px 0 8px 10px;
  font-weight: 700;
}
.nav-toggle__label { font-size: .95rem; }
.nav-toggle__icon { width: 26px; height: 18px; display: grid; align-content: center; gap: 6px; }
.nav-toggle__icon span { display: block; width: 26px; height: 2px; background: currentColor; border-radius: 99px; transition: transform .25s ease, width .25s ease; transform-origin: center; }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon span:first-child { transform: translateY(4px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__icon span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* Soft decorative depth without visual noise */
.hero { position: relative; overflow: clip; }
.hero::before {
  content: "";
  position: absolute;
  width: min(42vw, 620px);
  aspect-ratio: 1;
  right: -12vw;
  top: 5%;
  border: 1px solid rgba(23,63,56,.12);
  border-radius: 50%;
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  width: min(24vw, 330px);
  aspect-ratio: 1;
  right: 8vw;
  top: 27%;
  border: 1px solid rgba(23,63,56,.08);
  border-radius: 50%;
  pointer-events: none;
}
.hero-grid { position: relative; z-index: 1; }

/* Motion system: JS progressively enhances, content remains visible without JS */
[data-reveal] {
  opacity: 1;
  transform: none;
}
.motion-ready [data-reveal]:not(.is-visible) {
  opacity: 0;
  transform: translateY(30px);
}
.motion-ready [data-reveal="soft"]:not(.is-visible) { transform: translateY(18px); }
.motion-ready [data-reveal="left"]:not(.is-visible) { transform: translateX(-28px); }
.motion-ready [data-reveal="right"]:not(.is-visible) { transform: translateX(28px); }
.motion-ready [data-reveal] {
  transition: opacity .72s cubic-bezier(.2,.7,.2,1), transform .72s cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--reveal-delay, 0ms);
}
.motion-ready [data-reveal].is-visible { opacity: 1; transform: none; }

.project {
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
}
@media (hover:hover) and (pointer:fine) {
  .project:hover { transform: translateY(-6px); box-shadow: 0 22px 55px rgba(22,32,29,.09); border-color: rgba(23,63,56,.24); }
  .skills-grid article { transition: transform .25s ease, background-color .25s ease; }
  .skills-grid article:hover { transform: translateY(-4px); background: var(--surface); }
}

.stat strong { display: inline-block; }
.motion-ready .stat.is-visible strong { animation: rb-stat-settle .7s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rb-stat-settle { from { transform: translateY(10px); opacity: .25; } to { transform: none; opacity: 1; } }

/* Header becomes slightly more compact after scrolling */
.site-header { transition: background-color .25s ease, box-shadow .25s ease; }
body.is-scrolled .site-header { background: rgba(245,242,234,.95); box-shadow: 0 8px 30px rgba(22,32,29,.055); }

@media (max-width: 720px) {
  .container { width: min(var(--max), calc(100% - 32px)); }
  .nav-wrap { min-height: 66px; }
  .brand { font-size: 1.08rem; }
  .nav-toggle { display: inline-flex; }
  .nav { top: 66px; left: 16px; right: 16px; }
  .hero { min-height: auto; padding-top: 72px; padding-bottom: 78px; }
  .hero-grid { gap: 34px; }
  .hero .eyebrow { font-size: .72rem; letter-spacing: .115em; line-height: 1.55; margin-bottom: 1rem; }
  h1 { font-size: clamp(3.25rem, 13vw, 4.25rem); line-height: .98; letter-spacing: -.06em; margin-bottom: 1.25rem; max-width: 8.5ch; }
  .lead { font-size: 1.16rem; line-height: 1.55; }
  .hero-context { font-size: .98rem; }
  .hero-card { padding: 22px; border-radius: 18px; }
  .hero::before { width: 390px; right: -245px; top: 12%; }
  .hero::after { display: none; }
  .section { padding: 68px 0; }
  .section-heading { margin-bottom: 34px; }
  h2 { font-size: clamp(2.25rem, 11vw, 3.4rem); }
  .project, .project.featured { padding: 24px; }
  .project-meta { flex-direction: column; gap: 4px; margin-bottom: 20px; }
  .timeline { gap: 26px; padding-left: 38px; }
  .timeline::before, .timeline::after { left: 12px; transform: none; }
  .timeline-item { display: block; min-height: 0; }
  .timeline-card, .timeline-item:nth-child(even) .timeline-card { grid-column: auto; padding: 24px; }
  .timeline-card::after, .timeline-item:nth-child(even) .timeline-card::after {
    top: 34px; left: -10px; right: auto; width: 18px; height: 18px; transform: rotate(225deg);
  }
  .timeline-marker { position: absolute; left: -38px; top: 24px; width: 20px; height: 20px; box-shadow: 0 0 0 7px var(--surface); }
  .timeline-marker span { width: 6px; height: 6px; }
  .timeline-item.is-visible .timeline-marker { box-shadow: 0 0 0 7px var(--surface), 0 0 0 8px rgba(23,63,56,.14); }
  .timeline-step { font-size: 1.8rem; }
  .contact-card { border-radius: 20px; }
}

@media (max-width: 420px) {
  h1 { font-size: clamp(3rem, 12.5vw, 3.65rem); }
  .nav-toggle__label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .motion-ready [data-reveal]:not(.is-visible) { opacity: 1; transform: none; }
  .timeline::after { height: 100%; }
}
