/* ============================================
   ROBERTO FRANCO — PORTFOLIO
   Dark editorial, Japanese-informed composition
   ============================================ */

:root {
  --black: #0a0a0a;
  --carbon: #131313;
  --carbon-2: #1a1a1a;
  --line: #2a2a2a;
  --off-white: #efece5;
  --gray-text: #9a9791;

  --red: #d0271b;
  --red-dim: #7a1810;

  --green: #4caf7d;
  --magenta: #d6488f;
  --yellow: #e0b23c;
  --cyan: #4fb8c9;

  --font-display: 'Zen Kaku Gothic New', 'Noto Sans JP', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --edge: clamp(20px, 5vw, 64px);
  --section-pad: clamp(64px, 10vw, 140px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--black);
  color: var(--off-white);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

ul, ol { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--red); color: var(--off-white); }

/* film grain overlay */
.grain {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ============ CUSTOM CURSOR ============ */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1000;
  transform: translate(-50%, -50%);
  transition: opacity .2s ease;
}
.cursor-dot { width: 6px; height: 6px; background: var(--red); }
.cursor-ring {
  width: 34px; height: 34px;
  border: 1px solid var(--red);
  transition: width .2s, height .2s, border-color .2s, transform .06s linear;
}
.cursor-ring.is-active { width: 56px; height: 56px; border-color: var(--off-white); }
@media (hover: none) { .cursor-dot, .cursor-ring { display: none; } }

/* ============ HEADER / NAV ============ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px var(--edge);
  pointer-events: none;
}
.site-header > * { pointer-events: auto; }

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.05em;
  mix-blend-mode: difference;
  color: #fff;
}
.brand-dot { color: var(--red); }

.menu-toggle {
  width: 44px; height: 44px;
  background: none; border: none;
  display: flex; flex-direction: column;
  align-items: flex-end; justify-content: center;
  gap: 6px;
  cursor: pointer;
  z-index: 101;
  mix-blend-mode: difference;
}
.menu-toggle span {
  display: block; height: 1.5px; width: 28px;
  background: var(--off-white);
  transition: transform .35s ease, width .35s ease, opacity .35s ease;
}
.menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); width: 28px; }
.menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); width: 28px; }

.nav-panel {
  position: fixed;
  inset: 0;
  background: var(--black);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--edge);
  padding-top: max(var(--edge), 90px);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .4s ease, transform .4s ease, visibility 0s .4s;
  z-index: 99;
}
.nav-panel.is-open {
  opacity: 1; visibility: visible; transform: translateY(0);
  transition: opacity .4s ease, transform .4s ease;
}

.nav-list li { border-top: 1px solid var(--line); }
.nav-list li:last-child { border-bottom: 1px solid var(--line); }
.nav-list a {
  display: flex;
  align-items: baseline;
  gap: 20px;
  padding: 18px 4px;
  font-family: var(--font-display);
  font-size: clamp(28px, 6vw, 56px);
  font-weight: 700;
  color: var(--off-white);
  transition: color .25s ease, padding-left .25s ease;
}
.nav-list a::before {
  content: attr(data-num);
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--red);
}
.nav-list a:hover { color: var(--red); padding-left: 16px; }

.nav-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gray-text);
  letter-spacing: 0.05em;
}

/* ============ HERO ============ */
.hero {
  position: relative;
  min-height: 100vh;
  padding: 100px var(--edge) 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(24px, 5vw, 64px);
  align-items: end;
  flex: 1;
}

.hero-media {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  border: 1px solid var(--line);
}
.hero-media img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1) contrast(1.15) brightness(0.85);
}
.hero-tag--jp {
  position: absolute;
  top: 16px; left: 16px;
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--off-white);
  writing-mode: vertical-rl;
  border: 1px solid rgba(239,236,229,0.35);
  padding: 10px 6px;
  background: rgba(10,10,10,0.4);
  backdrop-filter: blur(2px);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--gray-text);
  margin: 0 0 20px;
}
.eyebrow-line { width: 40px; height: 1px; background: var(--red); }

.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(52px, 10vw, 128px);
  line-height: 0.92;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
}
.accent { color: var(--red); }

.hero-desc {
  max-width: 46ch;
  color: var(--gray-text);
  font-size: clamp(15px, 1.4vw, 18px);
  margin: 0 0 32px;
}

.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 26px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.05em;
  border: 1px solid var(--off-white);
  transition: background .25s ease, color .25s ease, border-color .25s ease, transform .2s ease;
}
.btn--primary { background: var(--off-white); color: var(--black); }
.btn--primary:hover { background: var(--red); border-color: var(--red); color: var(--off-white); transform: translateY(-2px); }
.btn--ghost { color: var(--off-white); }
.btn--ghost:hover { border-color: var(--red); color: var(--red); transform: translateY(-2px); }

.hero-marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 40px;
}
.marquee-track {
  display: flex;
  gap: 20px;
  white-space: nowrap;
  width: max-content;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--gray-text);
  animation: marquee 32s linear infinite;
}
.marquee-track span:nth-child(2n) { color: var(--red); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.scroll-cue {
  position: absolute;
  bottom: 90px;
  right: var(--edge);
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--gray-text);
  writing-mode: vertical-rl;
}
.scroll-cue i {
  width: 1px; height: 40px;
  background: linear-gradient(var(--red), transparent);
}

/* ============ SECTIONS ============ */
.section {
  padding: var(--section-pad) var(--edge);
  border-top: 1px solid var(--line);
}
.section--carbon { background: var(--carbon); }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: clamp(36px, 6vw, 64px);
}
.section-num {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--red);
}
.section-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(32px, 5vw, 56px);
  margin: 0;
  letter-spacing: -0.01em;
}
.section-jp {
  margin-left: auto;
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--gray-text);
  letter-spacing: 0.1em;
}
.section-intro {
  color: var(--gray-text);
  max-width: 52ch;
  font-size: clamp(15px, 1.5vw, 18px);
  margin: -24px 0 48px;
}

/* ============ ABOUT ============ */
/* Centered, content-driven container — reuses the section's own horizontal
   gutter (var(--edge)) as the outer margin, so it never stretches edge to
   edge on large monitors without duplicating that padding. */
.about-container {
  max-width: 1200px;
  margin-inline: auto;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr; /* ~57% / 43% */
  align-items: start;
  column-gap: clamp(40px, 6vw, 100px);
}

.about-col { display: flex; flex-direction: column; }

/* left column: statement + portrait, tightly related */
.about-col--left { gap: clamp(40px, 5.5vw, 64px); }

.about-lead p {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.15;
  max-width: 650px;
  margin: 0 0 14px;
}
.about-lead-sub {
  font-family: var(--font-body) !important;
  font-weight: 400 !important;
  font-size: 16px !important;
  color: var(--gray-text);
  max-width: 46ch;
}

.about-portrait {
  position: relative;
  width: clamp(280px, 28vw, 420px);
  border: 1px solid var(--line);
  border-top: 2px solid var(--red);
  overflow: hidden;
  align-self: start;
}
.about-portrait img { width: 100%; height: auto; aspect-ratio: 3 / 4; filter: grayscale(0.3) contrast(1.05); }

/* right column: professional copy + facts as one coherent block */
.about-body p {
  color: var(--off-white);
  max-width: 520px;
  margin: 0 0 18px;
}
.about-body p:last-of-type { margin-bottom: 0; }

.about-facts {
  margin-top: clamp(32px, 5vw, 48px);
  border-top: 1px solid var(--line);
  max-width: 520px;
}
.about-facts li {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
.about-facts li span {
  font-family: var(--font-mono);
  color: var(--red);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============ TIMELINE ============ */
.timeline { border-top: 1px solid var(--line); }
.timeline-item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: clamp(20px, 4vw, 48px);
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}
.timeline-period {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--red);
}
.timeline-body h3 {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.4vw, 28px);
  margin: 0 0 6px;
}
.timeline-org {
  color: var(--gray-text);
  font-size: 14px;
  margin: 0 0 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.timeline-body ul { display: grid; gap: 8px; max-width: 62ch; }
.timeline-body li {
  position: relative;
  padding-left: 18px;
  font-size: 14.5px;
  color: var(--off-white);
}
.timeline-body li::before {
  content: '';
  position: absolute; left: 0; top: 8px;
  width: 6px; height: 1px;
  background: var(--red);
}
.timeline-item--compact .timeline-body h3 { font-size: 18px; }

.education {
  margin-top: clamp(40px, 6vw, 72px);
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(24px, 5vw, 64px);
  padding-top: clamp(32px, 5vw, 56px);
  border-top: 1px solid var(--line);
}
.education-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--red);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.education-main h3 { font-family: var(--font-display); font-size: 22px; margin: 0 0 6px; }
.education-main p { color: var(--gray-text); font-size: 14px; }
.education-complementary ul { display: grid; gap: 12px; }
.education-complementary li { font-size: 14px; color: var(--off-white); line-height: 1.5; }
.education-complementary strong { font-weight: 600; }

/* ============ SKILLS ============ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.skill-card {
  background: var(--black);
  padding: clamp(24px, 3vw, 36px);
  position: relative;
}
.skill-card::before {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 28px; height: 3px;
  background: var(--tag-color);
}
.skill-card h3 {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 18px 0 20px;
}
.skill-card ul { display: grid; gap: 10px; }
.skill-card li {
  font-size: 13.5px;
  color: var(--gray-text);
  padding-left: 14px;
  position: relative;
}
.skill-card li::before {
  content: '·';
  position: absolute; left: 0; color: var(--tag-color);
}

/* ============ WORK ============ */
.work-block { margin-bottom: clamp(56px, 8vw, 96px); }
.work-block:last-child { margin-bottom: 0; }
.work-block-head {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.work-block-head h3 { font-family: var(--font-display); font-size: clamp(20px,2.6vw,28px); margin: 0; }

/* ---------- Carousel chrome (nav / counter) ---------- */
.carousel-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.carousel-counter {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gray-text);
  letter-spacing: 0.05em;
}
.carousel-counter-current { color: var(--red); }
.carousel-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--off-white);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease;
}
.carousel-btn:hover { border-color: var(--red); color: var(--red); }
.carousel-btn:focus-visible,
.carousel-track:focus-visible,
.card:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

/* ---------- Carousel track: native scroll-snap, no JS drag needed ---------- */
.carousel-track {
  --card-h: 420px;
  display: flex;
  gap: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }

/* ---------- Card: fixed height, width follows each item's true ratio
   (film-strip layout) so nothing is ever cropped or distorted ---------- */
.card {
  position: relative;
  flex: 0 0 auto;
  scroll-snap-align: start;
  height: var(--card-h);
  width: auto;
  aspect-ratio: var(--ratio, 3 / 4);
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--carbon-2);
  cursor: pointer;
}
.card--video { aspect-ratio: var(--ratio, 9 / 16); }
.card img, .card video {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s cubic-bezier(.2,.7,.2,1), filter .4s ease;
  pointer-events: none;
}
.card:hover img, .card:hover video { transform: scale(1.06); }
.card figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  font-size: 13px;
  display: flex; flex-direction: column; gap: 6px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .3s ease, transform .3s ease;
}
.card:hover figcaption, .card:focus-visible figcaption { opacity: 1; transform: translateY(0); }
.tag {
  display: inline-block;
  width: fit-content;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid var(--tag-color);
  color: var(--tag-color);
}

.play-btn {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(239,236,229,0.5);
  background: rgba(10,10,10,0.5);
  color: var(--off-white);
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.85;
  transition: opacity .3s ease, transform .3s ease, background .25s ease;
  backdrop-filter: blur(3px);
  pointer-events: none;
}
.card--video:hover .play-btn, .card--video:focus-visible .play-btn { opacity: 1; transform: translate(-50%,-50%) scale(1.08); background: var(--red); border-color: var(--red); }

/* ============ LIGHTBOX ============
   Single shared instance for every gallery. Owns the only <video> that is
   ever actually played — card previews are muted/paused metadata frames,
   so there is never more than one active playback on the page. */
html.lightbox-lock { overflow: hidden; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(6, 6, 6, 0.96);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility 0s .3s;
  padding: clamp(16px, 5vw, 48px);
}
.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity .3s ease;
}

.lightbox-stage {
  position: relative;
  max-width: min(92vw, 1100px);
  max-height: 76vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--black);
}
.lightbox-img, .lightbox-video {
  display: none;
  max-width: 100%;
  max-height: 76vh;
  width: auto;
  height: auto;
  border: 1px solid var(--line);
}

.lightbox-caption {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 90vw;
  font-size: 14px;
  color: var(--off-white);
}
.lightbox-label { font-family: var(--font-display); }
.lightbox-counter {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gray-text);
  margin-left: 4px;
}

.lightbox-close, .lightbox-fullscreen, .lightbox-nav {
  position: absolute;
  background: rgba(10, 10, 10, 0.5);
  border: 1px solid var(--line);
  color: var(--off-white);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
  transition: border-color .2s ease, color .2s ease;
}
.lightbox-close:hover, .lightbox-fullscreen:hover, .lightbox-nav:hover {
  border-color: var(--red); color: var(--red);
}
.lightbox-close:focus-visible, .lightbox-fullscreen:focus-visible, .lightbox-nav:focus-visible {
  outline: 2px solid var(--red); outline-offset: 2px;
}
.lightbox-close {
  top: clamp(14px, 4vw, 28px); right: clamp(14px, 4vw, 28px);
  width: 44px; height: 44px; font-size: 16px; z-index: 1;
}
.lightbox-fullscreen {
  top: clamp(14px, 4vw, 28px); right: calc(clamp(14px, 4vw, 28px) + 54px);
  width: 44px; height: 44px; font-size: 15px; z-index: 1;
}
.lightbox-nav {
  top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; font-size: 18px;
}
.lightbox-nav--prev { left: clamp(6px, 2.5vw, 28px); }
.lightbox-nav--next { right: clamp(6px, 2.5vw, 28px); }

@media (max-width: 640px) {
  .lightbox-nav { width: 40px; height: 40px; font-size: 16px; }
  .lightbox-close, .lightbox-fullscreen { width: 38px; height: 38px; }
  .lightbox-fullscreen { right: calc(clamp(14px, 4vw, 28px) + 46px); }
  .lightbox-caption { font-size: 12.5px; gap: 10px; }
}

/* case studies */
.case-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.case-card { background: var(--black); padding: clamp(28px, 3.5vw, 44px); }
.case-index {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--red);
}
.case-card h4 {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.6vw, 28px);
  margin: 10px 0 24px;
}
.case-card dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-text);
  margin-top: 18px;
}
.case-card dt:first-of-type { margin-top: 0; }
.case-card dd {
  margin: 6px 0 0;
  font-size: 14.5px;
  color: var(--off-white);
  line-height: 1.55;
}

/* ============ PROCESS ============ */
.process-chain {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.process-node {
  background: var(--black);
  padding: 28px 22px;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.process-node::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: var(--n-color);
}
.process-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--n-color);
}
.process-node h3 {
  font-family: var(--font-display);
  font-size: 19px;
  margin: 16px 0 12px;
}
.process-node p {
  font-size: 13px;
  color: var(--gray-text);
  line-height: 1.55;
  margin: 0;
}

/* ============ TOOLS ============ */
.tools-list {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 16px;
}
.tools-list li {
  font-family: var(--font-display);
  font-size: clamp(18px, 2.4vw, 26px);
  padding: 10px 22px;
  border: 1px solid var(--line);
  color: var(--gray-text);
  transition: color .25s ease, border-color .25s ease, transform .25s ease;
}
.tools-list li:hover {
  color: var(--off-white);
  border-color: var(--red);
  transform: translateY(-3px);
}

/* ============ CONTACT ============ */
.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(32px, 6vw, 64px);
  align-items: start;
}
.contact-cta {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(40px, 7vw, 84px);
  line-height: 1.02;
  margin: 0;
}
.contact-list { border-top: 1px solid var(--line); }
.contact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 4px;
  border-bottom: 1px solid var(--line);
  transition: padding-left .25s ease, color .25s ease;
}
a.contact-row:hover { color: var(--red); padding-left: 12px; }
.contact-row span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gray-text);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.contact-row strong { font-size: clamp(15px, 1.8vw, 19px); font-weight: 500; }
.contact-row--static:hover { padding-left: 4px; color: var(--off-white); }

/* ============ FOOTER ============ */
.site-footer {
  display: flex;
  justify-content: space-between;
  padding: 24px var(--edge) 32px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--gray-text);
  border-top: 1px solid var(--line);
}

/* ============ SCROLL REVEAL ============ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-media { max-width: 320px; }
  /* About keeps its 2-column composition on tablet, just tighter */
  .about-grid { column-gap: clamp(24px, 4vw, 48px); }
  .about-portrait { width: clamp(200px, 30vw, 300px); }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .carousel-track { --card-h: 320px; }
  .process-chain { grid-template-columns: repeat(3, 1fr); }
  .case-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .education { grid-template-columns: 1fr; }
  .timeline-item { grid-template-columns: 1fr; gap: 8px; }
}

@media (max-width: 640px) {
  .site-header { padding: 18px 20px; }
  /* About collapses to a single column; source order already reads
     title → intro → portrait → professional copy → facts */
  .about-grid { grid-template-columns: 1fr; row-gap: 40px; }
  .about-col--left { gap: 32px; }
  .about-portrait { width: 100%; max-width: 420px; }
  .about-lead p, .about-lead-sub, .about-body p, .about-facts { max-width: none; }
  .skills-grid { grid-template-columns: 1fr; }
  .card { height: auto; width: 78vw; max-width: 320px; }
  .work-block-head { flex-wrap: wrap; row-gap: 10px; }
  .process-chain { grid-template-columns: 1fr; }
  .process-node { min-height: unset; }
  .scroll-cue { display: none; }
  .hero { padding-top: 90px; }
}

/* ============ RENDER COST: OFF-SCREEN SECTIONS ============
   content-visibility lets the browser skip layout/paint work for sections
   far from the viewport (a lot of this page is images/video below the fold).
   contain-intrinsic-size reserves an approximate box so scrollbar height and
   scroll-anchoring stay stable before each section has ever been rendered. */
#experience, #work, #process {
  content-visibility: auto;
  contain-intrinsic-height: 1600px;
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .marquee-track { animation: none; }
  .reveal { opacity: 1; transform: none; }
  .card:hover img, .card:hover video { transform: none; }
  .cursor-dot, .cursor-ring { display: none; }
}
