/* ============================================
   THOMAS KOCH — VALUE DRIVEN CREATIVE
   Editorial typography meets dimensional motion
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter+Tight:wght@300;400;500;600;700&family=JetBrains+Mono:wght@300;400&display=swap');

/* —— RESET ————————————————— */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { min-height: 100vh; line-height: 1.4; font-family: var(--font-sans); }
img, video, svg { display: block; max-width: 100%; height: auto; }
button, input, textarea { font: inherit; color: inherit; background: none; border: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* —— TOKENS ————————————————— */
:root {
  --bg: #f4f1ec;
  --bg-deep: #ebe7df;
  --ink: #0a0a0a;
  --ink-soft: #2a2a2a;
  --ink-mute: #6f6a62;
  --line: rgba(10,10,10,0.12);
  --line-strong: rgba(10,10,10,0.4);
  /* Deep violet highlight that threads through the page */
  --accent: #3d0692;
  --accent-soft: rgba(61,6,146,0.18);
  --accent-tint: rgba(61,6,146,0.08);
  --paper: #ffffff;

  --font-serif: 'Instrument Serif', 'Times New Roman', serif;
  --font-sans: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --gutter: clamp(20px, 4vw, 56px);
  --radius: 14px;
  --ease: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --grain-opacity: 0.06;
}

/* —— BASE ————————————————— */
html, body { background: var(--bg); color: var(--ink); overflow-x: clip; }
body {
  font-feature-settings: 'ss01', 'cv11';
  letter-spacing: -0.01em;
  overflow-x: clip;
}

/* Subtle film-grain overlay across everything */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: var(--grain-opacity);
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

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

/* —— NAV ————————————————— */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px var(--gutter);
  z-index: 100;
  mix-blend-mode: difference;
  color: #fff;
  pointer-events: none;
}
.nav > * { pointer-events: auto; }

.nav__brand {
  font-family: var(--font-serif);
  font-size: clamp(20px, 1.4vw, 24px);
  letter-spacing: 0.01em;
  font-style: italic;
}
.nav__brand sup { font-family: var(--font-mono); font-size: 9px; vertical-align: super; letter-spacing: 0.1em; opacity: 0.8; margin-left: 2px; }

.nav__links {
  display: flex;
  gap: clamp(16px, 2vw, 28px);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}
.nav__links a {
  position: relative;
  padding: 6px 0;
  transition: opacity 0.3s var(--ease);
}
.nav__links a::after {
  content: '';
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.5s var(--ease);
}
.nav__links a:hover::after,
.nav__links a.is-active::after { transform: scaleX(1); transform-origin: left; }

/* —— UTILITY ————————————————— */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: middle; }

/* —— FOOTER ————————————————— */
.footer {
  position: relative;
  padding: clamp(60px, 12vh, 140px) var(--gutter) 40px;
  border-top: 1px solid var(--line);
  margin-top: 120px;
}
.footer__big {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(60px, 14vw, 220px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  margin-bottom: 60px;
}
.footer__big a {
  background: linear-gradient(transparent 60%, var(--accent-soft) 60%);
  background-size: 0% 100%;
  background-repeat: no-repeat;
  transition: background-size 0.6s var(--ease);
}
.footer__big a:hover { background-size: 100% 100%; }
.footer__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 30px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-mute);
}
.footer__row a:hover { color: var(--ink); }
.footer__col { display: flex; flex-direction: column; gap: 8px; }

/* —— SMOOTH SCROLL HOST ————————————————— */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* —— CURSOR ————————————————— */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--ink);
  pointer-events: none;
  z-index: 10000;
  mix-blend-mode: difference;
  transform: translate(-50%, -50%);
  transition: width 0.4s var(--ease-out), height 0.4s var(--ease-out), background 0.3s;
}
.cursor.is-hover { width: 80px; height: 80px; background: #fff; }
.cursor.is-text { width: 4px; height: 32px; border-radius: 2px; }

@media (hover: none) {
  .cursor { display: none; }
}

/* —— LOADER ————————————————— */
.loader {
  position: fixed;
  inset: 0;
  background: var(--ink);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(40px, 8vw, 100px);
  letter-spacing: -0.02em;
}
.loader__count {
  font-family: var(--font-mono);
  font-size: 11px;
  position: absolute;
  bottom: 30px; right: 30px;
  letter-spacing: 0.18em;
  font-style: normal;
}
.loader__line {
  position: absolute;
  bottom: 0; left: 0;
  height: 2px; width: 100%;
  background: rgba(255,255,255,0.2);
  overflow: hidden;
}
.loader__line::after {
  content: '';
  position: absolute; left: 0; top: 0;
  height: 100%; width: 0%;
  background: var(--bg);
  animation: load 2.4s var(--ease-out) forwards;
}
@keyframes load { to { width: 100%; } }

.loader.is-out {
  transform: translateY(-100%);
  transition: transform 1.1s var(--ease-out);
}

/* —— REVEAL ————————————————— */
.reveal {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}
.reveal__inner {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1.1s var(--ease-out);
}
.reveal.is-in .reveal__inner { transform: translateY(0); }

.fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
}
.fade-up.is-in { opacity: 1; transform: translateY(0); }

/* —— RESPONSIVE ————————————————— */
@media (max-width: 700px) {
  .nav__brand sup { display: none; }
  .footer__big { font-size: clamp(48px, 16vw, 120px); }
}
