/* Independent Homepage Module (home.html) */

.home-body {
  padding: clamp(20px, 4.5vw, 72px) clamp(16px, 5.5vw, 96px);
}

/* Outer framed dark canvas resting over the low-brightness color-shifting shell */
.page-canvas {
  position: relative;
  z-index: var(--z-canvas);
  width: 100%;
  max-width: var(--canvas-max);
  margin: 0 auto;
  background-color: var(--bg-canvas);
  border: 4px solid #050506;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.55);
  overflow: clip;
}

/* Ambient inner glow echoing the current shell color */
.page-canvas::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    ellipse 70% 42% at 50% 0%,
    var(--shell-glow),
    transparent 70%
  );
}

.page-canvas > * {
  position: relative;
  z-index: 1;
}

/* Sticky Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  height: var(--header-height);
  padding: 0 clamp(20px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(16, 17, 19, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.4s ease, border-color 0.4s ease;
}

.site-header.is-scrolled {
  background: rgba(14, 15, 17, 0.9);
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.home-body:not(.case-body) .site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1.5px;
  background: var(--shell-accent);
  transform: scaleX(var(--home-read-p, 0));
  transform-origin: left center;
  opacity: 0.78;
  pointer-events: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  height: 30px;
  width: auto;
  object-fit: contain;
  transition: transform 0.45s var(--ease-out-expo), filter 0.45s ease;
}

.brand:hover .brand-logo {
  transform: scale(1.06);
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--shell-accent) 45%, transparent));
}

.brand-text {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--ink-primary);
}

.brand-text i {
  font-style: normal;
  color: var(--ink-muted);
  margin: 0 4px;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.8vw, 40px);
}

.nav a {
  position: relative;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--ink-secondary);
  padding: 6px 0;
  transition: color var(--dur-fast) ease;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--shell-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease-out-expo);
}

.nav a:hover,
.nav a:focus-visible,
.nav a.is-active {
  color: var(--ink-primary);
}

.nav a:hover::after,
.nav a:focus-visible::after,
.nav a.is-active::after {
  transform: scaleX(1);
}

.menu-toggle {
  display: none;
  width: 36px;
  height: 36px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  z-index: calc(var(--z-drawer) + 10);
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--ink-primary);
  transition: transform 0.35s var(--ease-out-expo), opacity 0.25s ease;
}

.site-header.nav-open .menu-toggle span:first-child {
  transform: translateY(4.25px) rotate(45deg);
}

.site-header.nav-open .menu-toggle span:last-child {
  transform: translateY(-4.25px) rotate(-45deg);
}

/* Shared Section Rhythm */
.section {
  position: relative;
  padding: clamp(88px, 11vw, 152px) clamp(24px, 6.5vw, 108px);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-canvas);
}

/* Hero Section */
.home-hero {
  position: relative;
  min-height: calc(100vh - var(--header-height) - var(--shell-pad-y) * 2);
  min-height: max(620px, calc(100vh - var(--header-height) - var(--shell-pad-y) * 2));
  min-height: max(540px, calc(100svh - var(--header-height) - var(--shell-pad-y) * 2));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(64px, 8vw, 110px) clamp(24px, 6.5vw, 108px) clamp(28px, 3.2vw, 44px);
  overflow: hidden;
  background: #0d0e10;
}

.home-hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  clip-path: inset(6%);
  transform: scale(calc(1 + var(--p, 0) * 0.15)) translateY(calc(var(--p, 0) * 10%));
  transition: clip-path 1.6s cubic-bezier(0.77, 0, 0.18, 1);
  will-change: transform, clip-path;
}

html.is-ready .home-hero-media {
  clip-path: inset(0);
}

.home-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  animation: heroBreathe 18s ease-in-out infinite alternate;
}

.home-hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    112deg,
    transparent 30%,
    rgba(255, 255, 255, 0.11) 50%,
    transparent 70%
  );
  transform: translateX(-125%);
}

html.is-ready .home-hero-media::after {
  animation: heroSheen 1.9s var(--ease-out-expo) 0.45s forwards;
}

@keyframes heroSheen {
  to {
    transform: translateX(125%);
  }
}

@keyframes heroBreathe {
  from {
    transform: scale(1.03);
  }
  to {
    transform: scale(1.09);
  }
}

.home-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(12, 13, 15, 0.34) 0%, rgba(12, 13, 15, 0.42) 45%, rgba(12, 13, 15, 0.88) 100%),
    linear-gradient(90deg, rgba(12, 13, 15, 0.72) 0%, rgba(12, 13, 15, 0.25) 58%, transparent 100%);
}

.home-hero-copy {
  position: relative;
  z-index: 2;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-bottom: clamp(44px, 6vw, 84px);
  transform: translateY(calc(var(--p, 0) * -90px));
  opacity: calc(1 - var(--p, 0) * 1.4);
  will-change: transform, opacity;
}

.home-hero-copy h1 {
  font-family: var(--font-serif);
  font-size: clamp(44px, 6.2vw, 86px);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: 0.02em;
  color: var(--ink-primary);
}

.home-hero-copy h1 em {
  font-style: normal;
  color: color-mix(in srgb, var(--ink-primary) 86%, var(--shell-accent) 14%);
}

.home-hero-desc {
  max-width: 520px;
  font-size: clamp(15px, 1.25vw, 17px);
  line-height: 1.85;
  color: rgba(241, 238, 232, 0.82);
}

.line-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  align-self: flex-start;
  padding-bottom: 8px;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--ink-primary);
  border-bottom: 1px solid var(--border-strong);
  transition: gap 0.35s var(--ease-out-expo), color 0.35s ease;
}

.line-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--shell-accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.45s var(--ease-out-expo);
}

.line-link span {
  color: var(--shell-accent);
  transition: transform 0.35s var(--ease-out-expo);
}

.line-link:hover {
  gap: 20px;
  color: var(--shell-accent);
}

.line-link:hover::after {
  transform: scaleX(1);
}

.line-link:hover span {
  transform: translate(3px, 3px);
}

.home-hero-index {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(241, 238, 232, 0.65);
}

.home-hero-scroll {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.hero-scroll-line {
  display: block;
  width: 1px;
  height: 22px;
  background: linear-gradient(180deg, var(--shell-accent) 0%, transparent 100%);
  transform-origin: top center;
  animation: heroScrollPulse 2.2s ease-in-out infinite;
}

@keyframes heroScrollPulse {
  0%,
  100% {
    transform: scaleY(0.42);
    opacity: 0.45;
  }
  50% {
    transform: scaleY(1);
    opacity: 1;
  }
}

/* Vertical Chinese Title (Two independent columns, right-to-left, never overlaps) */
.vertical-title {
  display: inline-flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  gap: clamp(16px, 2.2vw, 30px);
  font-family: var(--font-serif);
  font-size: clamp(36px, 4.4vw, 66px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: 0.14em;
  color: var(--ink-primary);
}

.vertical-title > span {
  writing-mode: vertical-rl;
  text-orientation: upright;
  display: block;
}

.vertical-title > span:nth-child(2) {
  color: color-mix(in srgb, var(--ink-primary) 72%, var(--shell-accent) 28%);
  margin-top: clamp(24px, 3.4vw, 48px);
  transform: translateY(calc((var(--p, 0.5) - 0.5) * 28px));
  will-change: transform;
}

/* 01 — THE TEAM (Dark architectural surface) */
.intro {
  background:
    radial-gradient(circle at 18% 28%, var(--shell-tan-glow), transparent 52%),
    var(--bg-surface);
}

.intro-grid {
  margin-top: clamp(40px, 5vw, 68px);
  display: grid;
  grid-template-columns: auto minmax(0, 480px);
  justify-content: space-between;
  align-items: start;
  gap: clamp(40px, 6vw, 96px);
}

.intro-copy-col {
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 3.4vw, 44px);
}

.intro-body {
  font-size: clamp(15px, 1.3vw, 17px);
  line-height: 2;
  color: var(--ink-secondary);
  padding-top: clamp(8px, 2vw, 28px);
}

.intro-meta {
  position: relative;
  margin: 0;
  padding-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.intro-meta::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border-subtle);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.95s var(--ease-curtain) 0.18s;
}

.intro-grid.is-visible .intro-meta::before {
  transform: scaleX(1);
}

.intro-meta > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.7s var(--ease-out-expo),
    transform 0.7s var(--ease-out-expo);
}

.intro-meta > div:nth-child(1) { transition-delay: 0.2s; }
.intro-meta > div:nth-child(2) { transition-delay: 0.3s; }
.intro-meta > div:nth-child(3) { transition-delay: 0.4s; }

.intro-grid.is-visible .intro-meta > div {
  opacity: 1;
  transform: none;
}

.intro-meta dt {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--ink-muted);
}

.intro-meta dd {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--ink-primary);
}

/* Strong Visual Transition Band */
.transition-band {
  position: relative;
  min-height: clamp(420px, 62vh, 660px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-top: 1px solid var(--border-subtle);
  background: #0d0e10;
}

.transition-band-image {
  position: absolute;
  inset: -12% 0;
  z-index: 0;
}

.transition-band-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.68) contrast(1.06);
  transform: scale(calc(1.3 - var(--p, 0) * 0.25)) translateY(calc((var(--p, 0) - 0.5) * -60px));
  will-change: transform;
}

.transition-band-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(16, 17, 19, 0.64) 0%, rgba(16, 17, 19, 0.34) 50%, rgba(16, 17, 19, 0.76) 100%);
}

.transition-band-copy {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.transition-band-copy::before,
.transition-band-copy::after {
  content: "";
  width: 64px;
  height: 1px;
  background: var(--shell-accent);
  opacity: 0.65;
  transform-origin: center center;
  transform: scaleX(0);
  transition: transform 0.9s var(--ease-curtain) 0.15s;
}

.transition-band-copy.is-visible::before,
.transition-band-copy.is-visible::after {
  transform: scaleX(1);
}

.transition-band-copy p {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--shell-accent);
}

.transition-band-copy h2 {
  font-family: var(--font-serif);
  font-size: clamp(48px, 7.6vw, 108px);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: 0.04em;
  color: var(--ink-primary);
}

.band-line {
  display: block;
  will-change: transform;
}

.band-line--a {
  transform: translateX(calc((var(--p, 0) - 0.5) * -14vw));
}

.band-line--b {
  transform: translateX(calc((var(--p, 0) - 0.5) * 14vw));
}

.transition-band-copy h2 em {
  font-style: normal;
  color: rgba(241, 238, 232, 0.86);
}

.transition-band-copy > span {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: rgba(241, 238, 232, 0.62);
  margin-top: 12px;
  animation: bandFloat 2.6s ease-in-out infinite;
}

@keyframes bandFloat {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.6;
  }
  50% {
    transform: translateY(4px);
    opacity: 0.95;
  }
}

/* 02 — SELECTED WORK (Architectural Exhibition Gallery & Stacked Archive) */
.work {
  background:
    radial-gradient(circle at 82% 24%, var(--shell-cyan-glow), transparent 48%),
    var(--bg-canvas);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: clamp(44px, 5.5vw, 76px);
}

.section-count {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--shell-accent);
  font-variant-numeric: tabular-nums;
}

.project-stack {
  display: flex;
  flex-direction: column;
  gap: clamp(56px, 7.5vw, 108px);
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: transform 0.6s var(--ease-out-expo);
}

.project-card--large {
  width: 100%;
}

.project-card--offset {
  width: min(82%, 940px);
  margin-left: auto;
}

.project-card--small {
  width: min(76%, 860px);
  margin-right: auto;
}

/* Primary Image Stage */
.project-media {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--bg-surface);
  border: 3px solid #050506;
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.5);
  clip-path: inset(18% 0 0 0);
  transition:
    clip-path 1.3s cubic-bezier(0.77, 0, 0.18, 1),
    border-color 0.45s ease,
    box-shadow 0.55s var(--ease-out-expo);
}

.project-card.is-visible .project-media {
  clip-path: inset(0);
}

.project-card--large .project-media {
  aspect-ratio: 16 / 9;
}

.project-card--offset .project-media {
  aspect-ratio: 16 / 10;
}

.project-card--small .project-media {
  aspect-ratio: 16 / 10;
}

/* Crisp inner editorial inset frame appearing on hover */
.project-media::before {
  content: "";
  position: absolute;
  inset: 12px;
  z-index: 3;
  border: 1px solid rgba(241, 238, 232, 0.2);
  opacity: 0;
  transform: scale(1.015);
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.65s var(--ease-out-expo);
}

.project-card:hover .project-media::before,
.project-card:focus-within .project-media::before {
  opacity: 1;
  transform: scale(1);
}

.project-media-inner {
  position: absolute;
  inset: 0;
  overflow: hidden;
  transition: transform 0.9s var(--ease-out-expo);
}

.project-media-inner::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 26%,
    rgba(255, 255, 255, 0.13) 50%,
    transparent 74%
  );
  transform: translateX(-130%);
  transition: transform 0.85s var(--ease-out-expo);
}

.project-card:hover .project-media-inner::after {
  transform: translateX(130%);
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translateY(calc((var(--p, 0) - 0.5) * -8%)) scale(1.12);
  will-change: transform;
}

.project-media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(10, 11, 13, 0.36) 0%, transparent 26%, transparent 45%, rgba(10, 11, 13, 0.88) 100%);
}

.project-card:hover .project-media {
  border-color: #050506;
  box-shadow: 0 36px 84px rgba(0, 0, 0, 0.62);
}

.project-card:hover .project-media-inner {
  transform: scale(1.045);
}

/* Top Architectural HUD Bar inside Frame */
.project-hud {
  position: absolute;
  top: 20px;
  left: 24px;
  right: 24px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-10px);
  transition:
    opacity 0.75s var(--ease-out-expo) 0.25s,
    transform 0.75s var(--ease-out-expo) 0.25s;
}

.project-card.is-visible .project-hud {
  opacity: 1;
  transform: none;
}

.project-pill {
  padding: 5px 11px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 11, 13, 0.58);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 11px;
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
  color: var(--ink-primary);
}

.project-hud-code {
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(241, 238, 232, 0.72);
}

.project-hud-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--card-accent, var(--shell-accent)) 45%, rgba(255, 255, 255, 0.2));
  background: rgba(10, 11, 13, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--card-accent, var(--shell-accent));
  opacity: 0.78;
  transform: translateY(0);
  transition:
    opacity 0.35s ease,
    transform 0.45s var(--ease-out-expo),
    background-color 0.35s ease;
}

.project-hud-action i {
  font-style: normal;
  transition: transform 0.35s var(--ease-out-expo);
}

.project-card:hover .project-hud-action,
.project-card:focus-within .project-hud-action {
  opacity: 1;
  background: rgba(10, 11, 13, 0.86);
}

.project-card:hover .project-hud-action i {
  transform: translate(2px, -2px);
}

/* Bottom Editorial Overlay inside Frame */
.project-caption {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 24px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.8s var(--ease-out-expo) 0.32s,
    transform 0.8s var(--ease-out-expo) 0.32s;
}

.project-card.is-visible .project-caption {
  opacity: 1;
  transform: none;
}

.project-caption-top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(241, 238, 232, 0.78);
  font-variant-numeric: tabular-nums;
}

.project-caption-top::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--card-accent, var(--shell-accent));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.65s var(--ease-out-expo);
}

.project-card:hover .project-caption-top::after,
.project-card:focus-within .project-caption-top::after {
  transform: scaleX(1);
}

.project-caption-main {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.project-caption-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.project-caption-titles h3 {
  font-family: var(--font-serif);
  font-size: clamp(24px, 2.5vw, 36px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.05em;
  color: var(--ink-primary);
  transition: letter-spacing 0.45s var(--ease-out-expo), color 0.35s ease;
}

.project-card:hover .project-caption-titles h3 {
  letter-spacing: 0.1em;
  color: var(--card-accent, var(--shell-accent));
}

.project-caption-sub {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(8px);
  font-size: 13px;
  line-height: 1.65;
  color: rgba(241, 238, 232, 0.84);
  transition:
    max-height 0.55s var(--ease-out-expo),
    opacity 0.45s ease,
    transform 0.55s var(--ease-out-expo),
    margin-top 0.45s ease;
}

.project-card:hover .project-caption-sub,
.project-card:focus-within .project-caption-sub {
  max-height: 60px;
  opacity: 1;
  transform: translateY(0);
  margin-top: 8px;
}

.project-caption-en {
  flex-shrink: 0;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--card-accent, var(--shell-accent));
  opacity: 0.86;
}

.project-link {
  position: absolute;
  inset: 0;
  z-index: 4;
}

/* Folded Archive Deck & Expandable 2-Column Magazine Grid */
.project-card--extra {
  display: none;
}

.work.is-expanded .project-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 3vw, 44px);
  align-items: start;
}

.work.is-expanded .project-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-left: 0;
}

.work.is-expanded .project-aside {
  display: none;
}

.work.is-expanded .project-card--extra {
  display: flex;
}

.work.is-expanded .project-media {
  aspect-ratio: 16 / 10.6;
}

.work.is-expanded .project-hud-code {
  display: none;
}

.work.is-expanded .project-caption-titles h3 {
  font-size: clamp(20px, 1.9vw, 28px);
}

@media (min-width: 769px) {
  .work.is-expanded .project-stack {
    padding-bottom: clamp(28px, 3.6vw, 56px);
  }

  .work.is-expanded .project-card:nth-child(even) {
    margin-top: clamp(28px, 3.6vw, 56px);
  }
}

.project-card--extra.project-card--entering {
  opacity: 0;
  transform: translateY(38px);
}

.project-card--extra.project-card--entering .project-media {
  clip-path: inset(18% 0 0 0);
}

.project-card--extra.project-card--entering.is-revealed {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.72s var(--ease-out-expo),
    transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card--extra.project-card--entering.is-revealed .project-media {
  clip-path: inset(0);
  transition:
    clip-path 0.95s cubic-bezier(0.16, 1, 0.3, 1) 0.08s,
    border-color 0.45s ease,
    box-shadow 0.55s var(--ease-out-expo);
}

.work-fold {
  margin-top: clamp(56px, 6.5vw, 92px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.work-fold-peek {
  position: relative;
  width: min(84%, 920px);
  height: clamp(132px, 14vw, 176px);
  margin-bottom: -24px;
  overflow: hidden;
  border: 2px solid #050506;
  border-bottom: 0;
  background: var(--bg-surface);
  cursor: pointer;
  transform: scale(0.975);
  transform-origin: bottom center;
  opacity: 0.94;
  box-shadow:
    0 -10px 0 -4px rgba(28, 30, 35, 0.9),
    0 -11px 0 -3px rgba(255, 255, 255, 0.08),
    0 -24px 54px rgba(0, 0, 0, 0.42);
  transition:
    height 0.65s var(--ease-out-expo),
    margin-bottom 0.65s var(--ease-out-expo),
    opacity 0.45s ease,
    transform 0.65s var(--ease-out-expo),
    box-shadow 0.45s ease;
}

.work-fold-peek:hover {
  opacity: 1;
  border-color: color-mix(in srgb, var(--shell-accent) 48%, #050506);
  transform: scale(0.99) translateY(-6px);
  box-shadow:
    0 -14px 0 -4px rgba(34, 37, 43, 0.95),
    0 -15px 0 -3px color-mix(in srgb, var(--shell-accent) 40%, transparent),
    0 -28px 64px rgba(0, 0, 0, 0.54);
}

.work-fold-peek img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
  filter: brightness(0.62) saturate(0.92);
  transform: scale(1.04);
  transition: transform 0.8s var(--ease-out-expo), filter 0.45s ease;
}

.work-fold-peek:hover img {
  transform: scale(1.08);
  filter: brightness(0.78) saturate(1);
}

.work-fold-peek::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(16, 17, 19, 0.2) 0%,
    rgba(16, 17, 19, 0.65) 58%,
    var(--bg-canvas) 100%
  );
}

.work-fold-peek-meta {
  position: absolute;
  top: 18px;
  left: 24px;
  right: 24px;
  z-index: 3;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 16px;
  pointer-events: none;
}

.work-fold-peek-tag {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--shell-accent);
}

.work-fold-peek-title {
  font-family: var(--font-serif);
  font-size: clamp(18px, 1.8vw, 24px);
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--ink-primary);
}

.work-fold-peek-info {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(241, 238, 232, 0.72);
}

.work.is-expanded .work-fold-peek {
  height: 0;
  margin-bottom: 0;
  opacity: 0;
  border-width: 0;
  box-shadow: none;
  transform: translateY(-16px) scale(0.94);
  pointer-events: none;
}

.work-fold-bar {
  position: relative;
  z-index: 3;
  width: 100%;
  display: flex;
  align-items: center;
  gap: clamp(16px, 2.5vw, 32px);
}

.work-fold-bar::before,
.work-fold-bar::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.work-expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 14px 28px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: color-mix(in srgb, var(--bg-surface) 88%, var(--shell-accent) 12%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ink-primary);
  font-size: 13px;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition:
    border-color 0.35s ease,
    background-color 0.35s ease,
    transform 0.45s var(--ease-out-expo),
    box-shadow 0.45s var(--ease-out-expo);
}

.work-expand-btn:hover,
.work-expand-btn:focus-visible {
  border-color: var(--shell-accent);
  background: color-mix(in srgb, var(--bg-surface) 76%, var(--shell-accent) 24%);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.38),
    0 0 24px color-mix(in srgb, var(--shell-accent) 18%, transparent);
}

.work-expand-meta {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--shell-accent);
  font-variant-numeric: tabular-nums;
}

.work-expand-arrow {
  display: inline-block;
  font-size: 14px;
  line-height: 1;
  transition: transform 0.55s var(--ease-out-expo);
}

.work-expand-btn:hover .work-expand-arrow {
  transform: translateY(3px);
}

.work.is-expanded .work-expand-arrow {
  transform: rotate(180deg);
}

.work.is-expanded .work-expand-btn:hover .work-expand-arrow {
  transform: rotate(180deg) translateY(3px);
}

.project-link:focus-visible {
  outline: 1px solid var(--shell-accent);
  outline-offset: -6px;
}

/* 03 — OUR PROCESS */
.approach {
  background:
    radial-gradient(circle at 14% 72%, var(--shell-red-glow), transparent 52%),
    var(--bg-surface);
}

.approach-grid {
  margin-top: clamp(40px, 5vw, 68px);
  display: grid;
  grid-template-columns: auto minmax(0, 620px);
  justify-content: space-between;
  align-items: start;
  gap: clamp(40px, 6vw, 96px);
}

.principles {
  display: flex;
  flex-direction: column;
}

.principle-item {
  position: relative;
  padding: clamp(26px, 3vw, 38px) 16px;
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px 24px;
  transition:
    transform 0.45s var(--ease-out-expo),
    border-color 0.4s ease,
    background-color 0.45s ease;
}

.principle-item::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--shell-accent);
  transform-origin: top center;
  transform: scaleY(0);
  transition: transform 0.45s var(--ease-out-expo);
}

.principle-item:last-child {
  border-bottom: 1px solid var(--border-subtle);
}

.principle-item:hover {
  transform: translateX(8px);
  border-top-color: var(--shell-accent);
  background-color: rgba(255, 255, 255, 0.024);
}

.principle-item:hover::after {
  transform: scaleY(1);
}

.principle-index {
  grid-row: span 2;
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 1;
  color: var(--shell-accent);
  opacity: 0.72;
  transition:
    opacity 0.35s ease,
    transform 0.45s var(--ease-out-expo),
    text-shadow 0.45s ease;
}

.principle-item:hover .principle-index {
  opacity: 1;
  transform: translateX(4px);
  text-shadow: 0 0 18px color-mix(in srgb, var(--shell-accent) 42%, transparent);
}

.principle-item h3 {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-primary);
  transition: color 0.35s ease;
}

.principle-item:hover h3 {
  color: color-mix(in srgb, var(--ink-primary) 72%, var(--shell-accent) 28%);
}

.principle-item p {
  font-size: 15px;
  line-height: 1.85;
  color: var(--ink-secondary);
}

/* 04 — CONTACT */
.contact {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 72%, var(--shell-blue-glow), transparent 54%),
    var(--bg-canvas);
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 3.6vw, 44px);
}

.contact::after {
  content: "CUBO";
  position: absolute;
  right: clamp(16px, 4vw, 64px);
  bottom: -0.14em;
  font-family: var(--font-serif);
  font-size: clamp(120px, 22vw, 320px);
  line-height: 0.85;
  letter-spacing: 0.04em;
  color: var(--ink-primary);
  opacity: 0.035;
  pointer-events: none;
  user-select: none;
}

.contact h2 {
  font-family: var(--font-serif);
  font-size: clamp(38px, 5.4vw, 76px);
  font-weight: 400;
  line-height: 1.16;
  letter-spacing: 0.02em;
  color: var(--ink-primary);
}

.contact h2 em {
  font-style: normal;
  color: color-mix(in srgb, var(--ink-primary) 78%, var(--shell-accent) 22%);
}

.contact-link {
  position: relative;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-serif);
  font-size: clamp(26px, 3.6vw, 52px);
  color: var(--ink-primary);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-strong);
  transition: letter-spacing 0.45s var(--ease-out-expo), color 0.35s ease;
}

.contact-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--shell-accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.55s var(--ease-out-expo);
}

.contact-link span {
  color: var(--shell-accent);
  transition: transform 0.35s var(--ease-out-expo);
}

.contact-link:hover {
  letter-spacing: 0.03em;
  color: var(--shell-accent);
}

.contact-link:hover::after {
  transform: scaleX(1);
}

.contact-link:hover span {
  transform: translate(5px, -5px);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
}

.social-links a,
.social-links button {
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--ink-secondary);
  transition:
    transform 0.35s var(--ease-out-expo),
    border-color 0.35s ease,
    color 0.35s ease,
    background-color 0.35s ease;
}

.social-links a:hover,
.social-links button:hover,
.social-links button.is-active {
  transform: translateY(-3px);
  border-color: var(--shell-accent);
  color: var(--ink-primary);
  background: var(--bg-surface-elevated);
}

/* Footer */
.footer {
  padding: 28px clamp(24px, 6.5vw, 108px);
  border-top: 1px solid var(--border-subtle);
  background: #0d0e10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
}

.footer-right {
  display: inline-flex;
  align-items: center;
  gap: 20px;
}

.footer-top {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ink-secondary);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease, transform 0.35s var(--ease-out-expo);
}

.footer-top:hover,
.footer-top:focus-visible {
  color: var(--shell-accent);
  border-bottom-color: var(--shell-accent);
  transform: translateY(-2px);
}

/* Scroll Reveal States */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.85s var(--ease-out-expo),
    transform 0.85s var(--ease-out-expo);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Responsive */
@media (max-width: 960px) {
  .intro-grid,
  .approach-grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }

  .vertical-title {
    justify-self: start;
  }

  .project-card--offset,
  .project-card--small {
    width: 100%;
    margin: 0;
  }
}

@media (max-width: 768px) {
  .home-body {
    padding: 10px;
  }

  .page-canvas {
    border-width: 3px;
  }

  .brand-text {
    font-size: 12px;
  }

  .menu-toggle {
    display: flex;
  }

  .nav {
    position: fixed;
    inset: 0;
    z-index: var(--z-drawer);
    background: rgba(14, 15, 17, 0.96);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    gap: 28px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.38s var(--ease-out-expo);
  }

  .site-header.nav-open .nav {
    opacity: 1;
    pointer-events: auto;
  }

  .nav a {
    font-family: var(--font-serif);
    font-size: 32px;
    letter-spacing: 0.12em;
    color: var(--ink-primary);
    opacity: 0;
    transform: translateY(18px);
    transition:
      opacity 0.45s var(--ease-out-expo),
      transform 0.55s var(--ease-out-expo),
      color var(--dur-fast) ease;
  }

  .site-header.nav-open .nav a {
    opacity: 1;
    transform: none;
  }

  .site-header.nav-open .nav a:nth-child(1) { transition-delay: 0.06s; }
  .site-header.nav-open .nav a:nth-child(2) { transition-delay: 0.12s; }
  .site-header.nav-open .nav a:nth-child(3) { transition-delay: 0.18s; }
  .site-header.nav-open .nav a:nth-child(4) { transition-delay: 0.24s; }
  .site-header.nav-open .nav a:nth-child(5) { transition-delay: 0.30s; }

  .intro-meta {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .project-hud {
    top: 14px;
    left: 14px;
    right: 14px;
  }

  .project-hud-code {
    display: none;
  }

  .project-caption {
    left: 16px;
    right: 16px;
    bottom: 16px;
    gap: 8px;
  }

  .project-caption-top {
    padding-bottom: 8px;
    font-size: 10px;
  }

  .project-caption-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .project-caption-sub {
    display: none;
  }

  .work.is-expanded .project-stack {
    grid-template-columns: 1fr;
    padding-bottom: 0;
  }

  .work-fold-peek {
    width: 100%;
    height: 112px;
  }

  .work-fold-peek-meta {
    left: 14px;
    right: 14px;
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .work-fold-peek-info {
    display: none;
  }

  .work-expand-btn {
    padding: 12px 22px;
    gap: 10px;
    font-size: 12px;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Mobile / Touch WebView anti-flicker: disable clip-path reveals, infinite keyframe zoom, and scroll-linked transforms */
@media (hover: none), (pointer: coarse), (max-width: 820px) {
  .home-hero-media,
  .project-card .project-media,
  .project-card--extra.project-card--entering .project-media {
    clip-path: none !important;
    transition: none !important;
  }

  .home-hero-media img {
    animation: none !important;
    transform: none !important;
  }

  .home-hero-media,
  .home-hero-copy,
  .transition-band-image img,
  .band-line,
  .project-media img,
  .vertical-title > span:nth-child(2) {
    transform: none !important;
    opacity: 1 !important;
    will-change: auto !important;
  }

  .home-hero-media::after,
  .project-media-inner::after,
  .hero-scroll-line {
    display: none !important;
    animation: none !important;
  }

  .project-hud,
  .project-caption,
  .intro-meta > div {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .intro-meta::before,
  .transition-band-copy::before,
  .transition-band-copy::after {
    transform: scaleX(1) !important;
    transition: none !important;
  }

  .transition-band-copy > span {
    animation: none !important;
  }
}
