@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

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

:root {
  --ink:  #111;
  --bg:   #f3f1ee;
  --gap:  3px;
  --nav-h: 60px;
  --t: 0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Proxima Nova', 'Montserrat', sans-serif;
  animation: page-fade-in 0.35s ease both;
}

@keyframes page-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  body { animation: none !important; }
}

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 3.6rem;
  background: var(--bg);
  border-bottom: 1px solid rgba(0,0,0,0.08);
  transition: background 0.4s ease, border-color 0.4s ease;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.logo-symbol {
  height: 20px;
  width: auto;
  display: block;
  flex-shrink: 0;
}
.logo-wordmark-clip {
  display: block;
  overflow: hidden;
  line-height: 0;
}
.logo-wordmark {
  height: 14px;
  width: auto;
  display: block;
  animation: logo-wordmark-in 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.8s both;
}
@keyframes logo-wordmark-in {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .logo-wordmark { animation: none; }
}
.nav-links {
  display: flex; gap: 1.6rem; list-style: none;
}
.nav-links a {
  font-size: 0.65rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink);
  text-decoration: none; opacity: 0.5;
  transition: opacity 0.2s;
}
.nav-links a:hover { opacity: 1; }

/* ── HEADER ── */
header {
  padding: calc(var(--nav-h) + 2.5rem) 3.6rem 2rem;
}
header h1 {
  font-size: clamp(1.35rem, 3.5vw, 2.2rem);
  font-weight: 700; line-height: 1.22;
  letter-spacing: -0.015em; max-width: 580px;
}
header p {
  margin-top: 0.8rem;
  font-size: 0.8rem; line-height: 1.75;
  color: #666; max-width: 400px;
}

/* ── MOSAIC ── */
.mosaic {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  background: var(--bg);
  padding: 0;
  margin: calc(var(--nav-h) + 2rem) 3.6rem 0;
}

/* Mobile: 2 columnas */
@media (max-width: 600px) {
  .mosaic {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── TILE ── */
.tile {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  background: #1a1a1a;
}

/* Grain */
.tile::after {
  content: '';
  position: absolute; inset: 0; z-index: 5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.04; pointer-events: none; mix-blend-mode: overlay;
}

/* Images */
.tile img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  transition: opacity var(--t), transform var(--t);
  will-change: opacity, transform;
}

/* Home: bw/color pair */
.tile .img-bw    { object-fit: cover; object-position: center; opacity: 1; z-index: 1; transform: scale(1.0); }
.tile .img-color { object-fit: cover; object-position: center; opacity: 0; z-index: 2; transform: scale(1.035); }

/* Project: detail/full pair */
.img-detail { object-fit: cover;    object-position: center; opacity: 1; z-index: 2; }
.img-full   { object-fit: contain;  object-position: center; opacity: 0; z-index: 1; }

/* Hover — solo desktop */
@media (hover: hover) {
  .tile:hover .img-bw    { opacity: 0;   transform: scale(1.035); }
  .tile:hover .img-color { opacity: 1;   transform: scale(1.035); }
  .tile:hover .tile-label { opacity: 1; transform: translateY(0); }
}

/* ── LABEL ── */
.tile-label {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 10;
  padding: 3rem 1.1rem 0.9rem;
  background: linear-gradient(to top, rgba(0,0,0,0.65), transparent);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.28s ease, transform 0.28s ease;
  pointer-events: none;
}
.tile-label span {
  font-size: 0.62rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: #fff; font-weight: 600;
}

/* ── TEXTO TILE ── */
.tile-text {
  aspect-ratio: 1 / 1;
  background: var(--ink);
  display: flex; flex-direction: column;
  justify-content: flex-end; padding: 1.4rem;
}
.tile-text .t-eyebrow {
  font-family: 'Proxima Nova', 'Montserrat', sans-serif;
  font-size: 0.58rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: rgba(255,255,255,0.35);
  margin-bottom: 0.5rem;
}
.tile-text .t-num {
  font-size: 3rem; font-weight: 800; line-height: 1;
  letter-spacing: -0.04em; color: #fff;
}
.tile-text .t-desc {
  font-size: 0.65rem; line-height: 1.6;
  color: rgba(255,255,255,0.4); margin-top: 0.5rem;
}
.tile-text .t-cta {
  display: inline-block; margin-top: 1.2rem;
  font-size: 0.6rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: rgba(255,255,255,0.6);
  text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.2);
  padding-bottom: 0.15rem; transition: color 0.2s, border-color 0.2s;
}
.tile-text .t-cta:hover { color: #fff; border-color: #fff; }

/* Mobile: reveal al scroll */
@media (hover: none) {
  .tile.revealed .img-bw    { opacity: 0; transform: scale(1.035); }
  .tile.revealed .img-color { opacity: 1; transform: scale(1.035); }
  .tile.revealed .tile-label { opacity: 1; transform: translateY(0); }
}

/* ── FOOTER ── */
footer {
  padding: 1.8rem 3.6rem;
  display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid rgba(0,0,0,0.1);
  margin-top: 3rem;
}
footer small {
  font-size: 0.6rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: #aaa;
}
footer a { color: #aaa; text-decoration: none; }

/* ── BACK TO PROJECTS LINK ── */

/* Clip wrapper — clips the inner span animation, harmless without JS */
body.project footer small:last-child {
  display: inline-block;
  overflow: hidden;
  vertical-align: middle;
}

/* Base state — always fully visible, no hidden state here */
.back-to-projects {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  opacity: 0.78;
  transition: opacity 0.22s ease;
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0;
}

/* Arrow shown in no-JS fallback */
.back-to-projects::before {
  content: '←\00a0';
  display: inline-block;
}

.back-to-projects:hover { opacity: 1; }

/* JS-initialized: ::before replaced by the inner span which includes the arrow */
.back-to-projects.has-reveal-animation::before {
  display: none;
}

/* Inner span starts hidden only after JS sets .has-reveal-animation */
.back-to-projects.has-reveal-animation .back-inner {
  display: inline-block;
  transform: translateX(110%);
}

/* Reveal — triggered by IntersectionObserver adding .is-revealed */
.back-to-projects.has-reveal-animation.is-revealed .back-inner {
  animation: back-link-in 1.1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s both;
}

@keyframes back-link-in {
  from { transform: translateX(110%); }
  to   { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .back-to-projects.has-reveal-animation .back-inner {
    transform: translateX(0);
    animation: none;
  }
}

/* ── PROJECT PAGES ── */

.nav-back {
  font-size: 0.65rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink);
  text-decoration: none; opacity: 0.5; transition: opacity 0.2s;
}
.nav-back:hover { opacity: 1; }

body.project header {
  padding: calc(var(--nav-h) + 3rem) 3.6rem 0;
}
.eyebrow {
  font-size: 0.62rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: #999; margin-bottom: 0.6rem;
}
.meta {
  display: flex; gap: 2.5rem; margin-top: 2rem;
  padding-top: 1.5rem; border-top: 1px solid rgba(0,0,0,0.1);
}
.meta-item  { display: flex; flex-direction: column; gap: 0.25rem; }
.meta-label { font-size: 0.58rem; letter-spacing: 0.2em; text-transform: uppercase; color: #999; }
.meta-value { font-size: 0.8rem; font-weight: 500; }
.desc {
  max-width: 560px; margin-top: 2rem; padding-bottom: 2.5rem;
  font-size: 0.85rem; line-height: 1.8; color: #555;
}

/* Project tile overrides */
body.project .tile { cursor: zoom-in; background: #0c0c0c; }
.tile.empty         { cursor: default; }

/* Project hover */
@media (hover: hover) {
  body.project .tile:not(.empty):hover .img-detail { opacity: 0; }
  body.project .tile:not(.empty):hover .img-full   { opacity: 1; }
  body.project .tile:not(.empty):hover .tile-label { opacity: 1; transform: translateY(0); }
}

/* Project mobile reveal */
@media (hover: none) {
  body.project .tile.revealed .img-detail { opacity: 0; }
  body.project .tile.revealed .img-full   { opacity: 1; }
  body.project .tile.revealed .tile-label { opacity: 1; transform: translateY(0); }
}

/* ── LIGHTBOX ── */
.lightbox {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6,6,6,0.94);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease; backdrop-filter: blur(12px);
}
.lightbox.active { opacity: 1; pointer-events: all; }
.lb-inner {
  position: relative; width: min(88vw,1200px);
  display: flex; flex-direction: column; align-items: center;
  transform: translateY(10px);
  transition: transform 0.32s cubic-bezier(0.25,0.46,0.45,0.94);
}
.lightbox.active .lb-inner { transform: translateY(0); }
.lb-inner img { width: 100%; height: auto; max-height: 82vh; object-fit: contain; display: block; }
.lb-meta { display: flex; justify-content: space-between; width: 100%; margin-top: 0.9rem; }
.lb-label   { font-size: 0.58rem; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255,255,255,0.35); }
.lb-counter { font-size: 0.58rem; color: rgba(255,255,255,0.25); }
.lb-close {
  position: fixed; top: 1.2rem; right: 1.4rem; z-index: 501;
  width: 38px; height: 38px; border-radius: 50%;
  border: none; background: rgba(255,255,255,0.1); color: #fff;
  font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.lb-close:hover { background: rgba(255,255,255,0.2); }
.lb-prev, .lb-next {
  position: fixed; top: 50%; transform: translateY(-50%); z-index: 501;
  width: 44px; height: 44px; border-radius: 50%;
  border: none; background: rgba(255,255,255,0.08); color: #fff;
  font-size: 1.5rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.lb-prev { left: 1rem; }
.lb-next { right: 1rem; }
.lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,0.18); }

/* ── COMING SOON BANNER ── */
.coming-soon {
  margin: 3rem 1.8rem 1rem; padding: 1rem 1.4rem;
  border: 1px solid rgba(0,0,0,0.1);
  display: flex; align-items: center; gap: 0.9rem;
}
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #f59e0b; flex-shrink: 0; animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.2; } }
.coming-soon p {
  font-size: 0.68rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: #888;
}

/* ── LOGO TILE (project pages) ── */
.tile-logo {
  aspect-ratio: 1/1; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  cursor: default;
}

/* ── ABOUT PAGE ── */

.nav-links a.active {
  opacity: 1;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
}

/* Page container */
.about-page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 3.6rem;
}

/* Shared two-column grid — hero and What I do use identical columns.
   --left-col is set by JS on .about-page-wrap once the bio height is known. */
.about-two-col {
  display: grid;
  grid-template-columns: var(--left-col, minmax(340px, 460px)) minmax(0, 1fr);
  column-gap: 72px;
  align-items: start;
}


/* Slogan — single-line centered statement above the hero */
.about-slogan {
  padding-top: calc(var(--nav-h) + 3.5rem);
  padding-bottom: 3rem;
  text-align: center;
  white-space: nowrap;
  font-size: clamp(0.95rem, 1.6vw, 1.18rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.5;
  letter-spacing: 0.015em;
  color: #555;
}

/* Hero */
.about-hero {
  padding-top: 0;
  padding-bottom: 4rem;
}

.about-portrait {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center top;
  display: block;
  filter: grayscale(100%);
}

.about-bio h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.6rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 1.8rem;
}

.about-bio p {
  font-size: 0.875rem;
  line-height: 1.95;
  color: #555;
}

.about-bio p + p { margin-top: 1.35rem; }

/* Divider */
.about-divider {
  height: 1px;
  background: rgba(0,0,0,0.08);
}

/* What I do */
.what-i-do {
  padding: 3rem 0;
}

.section-label {
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 2rem;
}

/* 5-column tab row */
.skill-tab-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid rgba(0,0,0,0.1);
}

.skill-tab {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.2rem 1.2rem 1.4rem;
  cursor: pointer;
  user-select: none;
  box-shadow: inset 0 -2px 0 transparent;
  transition: box-shadow 0.25s ease;
}

.skill-tab.is-cycling,
.skill-tab:hover {
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.75);
}

.skill-tab-name {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--ink);
  opacity: 0.5;
  line-height: 1.4;
  transition: opacity 0.25s ease;
}

.skill-tab.is-cycling .skill-tab-name,
.skill-tab:hover .skill-tab-name {
  opacity: 1;
  font-weight: 600;
}

.skill-arrow {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.5;
  transform: rotate(0deg) translateY(0);
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.25s ease;
  color: var(--ink);
}

.skill-tab.is-cycling .skill-arrow,
.skill-tab:hover .skill-arrow {
  /* rotate(90deg) then translateX(4px) = visual downward nudge of 4px */
  transform: rotate(90deg) translateX(4px);
  opacity: 1;
}

/* Full-width preview area */
.skill-preview-full {
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  background: rgba(0,0,0,0.04);
  overflow: hidden;
}

.skill-preview-img,
.skill-preview-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

/* Zoom the 3D modeling video to crop baked-in black bars */
.skill-preview-video[data-key="advanced-3d-modeling"] {
  transform: scale(1.18);
  transform-origin: center center;
}

.skill-preview-img.is-active,
.skill-preview-video.is-active {
  opacity: 1;
}

@keyframes skill-img-zoom {
  from { transform: scale(1); }
  to   { transform: scale(1.12); }
}

.skill-preview-img.is-active {
  animation: skill-img-zoom 8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@media (prefers-reduced-motion: reduce) {
  .skill-preview-img.is-active {
    animation: none;
  }
}

/* Selected Collabs */
.selected-collabs {
  padding: 4rem 0;
}

.collabs-header {
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 600;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  margin-bottom: 0;
}

.logo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: 2rem;
}

.logo-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.4rem 1.6rem;
}

.logo-cell img {
  max-width: 400px;
  max-height: 120px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  filter: grayscale(100%);
  opacity: 0.55;
  transition: opacity 0.22s ease;
}

.logo-cell img:hover { opacity: 0.9; }

/* About responsive */
@media (max-width: 860px) {
  .about-page-wrap {
    padding: 0 1.8rem;
    --left-col: 1fr; /* neutralise JS-set variable on mobile */
  }

  .about-two-col {
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 2.4rem;
    align-items: start; /* both sections stack, no stretching needed */
  }

  .what-i-do { align-items: start; }

  .about-slogan {
    padding-top: calc(var(--nav-h) + 2rem);
    padding-bottom: 2rem;
    white-space: normal;
    font-size: 0.95rem;
    line-height: 1.65;
    max-width: 560px;
    margin: 0 auto;
  }

  .about-hero {
    padding-top: 0;
    padding-bottom: 3rem;
  }

  .about-portrait { max-width: 280px; }

  .skill-tab-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .skill-tab:nth-child(n+3) {
    border-top: 1px solid rgba(0,0,0,0.08);
  }

  .skill-preview-full {
    aspect-ratio: 4 / 3;
  }

  .selected-collabs { padding: 3rem 0; }

  .logo-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 440px) {
  .logo-cell { padding: 1.2rem 1rem; }
  .logo-cell img { max-height: 60px; max-width: 160px; }
}

/* ── CONTACT PAGE ── */

/* Ken Burns keyframes — also used by the homepage hero slideshow */
@keyframes contact-kb-in {
  from { transform: scale(1);    }
  to   { transform: scale(1.12); }
}
@keyframes contact-kb-out {
  from { transform: scale(1.12); }
  to   { transform: scale(1);    }
}

/* Scene: full-viewport flex container */
.contact-scene {
  display: flex;
  align-items: center;
  min-height: 100vh;
  padding: calc(var(--nav-h) + 3rem) 6vw 4rem;
  overflow: hidden;
}

/* Stage: two-column layout */
.contact-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: min(8rem, 10vw);
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

/* Contact text block — left column */
.contact-block {
  flex: 0 1 380px;
}

.contact-title {
  font-size: clamp(2rem, 3.2vw, 2.6rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 1.3rem;
}

.contact-text {
  font-size: 0.875rem;
  line-height: 1.9;
  color: #777;
  margin-bottom: 2.2rem;
}

/* Links */
.contact-links {
  display: flex;
  flex-direction: column;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  opacity: 0.55;
  transition: opacity 0.22s ease, border-color 0.22s ease;
}
.contact-link:first-child { border-top: 1px solid rgba(0,0,0,0.1); }

.contact-link::after {
  content: '→';
  margin-left: 0.6em;
  display: inline-block;
  transition: transform 0.22s ease;
}

.contact-link:hover { opacity: 1; border-color: rgba(0,0,0,0.28); }
.contact-link:hover::after { transform: translateX(4px); }

/* PIRCA symbol — right column */
.contact-symbol-wrap {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-pirca-symbol {
  width: clamp(72px, 9vw, 110px);
  height: auto;
  display: block;
}

/* Mobile: stack vertically */
@media (max-width: 700px) {
  .contact-scene {
    padding: calc(var(--nav-h) + 2.5rem) 1.8rem 3rem;
    align-items: flex-start;
  }

  .contact-stage {
    flex-direction: column;
    align-items: flex-start;
    gap: 2.5rem;
  }

  .contact-symbol-wrap {
    order: -1;
    align-self: center;
  }

  .contact-pirca-symbol { width: clamp(52px, 16vw, 72px); }
  .contact-title { font-size: clamp(1.8rem, 7vw, 2.4rem); }
}

/* ── HOMEPAGE ── */

/* Nav: transparent white over the dark hero */
body.home-page:not(.scrolled-past-hero) nav {
  background: linear-gradient(to bottom, rgba(0,0,0,0.45) 0%, transparent 100%);
  border-bottom-color: transparent;
}
body.home-page:not(.scrolled-past-hero) .logo,
body.home-page:not(.scrolled-past-hero) .nav-links a {
  color: #fff;
}
body.home-page:not(.scrolled-past-hero) .logo-symbol,
body.home-page:not(.scrolled-past-hero) .logo-wordmark {
  filter: brightness(0) invert(1);
}

/* Hero section */
.home-hero {
  position: relative;
  height: 100vh;
  overflow: hidden;
  background: #111;
}

.home-slideshow {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.home-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 1.2s ease;
  will-change: opacity, transform;
}
.home-slide.active { opacity: 1; }

.home-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    108deg,
    rgba(0,0,0,0.55) 0%,
    rgba(0,0,0,0.28) 50%,
    rgba(0,0,0,0.10) 100%
  );
}

/* Scroll cue — bottom center */
.home-scroll-cue {
  position: absolute;
  bottom: 2.4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  color: rgba(255,255,255,0.45);
}

.home-scroll-label {
  font-size: 0.55rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.home-scroll-line {
  width: 1px;
  height: 40px;
  background: rgba(255,255,255,0.28);
  transform-origin: top center;
  animation: heroScrollPulse 2.2s ease-in-out infinite;
}

/* Mosaic on homepage: edge-to-edge, flush below hero */
body.home-page .mosaic {
  gap: 2px;
  margin: 0;
}

/* ── PROJECT HERO ── */

body.has-hero nav {
  background: linear-gradient(to bottom, rgba(0,0,0,0.45) 0%, transparent 100%);
  border-bottom: none;
}
body.has-hero .logo,
body.has-hero .nav-links a {
  color: #fff;
}
body.has-hero .logo-symbol,
body.has-hero .logo-wordmark {
  filter: brightness(0) invert(1);
}
body.has-hero .nav-links a.active {
  border-bottom-color: rgba(255,255,255,0.6);
}

.project-hero {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  background: #111;
}

/* Slides container */
.hero-slides {
  position: absolute;
  inset: 0;
}

/* Individual slide */
.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.4s ease;
  will-change: opacity, transform;
}
.hero-slide.active {
  opacity: 1;
  /* Ken Burns applied via JS so it restarts cleanly on each transition */
}

@keyframes heroKenBurns {
  from { transform: scale(1);    }
  to   { transform: scale(1.06); }
}
@keyframes heroKenBurnsOut {
  from { transform: scale(1.06); }
  to   { transform: scale(1);    }
}

/* Bottom gradient for text legibility — z-index 3 keeps it above slides (max z-index 2 via JS) */
.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.85) 0%,
    rgba(0,0,0,0.5)  35%,
    rgba(0,0,0,0.12) 62%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 3;
}

/* Text block — lower-left */
.hero-content {
  position: relative;
  z-index: 4;
  padding: 0 4rem 5rem;
  max-width: 620px;
  color: #fff;
}

/* Soft local dark wash behind the text area */
.hero-content::before {
  content: '';
  position: absolute;
  inset: -5rem -6rem -3rem -4rem;
  background: radial-gradient(
    ellipse at 15% 85%,
    rgba(0,0,0,0.42) 0%,
    transparent 68%
  );
  pointer-events: none;
  z-index: -1;
}

.hero-eyebrow {
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.5;
  margin-bottom: 0.9rem;
}

.hero-title {
  font-size: clamp(3.4rem, 7.5vw, 6.2rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
}

.hero-meta {
  display: flex;
  gap: 3rem;
  margin-bottom: 1.6rem;
}

.hero-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.hero-meta-label {
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.45;
}

.hero-meta-value {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.hero-desc {
  font-size: 0.875rem;
  line-height: 1.9;
  opacity: 0.8;
  max-width: 100%;
}

/* Scroll cue */
.hero-scroll-cue {
  position: absolute;
  bottom: 2.8rem;
  right: 3.6rem;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  color: rgba(255,255,255,0.4);
}

.hero-scroll-label {
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero-scroll-line {
  width: 1px;
  height: 44px;
  background: rgba(255,255,255,0.25);
  transform-origin: top center;
  animation: heroScrollPulse 2.2s ease-in-out infinite;
}

@keyframes heroScrollPulse {
  0%, 100% { transform: scaleY(1);   opacity: 0.25; }
  50%       { transform: scaleY(0.4); opacity: 0.7;  }
}

/* Projects page — edge-to-edge, flush below nav */
body.projects-page .mosaic {
  gap: 2px;
  margin: var(--nav-h) 0 0;
}

/* Project detail pages — tighter tile gap */
body.project .mosaic {
  gap: 13px;
}

/* Mosaic margin reset when hero is present */
body.has-hero .mosaic {
  margin-top: 2rem;
}

/* Coming-soon — centered and more legible below hero */
body.has-hero .coming-soon {
  margin: 5rem auto 0;
  width: fit-content;
  justify-content: center;
  border-color: rgba(0,0,0,0.15);
}
body.has-hero .coming-soon p {
  font-size: 0.72rem;
  color: #555;
}

/* VR Headset: prevent "VR Headset" wrapping at the space without changing font size */
body.vr-headset .hero-title { white-space: nowrap; }

/* Padlock 701: prevent "Padlock 701" wrapping at the space without changing font size */
body.padlock-701 .hero-title { white-space: nowrap; font-size: clamp(3.06rem, 6.75vw, 5.58rem); }

/* ── PROJECT HERO — RESPONSIVE ── */

@media (max-width: 860px) {
  .hero-content {
    padding: 0 2.4rem 4.5rem;
    max-width: 100%;
  }
  .hero-title { font-size: clamp(2.4rem, 10vw, 3.8rem); }
  .hero-scroll-cue { right: 2.4rem; bottom: 2rem; }
}

@media (max-width: 600px) {
  .hero-content {
    padding: 0 1.8rem 4rem;
  }
  .hero-title { font-size: clamp(2.2rem, 11vw, 3rem); }
  .hero-meta  { gap: 2rem; }
  .hero-desc  { max-width: 100%; font-size: 0.78rem; }
  .hero-scroll-cue { right: 1.8rem; bottom: 1.6rem; }
}

/* ── PROJECT CONTENT GALLERY ── */
.project-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

.gallery-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #0c0c0c;
}

.gallery-tile img,
.gallery-tile video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-tile--wide {
  grid-column: 1 / -1;
  aspect-ratio: 16 / 7;
}

.project-gallery--2col {
  grid-template-columns: repeat(2, 1fr);
}

.project-gallery--2col .gallery-tile {
  aspect-ratio: 16 / 9;
}

.project-gallery--featured {
  grid-template-columns: 1fr 1fr;
}

.project-gallery--featured .gallery-tile {
  aspect-ratio: 16 / 9;
}

.project-gallery--featured .gallery-tile--featured-main {
  grid-column: 1;
  grid-row: 1 / span 2;
  aspect-ratio: unset;
}

@media (max-width: 600px) {
  .project-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
  .gallery-tile--wide {
    grid-column: 1 / -1;
    aspect-ratio: 4 / 3;
  }
  .project-gallery--2col {
    grid-template-columns: 1fr;
  }
  .project-gallery--featured {
    grid-template-columns: 1fr;
  }
  .project-gallery--featured .gallery-tile--featured-main {
    grid-row: span 1;
    aspect-ratio: 16 / 9;
  }
}

/* ── PADLOCK-701 ANALYSIS BOARD ── */
.padlock-analysis-board {
  margin: 5rem 1.8rem 0;
}

.pab-frame {
  position: relative;
  aspect-ratio: 8 / 5;
  background: #111;
  overflow: hidden;
  border-radius: 4px;
}

.pab-base {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pab-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

@media (max-width: 600px) {
  .padlock-analysis-board {
    margin: 3rem 1.2rem 0;
  }
}
