/* ───────────────────────── tokens ───────────────────────── */
:root {
  --bg: #000;
  --fg: #fff;
  --fg-2: rgba(255, 255, 255, .64);   /* secondary text  ~ 8.9:1 on black */
  --fg-3: rgba(255, 255, 255, .5);    /* labels          ~ 5.3:1 on black */
  --line: rgba(255, 255, 255, .14);
  --ghost: rgba(255, 255, 255, .07);

  --font: "Geologica", system-ui, sans-serif;
  --mono: "Martian Mono", ui-monospace, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --max: 1440px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --slant: -15deg; /* the avatar slash leans ~15° */

  --z-grain: 50;
  --z-nav: 40;
  --z-cursor: 100;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, blockquote { margin: 0; }
ul { padding: 0; list-style: none; }

:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 4px;
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .02em;
  color: var(--fg-3);
  font-weight: 400;
}

.slash polygon,
.hero__slash polygon,
.contact__slash polygon { fill: currentColor; }

.skip {
  position: fixed;
  left: var(--gutter);
  top: -100px;
  z-index: 200;
  padding: 12px 18px;
  background: var(--fg);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 13px;
}
.skip:focus { top: 16px; }

/* ───────────────────────── grain ───────────────────────── */
.grain {
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ───────────────────────── cursor ───────────────────────── */
.cursor { display: none; }

@media (hover: hover) and (pointer: fine) {
  .cursor {
    display: block;
    position: fixed;
    left: 0; top: 0;
    z-index: var(--z-cursor);
    width: 3px;
    height: 22px;
    margin: -11px 0 0 -1.5px;
    background: #fff;
    mix-blend-mode: difference;
    pointer-events: none;
    transform: translate3d(var(--cx, -100px), var(--cy, -100px), 0) skewX(var(--slant)) scale(var(--cs, 1));
    transition: transform .18s var(--ease), opacity .2s;
    will-change: transform;
  }
  .cursor.is-link { --cs: 2.2; }
  html, a, button, .btn { cursor: none; }
}

/* ───────────────────────── nav ───────────────────────── */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px var(--gutter) 22px;
  background: linear-gradient(to bottom, var(--bg) 0%, rgba(0, 0, 0, .86) 55%, rgba(0, 0, 0, 0) 100%);
}

.nav__logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -.02em;
}
.nav__logo .slash { width: 9px; height: 24px; }

.nav__links { display: flex; gap: clamp(12px, 2.4vw, 36px); }
.nav__links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-2);
  transition: color .2s;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 10px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .3s var(--ease);
}
.nav__links a:hover { color: var(--fg); }
.nav__links a:hover::after,
.nav__links a.is-active::after { transform: scaleX(1); transform-origin: left; }
.nav__links a.is-active { color: var(--fg); }

/* ───────────────────────── hero ───────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 96px var(--gutter) clamp(24px, 4vw, 48px);
  overflow: hidden;
  isolation: isolate;
}

/* field of tiny slashes — invisible until the cursor finds them */
.hero__field {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'%3E%3Cpolygon points='19.5,12 21,12 16.5,24 15,24' fill='%23fff'/%3E%3C/svg%3E");
  background-size: 36px 36px;
  opacity: .04;
}
.hero__field--lit {
  opacity: .55;
  -webkit-mask-image: radial-gradient(circle 220px at var(--mx, 50%) var(--my, -50%), #000 0%, transparent 100%);
          mask-image: radial-gradient(circle 220px at var(--mx, 50%) var(--my, -50%), #000 0%, transparent 100%);
}

.hero__slash {
  position: absolute;
  left: 50%;
  top: 50%;
  height: min(56vh, 520px);
  width: auto;
  aspect-ratio: 168 / 468;
  color: var(--fg);
  transform: translate(-50%, -54%) rotate(var(--tilt, 0deg));
  transition: transform .8s var(--ease);
  animation: draw 1.1s var(--ease) .15s both;
  z-index: -1;
}

@keyframes draw {
  from { clip-path: inset(0 0 100% 0); }
  to   { clip-path: inset(0 0 0 0); }
}

.hero__meta { display: flex; }
.hero__meta--tl { grid-row: 1; grid-column: 1; align-self: start; }
.hero__meta--tr { grid-row: 1; grid-column: 1; justify-self: end; align-self: start; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg-2);
}
.status i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--fg);
  box-shadow: 0 0 0 0 rgba(255, 255, 255, .6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 255, 255, .5); }
  70%  { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.hero__bottom {
  grid-row: 3;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 32px;
}

.hero__title {
  font-size: clamp(64px, 17vw, 268px);
  font-weight: 300;
  letter-spacing: -.05em;
  line-height: .8;
  margin-left: -.04em;
  font-variation-settings: "slnt" 0;
  transition: font-variation-settings .6s var(--ease);
}
.hero__title:hover { font-variation-settings: "slnt" -12; }

.hero__side { max-width: 340px; padding-bottom: .6em; }

.hero__lead {
  font-size: clamp(16px, 1.35vw, 19px);
  line-height: 1.45;
  color: var(--fg-2);
  margin-bottom: 24px;
}

.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; }

/* ───────────────────────── buttons ───────────────────────── */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  font-family: var(--mono);
  font-size: 12px;
  border: 1px solid var(--line);
  color: var(--fg);
  overflow: hidden;
  isolation: isolate;
  transition: color .3s var(--ease), border-color .3s;
  cursor: pointer;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0 -20%;
  z-index: -1;
  background: var(--fg);
  transform: skewX(var(--slant)) scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease);
}
.btn:hover { color: var(--bg); border-color: var(--fg); }
.btn:hover::before { transform: skewX(var(--slant)) scaleX(1); }
.btn:active { transform: scale(.98); }

.btn--solid { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn--solid::before { background: var(--bg); }
.btn--solid:hover { color: var(--fg); }

/* ───────────────────────── marquee ───────────────────────── */
.marquee {
  border-block: 1px solid var(--line);
  overflow: hidden;
  padding: 18px 0;
}
.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 38s linear infinite;
}
.marquee span {
  font-size: clamp(20px, 2.4vw, 34px);
  font-weight: 300;
  letter-spacing: -.02em;
  white-space: nowrap;
  color: var(--fg-2);
}
.marquee span::after {
  content: "/";
  margin: 0 .7em;
  color: var(--fg);
  font-weight: 200;
}
@keyframes marquee { to { transform: translateX(-50%); } }
.marquee:hover .marquee__track { animation-play-state: paused; }

/* ───────────────────────── sections ───────────────────────── */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(80px, 12vw, 160px) var(--gutter) 0;
}

.section__head {
  display: flex;
  align-items: baseline;
  gap: 20px;
  margin-bottom: clamp(40px, 6vw, 72px);
}
.section__head h2 {
  font-size: clamp(36px, 6vw, 88px);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: 1;
}

/* rows — services */
.rows { border-top: 1px solid var(--line); }
.row {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1.1fr) minmax(0, 1fr) 40px;
  align-items: center;
  gap: 24px;
  padding: clamp(22px, 3vw, 36px) 0;
  border-bottom: 1px solid var(--line);
  isolation: isolate;
  transition: color .35s var(--ease), padding .35s var(--ease);
}
.row::before {
  content: "";
  position: absolute;
  inset: 0 calc(var(--gutter) * -1);
  z-index: -1;
  background: var(--fg);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform .4s var(--ease);
}
.row__title {
  font-size: clamp(24px, 3.4vw, 48px);
  font-weight: 400;
  letter-spacing: -.035em;
  line-height: 1.05;
}
.row__desc { color: var(--fg-2); max-width: 46ch; transition: color .35s; }
.row__arrow {
  justify-self: end;
  font-size: 32px;
  font-weight: 200;
  transition: transform .4s var(--ease);
}
.row .mono { transition: color .35s; }

@media (hover: hover) {
  .row:hover { color: var(--bg); }
  .row:hover::before { transform: scaleY(1); }
  .row:hover .row__desc,
  .row:hover .mono { color: rgba(0, 0, 0, .64); }
  .row:hover .row__arrow { transform: translateX(-8px) rotate(15deg); }
}

/* cards — work */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: clamp(320px, 34vw, 460px);
  padding: clamp(20px, 2.4vw, 32px);
  background: var(--bg);
  overflow: hidden;
}
.card__top { display: flex; justify-content: space-between; gap: 12px; }
.card__title {
  margin-top: auto;
  font-size: clamp(24px, 2.4vw, 34px);
  font-weight: 400;
  letter-spacing: -.03em;
  line-height: 1.1;
  margin-bottom: 12px;
}
.card__desc { color: var(--fg-2); font-size: 15px; max-width: 34ch; }

.card__slash {
  position: absolute;
  top: 18%;
  left: 50%;
  width: 18px;
  height: 46%;
  background: var(--fg);
  transform: translateX(-50%) skewX(var(--slant)) scaleX(.1);
  opacity: .22;
  transition: transform .6s var(--ease), opacity .6s var(--ease);
}
@media (hover: hover) {
  .card:hover .card__slash { transform: translateX(-50%) skewX(var(--slant)) scaleX(1); opacity: 1; }
}

/* approach */
.quote {
  font-size: clamp(28px, 4.6vw, 68px);
  font-weight: 300;
  letter-spacing: -.04em;
  line-height: 1.08;
  max-width: 20ch;
  margin-bottom: clamp(56px, 8vw, 112px);
}
.quote em {
  font-style: normal;
  font-variation-settings: "slnt" -12;
  color: transparent;
  -webkit-text-stroke: 1px var(--fg);
}

.principles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 48px);
}
.principle {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.principle h3 {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -.02em;
  margin: 28px 0 10px;
}
.principle p { color: var(--fg-2); font-size: 15px; }

/* ───────────────────────── contact ───────────────────────── */
.contact {
  position: relative;
  margin-top: clamp(96px, 14vw, 200px);
  padding: clamp(80px, 12vw, 160px) var(--gutter);
  border-top: 1px solid var(--line);
  overflow: hidden;
  isolation: isolate;
}
.contact__inner { max-width: var(--max); margin: 0 auto; }
.contact__slash {
  position: absolute;
  right: 6%;
  top: 50%;
  height: 120%;
  aspect-ratio: 168 / 468;
  color: var(--ghost);
  transform: translateY(-50%);
  z-index: -1;
}
.contact__title {
  margin: 24px 0 clamp(40px, 6vw, 72px);
  font-size: clamp(36px, 6.4vw, 104px);
  font-weight: 500;
  letter-spacing: -.05em;
  line-height: .98;
  max-width: 16ch;
}
.ghost {
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, .5);
  transition: color .5s var(--ease), -webkit-text-stroke-color .5s;
}
.contact__title:hover .ghost { color: var(--fg); -webkit-text-stroke-color: var(--fg); }

.contact__mail {
  display: inline-block;
  font-size: clamp(22px, 3.6vw, 52px);
  font-weight: 300;
  letter-spacing: -.03em;
  padding-bottom: 6px;
  background: linear-gradient(var(--fg), var(--fg)) left bottom / 100% 1px no-repeat;
  transition: background-size .4s var(--ease);
  overflow-wrap: anywhere;
}
.contact__mail:hover { background-size: 0 1px; background-position: right bottom; }

.contact__links { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 32px; }
.contact__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--fg-2);
  transition: color .2s;
}
.contact__links a:hover { color: var(--fg); }

/* ───────────────────────── footer ───────────────────────── */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px var(--gutter);
  border-top: 1px solid var(--line);
}
.footer a { display: inline-flex; align-items: center; min-height: 44px; transition: color .2s; }
.footer a:hover { color: var(--fg); }

/* ───────────────────────── reveal ───────────────────────── */
.reveal-load {
  animation: rise .9s var(--ease) var(--d, 0s) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}

.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
  transition-delay: var(--d, 0s);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* ───────────────────────── responsive ───────────────────────── */
@media (max-width: 1024px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card:last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 280px; }
  .principles { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
}

@media (max-width: 768px) {
  .nav { padding-block: 10px; }
  .nav__links { gap: 14px; }
  .nav__links a { font-size: 11px; }

  .hero { padding-top: 80px; }
  .hero__slash {
    position: relative;
    left: auto; top: auto;
    grid-row: 2;
    grid-column: 1;
    justify-self: center;
    align-self: center;
    height: min(34vh, 300px);
    margin: 24px 0;
    transform: none;
  }
  .hero__meta--tr { justify-self: start; margin-top: 28px; }
  .hero__bottom { grid-template-columns: 1fr; gap: 24px; }
  .hero__title { font-size: 25vw; }
  .hero__side { max-width: none; padding-bottom: 0; }

  .row {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 8px 12px;
  }
  .row__desc { grid-column: 2; font-size: 15px; }
  .row__arrow { display: none; }

  .cards { grid-template-columns: 1fr; }
  .card { min-height: 280px; }
  .card__slash { top: 22%; height: 34%; }

  .principles { grid-template-columns: 1fr; }
  .principle h3 { margin-top: 16px; }

  .contact__slash { right: -10%; }
}

@media (max-width: 480px) {
  .nav__links a:not(:last-child) { display: none; }
}

/* ───────────────────────── reduced motion ───────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .marquee__track { animation: none; }
  .js .reveal { opacity: 1; transform: none; }
  .hero__field--lit { display: none; }
}

/* staggered hero reveal delays (kept out of inline style attributes for the strict CSP) */
.hero__meta--tl { --d: .9s; }
.hero__meta--tr { --d: 1s; }
.hero__title    { --d: 1.1s; }
.hero__side     { --d: 1.25s; }
