:root {
  --color-bg: #ffffff;
  --color-fg: #0a0a0a;
  --color-grey-bg: #f4f4f4;
  --color-grey-text: #8a8a8a;
  --color-accent: #ea3323;
  --color-pill: #0b0f19;
  --color-card: #3a3a3a;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Content frame */
  --frame-w: min(100vw, 1440px);
  --frame-x: calc((100vw - var(--frame-w)) / 2);
  --frame-h: max(100vh, 620px);

  /* THE scale unit: 1u = 1px at 1440w, scales uniformly below */
  --u: calc(var(--frame-w) / 1440);

  /* Swiss grid */
  --gx-margin: calc(0.07 * var(--frame-w));
  --gx-gutter: calc(0.00875 * var(--frame-w));
  --gx-col: calc((var(--frame-w) - 2 * var(--gx-margin) - 3 * var(--gx-gutter)) / 4);
  --gy-margin: calc(0.0715 * var(--frame-h));
  --gy-gutter: calc(0.0116 * var(--frame-h));
  --gy-row: calc((var(--frame-h) - 2 * var(--gy-margin) - 3 * var(--gy-gutter)) / 4);
  --m: calc(var(--frame-x) + var(--gx-margin));

  /* Nav rail (column 1) + centered content field */
  --rail: max(calc(0.7 * (var(--gx-col) + var(--gx-gutter))), 110px);
  --content-left: calc(var(--m) + var(--rail));
  --field-w: calc(var(--frame-w) - 2 * var(--gx-margin) - 2 * var(--rail));

  /* Pill + card geometry, width-scaled */
  --pill-h: calc(340 * var(--u));
  --pill-pad: calc(0.16 * var(--pill-h));
  --card-gap: calc(0.11 * var(--pill-h));
  --card-w: calc(0.74 * (var(--pill-h) - 2 * var(--pill-pad)));

  /* Type scale: pure multiples of --u, floors only for legibility */
  --fs-heading: max(calc(30 * var(--u)), 15px);
  --fs-body-lg: max(calc(26 * var(--u)), 13px);
  --fs-body: max(calc(16 * var(--u)), 11px);
  --fs-small: max(calc(14 * var(--u)), 10px);
  --fs-nav: max(calc(14 * var(--u)), 10px);

  /* Tracking / leading */
  --track-display: -0.03em;
  --track-body: -0.01em;
  --track-small: 0em;
  --lh-display: 1.1;
  --lh-body-lg: 1.3;
  --lh-body: 1.45;

  /* Spacing tokens, width-scaled */
  --s1: calc(4 * var(--u));
  --s2: calc(8 * var(--u));
  --s3: calc(12 * var(--u));
  --s4: calc(16 * var(--u));
  --s5: calc(24 * var(--u));
  --s6: calc(32 * var(--u));
  --s7: calc(48 * var(--u));
  --s8: calc(64 * var(--u));

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 150ms;
  --dur-med: 300ms;
  --dur-slow: 600ms;
  --dur-unfold: 900ms;
  --ease-unfold: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-sans);
  letter-spacing: var(--track-body);
  line-height: var(--lh-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--color-fg);
  color: var(--color-bg);
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* --- Nav: fixed in the left rail --- */

.nav-links {
  position: fixed;
  top: calc(var(--gy-margin) + 0.35 * var(--gy-row));
  left: var(--m);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s1);
  font-size: var(--fs-nav);
  letter-spacing: var(--track-small);
}

.nav-links a {
  display: flex;
  align-items: center;
  gap: var(--s2);
  color: #86868b;
  text-decoration: none;
  transition: color var(--dur-med) var(--ease);
}

.nav-links a:hover { color: #b0b0b5; }

.nav-links a::before {
  content: '';
  height: 1px;
  width: calc(12 * var(--u));
  background: #86868b;
  transition:
    width var(--dur-slow) var(--ease),
    height var(--dur-med) var(--ease),
    background-color var(--dur-med) var(--ease);
}

.nav-links a:hover::before {
  width: calc(22 * var(--u));
  background: #b0b0b5;
}

.nav-links a.active { color: var(--color-accent); }

.nav-links a.active::before {
  width: calc(34 * var(--u));
  height: 2px;
  background: var(--color-accent);
}

/* Over dark regions: same hierarchy, light tones; red stays red */
body.nav-dark .nav-links a { color: #a1a1a6; }
body.nav-dark .nav-links a:hover { color: #d2d2d7; }
body.nav-dark .nav-links a::before { background: #a1a1a6; }
body.nav-dark .nav-links a:hover::before { background: #d2d2d7; }
body.nav-dark .nav-links a.active { color: var(--color-accent); }
body.nav-dark .nav-links a.active::before { background: var(--color-accent); }

/* --- Hero --- */

.hero {
  position: relative;
  height: max(100vh, 620px);
}

.hero-text {
  position: absolute;
  left: var(--content-left);
  top: 50vh;
  transform: translateY(-50%);
}

/* Logos: above the intro lines, CA overhanging past their right end */
.hero-logos {
  position: absolute;
  bottom: calc(100% + var(--s6));
  right: calc(-1 * var(--s8));
  display: flex;
  align-items: center;
  gap: var(--s6);
}

.logo {
  height: max(calc(80 * var(--u)), 44px);
  width: auto;
  object-fit: contain;
}

.hero h1 {
  font-size: var(--fs-heading);
  font-weight: 500;
  letter-spacing: var(--track-display);
  line-height: var(--lh-display);
  margin-bottom: var(--s1);
}

.hero p {
  font-size: var(--fs-body-lg);
  font-weight: 400;
  letter-spacing: var(--track-display);
  line-height: var(--lh-body-lg);
  white-space: nowrap;
}

.hero .muted { color: var(--color-grey-text); }

/* --- Work preview half-pills --- */

.work {
  margin-top: calc(-0.32 * var(--pill-h));
  padding-bottom: calc(0.85 * var(--pill-h));
  display: flex;
  flex-direction: column;
  gap: calc(0.7 * var(--pill-h));
}

.carousel-row {
  position: relative;
  width: calc(100vw - var(--content-left));
  height: var(--pill-h);
  background: var(--color-pill);
  overflow: hidden;
}

.row-top {
  margin-left: var(--content-left);
  border-radius: calc(var(--pill-h) / 2) 0 0 calc(var(--pill-h) / 2);
}
.row-bottom {
  margin-left: 0;
  width: calc(100vw - var(--m));
  border-radius: 0 calc(var(--pill-h) / 2) calc(var(--pill-h) / 2) 0;
}

.carousel-track {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  gap: var(--card-gap);
  height: 100%;
  padding: var(--pill-pad) calc(0.5 * var(--pill-h));
  will-change: transform;
}

.card {
  flex: none;
  width: var(--card-w);
  height: 100%;
  background: var(--color-card);
  border-radius: calc(12 * var(--u));
  will-change: transform, opacity;
}

/* --- About / Contact: centered content field --- */

.about,
.contact {
  padding: var(--gy-margin) var(--content-left);
}

.about h2,
.contact h2 {
  font-size: var(--fs-heading);
  font-weight: 500;
  letter-spacing: var(--track-display);
  line-height: var(--lh-display);
  margin-bottom: var(--s3);
}

.section-placeholder {
  color: var(--color-grey-text);
  font-size: var(--fs-body);
}

.about-content {
  display: flex;
  gap: var(--s6);
  flex-wrap: nowrap;
  align-items: flex-start;
}

.about-photo {
  width: calc(0.75 * var(--gx-col));
  aspect-ratio: 3 / 4;
  background: var(--color-grey-bg);
  border-radius: calc(8 * var(--u));
  flex-shrink: 0;
}

.about-text {
  flex: 1;
  min-width: 0;
}

.about-list-title {
  font-size: var(--fs-small);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-grey-text);
  margin: var(--s5) 0 var(--s2);
}

.about-list-item {
  display: flex;
  align-items: center;
  gap: var(--s3);
  font-size: var(--fs-body);
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--color-grey-bg);
  opacity: 0;
  transform: translateY(20px);
}

.about-list-item::before {
  content: '';
  width: calc(5 * var(--u));
  height: calc(5 * var(--u));
  min-width: 3px;
  min-height: 3px;
  border-radius: 50%;
  border: 1px solid var(--color-grey-text);
  background: transparent;
  flex-shrink: 0;
}

/* --- Contact --- */

.contact-content {
  display: flex;
  flex-direction: column;
  gap: var(--s6);
}

.contact-links {
  display: flex;
  gap: var(--s5);
  font-size: var(--fs-body);
}

.contact-links a {
  color: var(--color-fg);
  text-decoration: none;
  border-bottom: 1px solid var(--color-grey-bg);
  padding-bottom: 2px;
  transition: border-color var(--dur-med) var(--ease);
}

.contact-links a:hover { border-color: var(--color-fg); }

.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  max-width: calc(420 * var(--u));
}

.contact-form input,
.contact-form textarea {
  border: 1px solid var(--color-grey-bg);
  padding: var(--s3);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  border-radius: calc(6 * var(--u));
  resize: none;
  transition: border-color var(--dur-fast) var(--ease);
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--color-fg);
}

.contact-form button {
  align-self: flex-start;
  padding: var(--s3) var(--s6);
  background: var(--color-fg);
  color: #fff;
  border: none;
  border-radius: calc(6 * var(--u));
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}

.contact-form button:hover { opacity: 0.85; }
.contact-form button:active { transform: scale(0.97); }

/* --- Full Work gallery --- */

.work-gallery {
  border-radius: calc(40 * var(--u)) calc(40 * var(--u)) 0 0;
  background: #0a0a0a;
  color: #f4f4f4;
  padding: var(--gy-margin) var(--content-left);
}

.work-gallery h2 {
  color: #ffffff;
  font-size: var(--fs-heading);
  font-weight: 500;
  letter-spacing: var(--track-display);
  line-height: var(--lh-display);
  margin-bottom: var(--s6);
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gx-gutter);
}

.grid-card {
  aspect-ratio: 3 / 4;
  background: var(--color-card);
  border-radius: calc(8 * var(--u));
  transition: transform var(--dur-med) var(--ease);
}

.grid-card:hover { transform: translateY(calc(-4 * var(--u))); }

/* --- Grid overlay (G to toggle) --- */

#grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: none;
  pointer-events: none;
  z-index: 9999;
}

#grid-overlay.visible { display: block; }

.grid-page { position: relative; height: 100vh; }

.g-cols,
.g-rows {
  position: absolute;
  inset: 0;
  display: flex;
}

.g-cols {
  padding: 0 var(--m);
  gap: var(--gx-gutter);
}

.g-cols div {
  flex: 1;
  border-left: 1px solid rgba(10, 10, 10, 0.18);
  border-right: 1px solid rgba(10, 10, 10, 0.18);
}

.g-rows {
  flex-direction: column;
  padding: var(--gy-margin) 0;
  gap: var(--gy-gutter);
}

.g-rows div {
  flex: 1;
  border-top: 1px solid rgba(10, 10, 10, 0.18);
  border-bottom: 1px solid rgba(10, 10, 10, 0.18);
}

/* --- Reduced motion --- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

.hero-logos a {
  display: inline-flex;
  transition: transform var(--dur-fast) var(--ease);
}

.hero-logos a:hover { transform: scale(1.05); }

.hidden-field { display: none; }

.form-status {
  font-size: var(--fs-small);
  color: var(--color-grey-text);
  min-height: 1.2em;
  margin: 0;
}

.form-status.ok { color: var(--color-fg); }
.form-status.err { color: var(--color-accent); }

.contact-form button:disabled {
  opacity: 0.5;
  cursor: default;
}

.card img,
.grid-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.card.linked,
.grid-card.linked { cursor: pointer; }

/* --- Footer --- */

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--s6) var(--content-left);
  background: #0a0a0a;
  color: var(--color-grey-text);
  font-size: var(--fs-small);
}

.footer-links {
  display: flex;
  gap: var(--s5);
}

.footer a {
  color: var(--color-grey-text);
  text-decoration: none;
  transition: color var(--dur-med) var(--ease);
}

.footer a:hover { color: #ffffff; }

/* --- Gallery: masonry, fixed column width, natural heights --- */

.work-grid {
  display: block;
  columns: 3;
  column-gap: var(--s7);
}

.grid-card {
  aspect-ratio: auto;
  break-inside: avoid;
  margin-bottom: var(--s7);
}

.grid-card:empty { aspect-ratio: 3 / 4; }

.grid-card img {
  width: 100%;
  height: auto;
  border-radius: inherit;
  display: block;
}

/* --- Lightbox --- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s6);
  visibility: hidden;
  pointer-events: none;
}

.lightbox .lightbox-panel { opacity: 0; transition: opacity var(--dur-med) var(--ease), transform var(--dur-med) var(--ease); }
.lightbox.open .lightbox-panel { opacity: 1; }

.lightbox.open {
  visibility: visible;
  pointer-events: auto;
}

.lightbox-panel {
  position: relative;
  width: fit-content;
  min-width: min(420px, 92vw);
  max-width: min(880px, 92vw);
  max-height: 86vh;
  overflow-y: auto;
  background: rgba(20, 20, 26, 0.24);
  backdrop-filter: blur(44px) saturate(130%);
  -webkit-backdrop-filter: blur(44px) saturate(130%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: calc(16 * var(--u));
  padding: var(--s6);
  color: #f4f4f4;
  transform: scale(0.97) translateY(8px);
  transition: transform var(--dur-med) var(--ease);
}

.lightbox.open .lightbox-panel {
  transform: scale(1) translateY(0);
}

.lightbox-panel img {
  width: 100%;
  height: auto;
  border-radius: calc(10 * var(--u));
  display: block;
  margin-bottom: var(--s4);
}

.lightbox-close {
  position: absolute;
  top: calc(-1 * var(--s2) - 34px);
  right: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #f4f4f4;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}

.lightbox-close:hover { background: rgba(255, 255, 255, 0.14); }

.lightbox-title {
  font-size: var(--fs-body-lg);
  font-weight: 500;
  letter-spacing: var(--track-display);
  margin-bottom: var(--s2);
}

.lightbox-desc {
  color: rgba(244, 244, 244, 0.65);
  font-size: var(--fs-body);
  margin-bottom: var(--s4);
  white-space: pre-line;
}

.lightbox-visit {
  display: inline-block;
  color: #f4f4f4;
  text-decoration: none;
  font-size: var(--fs-body);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  padding-bottom: 2px;
  margin-bottom: var(--s5);
  transition: border-color var(--dur-med) var(--ease);
}

.lightbox-visit:hover { border-color: #f4f4f4; }


.footer-credit {
  color: var(--color-grey-text);
}

/* --- Carousel cards: fixed height, natural-ratio width --- */

.card { width: auto; }
.card:empty { width: var(--card-w); }

.card img {
  width: auto;
  height: 100%;
  object-fit: contain;
}

/* --- Lightbox: adaptive layout for portrait covers --- */

.lightbox-body {
  display: flex;
  flex-direction: column;
}

.lb-media { order: -1; min-width: 0; }
.lb-info { min-width: 0; }

.lb-media img {
  width: auto;
  max-width: 100%;
  max-height: 62vh;
  height: auto;
  border-radius: calc(10 * var(--u));
  display: block;
  margin: 0 auto var(--s4);
}












/* Comfortable reading measure inside the panel */
.lb-info { max-width: 62ch; }
.lightbox-desc { max-width: 58ch; }


/* --- Back to top --- */

.back-top {
  position: fixed;
  bottom: calc(var(--gy-margin) + 0.35 * var(--gy-row));
  left: var(--m);
  z-index: 100;
  width: calc(36 * var(--u));
  height: calc(36 * var(--u));
  min-width: 28px;
  min-height: 28px;
  border-radius: 50%;
  border: 1px solid #86868b;
  background: transparent;
  color: #86868b;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity var(--dur-med) var(--ease),
    transform var(--dur-med) var(--ease),
    color var(--dur-med) var(--ease),
    border-color var(--dur-med) var(--ease);
}

.back-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-top:hover {
  color: #b0b0b5;
  border-color: #b0b0b5;
}

body.backtop-dark .back-top { color: #a1a1a6; border-color: #a1a1a6; }
body.backtop-dark .back-top:hover { color: #d2d2d7; border-color: #d2d2d7; }


.back-top svg {
  width: 44%;
  height: 44%;
  display: block;
  transition: transform var(--dur-med) var(--ease);
}

.back-top:hover svg { transform: translateY(-0.5px); }

/* --- About list: name + detail layout, sub-items --- */


.about-list-item.sub {
  margin-left: var(--s6);
  font-size: var(--fs-small);
}

.about-list-item.sub::before {
  width: calc(3.5 * var(--u));
  height: calc(3.5 * var(--u));
}



/* --- About list: clean stacked layout --- */

.about-list-item {
  flex-wrap: wrap;
  row-gap: calc(3 * var(--u));
  padding: var(--s3) 0;
}

.li-name {
  font-weight: 500;
}

.li-detail {
  flex-basis: 100%;
  color: var(--color-grey-text);
  font-size: var(--fs-small);
  padding-left: calc(5px + var(--s3));
}

.about-list-title { margin-top: var(--s6); }

.about-text > .section-placeholder { margin-bottom: var(--s4); }



.about-bio {
  font-size: var(--fs-small);
  line-height: 1.55;
  color: #555;
  max-width: 58ch;
  margin-bottom: var(--s4);
}

/* --- Collapsible bio --- */

.bio-wrap { margin-top: var(--s6); }

.bio-toggle {
  display: flex;
  align-items: center;
  gap: var(--s2);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-grey-text);
  transition: color var(--dur-med) var(--ease);
}

.bio-toggle:hover { color: var(--color-fg); }

.bio-icon {
  display: inline-block;
  font-size: 1.1em;
  transition: transform var(--dur-med) var(--ease);
}

.bio-wrap.open .bio-icon { transform: rotate(45deg); }

.bio-panel {
  /* space permanently reserved: expanding never moves the layout below */
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition:
    opacity var(--dur-unfold) var(--ease-unfold),
    transform var(--dur-unfold) var(--ease-unfold);
}

.bio-wrap.open .bio-panel {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.bio-inner .about-bio { margin: var(--s3) 0 0; }


/* --- Lightbox: unified centered layout --- */

.lightbox-body {
  align-items: center;
  text-align: center;
}

.lb-media { width: 100%; }

.lb-media img {
  max-height: 58vh;
  width: auto;
  max-width: 100%;
  margin: 0 auto var(--s4);
}

.lb-info {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-title {
  text-align: center;
  overflow-wrap: break-word;
  max-width: 100%;
}

.lightbox-desc { text-align: center; }

.lightbox-visit { align-self: center; }







/* ============================================
   Lightbox caption system (single source of truth)
   Rhythm: image | air | [title+desc bound] | equal air
   ============================================ */

.lightbox-panel { padding-bottom: var(--s5); }

.lb-media img { margin-bottom: var(--s5); }

.lightbox-title {
  font-size: max(calc(20 * var(--u)), 13px);
  font-weight: 500;
  letter-spacing: var(--track-body);
  line-height: 1.25;
  margin-bottom: var(--s1);
}

.lightbox-desc {
  font-size: max(calc(14.5 * var(--u)), 10.5px);
  line-height: 1.55;
  max-width: 44ch;
  color: rgba(244, 244, 244, 0.72);
  margin-bottom: 0;
}

.lightbox-visit {
  margin: var(--s4) 0 0;
  font-size: max(calc(13.5 * var(--u)), 10px);
}

/* --- Projects slides section --- */

.slides-section {
  background: #1c1c1e;
  color: #f4f4f4;
  border-radius: calc(40 * var(--u)) calc(40 * var(--u)) 0 0;
  padding: var(--gy-margin) var(--content-left);
}

.slides-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--s6);
}

.slides-head h2 {
  color: #ffffff;
  font-size: var(--fs-heading);
  font-weight: 500;
  letter-spacing: var(--track-display);
  line-height: var(--lh-display);
}

.slides-arrows { display: flex; gap: var(--s2); }

.slide-arrow {
  width: calc(36 * var(--u));
  height: calc(36 * var(--u));
  min-width: 28px;
  min-height: 28px;
  border-radius: 50%;
  border: 1px solid #6e6e73;
  background: transparent;
  color: #a1a1a6;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: color var(--dur-med) var(--ease), border-color var(--dur-med) var(--ease);
}

.slide-arrow svg { width: 42%; height: 42%; }
.slide-arrow:hover { color: #d2d2d7; border-color: #d2d2d7; }

.slides-track {
  display: flex;
  gap: var(--s6);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--s2);
}

.slides-track::-webkit-scrollbar { display: none; }

.slide {
  flex: 0 0 min(calc(560 * var(--u)), 86%);
  scroll-snap-align: start;
}

.slide img {
  width: 100%;
  height: calc(320 * var(--u));
  object-fit: cover;
  border-radius: calc(10 * var(--u));
  display: block;
  margin-bottom: var(--s4);
  background: #2a2a2c;
}

.slide.placeholder .slide-img-ph {
  width: 100%;
  height: calc(320 * var(--u));
  border-radius: calc(10 * var(--u));
  background: #2a2a2c;
  margin-bottom: var(--s4);
}

.slide h3 {
  font-size: max(calc(20 * var(--u)), 13px);
  font-weight: 500;
  margin-bottom: var(--s1);
}

.slide p {
  font-size: max(calc(14.5 * var(--u)), 10.5px);
  line-height: 1.55;
  color: rgba(244, 244, 244, 0.72);
}

.slide-process {
  margin-top: var(--s4);
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.slide-step {
  display: flex;
  gap: var(--s3);
  font-size: max(calc(13.5 * var(--u)), 10px);
  color: rgba(244, 244, 244, 0.6);
}

.slide-step .n {
  color: rgba(244, 244, 244, 0.35);
  font-variant-numeric: tabular-nums;
}

/* --- Longer term projects: sub-block of the black Work section --- */

.slides-section { display: none; }

.longterm { margin-bottom: calc(var(--s8) + var(--s6)); }

.sub-title {
  font-size: max(calc(15 * var(--u)), 11px);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(244, 244, 244, 0.45);
  margin-bottom: var(--s5);
}

.slides-head { margin-bottom: var(--s5); }
.slides-head .sub-title { margin-bottom: 0; }

/* slides restyled for the black background */
.slide img,
.slide.placeholder .slide-img-ph { background: #1a1a1a; }

/* --- Longer term projects: per-project page viewer --- */

.lt-project { margin-bottom: var(--s8); }

.lt-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--s4);
}

.lt-head h3 {
  font-size: max(calc(18 * var(--u)), 12px);
  font-weight: 500;
  color: rgba(244, 244, 244, 0.92);
}

.lt-controls {
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.lt-count {
  font-size: max(calc(13 * var(--u)), 10px);
  color: rgba(244, 244, 244, 0.45);
  font-variant-numeric: tabular-nums;
}

.lt-stage {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #1a1a1a;
  border-radius: calc(10 * var(--u));
  overflow: hidden;
  position: relative;
  margin-bottom: var(--s4);
}

.lt-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity var(--dur-med) var(--ease);
}

.lt-stage img.current { opacity: 1; }

.lt-desc {
  font-size: max(calc(14.5 * var(--u)), 10.5px);
  line-height: 1.55;
  color: rgba(244, 244, 244, 0.72);
  max-width: 58ch;
}

.slide-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

.longterm h2 {
  color: #8a8a8a;
  font-size: var(--fs-heading);
  font-weight: 500;
  letter-spacing: var(--track-display);
  line-height: var(--lh-display);
  margin-bottom: var(--s7);
}

/* --- Work heading: on the white, above the black section --- */

.work-heading {
  padding: 0 var(--content-left);
  color: var(--color-fg);
  font-size: var(--fs-heading);
  font-weight: 500;
  letter-spacing: var(--track-display);
  line-height: var(--lh-display);
  margin-bottom: var(--s6);
}


/* --- Lightbox dismiss hint --- */

.lightbox-hint {
  position: absolute;
  top: max(28px, 4vh);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: max(calc(12 * var(--u)), 9px);
  letter-spacing: 0.02em;
  color: rgba(244, 244, 244, 0.55);
  opacity: 0;
  transition: opacity 600ms var(--ease);
  pointer-events: none;
}

.lightbox-hint.visible { opacity: 1; }

/* --- IYA link: red blooms through the letters from the hover point --- */

.iya-link {
  position: relative;
  display: inline-block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.iya-red {
  position: absolute;
  inset: 0;
  color: var(--color-accent);
  clip-path: circle(0% at var(--mx, 50%) var(--my, 50%));
  transition: clip-path 1000ms var(--ease);
  pointer-events: none;
}

.iya-link:hover .iya-red {
  transition: clip-path 2400ms var(--ease);
}

.iya-link:hover .iya-red {
  clip-path: circle(150% at var(--mx, 50%) var(--my, 50%));
}


.iya-link { cursor: none; }

/* --- Custom site cursor --- */




/* --- IYA dot cursor: red, blooms black while pressed --- */

.iya-dot {
  position: fixed;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-accent);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2000;
  opacity: 0;
  transition: background-color 1500ms var(--ease), opacity 250ms var(--ease);
}

.iya-dot.on { opacity: 1; }
.iya-dot.pressed { background: #0a0a0a; }




/* --- Cursor system: default cur-default.svg / link cur-link.svg, click variants --- */

:root {
  --cur-default: url('/cursors/cur-default.svg') 3 3, auto;
  --cur-link: url('/cursors/cur-link.svg') 3 3, pointer;
}

html.clicking {
  --cur-default: url('/cursors/cur-default.svg') 3 3, auto;
  --cur-link: url('/cursors/cur-link-click.svg') 3 3, pointer;
}

*, *::before, *::after { cursor: var(--cur-default); }

a, a *, button, button *, .linked, .linked *,
.grid-card, .grid-card *, .slide-arrow, .slide-arrow *,
.bio-toggle, .bio-toggle *, .back-top, .back-top *, label {
  cursor: var(--cur-link);
}

input[type="text"], input[type="email"], input[type="url"],
input[type="password"], textarea { cursor: text; }


/* --- Cursor system: default cur-default.svg / link cur-link.svg, click variants --- */

:root {
  --cur-default: url('/cursors/cur-default.svg') 3 3, auto;
  --cur-link: url('/cursors/cur-link.svg') 3 3, pointer;
}

html.clicking {
  --cur-default: url('/cursors/cur-default.svg') 3 3, auto;
  --cur-link: url('/cursors/cur-link-click.svg') 3 3, pointer;
}

body { cursor: var(--cur-default); }

a, button, .linked, .grid-card, .slide-arrow,
input[type="submit"], .bio-toggle, .back-top, label {
  cursor: var(--cur-link);
}

input[type="text"], input[type="email"], input[type="url"],
input[type="password"], textarea { cursor: text; }

/* IYA hover: red dot only — outranks the blanket cursor rules below/above */
.iya-link, .iya-link * { cursor: none; }

/* current program marked in accent */
.li-current { color: var(--color-accent); }


/* Blur layer: always alive at blur(0); opening ramps the radius (no cold build) */
.lightbox::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 12, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  z-index: -1;
  transition: all var(--dur-med) var(--ease);
  will-change: backdrop-filter, -webkit-backdrop-filter;
  transform: translateZ(0);
}

.lightbox.open::before {
  background: rgba(8, 8, 12, 0.55);
  backdrop-filter: blur(34px) saturate(120%);
  -webkit-backdrop-filter: blur(34px) saturate(120%);
}

/* ============ Phone (≤767px) ============ */

.nav-fade {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 58px;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid rgba(10, 10, 10, 0.08);
  z-index: 90;
  pointer-events: none;
}

/* --- Phone + iPad shared mobile layout --- */
@media (max-width: 1024px) and (pointer: coarse) {
  :root {
    --rail: 0px; /* rail gone; content uses simple margins */
  }

  .nav-fade { display: block; }

  .nav-links {
    flex-direction: row;
    align-items: center;
    top: 0;
    left: var(--m);
    height: 58px; /* matches .nav-fade — links center on the bar's midline */
    gap: 20px;
  }

  .nav-links a::before { display: none; }

  .hero-logos { right: 0; }
  .hero p { white-space: normal; }

  .contact-form { max-width: 100%; }
  .footer { flex-wrap: wrap; gap: var(--s3); }

  .work-grid {
    columns: 3;
    column-gap: var(--s4);
  }
  .grid-card { margin-bottom: var(--s4); }
}

/* --- Phone only --- */
@media (max-width: 767px) and (pointer: coarse) {
  :root {
    --u: calc(100vw / 800); /* phone-native scale */
  }

  .about-content { flex-wrap: wrap; }
  .about-photo { width: 42%; min-width: 120px; }

  .work-grid { columns: 2; }
}

/* --- Phone: carousels are native touch sliders --- */

.carousel-row.touch-slide {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.carousel-row.touch-slide::-webkit-scrollbar { display: none; }

.carousel-row.touch-slide .carousel-track {
  position: relative;
  width: max-content;
}


/* --- Mobile glass bar: readable links over dark sections --- */

@media (max-width: 1024px) and (pointer: coarse) {
  body.nav-dark .nav-links a { color: #2c2c2e; }
  body.nav-dark .nav-links a:hover { color: #0a0a0a; }
  body.nav-dark .nav-links a.active { color: var(--color-accent); }

  body.nav-dark .nav-fade {
    background: rgba(255, 255, 255, 0.32);
  }
}

/* --- Mobile: runway below Contact so it can reach the nav detector's band --- */

@media (max-width: 1024px) and (pointer: coarse) {
  .contact {
    padding-bottom: 46vh;
  }
}


/* --- iPad only: larger type below the intro screen --- */

@media (min-width: 768px) and (max-width: 1024px) and (pointer: coarse) {
  .about h2, .contact h2, .work-heading { font-size: calc(1.25 * var(--fs-heading)); }

  .about-bio,
  .about-list-item,
  .contact-links,
  .contact-form input,
  .contact-form textarea,
  .contact-form button,
  .lt-desc { font-size: calc(1.25 * var(--fs-body)); }

  .li-detail,
  .about-list-title,
  .bio-toggle,
  .form-status,
  .slide-step,
  .sub-title,
  .footer { font-size: calc(1.25 * var(--fs-small)); }

  .lt-head h3 { font-size: calc(1.25 * max(calc(18 * var(--u)), 12px)); }
  .lt-count { font-size: calc(1.25 * max(calc(13 * var(--u)), 10px)); }
}

/* --- Mobile: tighter intro screen, larger intro lines --- */

@media (max-width: 1024px) and (pointer: coarse) {
  .hero {
    height: max(72vh, 460px);
  }

  .hero-text {
    top: 50%;
  }

  .hero h1 { font-size: calc(1.18 * var(--fs-heading)); }
  .hero p { font-size: calc(1.18 * var(--fs-body-lg)); }
}


/* --- iPhone: intro lines back to base size (the +18% stays iPad-only) --- */

@media (max-width: 767px) and (pointer: coarse) {
  .hero h1 { font-size: var(--fs-heading); }
  .hero p { font-size: var(--fs-body-lg); }
}
/* inter-cyrillic-ext-400-normal */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/assets/inter-cyrillic-ext-400-normal-BQZuk6qB.woff2) format('woff2'), url(/assets/inter-cyrillic-ext-400-normal-DQukG94-.woff) format('woff');
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}

/* inter-cyrillic-400-normal */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/assets/inter-cyrillic-400-normal-obahsSVq.woff2) format('woff2'), url(/assets/inter-cyrillic-400-normal-HOLc17fK.woff) format('woff');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

/* inter-greek-ext-400-normal */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/assets/inter-greek-ext-400-normal-DGGRlc-M.woff2) format('woff2'), url(/assets/inter-greek-ext-400-normal-KugGGMne.woff) format('woff');
  unicode-range: U+1F00-1FFF;
}

/* inter-greek-400-normal */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/assets/inter-greek-400-normal-B4URO6DV.woff2) format('woff2'), url(/assets/inter-greek-400-normal-q2sYcFCs.woff) format('woff');
  unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF;
}

/* inter-vietnamese-400-normal */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/assets/inter-vietnamese-400-normal-DMkecbls.woff2) format('woff2'), url(/assets/inter-vietnamese-400-normal-Bbgyi5SW.woff) format('woff');
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
}

/* inter-latin-ext-400-normal */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/assets/inter-latin-ext-400-normal-C1nco2VV.woff2) format('woff2'), url(/assets/inter-latin-ext-400-normal-77YHD8bZ.woff) format('woff');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* inter-latin-400-normal */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/assets/inter-latin-400-normal-C38fXH4l.woff2) format('woff2'), url(/assets/inter-latin-400-normal-CyCys3Eg.woff) format('woff');
  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;
}/* inter-cyrillic-ext-500-normal */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(/assets/inter-cyrillic-ext-500-normal-B0yAr1jD.woff2) format('woff2'), url(/assets/inter-cyrillic-ext-500-normal-BmqWE9Dz.woff) format('woff');
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}

/* inter-cyrillic-500-normal */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(/assets/inter-cyrillic-500-normal-BasfLYem.woff2) format('woff2'), url(/assets/inter-cyrillic-500-normal-CxZf_p3X.woff) format('woff');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

/* inter-greek-ext-500-normal */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(/assets/inter-greek-ext-500-normal-C4iEst2y.woff2) format('woff2'), url(/assets/inter-greek-ext-500-normal-2j5mBUwD.woff) format('woff');
  unicode-range: U+1F00-1FFF;
}

/* inter-greek-500-normal */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(/assets/inter-greek-500-normal-BIZE56-Y.woff2) format('woff2'), url(/assets/inter-greek-500-normal-Xzm54t5V.woff) format('woff');
  unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF;
}

/* inter-vietnamese-500-normal */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(/assets/inter-vietnamese-500-normal-DOriooB6.woff2) format('woff2'), url(/assets/inter-vietnamese-500-normal-mJboJaSs.woff) format('woff');
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
}

/* inter-latin-ext-500-normal */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(/assets/inter-latin-ext-500-normal-CV4jyFjo.woff2) format('woff2'), url(/assets/inter-latin-ext-500-normal-BxGbmqWO.woff) format('woff');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* inter-latin-500-normal */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(/assets/inter-latin-500-normal-Cerq10X2.woff2) format('woff2'), url(/assets/inter-latin-500-normal-BL9OpVg8.woff) format('woff');
  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;
}/* inter-cyrillic-ext-600-normal */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(/assets/inter-cyrillic-ext-600-normal-Dfes3d0z.woff2) format('woff2'), url(/assets/inter-cyrillic-ext-600-normal-Bcila6Z-.woff) format('woff');
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}

/* inter-cyrillic-600-normal */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(/assets/inter-cyrillic-600-normal-CWCymEST.woff2) format('woff2'), url(/assets/inter-cyrillic-600-normal-4D_pXhcN.woff) format('woff');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

/* inter-greek-ext-600-normal */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(/assets/inter-greek-ext-600-normal-DRtmH8MT.woff2) format('woff2'), url(/assets/inter-greek-ext-600-normal-B8X0CLgF.woff) format('woff');
  unicode-range: U+1F00-1FFF;
}

/* inter-greek-600-normal */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(/assets/inter-greek-600-normal-plRanbMR.woff2) format('woff2'), url(/assets/inter-greek-600-normal-BZpKdvQh.woff) format('woff');
  unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF;
}

/* inter-vietnamese-600-normal */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(/assets/inter-vietnamese-600-normal-Cc8MFFhd.woff2) format('woff2'), url(/assets/inter-vietnamese-600-normal-BuLX-rYi.woff) format('woff');
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
}

/* inter-latin-ext-600-normal */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(/assets/inter-latin-ext-600-normal-D2bJ5OIk.woff2) format('woff2'), url(/assets/inter-latin-ext-600-normal-CIVaiw4L.woff) format('woff');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* inter-latin-600-normal */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(/assets/inter-latin-600-normal-LgqL8muc.woff2) format('woff2'), url(/assets/inter-latin-600-normal-CiBQ2DWP.woff) format('woff');
  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;
}