:root {
  --bg: #000000;
  --text: #ffffff;
  --muted: #8a8a8a;
  --line: #2a2a2a;
  --line-soft: #1a1a1a;
  --max: 1440px;
  --display: "Anton", "Arial Narrow", Impact, sans-serif;
  --mono: "Space Mono", ui-monospace, "Courier New", monospace;
  --sans: "Space Grotesk", -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

body.nav-open { overflow: hidden; }
body.has-cursor,
body.has-cursor a,
body.has-cursor button { cursor: none; }

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a, button { touch-action: manipulation; }

.mono {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 0.92;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.005em;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 200;
  padding: 0.6rem 1rem;
  background: var(--text);
  color: var(--bg);
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- Backgrounds / overlays ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 88px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 88px);
}
.grain {
  position: fixed;
  inset: -50%;
  z-index: 3;
  pointer-events: none;
  opacity: 0.05;
  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.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.7s steps(3) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-3%, 2%); }
  66% { transform: translate(2%, -3%); }
  100% { transform: translate(0, 0); }
}

.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  pointer-events: none;
  mix-blend-mode: difference;
  opacity: 0;
  transition: opacity 0.3s ease, width 0.25s ease, height 0.25s ease, margin 0.25s ease;
}
body.has-cursor .cursor { opacity: 1; }
.cursor i {
  position: absolute;
  background: #fff;
}
.cursor i:nth-child(1) { left: 50%; top: 0; width: 1px; height: 100%; }
.cursor i:nth-child(2) { top: 50%; left: 0; height: 1px; width: 100%; }
.cursor.is-hover { width: 58px; height: 58px; margin: -29px 0 0 -29px; }

/* ---------- Topbar ---------- */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: max(1rem, env(safe-area-inset-top)) max(clamp(1rem, 4vw, 2.5rem), env(safe-area-inset-right)) 1rem max(clamp(1rem, 4vw, 2.5rem), env(safe-area-inset-left));
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px);
}
.brand {
  font-family: var(--display);
  font-size: 1.5rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.topbar__status {
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.live-dot {
  width: 7px;
  height: 7px;
  background: #fff;
  border-radius: 50%;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.15; } }

.nav { display: flex; gap: clamp(0.8rem, 2vw, 1.8rem); }
.nav a {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.2rem 0;
  transition: color 0.25s ease;
}
.nav a:hover,
.nav a.is-active { color: var(--text); }

.nav-toggle {
  display: none;
  position: relative;
  z-index: 2;
  background: none;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.5rem 0.85rem;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 7rem clamp(1rem, 4vw, 2.5rem) 3rem;
}
.hero__meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 1rem;
  margin-bottom: auto;
}
.hero__title {
  font-size: clamp(3.6rem, 15vw, 13rem);
  line-height: 0.86;
  margin: clamp(2rem, 6vh, 5rem) 0 0;
}
.hero__outline {
  font-family: var(--display);
  font-size: clamp(2.4rem, 11vw, 9.5rem);
  line-height: 0.9;
  text-transform: uppercase;
  color: transparent;
  -webkit-text-stroke: 1px var(--text);
  text-stroke: 1px var(--text);
  margin: 0.1em 0 0;
  letter-spacing: 0.02em;
}
.hero__lead {
  max-width: 48ch;
  margin: 2.4rem 0 2rem;
  color: #cfcfcf;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.btn {
  display: inline-block;
  padding: 0.9rem 1.5rem;
  border: 1px solid var(--text);
  color: var(--text);
  background: transparent;
  transition: background 0.25s ease, color 0.25s ease;
}
.btn:hover { background: var(--text); color: var(--bg); }
.btn--ghost { border-color: var(--line); color: var(--muted); }
.btn--ghost:hover { border-color: var(--text); background: var(--text); color: var(--bg); }

.hero__foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  margin-top: 3rem;
}

/* ---------- Glitch ---------- */
.glitch { position: relative; }
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  clip-path: inset(0 0 0 0);
}
.glitch::before {
  color: #fff;
  transform: translate(-3px, 0);
  mix-blend-mode: screen;
  animation: glitch-a 3.6s infinite steps(2);
}
.glitch::after {
  color: #fff;
  transform: translate(3px, 0);
  mix-blend-mode: screen;
  animation: glitch-b 3.1s infinite steps(2);
}
@keyframes glitch-a {
  0%, 92%, 100% { clip-path: inset(0 0 0 0); transform: translate(-3px, 0); }
  93% { clip-path: inset(10% 0 55% 0); transform: translate(-8px, -2px); }
  95% { clip-path: inset(60% 0 15% 0); transform: translate(6px, 2px); }
  97% { clip-path: inset(30% 0 40% 0); transform: translate(-6px, 1px); }
}
@keyframes glitch-b {
  0%, 90%, 100% { clip-path: inset(0 0 0 0); transform: translate(3px, 0); }
  91% { clip-path: inset(45% 0 20% 0); transform: translate(8px, 2px); }
  94% { clip-path: inset(5% 0 70% 0); transform: translate(-5px, -1px); }
  96% { clip-path: inset(70% 0 5% 0); transform: translate(5px, -2px); }
}

/* ---------- Marquee ---------- */
.marquee {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 28s linear infinite;
}
.marquee__track--rev { animation-direction: reverse; }
.marquee__track span {
  font-family: var(--display);
  font-size: clamp(1.4rem, 3.4vw, 2.6rem);
  text-transform: uppercase;
  padding: 0.5rem 0;
  white-space: nowrap;
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(4rem, 9vw, 8rem) clamp(1rem, 4vw, 2.5rem);
  background: rgba(0, 0, 0, 0.82);
}
.section__head { margin-bottom: clamp(2.2rem, 5vw, 3.6rem); }
.section__index { color: var(--muted); margin: 0 0 0.9rem; }
.section__title { font-size: clamp(2.6rem, 7vw, 5.5rem); }
.section__intro { color: var(--muted); margin: 1rem 0 0; max-width: 52ch; }

/* ---------- Works ---------- */
.works {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.work {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem;
  background: #000;
  border: none;
  color: inherit;
  font: inherit;
  text-align: left;
  transition: background 0.25s ease, color 0.25s ease;
}
.work:hover { background: #fff; color: #000; }
.work__num { color: var(--muted); }
.work:hover .work__num { color: #000; }
.work__media {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: #0d0d0d;
  border: 1px solid var(--line-soft);
}
.work__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  transition: transform 0.7s cubic-bezier(0.2, 0.6, 0.2, 1), opacity 0.3s ease, filter 0.4s ease;
}
.work:hover .work__media img { transform: scale(1.04); opacity: 1; filter: grayscale(0) contrast(1); }
.work__title { font-family: var(--display); font-size: 1.5rem; text-transform: uppercase; }
.work__sub { color: var(--muted); }
.work:hover .work__sub { color: #333; }

/* ---------- About ---------- */
.section--about .about {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.about__portrait {
  margin: 0;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0d0d0d;
}
.about__portrait img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); }
.about__body p { margin: 0 0 1.2rem; color: #cfcfcf; }
.statement {
  font-family: var(--display);
  font-size: clamp(1.6rem, 3.4vw, 2.8rem);
  line-height: 1.05;
  text-transform: uppercase;
  color: var(--text) !important;
  margin-bottom: 1.8rem !important;
}
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin: 2.4rem 0 0;
}
.facts div { background: #000; padding: 1rem; display: flex; flex-direction: column; gap: 0.3rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; color: var(--text); }

/* ---------- Data tables ---------- */
.data { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.data__head,
.data__row {
  display: grid;
  grid-template-columns: 4rem 5rem minmax(0, 2.4fr) minmax(0, 1.5fr);
  gap: 1rem;
  align-items: center;
  padding: 1.05rem 0.6rem;
  border-bottom: 1px solid var(--line);
}
.data__head { color: var(--muted); }
.data__row { transition: background 0.2s ease, color 0.2s ease; }
.data__row:hover { background: #fff; color: #000; }
.data__row:hover .mono { color: #000; }
.data__row .mono { color: var(--muted); }
.data__title { font-family: var(--display); font-size: 1.3rem; text-transform: uppercase; }

/* ---------- Contact ---------- */
.section--contact { text-align: center; }
.contact__lead { color: var(--muted); margin: 0 0 1.8rem; }
.contact__mail {
  display: inline-block;
  font-family: var(--display);
  font-size: clamp(1.8rem, 7vw, 5rem);
  text-transform: uppercase;
  line-height: 1;
  border-bottom: 3px solid var(--line);
  transition: border-color 0.3s ease;
  word-break: break-word;
}
.contact__mail:hover { border-color: var(--text); }
.socials {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.6rem;
  list-style: none;
  margin: 2.6rem 0 0;
  padding: 0;
}
.socials a { color: var(--muted); transition: color 0.25s ease; }
.socials a:hover { color: var(--text); }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.6rem clamp(1rem, 4vw, 2.5rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.site-footer a:hover { color: var(--text); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 4rem 1.5rem 2rem;
  background: rgba(0, 0, 0, 0.96);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox img {
  max-width: min(1100px, 100%);
  max-height: 76vh;
  object-fit: contain;
  border: 1px solid var(--line);
  filter: grayscale(1);
}
.lightbox__caption { color: var(--muted); text-align: center; }
.lightbox__close {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  background: none;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.5rem 0.85rem;
}
.lightbox__close:hover { background: var(--text); color: var(--bg); }

/* ---------- Reveal ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
[data-reveal].is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .topbar__status { display: none; }
  .nav-toggle { display: block; }
  .nav {
    position: fixed;
    inset: 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1.6rem;
    padding: 2rem clamp(1.5rem, 8vw, 3rem);
    background: #000;
    border-left: 1px solid var(--line);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
  }
  .nav.is-open { transform: translateX(0); }
  .nav a { font-size: 1.4rem; }

  .section--about .about { grid-template-columns: 1fr; }
  .about__portrait { max-width: 420px; }

  .data__head { display: none; }
  .data__row {
    grid-template-columns: 3rem 1fr;
    grid-template-areas:
      "num title"
      "year meta";
    gap: 0.35rem 0.9rem;
    padding: 1.2rem 0.4rem;
  }
  .data__row > span:nth-child(1) { grid-area: num; }
  .data__row > span:nth-child(2) { grid-area: year; }
  .data__row > span:nth-child(3) { grid-area: title; }
  .data__row > span:nth-child(4) { grid-area: meta; }
}

@media (max-width: 520px) {
  .hero__meta span:last-child { display: none; }
  .works { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .grain { display: none; }
  .hero { padding-top: 6rem; }
  .hero__title { font-size: clamp(3rem, 17vw, 6rem); }
  .hero__outline { font-size: clamp(2.2rem, 13vw, 4rem); }
  .hero__actions .btn { flex: 1 1 auto; text-align: center; }
  .section { padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); }
  .topbar { padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); }
  .site-footer { padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); padding-bottom: max(1.6rem, env(safe-area-inset-bottom)); }
  .marquee__track { animation-duration: 18s; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .grain { animation: none; }
  .marquee__track { animation: none; }
  [data-reveal] { opacity: 1; transform: none; }
}
