/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   exceptionforme — unhandled identity
   warm ink / bone / signal vermillion
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

:root {
  --ink:        oklch(15% 0.011 65);
  --ink-2:      oklch(19% 0.013 65);
  --bone:       oklch(93% 0.022 84);
  --bone-dim:   oklch(66% 0.018 78);
  --signal:     oklch(63% 0.225 31);
  --signal-hot: oklch(70% 0.24 29);
  --line:       oklch(29% 0.014 65);

  --font-display: 'Syne', system-ui, sans-serif;
  --font-body: 'Hanken Grotesk', system-ui, sans-serif;
  --font-mono: 'Fragment Mono', ui-monospace, monospace;

  --pad-x: clamp(1.25rem, 4.5vw, 4.5rem);
  --gap-section: clamp(7rem, 18vh, 14rem);

  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--signal); color: var(--ink); }

.mono {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
}

.t-signal { color: var(--signal); }

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

/* ── scene & grain ─────────────────────────────────────── */

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

.grain {
  position: fixed;
  inset: -100px;
  z-index: 4;
  pointer-events: none;
  opacity: 0.07;
  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.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 0.9s steps(3) infinite;
}

@keyframes grain-shift {
  0%   { transform: translate(0, 0); }
  33%  { transform: translate(-40px, 25px); }
  66%  { transform: translate(30px, -35px); }
  100% { transform: translate(0, 0); }
}

/* ── preloader ─────────────────────────────────────────── */

.preloader {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--ink);
  display: flex;
  align-items: flex-end;
  padding: var(--pad-x);
  transition: transform 0.9s var(--ease-out-expo);
}

.preloader.done { transform: translateY(-101%); }

.preloader__log {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--bone-dim);
  line-height: 1.9;
  white-space: pre-wrap;
}

.preloader__log .ok { color: var(--signal); }

/* ── custom cursor: trailing scope ring ────────────────── */

.cursor-ring {
  position: fixed;
  top: 0; left: 0;
  z-index: 60;
  pointer-events: none;
  border-radius: 50%;
  display: none;
  width: 34px; height: 34px;
  border: 1px solid var(--bone-dim);
  transform: translate(-50%, -50%);
  transition: border-color 0.25s, opacity 0.25s;
  opacity: 0.55;
}

.cursor-ring.is-hover {
  border-color: var(--signal);
  opacity: 1;
}

@media (pointer: fine) {
  body { cursor: crosshair; }
  a, button { cursor: pointer; }
  .cursor-ring { display: block; }
}

/* ── header ────────────────────────────────────────────── */

.site-head {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: baseline;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  padding: 1.4rem var(--pad-x);
}

.site-head__mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.tick { color: var(--signal); font-style: normal; }

.site-head__nav {
  display: flex;
  gap: clamp(1rem, 2.5vw, 2rem);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.site-head__nav a {
  color: var(--bone-dim);
  transition: color 0.2s;
}

.site-head__nav a:hover,
.site-head__nav a:focus-visible { color: var(--signal); }

.site-head__status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--bone-dim);
}

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--bone-dim);
  transition: background 0.15s;
}

.status-dot.is-throwing {
  background: var(--signal-hot);
  animation: dot-pulse 0.35s ease-in-out infinite alternate;
}

@keyframes dot-pulse {
  from { opacity: 1; }
  to   { opacity: 0.35; }
}

@media (max-width: 640px) {
  .site-head__status { display: none; }
}

/* ── hero ──────────────────────────────────────────────── */

main { position: relative; z-index: 2; }

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 var(--pad-x) clamp(3rem, 8vh, 6rem);
  position: relative;
}

.hero__eyebrow {
  color: var(--signal);
  margin-bottom: clamp(0.75rem, 2vh, 1.5rem);
}

.hero__mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.2rem, 13.5vw, 11.5rem);
  line-height: 0.92;
  letter-spacing: -0.045em;
  text-transform: lowercase;
  display: flex;
  flex-direction: column;
  max-width: 14ch;
}

.hero__mark-line2 { margin-left: clamp(1.5rem, 9vw, 9rem); }

.hero__trace {
  margin-top: clamp(1.5rem, 4vh, 3rem);
  font-family: var(--font-mono);
  font-size: clamp(0.7rem, 0.65rem + 0.3vw, 0.8125rem);
  line-height: 1.8;
  color: var(--bone-dim);
  overflow-x: auto;
}

.hero__hint {
  margin-top: clamp(1.25rem, 3vh, 2rem);
  color: var(--bone-dim);
  opacity: 0.7;
}

.hero__footnote {
  position: absolute;
  right: var(--pad-x);
  bottom: clamp(3rem, 8vh, 6rem);
  color: var(--bone-dim);
  max-width: 16rem;
  text-align: right;
}

.hero__scrollcue {
  position: absolute;
  left: var(--pad-x);
  top: 50vh;
  writing-mode: vertical-rl;
  color: var(--bone-dim);
  font-size: 0.75rem;
  opacity: 0.55;
  transition: color 0.2s, opacity 0.2s;
}

.hero__scrollcue:hover { color: var(--signal); opacity: 1; }

@media (max-width: 900px) {
  .hero__scrollcue { display: none; }
  .hero__footnote { position: static; text-align: left; margin-top: 2rem; max-width: none; }
}

/* ── glitch treatment ──────────────────────────────────── */

.glitch { position: relative; display: inline-block; }

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.glitch.is-glitching::before {
  opacity: 0.85;
  color: var(--signal);
  transform: translate(-0.06em, -0.02em);
  animation: glitch-slice-a 0.36s steps(4) both;
}

.glitch.is-glitching::after {
  opacity: 0.6;
  color: var(--bone);
  transform: translate(0.05em, 0.03em);
  animation: glitch-slice-b 0.36s steps(4) both;
}

@keyframes glitch-slice-a {
  0%   { clip-path: inset(8% 0 76% 0); }
  25%  { clip-path: inset(52% 0 23% 0); }
  50%  { clip-path: inset(30% 0 55% 0); }
  75%  { clip-path: inset(70% 0 8% 0); }
  100% { clip-path: inset(15% 0 70% 0); opacity: 0; }
}

@keyframes glitch-slice-b {
  0%   { clip-path: inset(65% 0 12% 0); }
  25%  { clip-path: inset(15% 0 70% 0); }
  50%  { clip-path: inset(80% 0 5% 0); }
  75%  { clip-path: inset(40% 0 42% 0); }
  100% { clip-path: inset(58% 0 25% 0); opacity: 0; }
}

/* ── shared section chrome ─────────────────────────────── */

.section {
  padding: var(--gap-section) var(--pad-x) 0;
  position: relative;
}

.section__rule {
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  margin-bottom: clamp(2.5rem, 7vh, 5rem);
}

.section__index { color: var(--signal); }

.section__name { color: var(--bone-dim); }

.section__close {
  margin-top: clamp(2.5rem, 6vh, 4.5rem);
  color: var(--bone-dim);
}

/* ── §01 manifesto ─────────────────────────────────────── */

.manifesto__statement {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 4.4vw, 3.6rem);
  line-height: 1.18;
  letter-spacing: -0.025em;
  max-width: 22ch;
}

.manifesto__statement em {
  font-style: normal;
  color: var(--signal);
}

.manifesto__cols {
  margin-top: clamp(3rem, 8vh, 5.5rem);
  margin-left: auto;
  max-width: 64ch;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: clamp(1.5rem, 4vw, 3.5rem);
  color: var(--bone-dim);
}

.manifesto__cols p:first-child { color: var(--bone); }

/* ── §02 works ─────────────────────────────────────────── */

.works__list { list-style: none; }

.work { border-top: 1px solid var(--line); }

.work:last-child { border-bottom: 1px solid var(--line); }

.work__row {
  display: grid;
  grid-template-columns: 4rem 1fr minmax(0, 28rem) 2rem;
  align-items: baseline;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: clamp(1.4rem, 3.5vh, 2.4rem) 0;
  transition: background 0.3s var(--ease-out-quint), padding-left 0.3s var(--ease-out-quint);
}

.work__index {
  color: var(--bone-dim);
  transition: color 0.2s;
}

.work__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 3.2vw, 2.6rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
  transition: transform 0.35s var(--ease-out-quint);
}

.work__meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.work__desc {
  color: var(--bone-dim);
  font-size: 0.95rem;
  line-height: 1.5;
}

.work__tag { color: var(--bone-dim); opacity: 0.65; }

.work__arrow {
  color: var(--signal);
  opacity: 0;
  transform: translate(-0.4em, 0.4em);
  transition: opacity 0.3s, transform 0.3s var(--ease-out-quint);
  font-size: 1.3rem;
}

.work__row:hover, .work__row:focus-visible {
  background: var(--ink-2);
  padding-left: 0.75rem;
}

.work__row:hover .work__index,
.work__row:focus-visible .work__index { color: var(--signal); }

.work__row:hover .work__title { transform: translateX(0.35rem); }

.work__row:hover .work__arrow,
.work__row:focus-visible .work__arrow {
  opacity: 1;
  transform: translate(0, 0);
}

@media (max-width: 800px) {
  .work__row { grid-template-columns: 3rem 1fr; }
  .work__meta { grid-column: 2; }
  .work__arrow { display: none; }
}

/* ── §03 process ───────────────────────────────────────── */

.process__grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(2rem, 5vh, 3.5rem) clamp(1rem, 3vw, 2.5rem);
}

.process__group p {
  color: var(--bone-dim);
  max-width: 34ch;
  margin-top: 0.8rem;
}

.process__label {
  color: var(--signal);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.process__group--a { grid-column: 1 / span 5; }
.process__group--b { grid-column: 7 / span 5; margin-top: clamp(2rem, 8vh, 6rem); }
.process__group--c { grid-column: 3 / span 6; }

@media (max-width: 800px) {
  .process__group--a, .process__group--b, .process__group--c {
    grid-column: 1 / -1;
    margin-top: 0;
  }
}

/* ── §04 contact ───────────────────────────────────────── */

.contact { padding-bottom: var(--gap-section); }

.contact__lede {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.3rem, 2.6vw, 2.1rem);
  letter-spacing: -0.02em;
  color: var(--bone-dim);
  margin-bottom: clamp(2rem, 5vh, 3.5rem);
}

.contact__mail {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 5.6vw, 5rem);
  letter-spacing: -0.035em;
  line-height: 1.05;
  display: inline-block;
  word-break: break-all;
  border-bottom: 2px solid var(--line);
  padding-bottom: 0.15em;
  transition: border-color 0.3s, color 0.3s;
}

.contact__mail:hover, .contact__mail:focus-visible {
  color: var(--signal);
  border-color: var(--signal);
}

.contact__links {
  list-style: none;
  display: flex;
  gap: clamp(1.5rem, 4vw, 3rem);
  margin-top: clamp(2.5rem, 6vh, 4rem);
}

.contact__links a {
  color: var(--bone-dim);
  transition: color 0.2s;
}

.contact__links a:hover, .contact__links a:focus-visible { color: var(--signal); }

/* ── footer ────────────────────────────────────────────── */

.site-foot {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2.5rem;
  justify-content: space-between;
  padding: 1.5rem var(--pad-x) 2rem;
  border-top: 1px solid var(--line);
  color: var(--bone-dim);
}

.site-foot__aside { opacity: 0.6; }

/* ── reveal on scroll ──────────────────────────────────── */

[data-reveal] {
  opacity: 0;
  transform: translateY(1.6rem);
  transition:
    opacity 0.9s var(--ease-out-quint),
    transform 0.9s var(--ease-out-quint);
  transition-delay: var(--reveal-delay, 0s);
}

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

/* ── reduced motion ────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .grain { animation: none; }
  .preloader { transition: none; }
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .glitch.is-glitching::before,
  .glitch.is-glitching::after { animation: none; opacity: 0; }
}
