@import url('tokens.css');

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('../fonts/BricolageGrotesque-Variable.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  background: var(--void);
  color: var(--bone);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

::selection { background: var(--phosphor); color: var(--void); }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }

/* ── grain ── */
.grain {
  position: fixed; inset: -50%;
  width: 200%; height: 200%;
  pointer-events: none; z-index: 9000;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift 0.9s steps(4) infinite;
}
@keyframes grainShift {
  0%   { transform: translate(0,0); }
  25%  { transform: translate(-2%,1%); }
  50%  { transform: translate(1%,-2%); }
  75%  { transform: translate(-1%,2%); }
  100% { transform: translate(0,0); }
}

/* ── cursor ── */
.cursor {
  position: fixed; top: 0; left: 0;
  width: 10px; height: 10px;
  background: var(--phosphor);
  border-radius: 50%;
  pointer-events: none; z-index: 9999;
  mix-blend-mode: difference;
  transform: translate(-50%,-50%) scale(1);
  transition: transform 0.25s ease;
}
.cursor.is-hover { transform: translate(-50%,-50%) scale(4); }
@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) { .cursor { display: none; } }

/* ── rails ── */
.rail { position: fixed; top: 0; bottom: 0; width: 1px; background: var(--line-soft); z-index: 50; pointer-events: none; }
.rail--l { left: 24px; } .rail--r { right: 24px; }
@media (max-width: 760px) { .rail { display: none; } }

/* ── progress ── */
#progress {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: 2px; background: var(--phosphor);
  transform-origin: left; transform: scaleX(0);
  transition: transform 0.1s linear;
}

/* ── header ── */
header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 40px;
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--bone);
  background: var(--nav-bg);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--line-soft);
  transition: background 0.4s ease, border-color 0.4s ease, color 0.4s ease;
}
header .brand { font-weight: 500; display: inline-block; padding: 14px 0; }
header .brand span { color: var(--bone-dim); display: block; font-size: 9px; letter-spacing: 0.28em; }
header nav { display: flex; gap: 28px; align-items: center; }
header nav a { position: relative; padding: 4px 0; color: var(--bone-dim); transition: color 0.2s; }
header nav a:hover { color: var(--bone); }
header nav a::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.35s cubic-bezier(0.65,0,0.35,1);
}
header nav a:hover::after { transform: scaleX(1); transform-origin: left; }
#theme-toggle {
  background: none; border: 1px solid var(--line);
  color: var(--bone-dim); font: inherit; letter-spacing: inherit;
  text-transform: inherit; padding: 5px 12px; cursor: pointer;
  border-radius: 2px; display: inline-flex; align-items: center; gap: 8px;
  transition: border-color 0.2s, color 0.2s;
}
#theme-toggle:hover { border-color: var(--bone-dim); color: var(--bone); }
#theme-toggle .th-icon { font-size: 13px; line-height: 1; }
@media (max-width: 760px) {
  :root { --nav-bg: rgba(10,12,11,0.92); }
  [data-theme="light"] { --nav-bg: rgba(244,240,230,0.95); }
  header { padding: 14px 20px; }
  header nav { gap: 16px; }
  header nav .hide-m { display: none; }
  .hero__cat { font-size: 9px; padding: 5px 12px; margin-bottom: 24px; letter-spacing: 0.2em; }
}

/* ── hero ── */
.hero {
  padding: 160px 40px 80px;
  max-width: 1200px; margin: 0 auto;
}
.hero__cat {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--phosphor);
  border: 1px solid var(--phosphor-dim);
  padding: 7px 16px; border-radius: 999px;
  margin-bottom: 36px;
  opacity: 0; animation: rise 0.7s 0.1s cubic-bezier(0.22,1,0.36,1) forwards;
}
.hero h1 {
  font-family: var(--display);
  font-weight: 790;
  font-size: clamp(3.5rem, 10vw, 9rem);
  line-height: 0.9;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  margin-bottom: 48px;
  color: var(--bone);
}
.hero h1 .line { display: block; overflow: hidden; }
.hero h1 .line > span {
  display: block;
  transform: translateY(110%);
  animation: lineUp 1s cubic-bezier(0.22,1,0.36,1) forwards;
}
.hero h1 .line:nth-child(1) > span { animation-delay: 0.25s; }
.hero h1 .line:nth-child(2) > span { animation-delay: 0.37s; }
.hero h1 em { font-style: normal; color: var(--phosphor); }
.hero h1 .hollow { color: transparent; -webkit-text-stroke: 1.5px var(--bone); }

.hero__meta {
  display: grid;
  grid-template-columns: 1fr 1px 1fr 1px 1fr 1px 1fr;
  border: 1px solid var(--line);
  border-radius: 3px;
  margin-top: 56px;
  opacity: 0; animation: rise 0.8s 0.6s cubic-bezier(0.22,1,0.36,1) forwards;
  transition: border-color 0.4s;
}
.hero__meta .div { background: var(--line); width: 1px; transition: background 0.4s; }
.hero__meta .cell {
  padding: 20px 24px;
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--bone-faint);
  transition: color 0.4s;
}
.hero__meta .cell strong {
  display: block; margin-top: 8px;
  font-size: 13px; letter-spacing: 0; text-transform: none;
  color: var(--bone); font-weight: 400;
  white-space: nowrap;
  transition: color 0.4s;
}
@media (max-width: 760px) {
  .hero { padding: 120px 20px 60px; }
  .hero__meta { grid-template-columns: 1fr 1fr; }
  .hero__meta .div { display: none; }
  .hero__meta .cell { border-bottom: none; }
  .hero__meta .cell:nth-child(1), .hero__meta .cell:nth-child(3) { border-bottom: 1px solid var(--line); }
  .hero__meta .cell strong { white-space: normal; }
}
@media (max-width: 380px) {
  .hero h1 { font-size: clamp(3rem, 15vw, 9rem); }
}

/* ── hero image / video ── */
.hero-media {
  width: 100%; overflow: hidden; position: relative;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transition: border-color 0.4s;
}
.hero-media img, .hero-media video {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.04);
  transition: transform 1.2s cubic-bezier(0.22,1,0.36,1);
  aspect-ratio: 16/9;
}
.hero-media.is-square img, .hero-media.is-square video { aspect-ratio: 1/1; }
.hero-media.is-in img, .hero-media.is-in video { transform: scale(1); }
@media (max-width: 760px) {
  .hero-media { overflow: visible; }
  .hero-media img, .hero-media video {
    height: auto; aspect-ratio: auto; object-fit: initial; transform: none !important;
  }
}
.hero-media figcaption {
  padding: 8px 0 0;
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--bone-faint); text-align: right;
}

/* ── content ── */
.content { max-width: var(--content); margin: 0 auto; padding: 0 40px; }
@media (max-width: 760px) { .content { padding: 0 20px; } }

.content-section {
  padding: 80px 0;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.4s;
}
.content-section:last-of-type { border-bottom: none; }

.sec-label {
  font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--bone-faint); margin-bottom: 28px;
  display: flex; align-items: center; gap: 12px;
}
.sec-label::before { content: ''; display: block; width: 24px; height: 1px; background: var(--phosphor-dim); }

.content-section h2 {
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700; letter-spacing: -0.025em; line-height: 1.1;
  text-transform: uppercase; margin-bottom: 28px;
  color: var(--bone);
}
.content-section h2 em { font-style: normal; color: var(--phosphor); }
.content-section p {
  font-size: 15px; line-height: 1.85; color: var(--bone-dim);
  margin-bottom: 1.4em;
}
.content-section p:last-child { margin-bottom: 0; }
.content-section p strong { color: var(--bone); font-weight: 500; }

.pullquote {
  margin: 48px 0;
  padding: 32px 0 32px 28px;
  border-left: 2px solid var(--phosphor);
  font-family: var(--display);
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  font-weight: 500; line-height: 1.45; letter-spacing: -0.01em;
  color: var(--bone); transition: color 0.4s;
}

.content-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--phosphor); margin-top: 32px;
  padding: 19px 0;
  transition: opacity 0.2s;
}
.content-link:hover { opacity: 0.7; }

/* ── full-bleed ── */
.bleed {
  width: 100vw; margin-left: calc(50% - 50vw);
  overflow: hidden; position: relative;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transition: border-color 0.4s;
}
.bleed img, .bleed video { width: 100%; object-fit: cover; }
.bleed figcaption {
  position: absolute; bottom: 16px; right: 24px;
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(233,229,218,0.45);
}

/* image grids */
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 2px; margin: 40px 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin: 40px 0; }
.grid-3 img, .grid-2 img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.grid-label {
  font-size: 10px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--bone-faint); margin-bottom: 16px; margin-top: 48px;
}
@media (max-width: 600px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

/* ── next project ── */
.next-project { border-top: 1px solid var(--line); padding: 0 40px; transition: border-color 0.4s; }
.next-project a {
  display: grid; grid-template-columns: 1fr 300px;
  gap: 48px; align-items: center; padding: 72px 0;
  transition: gap 0.5s cubic-bezier(0.22,1,0.36,1);
}
.next-project a:hover { gap: 24px; }
.np-label { font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--bone-faint); margin-bottom: 16px; }
.np-title {
  font-family: var(--display);
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  font-weight: 790; letter-spacing: -0.04em; line-height: 0.92;
  text-transform: uppercase;
  color: transparent; -webkit-text-stroke: 1.5px var(--bone);
  transition: color 0.35s, -webkit-text-stroke-color 0.35s;
}
.next-project a:hover .np-title { color: var(--phosphor); -webkit-text-stroke-color: var(--phosphor); }
.np-arrow {
  font-family: var(--display); font-size: 2.5rem; color: var(--bone-faint);
  transition: color 0.35s, transform 0.4s cubic-bezier(0.22,1,0.36,1);
  display: inline-block; margin-top: 20px;
}
.next-project a:hover .np-arrow { color: var(--phosphor); transform: translateX(8px); }
.np-img { aspect-ratio: 16/10; overflow: hidden; border: 1px solid var(--line); transition: border-color 0.4s; }
.np-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.22,1,0.36,1); }
.next-project a:hover .np-img img { transform: scale(1.04); }
@media (max-width: 760px) {
  .next-project { padding: 0 20px; }
  .next-project a { grid-template-columns: 1fr; gap: 20px; padding: 48px 0; }
  .np-img { display: block; }
}

/* ── footer ── */
footer { border-top: 1px solid var(--line); padding: 32px 40px; transition: border-color 0.4s; }
footer .cols {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px;
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bone-dim);
}
footer .cols a { padding: 18px 0; }
footer .cols a:hover { color: var(--phosphor); }
footer .cols .links { display: flex; gap: 28px; }
footer #theme-toggle { font-size: 11px; }
@media (max-width: 760px) { footer { padding: 24px 20px; } }

/* ── burger + mobile nav ── */
.burger {
  display: none;
  background: none; border: 1px solid var(--line);
  color: var(--bone-dim); cursor: pointer;
  border-radius: 2px; padding: 5px 10px;
  font-size: 18px; line-height: 1; align-items: center;
  transition: border-color 0.2s, color 0.2s;
}
.burger:hover { border-color: var(--bone-dim); color: var(--bone); }
@media (max-width: 760px) {
  .burger { display: inline-flex; }
  header nav .hide-m { display: none; }
}

.mobile-nav {
  position: fixed; inset: 0; z-index: 200;
  background: var(--void);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.45s cubic-bezier(0.22,1,0.36,1), background 0.4s;
  pointer-events: none;
}
.mobile-nav.is-open { transform: translateX(0); pointer-events: auto; }
.mobile-nav__top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.4s;
}
.mobile-nav__brand {
  display: block;
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--bone); font-weight: 500;
}
.mobile-nav__tagline {
  display: block;
  font-size: 9px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--bone-dim); margin-top: 2px;
}
.mobile-nav__close {
  background: none; border: 1px solid var(--line);
  color: var(--bone-dim); font: 16px/1 var(--mono);
  padding: 5px 12px; cursor: pointer; border-radius: 2px;
  transition: border-color 0.2s, color 0.2s;
}
.mobile-nav__close:hover { border-color: var(--bone-dim); color: var(--bone); }
.mobile-nav__links {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: 0 28px;
}
.mobile-nav__links a {
  display: block;
  font-size: 1.125rem; font-weight: 400; letter-spacing: 0.01em;
  color: var(--bone-dim); padding: 18px 0;
  border-bottom: 1px solid var(--line);
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.4s, transform 0.4s cubic-bezier(0.22,1,0.36,1), color 0.2s, border-color 0.4s;
}
.mobile-nav__links a:first-child { border-top: 1px solid var(--line); }
.mobile-nav.is-open .mobile-nav__links a:nth-child(1) { opacity: 1; transform: none; transition-delay: 0.06s; }
.mobile-nav.is-open .mobile-nav__links a:nth-child(2) { opacity: 1; transform: none; transition-delay: 0.12s; }
.mobile-nav.is-open .mobile-nav__links a:nth-child(3) { opacity: 1; transform: none; transition-delay: 0.18s; }
.mobile-nav__links a:hover { color: var(--bone); }
.mobile-nav__cta {
  display: block; padding: 24px 28px;
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--bone-faint);
  text-decoration: underline; text-underline-offset: 3px;
  border-top: 1px solid var(--line);
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.4s 0.22s, transform 0.4s 0.22s cubic-bezier(0.22,1,0.36,1), color 0.2s, border-color 0.4s;
}
.mobile-nav.is-open .mobile-nav__cta { opacity: 1; transform: none; }
.mobile-nav__cta:hover { color: var(--phosphor); }

/* ── scroll reveal ── */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.9s cubic-bezier(0.22,1,0.36,1), transform 0.9s cubic-bezier(0.22,1,0.36,1); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

@keyframes lineUp { to { transform: translateY(0); } }
@keyframes rise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
