/* Self-hosted fonts (latin subset) */
@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/instrument-serif-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/instrument-serif-italic-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/dm-sans-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
:root {
  --bg: #f4efe6;
  --paper: #fbf8f2;
  --ink: #1a1714;
  --muted: #6b635a;
  --line: #d9d0c2;
  --accent: #2e5b3c;
  --accent-soft: #dce8de;
  --on-accent: #ffffff;
  --dark: #1a1714;
  --dark-ink: #f4efe6;
  --max: 1160px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16130f;
    --paper: #1e1a16;
    --ink: #f1ebe1;
    --muted: #a69c90;
    --line: #3a332b;
    --accent: #8dc09c;
    --accent-soft: #1c2b21;
    --on-accent: #16130f;
    --dark: #0e0c0a;
    --dark-ink: #f1ebe1;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.65 "DM Sans", system-ui, -apple-system, Segoe UI, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; line-height: 1.02; margin: 0; letter-spacing: -.01em; }
em { font-style: italic; color: var(--accent); }
a { color: inherit; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
section { padding: 104px 0; }
.label {
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 28px;
}
.label::before { content: ""; width: 28px; height: 1.5px; background: var(--accent); }
h2 { font-size: clamp(44px, 6vw, 72px); margin-bottom: 24px; }

/* Nav */
nav { border-bottom: 1px solid var(--line); }
nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.logo { font-family: "Instrument Serif", Georgia, serif; font-size: 26px; text-decoration: none; }
.logo span { color: var(--accent); }
.links { display: flex; gap: 32px; }
.links a { text-decoration: none; font-size: 14px; font-weight: 500; position: relative; }
.links a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -4px; height: 1.5px; background: var(--accent); transition: right .25s ease; }
.links a:hover::after { right: 0; }
@media (max-width: 760px) { .links { display: none; } }

/* Hero */
.hero { padding: 72px 0 88px; border-bottom: 1px solid var(--line); }
.hero-top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 14px; color: var(--muted); margin-bottom: 40px; }
.status { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.hero h1 { font-size: clamp(64px, 13vw, 176px); line-height: .9; letter-spacing: -.03em; }
.hero-bottom { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; margin-top: 48px; align-items: end; }
.hero-bottom p { font-size: clamp(19px, 2.1vw, 24px); line-height: 1.5; margin: 0; max-width: 600px; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }
@media (max-width: 820px) { .hero-bottom { grid-template-columns: 1fr; } .ctas { justify-content: flex-start; } }

.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 15px 26px; border-radius: 999px;
  font-weight: 500; font-size: 15px; text-decoration: none; transition: background .2s, color .2s, transform .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-solid { background: var(--ink); color: var(--bg); }
.btn-solid:hover { background: var(--accent); color: var(--on-accent); }
.btn-line { border: 1.5px solid var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--bg); }

/* Marquee */
.marquee { overflow: hidden; border-bottom: 1px solid var(--line); background: var(--accent); color: var(--on-accent); }
.marquee-track { display: flex; width: max-content; animation: scroll 38s linear infinite; }
.marquee span { font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-size: 30px; padding: 14px 0; white-space: nowrap; }
.marquee span::after { content: "✦"; font-style: normal; font-size: 18px; margin: 0 28px; vertical-align: middle; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 8px 28px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat b { display: block; font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: clamp(56px, 7vw, 88px); line-height: 1; }
.stat b sup { font-size: .45em; color: var(--accent); vertical-align: top; position: relative; top: .2em; }
.stat span { display: block; color: var(--muted); font-size: 15px; margin-top: 10px; max-width: 220px; }
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, 1fr); row-gap: 40px; }
  .stat:nth-child(3) { border-left: 0; padding-left: 0; }
}

/* Intro / services */
.intro { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; }
.intro p.big { font-family: "Instrument Serif", Georgia, serif; font-size: clamp(28px, 3.2vw, 40px); line-height: 1.2; margin: 0; }
.services { list-style: none; margin: 0; padding: 0; }
.services li { padding: 24px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 48px 1fr; }
.services li:last-child { border-bottom: 1px solid var(--line); }
.services .n { font-size: 13px; font-weight: 700; color: var(--accent); padding-top: 6px; }
.services h3 { font-size: 30px; margin-bottom: 6px; }
.services p { margin: 0; color: var(--muted); font-size: 16px; }
@media (max-width: 860px) { .intro { grid-template-columns: 1fr; gap: 40px; } }

/* Work */
.work { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.case { display: grid; grid-template-columns: 120px 1fr 1.1fr; gap: 40px; padding: 48px 0; border-top: 1px solid var(--line); }
.case .num { font-family: "Instrument Serif", Georgia, serif; font-size: 72px; line-height: .9; color: var(--accent); }
.case h3 { font-size: clamp(32px, 3.4vw, 44px); }
.case .meta { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 16px; }
.case ul { margin: 0; padding: 0; list-style: none; }
.case li { padding: 0 0 14px 24px; position: relative; }
.case li::before { content: "→"; position: absolute; left: 0; color: var(--accent); }
.case strong { font-weight: 700; }
.tags { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: 13px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
@media (max-width: 900px) { .case { grid-template-columns: 1fr; gap: 16px; } .case .num { font-size: 52px; } }

/* Samples teaser (home page) */
.teaser-head { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 20px; margin-bottom: 40px; }
.teaser-head h2 { margin: 0; }
.teasers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 1100px) { .teasers { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) { .teasers { grid-template-columns: 1fr; } }
.teaser {
  display: flex; flex-direction: column; text-decoration: none; background: var(--paper);
  border: 1px solid var(--line); border-radius: 20px; overflow: hidden; transition: transform .3s ease, border-color .3s ease;
}
.teaser:hover { transform: translateY(-4px); border-color: var(--accent); }
/* Fanned stack of thumbnails rising from the bottom edge; everything scales with the card width */
.thumbs { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--accent-soft); }
.thumbs img {
  position: absolute; bottom: -12%; left: 50%; width: 40%; aspect-ratio: 4 / 5; height: auto;
  object-fit: cover; object-position: top; border-radius: 10px; background: #fff;
  box-shadow: 0 14px 30px -12px rgba(26, 23, 20, .55); transform-origin: bottom center; transition: transform .35s ease;
}
.thumbs img:nth-child(1) { transform: translateX(-108%) rotate(-7deg); }
.thumbs img:nth-child(2) { transform: translateX(-50%) translateY(-6%); z-index: 2; }
.thumbs img:nth-child(3) { transform: translateX(8%) rotate(7deg); }
.teaser:hover .thumbs img:nth-child(1) { transform: translateX(-114%) rotate(-10deg) translateY(-3%); }
.teaser:hover .thumbs img:nth-child(2) { transform: translateX(-50%) translateY(-11%); }
.teaser:hover .thumbs img:nth-child(3) { transform: translateX(14%) rotate(10deg) translateY(-3%); }
/* Landscape variant for slide decks */
.thumbs.wide img { width: 62%; aspect-ratio: 16 / 10; bottom: -6%; }
.thumbs.wide img:nth-child(1) { transform: translateX(-88%) translateY(-34%) rotate(-6deg); }
.thumbs.wide img:nth-child(2) { transform: translateX(-50%) translateY(-4%); z-index: 2; }
.thumbs.wide img:nth-child(3) { transform: translateX(-12%) translateY(-34%) rotate(6deg); }
.teaser:hover .thumbs.wide img:nth-child(1) { transform: translateX(-94%) translateY(-40%) rotate(-8deg); }
.teaser:hover .thumbs.wide img:nth-child(2) { transform: translateX(-50%) translateY(-10%); }
.teaser:hover .thumbs.wide img:nth-child(3) { transform: translateX(-6%) translateY(-40%) rotate(8deg); }
.quote {
  aspect-ratio: 16 / 9; display: flex; align-items: center; padding: 28px; background: var(--dark); color: var(--dark-ink);
  font-family: "Instrument Serif", Georgia, serif; font-style: italic; font-size: clamp(20px, 1.75vw, 25px); line-height: 1.15; overflow: hidden;
}
.teaser-text { padding: 24px 28px 28px; }
.teaser-text small { display: block; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.teaser-text strong { display: block; font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: 36px; line-height: 1.1; margin: 6px 0 6px; }
.teaser-text span { color: var(--muted); font-size: 16px; }

/* Samples page */
.links a[aria-current="page"]::after { right: 0; }
.page-hero { padding: 64px 0 72px; border-bottom: 1px solid var(--line); }
.page-hero .back { display: inline-block; font-size: 14px; color: var(--muted); text-decoration: none; margin-bottom: 32px; }
.page-hero .back:hover { color: var(--accent); }
.page-hero h1 { font-size: clamp(60px, 11vw, 140px); line-height: .92; letter-spacing: -.03em; }
.page-hero p { font-size: clamp(18px, 2vw, 22px); max-width: 640px; margin: 28px 0 32px; }
.jump { display: flex; flex-wrap: wrap; gap: 12px; }
.jump a {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border: 1.5px solid var(--ink);
  border-radius: 999px; text-decoration: none; font-weight: 500; font-size: 15px; transition: background .2s, color .2s;
}
.jump a span { font-size: 12px; font-weight: 700; background: var(--accent); color: var(--on-accent); border-radius: 999px; padding: 1px 8px; }
.jump a:hover { background: var(--ink); color: var(--bg); }

/* Social */
.section-lede { color: var(--muted); max-width: 600px; margin: 0 0 48px; }
.social-grid { columns: 3 300px; column-gap: 24px; }
.post { break-inside: avoid; margin: 0 0 28px; }
.post button {
  display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 14px;
  background: #fff; overflow: hidden; cursor: zoom-in;
  box-shadow: 0 1px 2px rgba(26, 23, 20, .04), 0 12px 32px -18px rgba(26, 23, 20, .35);
  transition: transform .3s ease, box-shadow .3s ease;
}
.post button:hover { transform: translateY(-4px) rotate(-.4deg); box-shadow: 0 2px 4px rgba(26, 23, 20, .06), 0 22px 44px -18px rgba(26, 23, 20, .45); }
.post button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.post img { display: block; width: 100%; height: auto; }
.post figcaption { margin-top: 12px; font-family: "Instrument Serif", Georgia, serif; font-size: 22px; line-height: 1.2; }
.post figcaption span {
  display: block; font-family: "DM Sans", sans-serif; font-size: 12px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px;
}

/* Design */
.design-grid { columns: 3 280px; column-gap: 24px; }
.series-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px;
}
.series-grid button { border-radius: 8px; box-shadow: none; }
.series-grid button:hover { transform: scale(1.03); }

/* Campaigns */
.campaign { display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px; align-items: start; padding: 48px 0; border-top: 1px solid var(--line); }
.campaign:first-of-type { border-top: 0; padding-top: 0; }
@media (max-width: 900px) { .campaign { grid-template-columns: 1fr; gap: 28px; } }
.campaign-visual button {
  display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: #fff; cursor: zoom-in; transition: transform .3s ease, box-shadow .3s ease;
}
.campaign-visual button:hover { transform: translateY(-3px); box-shadow: 0 18px 36px -20px rgba(26, 23, 20, .45); }
.campaign-visual button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.campaign-visual img { display: block; width: 100%; height: auto; }
.campaign-cover { box-shadow: 0 16px 40px -24px rgba(26, 23, 20, .5); }
.campaign-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.campaign-thumbs button { border-radius: 8px; }
.campaign-text .meta { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.campaign-text h3 { font-size: clamp(34px, 3.6vw, 48px); margin-top: 10px; }
.campaign-sub { color: var(--muted); font-size: 17px; margin: 8px 0 24px; }
.campaign dl { margin: 0 0 28px; }
.campaign dt { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 18px; }
.campaign dd { margin: 4px 0 0; font-size: 16px; }
.deck-open { background: transparent; color: var(--ink); cursor: pointer; font-family: inherit; }

.lightbox.is-deck { max-width: min(94vw, 1100px); }
.lightbox-nav { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 14px; }
.lightbox-nav[hidden] { display: none; }
.lightbox-nav button {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent);
  font-size: 20px; cursor: pointer; transition: transform .2s ease;
}
.lightbox-nav button:hover { transform: scale(1.08); }
.lightbox-count { color: #f4efe6; font-size: 14px; font-weight: 500; min-width: 56px; text-align: center; }
.lightbox.is-deck img { max-height: 80vh; }

.lightbox {
  border: 0; padding: 0; background: transparent; max-width: min(92vw, 720px); max-height: 92vh; overflow: visible;
}
.lightbox::backdrop { background: rgba(14, 12, 10, .82); backdrop-filter: blur(4px); }
.lightbox img { display: block; max-width: 100%; max-height: 88vh; width: auto; height: auto; border-radius: 12px; margin: 0 auto; }
.lightbox-close {
  position: absolute; top: -18px; right: -18px; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: var(--accent); color: var(--on-accent); font-size: 24px; line-height: 1; cursor: pointer;
}
@media (max-width: 600px) { .lightbox-close { top: -48px; right: 0; } }

/* Writing */
.articles { border-top: 1px solid var(--ink); }
.article {
  display: grid; grid-template-columns: 160px 1fr 40px; gap: 24px; align-items: center;
  padding: 28px 0; border-bottom: 1px solid var(--line); text-decoration: none; transition: padding .25s ease, color .25s;
}
.article small { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.article strong { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: clamp(26px, 3vw, 36px); line-height: 1.1; }
.article .arrow { font-size: 24px; justify-self: end; transition: transform .25s ease; }
.article:hover { color: var(--accent); padding-left: 12px; }
.article:hover .arrow { transform: translate(4px, -4px); }
@media (max-width: 700px) { .article { grid-template-columns: 1fr 32px; } .article small { grid-column: 1 / -1; } }

/* Experience */
.exp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; }
@media (max-width: 900px) { .exp-grid { grid-template-columns: 1fr; gap: 64px; } }
.role { display: grid; grid-template-columns: 110px 1fr; gap: 20px; padding: 22px 0; border-top: 1px solid var(--line); }
.role .when { font-size: 14px; color: var(--muted); padding-top: 4px; }
.role h3 { font-size: 26px; }
.role .co { font-size: 15px; font-weight: 500; color: var(--accent); margin-top: 2px; }
.role p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.skills h3 { font-family: "DM Sans", sans-serif; font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }
.skills + .skills { margin-top: 36px; }
.skill-list { font-family: "Instrument Serif", Georgia, serif; font-size: clamp(26px, 2.8vw, 34px); line-height: 1.35; }
.skill-list span:not(:last-child)::after { content: " / "; color: var(--accent); }

/* About */
.about { display: grid; grid-template-columns: 1fr 1.2fr; gap: 64px; align-items: end; }
.about p { margin: 0 0 18px; font-size: 18px; }
.about .where { color: var(--muted); font-size: 15px; }
.portrait { position: relative; width: min(100%, 320px); margin: 40px 0 0 0; }
.portrait::before {
  content: ""; position: absolute; inset: 0; transform: translate(18px, 18px) rotate(3deg);
  border: 2px solid var(--accent); border-radius: 24px;
}
.portrait img {
  position: relative; display: block; width: 100%; aspect-ratio: 1 / 1; height: auto;
  object-fit: cover; border-radius: 24px; transform: rotate(-2deg);
  box-shadow: 0 18px 40px -20px rgba(26, 23, 20, .45);
}
@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; gap: 24px; align-items: start; }
  .portrait { width: min(80%, 300px); margin: 32px 0 16px; }
}

/* Contact */
.contact { background: var(--dark); color: var(--dark-ink); padding: 120px 0 40px; }
.contact .label { color: #a69c90; }
.contact h2 { font-size: clamp(56px, 10vw, 140px); line-height: .92; margin-bottom: 40px; }
.contact p { max-width: 560px; font-size: 19px; color: #cfc6b9; margin: 0 0 40px; }
.contact .mail {
  display: inline-block; font-family: "Instrument Serif", Georgia, serif; font-size: clamp(28px, 5vw, 56px);
  text-decoration: none; border-bottom: 2px solid #8dc09c; padding-bottom: 4px; transition: color .2s; word-break: break-all;
}
/* Light sage keeps the accent readable on the dark contact block in light mode */
.contact em { color: #8dc09c; }
.contact .label::before { background: #8dc09c; }
.contact .mail:hover { color: #8dc09c; }
.contact-foot {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-top: 104px; padding-top: 28px;
  border-top: 1px solid #3a332b; font-size: 14px; color: #a69c90;
}
.contact-foot a { text-decoration: none; color: var(--dark-ink); }
.contact-foot a:hover { color: #8dc09c; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .marquee-track { animation: none; }
  html { scroll-behavior: auto; }
}
.section-first { padding-top: 64px; }

/* Skip link: hidden until focused with the keyboard */
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 8px;
  background: var(--ink); color: var(--bg); text-decoration: none; font-weight: 500; transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

/* 404 page */
.not-found { min-height: calc(100vh - 73px); display: flex; align-items: center; border-bottom: 0; }
/* Resume links */
.links a.nav-cta { padding: 6px 14px; margin: -6px 0; border: 1.5px solid var(--ink); border-radius: 999px; }
.links a.nav-cta::after { display: none; }
.links a.nav-cta:hover { background: var(--ink); color: var(--bg); }
.contact-actions { margin-top: 36px; }
.btn-resume { background: #8dc09c; color: #16130f; }
.btn-resume:hover { background: #f4efe6; }
.foot-links { display: flex; gap: 24px; }
@media (max-width: 760px) { .links { display: flex; gap: 0; } .links a:not(.nav-cta) { display: none; } }