:root {
  --paper: #efe9df;
  --ink: #16130f;
  --muted: #5f584e;
  --line: rgba(22, 19, 15, 0.16);
  --accent: #ff4a1c;
  --display: Bahnschrift, "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --gutter: clamp(16px, 4vw, 56px);
  --nav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }

/* page-to-page transitions: the work preview grows into the project hero, the rest slides */
@view-transition { navigation: auto; }
.nav { view-transition-name: nav; }
::view-transition-old(root) { animation: vt-out 0.3s var(--ease-out) both; }
::view-transition-new(root) { animation: vt-in 0.6s var(--ease-out) 0.05s both; }
::view-transition-group(hero) { animation-duration: 0.8s; animation-timing-function: var(--ease-in-out); }
::view-transition-old(hero), ::view-transition-new(hero) { height: 100%; object-fit: cover; }
@keyframes vt-out { to { opacity: 0; transform: translate3d(0, -20px, 0); } }
@keyframes vt-in { from { opacity: 0; transform: translate3d(0, 28px, 0); } }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.6 var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0; }
main:focus { outline: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; left: var(--gutter); top: 10px; z-index: 100;
  padding: 12px 16px; border-radius: 4px; background: var(--ink); color: var(--paper);
  transform: translateY(-160%); transition: transform 0.2s var(--ease-out);
}
.skip:focus { transform: none; }

.wrap { width: 100%; max-width: 1440px; margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(96px, 16vh, 180px); }

.h2 {
  margin: 0 0 0.45em;
  font: 700 clamp(2.75rem, 7vw, 7rem)/0.9 var(--display);
  font-stretch: 75%;
  text-transform: uppercase;
  letter-spacing: -0.005em;
}

/* ---------- links and buttons ---------- */
.link { position: relative; text-decoration: none; }
.link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform 0.35s var(--ease-out);
}
.link[aria-current="true"]::after { transform: scaleX(1); }

.btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 20px;
  border-radius: 4px; background: var(--ink); color: var(--paper);
  font: 500 0.875rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; text-decoration: none;
  transition: transform 0.16s var(--ease-out), background-color 0.2s ease;
}
.btn:active { transform: scale(0.97); }

@media (hover: hover) and (pointer: fine) {
  .link:hover::after { transform: scaleX(1); transform-origin: left; }
  .btn:hover { transform: translateY(-2px); background: #2b2620; }
  .btn:hover:active { transform: translateY(-2px) scale(0.97); }
}

/* ---------- nav ---------- */
.nav { position: fixed; inset: 0 0 auto; z-index: 50; height: var(--nav-h); background: var(--paper); }
.nav__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.nav__mark {
  display: inline-flex; align-items: center; min-height: 44px;
  font: 700 1.375rem/1 var(--display); font-stretch: 75%; letter-spacing: 0.02em; text-decoration: none;
}
.nav ul { display: flex; gap: clamp(14px, 3vw, 40px); margin: 0; padding: 0; list-style: none; }
.nav .link {
  display: inline-flex; align-items: center; min-height: 44px;
  font: 500 0.8125rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em;
}
.nav .link::after { bottom: 12px; }
.nav__progress {
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--ink); transform: scaleX(0); transform-origin: left;
}

/* ---------- traveler ---------- */
.traveler {
  position: fixed; left: 0; top: 0; z-index: 40; display: none;
  width: 100px; height: 100px; overflow: hidden; pointer-events: none;
  mix-blend-mode: multiply; contain: layout paint style; will-change: transform;
}
html.travel .traveler { display: block; }
.traveler__inner {
  position: absolute; inset: 0; container-type: size;
  border-radius: inherit; background: var(--accent);
  transition: transform 0.25s var(--ease-out);
}
html.travel .traveler .layer { opacity: 0; }
.traveler.is-hover .traveler__inner { transform: scale(1.05); }
.traveler.is-press .traveler__inner { transform: scale(0.95); }

.slot { position: relative; container-type: size; border-radius: 0; }
.layer { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; }

/* mark */
.layer--mark, .layer--marker, .layer--cta { background: var(--accent); color: var(--ink); }
.ring { position: absolute; inset: 6%; width: 88%; height: 88%; overflow: visible; }
.ring text { font: 500 11px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; fill: currentColor; }
.mark__initials {
  position: absolute; inset: 0; display: grid; place-items: center;
  font: 700 30cqmin/1 var(--display); font-stretch: 75%;
}

/* portrait */
.layer--portrait { background: var(--ink); color: var(--accent); }
.layer--portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait__mono {
  position: absolute; left: -2cqw; bottom: -8cqh;
  font: 700 74cqh/0.78 var(--display); font-stretch: 75%; letter-spacing: -0.02em;
}

/* preview covers */
.layer--preview { background: var(--ink); }
.cover {
  position: absolute; inset: 0; margin: 0; background: var(--c); color: var(--fg);
  clip-path: inset(100% 0 0 0);
}
.cover.is-prev { clip-path: inset(0); z-index: 1; }
.cover.is-active { clip-path: inset(0); z-index: 2; transition: clip-path 0.8s var(--ease-in-out); }
.cover.is-reset { transition: none !important; clip-path: inset(100% 0 0 0) !important; }
.cover.is-instant, .cover.is-instant * { transition: none !important; }
.cover__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover__no { position: absolute; left: 6cqw; top: 5cqw; font: 500 max(11px, 2.4cqw)/1 var(--mono); }
.cover__title {
  position: absolute; left: 6cqw; right: 6cqw; bottom: 5cqw;
  font: 700 12cqw/0.88 var(--display); font-stretch: 75%; text-transform: uppercase;
}
.cover__phone, .cover__code, .cover__title { transform: translate3d(0, 10cqh, 0); transition: transform 1s var(--ease-out) 0.2s; }
.cover.is-active .cover__phone, .cover.is-active .cover__code, .cover.is-active .cover__title,
.cover.is-prev .cover__phone, .cover.is-prev .cover__code, .cover.is-prev .cover__title { transform: none; }
.cover__title { max-width: 55%; }
.cover__phone {
  position: absolute; right: 8cqw; top: 8cqh; width: 27cqw; height: auto;
  border: 0.9cqw solid #0b0b0b; border-radius: 3.4cqw; background: #0b0b0b;
}
.cover__code {
  position: absolute; right: 6cqw; top: 12cqh; margin: 0; padding: 3cqw 3.4cqw;
  border: 1px solid currentColor; border-radius: 1.4cqw;
  font: 400 2.5cqw/1.6 var(--mono); white-space: pre;
}

/* marker and button */
.marker__no { position: absolute; inset: 0; display: grid; place-items: center; font: 600 30cqmin/1 var(--mono); }
.layer--cta > span {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 0.35em;
  font: 700 15cqmin/1 var(--display); font-stretch: 75%; text-transform: uppercase; letter-spacing: 0.02em;
}
.cta__arrow { display: inline-block; transition: transform 0.35s var(--ease-out); }
.traveler.is-hover .cta__arrow, .slot--cta:hover .cta__arrow { transform: translateX(0.25em); }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100svh; padding-top: var(--nav-h); display: flex; flex-direction: column; }
.hero__grid { position: relative; flex: 1; display: flex; flex-direction: column; padding-top: clamp(24px, 5vh, 56px); }
.eyebrow { font: 500 0.8125rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.slot--mark {
  position: absolute; right: var(--gutter); top: clamp(72px, 13vh, 150px);
  width: clamp(180px, 31vw, 470px); aspect-ratio: 1; border-radius: 50%;
}
.hero__title {
  margin: auto 0 0;
  font: 700 clamp(4rem, 12vw, 11.5rem)/0.86 var(--display);
  font-stretch: 75%; text-transform: uppercase; letter-spacing: -0.01em;
}
.line { display: block; clip-path: inset(-40% -20% 0 -20%); }
.hero__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 20px 32px; padding-block: 28px 36px; }
.hero__lede { max-width: 40ch; font-size: clamp(1rem, 1.2vw, 1.125rem); }

.marquee { overflow: clip; border-block: 1px solid var(--line); padding-block: 14px; }
.marquee__track {
  display: flex; gap: 0.5em; width: max-content; white-space: nowrap; will-change: transform;
  font: 700 clamp(2rem, 5vw, 4.5rem)/1 var(--display); font-stretch: 75%; text-transform: uppercase;
}
.marquee__track span { padding-right: 0.5em; }
.marquee__track .o { -webkit-text-fill-color: transparent; -webkit-text-stroke: 1.5px var(--ink); }

/* ---------- about ---------- */
.about__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: start; }
.slot--portrait { grid-column: 1 / span 5; width: 100%; max-width: 460px; aspect-ratio: 4 / 5; border-radius: 12px; }
.about__text { grid-column: 7 / -1; }
.about__big { max-width: 26ch; margin-bottom: 1.1em; font-size: clamp(1.375rem, 2.3vw, 2.125rem); line-height: 1.25; letter-spacing: -0.01em; }
.about__text p:not(.about__big) { max-width: 56ch; color: var(--muted); }

/* ---------- work ---------- */
.work__head { margin-bottom: 0.6em; }
.work__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
.projects { grid-column: 1 / span 6; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.projects li { border-bottom: 1px solid var(--line); }
.project {
  display: grid; grid-template-columns: 3.2rem 1fr; align-content: center;
  min-height: 26vh; padding-block: 32px; text-decoration: none; color: inherit;
}
.project__title::after { content: "→"; display: inline-block; margin-left: 0.25em; opacity: 0; transform: translateX(-0.3em); transition: opacity 0.3s ease, transform 0.45s var(--ease-out); }
.project.is-active .project__title::after { opacity: 1; transform: none; }
.project__no { position: relative; padding-top: 0.55em; font: 500 0.8125rem/1 var(--mono); color: var(--muted); }
.project__no::before {
  content: ""; position: absolute; left: -16px; top: calc(0.55em + 2px); width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); transform: scale(0); transition: transform 0.3s var(--ease-out);
}
.project__title {
  margin: 0; font: 700 clamp(2.25rem, 4.6vw, 4.5rem)/0.92 var(--display); font-stretch: 75%; text-transform: uppercase;
  transition: transform 0.45s var(--ease-out), color 0.3s ease;
}
.project__meta { display: block; grid-column: 2; margin-top: 0.6em; color: var(--muted); font-size: 0.9375rem; transition: transform 0.45s var(--ease-out); }
.project.is-active .project__no { color: var(--ink); }
.project.is-active .project__no::before { transform: scale(1); }
.project.is-active .project__title, .project.is-active .project__meta { transform: translateX(14px); }
.projects:has(.is-active) .project:not(.is-active) .project__title { color: var(--muted); }

.work__stage { grid-column: 8 / -1; position: sticky; top: 20svh; align-self: start; }
.slot--preview { width: 100%; aspect-ratio: 4 / 3; border-radius: 12px; }

/* ---------- services ---------- */
.services__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
.services__head { grid-column: 1 / span 5; align-self: start; position: sticky; top: calc(var(--nav-h) + 48px); }
.svc-wrap { position: relative; grid-column: 6 / -1; padding-left: 96px; }
.slot--marker {
  position: absolute; left: 0; top: 0; width: 60px; aspect-ratio: 1; border-radius: 50%;
  transition: transform 0.6s var(--ease-in-out);
}
.services__list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.svc { display: grid; align-content: center; min-height: 22vh; padding-block: 28px; border-bottom: 1px solid var(--line); }
.svc h3 {
  margin: 0 0 0.35em; color: var(--muted); transition: color 0.3s ease;
  font: 700 clamp(1.75rem, 3.2vw, 3rem)/1 var(--display); font-stretch: 75%; text-transform: uppercase;
}
.svc p { max-width: 48ch; color: var(--muted); }
.svc.is-active h3 { color: var(--ink); }

/* ---------- contact ---------- */
.contact { min-height: 100svh; display: flex; align-items: center; }
.contact__grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 48px; }
.contact__title { font-size: clamp(3.25rem, 9.5vw, 10.5rem); max-width: 9ch; }
.contact__mail { max-width: 46ch; font-size: 1.125rem; color: var(--muted); }
.contact__mail .link { color: var(--ink); white-space: nowrap; }
.contact__mail .link::after, .contact__more .link::after { transform: scaleX(1); }
.contact__more { margin-top: 1.25em; font: 500 0.875rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; }
.contact__more .link { display: inline-flex; align-items: center; min-height: 44px; }
.contact__more .link::after { bottom: 10px; }
.slot--cta { display: block; width: clamp(150px, 15vw, 220px); aspect-ratio: 1; border-radius: 50%; color: var(--ink); text-decoration: none; }
.slot--cta .layer { transition: transform 0.25s var(--ease-out); }
.slot--cta:active .layer { transform: scale(0.95); }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); }
.footer__inner {
  display: flex; justify-content: space-between; align-items: center; min-height: 72px;
  font: 500 0.8125rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
}
.footer .link { display: inline-flex; align-items: center; gap: 0.5em; min-height: 44px; color: var(--ink); }
.footer .link::after { bottom: 12px; }

/* ---------- entrance and reveals (JS only, so nothing hides without it) ---------- */
html.js [data-split] .ch { display: inline-block; transform: translate3d(0, 105%, 0); transition: transform 1.1s var(--ease-out); transition-delay: calc(var(--i) * 40ms + 0.1s); }
html.js.is-loaded [data-split] .ch { transform: none; }
html.js [data-enter] { opacity: 0; transform: translate3d(0, 14px, 0); transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out); transition-delay: var(--d, 0.5s); }
html.js.is-loaded [data-enter] { opacity: 1; transform: none; }
html.js .traveler__inner { opacity: 0; transform: scale(0.9); }
html.js.is-loaded .traveler__inner { opacity: 1; transform: none; transition: opacity 0.8s var(--ease-out) 0.35s, transform 1.1s var(--ease-out) 0.35s; }
html.js.is-ready .traveler__inner { transition: transform 0.25s var(--ease-out); }
html.js.is-ready .traveler.is-hover .traveler__inner { transform: scale(1.05); }
html.js.is-ready .traveler.is-press .traveler__inner { transform: scale(0.95); }

html.js .reveal .w { display: inline-block; clip-path: inset(-30% -10% 0 -10%); }
html.js .reveal .w > span { display: inline-block; transform: translate3d(0, 105%, 0); transition: transform 0.9s var(--ease-out); transition-delay: calc(var(--i) * 70ms); }
html.js .reveal.is-in .w > span { transform: none; }

@media (hover: hover) and (pointer: fine) {
  .slot--cta:hover .layer { transform: scale(1.05); }
}

/* ---------- small screens ---------- */
@media (max-width: 819px) {
  .slot--portrait { grid-column: 1 / -1; max-width: 72%; margin-bottom: 40px; }
  .about__text { grid-column: 1 / -1; }
  .projects { grid-column: 1 / -1; }
  /* solid backing so the list scrolls under the pinned preview instead of showing through it */
  .work__stage {
    grid-column: 1 / -1; order: -1; top: var(--nav-h); z-index: 1;
    margin: 0 calc(-1 * var(--gutter)) 24px; padding: 12px var(--gutter);
    background: var(--paper); box-shadow: 0 1px 0 var(--line);
  }
  .slot--preview { aspect-ratio: 16 / 10; }
  .project { min-height: 26vh; }
  .services__head { grid-column: 1 / -1; position: static; }
  .svc-wrap { grid-column: 1 / -1; padding-left: 72px; }
  .slot--marker { width: 48px; }
  .contact__grid { grid-template-columns: 1fr; }
}
@media (max-width: 479px) {
  .nav .link { letter-spacing: 0.04em; font-size: 0.75rem; }
  .hero__foot .btn { width: 100%; justify-content: center; }
}

/* ---------- reduced motion: content in place, no travel, fades only ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js [data-split] .ch, html.js .reveal .w > span { transform: none; opacity: 0; transition: opacity 0.4s ease; }
  html.js.is-loaded [data-split] .ch, html.js .reveal.is-in .w > span { opacity: 1; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  html.js [data-enter] { transform: none; }
  .cover.is-active { transition: opacity 0.3s ease; }
  .cover__art, .cover__title, .slot--marker, .project__title, .project__meta { transition: none; }
}
