@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;1,500;1,600&family=Manrope:wght@400;500;600;700&display=swap');

:root {
  color-scheme: light;
  --bg: #f3f0e7;
  --surface: #e9e5da;
  --surface-2: #dde1d4;
  --ink: #20251f;
  --muted: #747970;
  --accent: #637157;
  --terra: #b87555;
  --line: rgba(32, 37, 31, .14);
  --card: #f8f6ef;
  --shadow: 0 28px 80px rgba(35, 42, 33, .12);
  --sans: "Manrope", "Avenir Next", sans-serif;
  --serif: "Cormorant Garamond", Georgia, serif;
  --shell: 1180px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1d211d;
  --surface: #292e28;
  --surface-2: #343a31;
  --ink: #f1eee4;
  --muted: #adb2a6;
  --accent: #abb99e;
  --terra: #d39978;
  --line: rgba(241, 238, 228, .13);
  --card: #242923;
  --shadow: 0 28px 80px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  transition: background .45s var(--ease), color .45s var(--ease);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.shell { width: min(var(--shell), calc(100% - 96px)); margin-inline: auto; }
.section { position: relative; padding-block: 130px; }
.section-tinted { background: var(--surface); padding-block: 126px; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 1001; background: var(--ink); color: var(--bg); padding: 12px 16px; }
.skip-link:focus { top: 16px; }

.scroll-progress { position: fixed; inset: 0 auto auto 0; z-index: 120; width: 0; height: 2px; background: var(--terra); }
.preloader {
  position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center;
  background: var(--ink); color: var(--bg); transition: transform 1s var(--ease), visibility 1s;
}
.preloader.is-leaving { transform: translateY(-100%); visibility: hidden; }
.preloader-mark { font-family: var(--serif); font-size: clamp(40px, 8vw, 92px); line-height: 1; overflow: hidden; }
.preloader-mark span { display: inline-block; animation: preloader-in 1s var(--ease) both; }
@keyframes preloader-in { from { transform: translateY(110%) rotate(5deg); } to { transform: translateY(0) rotate(0); } }

.site-header {
  position: fixed; left: 0; right: 0; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px) saturate(130%);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.site-header.is-scrolled { border-color: var(--line); }
.nav { height: 82px; display: flex; align-items: center; gap: 32px; }
.brand { font-family: var(--serif); font-size: 27px; font-weight: 600; letter-spacing: -.04em; white-space: nowrap; }
.brand i { color: var(--terra); font-style: normal; }
.nav-links { margin-left: auto; display: flex; align-items: center; gap: clamp(16px, 2.2vw, 32px); }
.nav-links a { position: relative; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; transition: color .25s; }
.nav-links a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -10px; height: 1px; background: var(--terra); transition: right .35s var(--ease); }
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a:hover::after, .nav-links a.active::after { right: 0; }
.theme-toggle, .menu-toggle { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; }
.theme-toggle { border-radius: 50%; transition: transform .35s var(--ease), background .25s; }
.theme-toggle:hover { transform: rotate(20deg); background: var(--surface); }
.menu-toggle { display: none; }

.hero {
  min-height: 100svh;
  display: grid;
  grid-template-columns: .92fr 1.08fr;
  align-items: center;
  gap: 7%;
  padding-top: 142px;
  padding-bottom: 70px;
}
.eyebrow {
  display: flex; align-items: center; gap: 13px;
  margin: 0 0 24px; color: var(--accent);
  font-size: 9px; font-weight: 700; letter-spacing: .19em; text-transform: uppercase;
}
.eyebrow-line { width: 32px; height: 1px; background: var(--terra); }
.hero h1 {
  margin: 0 0 28px;
  font-size: clamp(62px, 7.4vw, 104px);
  line-height: .82;
  letter-spacing: -.075em;
  font-weight: 500;
}
.hero h1 em { display: block; margin-left: clamp(30px, 5vw, 82px); font-family: var(--serif); font-weight: 500; }
.period { color: var(--terra); }
.hero-headline { max-width: 560px; margin: 0 0 14px; font-family: var(--serif); font-size: clamp(24px, 2.4vw, 34px); line-height: 1.22; }
.hero-description { max-width: 530px; margin: 0; color: var(--muted); font-size: 13px; line-height: 2; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.button {
  position: relative; display: inline-flex; min-height: 51px; align-items: center; justify-content: center;
  gap: 22px; padding: 0 22px; overflow: hidden;
  border: 1px solid var(--ink); font-size: 10px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; cursor: pointer;
  transition: color .35s var(--ease), background .35s var(--ease), border-color .35s, transform .35s var(--ease);
}
.button span:last-child { transition: transform .35s var(--ease); }
.button:hover span:last-child { transform: translate(4px, -4px); }
.button-dark { background: var(--ink); color: var(--bg); }
.button-dark:hover { background: var(--accent); border-color: var(--accent); }
.button-outline { border-color: var(--line); }
.button-outline:hover { border-color: var(--accent); color: var(--accent); }
.button-text { border: 0; padding-inline: 8px; }
.hero-note { margin: 24px 0 0; color: var(--muted); font-family: var(--serif); font-size: 13px; font-style: italic; }
.availability { display: flex; align-items: center; gap: 9px; margin-top: 18px; color: var(--muted); font-size: 10px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #78966b; box-shadow: 0 0 0 5px rgba(120, 150, 107, .12); }
.hero-meta { display: flex; gap: 13px; margin-top: 46px; color: var(--muted); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
.hero-meta b { margin-left: 6px; color: var(--terra); }
.meta-separator { color: var(--terra); }
.hero-visual { position: relative; width: 100%; max-width: 470px; justify-self: start; padding: 0 24px 24px 0; perspective: 1000px; }
.hero-copy { padding-left: 3%; }
.portrait-frame { position: relative; width: 100%; aspect-ratio: 4 / 5.15; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); transform-style: preserve-3d; transition: transform .15s linear; }
.portrait-frame::before { content: ""; position: absolute; z-index: 2; inset: 0; background: linear-gradient(150deg, rgba(255,255,255,.06), transparent 45%, rgba(20,25,20,.08)); pointer-events: none; }
.portrait-frame::after { content: ""; position: absolute; inset: 15px -15px -15px 15px; z-index: -1; border: 1px solid var(--terra); }
.portrait-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center 27%; transform: scale(1.02); transition: transform 1.2s var(--ease), filter .5s; }
.hero-visual:hover .portrait-frame img { transform: scale(1.055); }
.portrait-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--accent); background: repeating-linear-gradient(135deg, transparent 0 18px, color-mix(in srgb, var(--accent) 6%, transparent) 18px 19px); }
.portrait-fallback span { font-family: var(--serif); font-size: 58px; line-height: 1; }
.portrait-fallback small { margin-top: 20px; font-size: 8px; letter-spacing: .19em; text-align: center; }
.portrait-frame:not(.no-photo) .portrait-fallback { display: none; }
.image-caption { display: block; margin-top: 18px; text-align: right; color: var(--muted); font-family: var(--serif); font-size: 13px; font-style: italic; }
.portrait-edition { position: absolute; right: 38px; bottom: 39px; z-index: 3; color: var(--muted); font-size: 7px; letter-spacing: .18em; }
.vertical-note { position: absolute; right: -28px; top: 18%; writing-mode: vertical-rl; color: var(--muted); font-size: 7px; letter-spacing: .2em; }
.marquee { overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--ink); color: var(--bg); }
.marquee-track { width: max-content; display: flex; align-items: center; gap: 32px; padding: 18px 0; animation: marquee-run 24s linear infinite; }
.marquee-track span { font-family: var(--serif); font-size: 21px; font-style: italic; white-space: nowrap; }
.marquee-track i { color: var(--terra); font-size: 9px; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee-run { to { transform: translateX(-50%); } }

.about-section { display: grid; grid-template-columns: .82fr 1.18fr; gap: 10%; border-top: 1px solid var(--line); }
.section-heading h2, .contact-copy h2 { margin: 0; font-size: clamp(50px, 5.6vw, 76px); line-height: .94; letter-spacing: -.055em; font-weight: 500; }
.section-heading h2 em, .contact-copy h2 em { font-family: var(--serif); font-weight: 500; }
.section-heading .eyebrow { margin-bottom: 22px; }
.about-content { max-width: 650px; padding-top: 5px; }
.lead { margin: 0 0 30px; font-family: var(--serif); font-size: clamp(26px, 2.5vw, 38px); line-height: 1.35; }
.about-paragraphs p { margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 2; }
.about-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.fact-tag, .interest-tag { border: 1px solid var(--line); padding: 9px 14px; color: var(--accent); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.section-intro { max-width: 360px; margin: 20px 0 0; color: var(--muted); font-size: 13px; line-height: 1.9; }

.section-heading-row { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.section-heading-row .section-intro { margin: 0 0 7px; }
.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin-top: 58px; background: var(--line); border: 1px solid var(--line); }
.skill-group { position: relative; min-height: 210px; overflow: hidden; background: var(--surface); padding: 38px 38px 42px; transition: background .4s, color .4s; }
.skill-group::before { content: ""; position: absolute; width: 180px; height: 180px; right: -100px; bottom: -100px; border: 1px solid var(--accent); border-radius: 50%; opacity: 0; transition: right .6s var(--ease), bottom .6s var(--ease), opacity .4s; }
.skill-group:hover::before { right: -40px; bottom: -40px; opacity: .28; }
.skills-grid > .skill-group:only-child { grid-column: 1 / -1; }
.skill-group-top { display: flex; align-items: baseline; gap: 16px; }
.index-number { color: var(--terra); font-family: var(--serif); font-size: 16px; }
.skill-group h3 { margin: 0; font-family: var(--serif); font-size: 28px; line-height: 1; font-weight: 500; }
.skill-description { margin: 10px 0 16px 36px; color: var(--muted); font-size: 11px; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 0 36px; }
.skill-tag { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); padding: 7px 10px; background: color-mix(in srgb, var(--card) 60%, transparent); font-size: 10px; transition: transform .3s var(--ease), border-color .3s; }
.skill-tag:hover { transform: translateY(-4px); border-color: var(--accent); }
.skill-tag small { color: var(--muted); font-size: 8px; }
.language-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding-top: 24px; }
.language-label { color: var(--muted); font-size: 8px; letter-spacing: .18em; }
.language-item { font-family: var(--serif); font-size: 16px; }
.language-item small { color: var(--muted); font-family: var(--sans); font-size: 9px; }

.projects-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 62px 34px; margin-top: 58px; }
.project-card { min-width: 0; }
.projects-grid > .project-card:only-child { grid-column: 1 / -1; max-width: 820px; }
.project-visual { position: relative; aspect-ratio: 1.48; display: grid; place-items: center; overflow: hidden; background: var(--surface); border: 1px solid var(--line); transition: transform .5s var(--ease), box-shadow .5s var(--ease); }
.project-card:hover .project-visual { transform: translateY(-8px); box-shadow: var(--shadow); }
.project-visual img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease), filter .5s; }
.project-card:hover .project-visual img { transform: scale(1.055); }
.project-visual.visual-fallback { background: linear-gradient(135deg, var(--surface) 0 48%, var(--surface-2) 48% 100%); }
.project-visual.visual-fallback::before, .project-visual.visual-fallback::after { content: ""; position: absolute; width: 42%; height: 55%; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); transform: rotate(-12deg); }
.project-visual.visual-fallback::after { width: 28%; height: 70%; transform: rotate(14deg); }
.project-index { position: absolute; z-index: 2; top: 18px; left: 20px; color: var(--muted); font-size: 8px; letter-spacing: .16em; }
.visual-mark { position: absolute; z-index: 2; right: 16px; bottom: 8px; color: var(--accent); font-family: var(--serif); font-size: 46px; }
.project-body { padding-top: 21px; }
.project-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 8px; letter-spacing: .13em; text-transform: uppercase; }
.project-status { color: var(--accent); }
.project-body h3 { margin: 10px 0 8px; font-family: var(--serif); font-size: 30px; line-height: 1.05; font-weight: 500; }
.project-description { max-width: 520px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.9; }
.technology-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.technology-list span { color: var(--accent); font-size: 9px; }
.technology-list span + span::before { content: "/"; margin-right: 8px; color: var(--terra); }
.project-links { display: flex; gap: 20px; margin-top: 18px; }
.project-links a, .text-link { border-bottom: 1px solid var(--terra); padding-bottom: 3px; font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.empty-note { margin-top: 45px; color: var(--muted); font-family: var(--serif); font-size: 18px; }

.education-timeline { max-width: 820px; margin: 62px 0 0 10%; border-left: 1px solid var(--line); }
.education-item { position: relative; display: flex; padding: 0 0 52px 44px; }
.education-item:last-child { padding-bottom: 0; }
.timeline-marker { position: absolute; left: -5px; top: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--terra); box-shadow: 0 0 0 6px var(--bg); }
.education-meta { display: flex; gap: 16px; color: var(--muted); font-size: 8px; letter-spacing: .13em; text-transform: uppercase; }
.education-status { color: var(--accent); }
.education-content h3 { margin: 11px 0 6px; font-family: var(--serif); font-size: clamp(24px, 3vw, 34px); line-height: 1.1; font-weight: 500; }
.institution { margin: 0; font-size: 12px; }
.education-detail { margin: 6px 0 0; color: var(--muted); font-size: 11px; }

.interests-layout { display: grid; grid-template-columns: .9fr 1.1fr; align-items: center; gap: 12%; }
.interest-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.interest-tag { padding: 12px 17px; font-family: var(--serif); font-size: 16px; text-transform: none; transition: background .3s, color .3s, transform .3s var(--ease); }
.interest-tag:hover { transform: translateY(-4px); background: var(--ink); color: var(--bg); }

.contact-section { display: grid; grid-template-columns: 1fr .72fr; gap: 12%; padding-block: 138px; }
.contact-copy h2 { font-size: clamp(50px, 6vw, 82px); }
.contact-copy > p:not(.eyebrow) { max-width: 440px; margin: 24px 0; color: var(--muted); font-size: 13px; }
.contact-email { display: inline-block; border-bottom: 1px solid var(--terra); padding-bottom: 5px; font-family: var(--serif); font-size: clamp(20px, 2.2vw, 29px); }
.contact-details { display: flex; flex-wrap: wrap; gap: 14px 20px; margin-top: 28px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .07em; }
.contact-details a:hover, .footer-socials a:hover { color: var(--terra); }
.contact-form { display: flex; flex-direction: column; border-top: 1px solid var(--line); padding-top: 24px; }
.form-kicker { margin: 0 0 26px; color: var(--accent); font-size: 8px; font-weight: 700; letter-spacing: .18em; }
.contact-form label { margin: 0 0 6px; color: var(--muted); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.contact-form input, .contact-form textarea { margin-bottom: 20px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; outline: none; background: transparent; color: var(--ink); padding: 9px 0 13px; resize: vertical; font-size: 12px; transition: border-color .3s, padding .3s; }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--accent); padding-left: 8px; }
.contact-form input::placeholder, .contact-form textarea::placeholder { color: color-mix(in srgb, var(--muted) 60%, transparent); }
.contact-form .button { align-self: flex-start; margin-top: 8px; }
.form-note { margin-top: 12px; color: var(--muted); font-size: 8px; }

.site-footer { border-top: 1px solid var(--line); }
.footer-inner { min-height: 105px; display: flex; align-items: center; gap: 28px; }
.footer-inner .brand { font-size: 21px; }
.footer-inner p { margin: 0 auto 0 0; color: var(--muted); font-size: 8px; letter-spacing: .04em; }
.footer-inner p span { margin-left: 8px; }
.footer-socials { display: flex; gap: 16px; }
.footer-socials a { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.back-top { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-size: 16px; transition: transform .35s var(--ease), background .25s; }
.back-top:hover { transform: translateY(-5px); background: var(--surface); }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.hero-copy > * { opacity: 0; transform: translateY(22px); animation: hero-enter 1s var(--ease) forwards; }
.hero-copy > *:nth-child(1) { animation-delay: .55s; }
.hero-copy > *:nth-child(2) { animation-delay: .68s; }
.hero-copy > *:nth-child(3) { animation-delay: .78s; }
.hero-copy > *:nth-child(4) { animation-delay: .86s; }
.hero-copy > *:nth-child(5) { animation-delay: .94s; }
.hero-copy > *:nth-child(n+6) { animation-delay: 1.02s; }
.hero-visual { opacity: 0; transform: translateX(40px); animation: hero-enter 1.2s .7s var(--ease) forwards; }
@keyframes hero-enter { to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .shell { width: min(var(--shell), calc(100% - 48px)); }
  .nav { gap: 18px; }
  .nav-links { gap: 15px; }
  .hero { gap: 4%; min-height: 720px; }
  .hero h1 { font-size: clamp(58px, 8vw, 78px); }
  .section { padding-block: 100px; }
  .contact-section { gap: 8%; }
}

@media (max-width: 680px) {
  html { scroll-padding-top: 72px; }
  .shell { width: calc(100% - 40px); }
  .nav { height: 68px; }
  .brand { font-size: 23px; }
  .menu-toggle { display: flex; flex-direction: column; justify-content: center; gap: 5px; order: 2; margin-left: auto; }
  .menu-toggle span { width: 16px; height: 1px; background: var(--ink); transition: transform .25s; }
  .menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(3px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3px) rotate(-45deg); }
  .theme-toggle { order: 3; }
  .nav-links { display: none; position: absolute; left: 0; right: 0; top: 68px; margin: 0; flex-direction: column; align-items: stretch; gap: 0; border-bottom: 1px solid var(--line); background: var(--bg); padding: 12px 20px 22px; }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
  .nav-links a::after { display: none; }
  .hero { grid-template-columns: 1fr; min-height: auto; gap: 48px; padding-top: 112px; padding-bottom: 84px; }
  .hero-copy { order: 2; padding-left: 0; }
  .hero-visual { order: 1; width: 86%; max-width: 350px; justify-self: center; }
  .hero h1 { font-size: clamp(58px, 17vw, 82px); line-height: .86; }
  .hero h1 em { margin-left: 18px; }
  .hero-headline { font-size: 25px; }
  .hero-description { max-width: 410px; }
  .hero-meta { margin-top: 36px; }
  .vertical-note { right: -13px; }
  .section, .section-tinted { padding-block: 82px; }
  .about-section, .interests-layout, .contact-section { grid-template-columns: 1fr; gap: 38px; }
  .about-content { padding-top: 0; }
  .section-heading h2 { font-size: 48px; }
  .section-heading-row { display: block; }
  .section-heading-row .section-intro { margin-top: 18px; }
  .skills-grid, .projects-grid { grid-template-columns: 1fr; }
  .skills-grid { margin-top: 40px; }
  .skill-group { min-height: 190px; padding: 30px 24px; }
  .skill-tags, .skill-description { margin-left: 0; }
  .projects-grid { gap: 42px; margin-top: 42px; }
  .projects-grid > .project-card:only-child { max-width: none; }
  .education-timeline { margin: 44px 0 0 8px; }
  .education-item { padding-left: 28px; }
  .contact-section { padding-block: 88px; }
  .contact-copy h2 { font-size: 52px; }
  .footer-inner { min-height: 130px; flex-wrap: wrap; gap: 12px 20px; padding-block: 20px; }
  .footer-inner p { order: 3; width: 100%; }
  .footer-socials { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .preloader { display: none; }
  .reveal { opacity: 1; transform: none; }
}
