/* ------------------------------------------------------------------
   Yan Mark Darunday — tokens
   neutral pair (night / bone) + one signal (lime), alpha steps for greys
   motif: the request-trace span bar
------------------------------------------------------------------- */
:root {
  --bg: #0b0b0c;
  --fg: #ebe9e3;
  --signal: #c6ff3a;
  --signal-ink: #c6ff3a;   /* signal used as text; darkens when the theme inverts */

  --fg-64: color-mix(in srgb, var(--fg) 64%, transparent);
  --fg-32: color-mix(in srgb, var(--fg) 32%, transparent);
  --fg-16: color-mix(in srgb, var(--fg) 16%, transparent);
  --fg-08: color-mix(in srgb, var(--fg) 8%, transparent);
  --fg-04: color-mix(in srgb, var(--fg) 4%, transparent);

  --f-display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --f-ui: "Manrope", system-ui, sans-serif;
  --f-mono: "Martian Mono", ui-monospace, monospace;

  --ease-osmo: cubic-bezier(0.625, 0.05, 0, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);

  --gutter: clamp(16px, 2vw, 32px);
  --hud: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: clip; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 16px/1.6 var(--f-ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
body.is-loading { overflow: hidden; }
::selection { background: var(--signal); color: #0b0b0c; }

a { color: inherit; text-decoration: none; }
em { font-style: normal; color: var(--signal-ink); }
img { display: block; max-width: 100%; }
.mono {
  font: 400 10.5px/1.45 var(--f-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
:focus-visible { outline: 2px solid var(--signal); outline-offset: 4px; }
.dot { color: var(--signal-ink); }

/* ------------------------------------------------------------------
   Motif: span bar on a track
------------------------------------------------------------------- */
.track { position: relative; display: block; height: 8px; }
.track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--fg-16); }
.track b {
  position: absolute; top: 0; bottom: 0;
  left: calc(var(--x) * 100%); width: calc(var(--w) * 100%);
  background: var(--signal); border-radius: 1px;
  transform-origin: 0 50%;
}

/* ------------------------------------------------------------------
   Atmosphere
------------------------------------------------------------------- */
.grid-lines {
  position: fixed; inset: 0 var(--gutter); z-index: 0; pointer-events: none;
  display: flex; justify-content: space-between;
}
.grid-lines i { width: 1px; height: 100%; background: var(--fg-04); }

.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: 0.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='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.8s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 25% { transform: translate(-3%, 2%); }
  50% { transform: translate(2%, -3%); } 75% { transform: translate(-2%, -1%); }
  100% { transform: translate(0, 0); }
}

/* ------------------------------------------------------------------
   Odometer
------------------------------------------------------------------- */
.odo { display: inline-flex; line-height: 1; font-variant-numeric: tabular-nums; }
.odo-digit { display: inline-block; height: 1em; overflow: hidden; }
.odo-reel { display: flex; flex-direction: column; }
.odo-reel span { display: block; height: 1em; line-height: 1; text-align: center; }

/* ------------------------------------------------------------------
   Loader — the page's own request trace
------------------------------------------------------------------- */
.loader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg); color: var(--fg);
  display: grid; grid-template-rows: auto 1fr auto;
  padding: 24px var(--gutter);
}
.loader-head { display: flex; justify-content: space-between; color: var(--fg-64); }
.loader-trace {
  list-style: none; margin: 0; padding: 0; align-self: center;
  display: grid; gap: 18px; width: min(880px, 100%); justify-self: center;
}
.loader-trace li { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 16px; }
.loader-trace .mono { color: var(--fg-64); }
.loader-trace .track b { transform: scaleX(0); }
.loader-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.loader-status { margin: 0 0 14px; color: var(--fg-64); }
.loader-count {
  margin: 0; display: flex; align-items: flex-end; gap: 10px;
  font: 700 clamp(96px, 15vw, 220px)/0.82 var(--f-display); font-stretch: 75%; letter-spacing: -0.04em;
}
.loader-unit { padding-bottom: 0.9em; color: var(--signal); }

/* ------------------------------------------------------------------
   Cursor
------------------------------------------------------------------- */
.cursor {
  position: fixed; top: 0; left: 0; z-index: 95; pointer-events: none;
  width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%;
  background: #fff; mix-blend-mode: difference;
  display: grid; place-items: center;
  transition: width .45s var(--ease-expo), height .45s var(--ease-expo), margin .45s var(--ease-expo);
}
.cursor.is-active { width: 84px; height: 84px; margin: -42px 0 0 -42px; }
.cursor-label {
  font: 500 9px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: #000;
  opacity: 0; transition: opacity .2s;
}
.cursor.is-active .cursor-label { opacity: 1; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ------------------------------------------------------------------
   HUD
------------------------------------------------------------------- */
.hud { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.hud > * { pointer-events: auto; position: absolute; margin: 0; }
.brand { top: 20px; left: var(--gutter); display: flex; align-items: center; }
.brand-logo {
  font: 400 24px/1 "Major Mono Display", var(--f-mono); letter-spacing: -0.2em;
  transition: color .3s var(--ease-osmo);
}
.brand:hover .brand-logo, .brand:focus-visible .brand-logo { color: var(--signal-ink); }

.nav {
  top: 16px; left: 0; right: 0; width: max-content; margin-inline: auto;
  display: flex; gap: 2px; padding: 4px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  border: 1px solid var(--fg-16); border-radius: 6px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.nav-link {
  position: relative; display: flex; align-items: flex-start; gap: 2px;
  padding: 9px 14px 11px; border-radius: 3px;
  font: 500 12px/1 var(--f-ui); letter-spacing: .04em; text-transform: uppercase;
  transition: background-color .35s var(--ease-osmo), color .35s var(--ease-osmo);
}
.nav-link.is-active { background: var(--fg); color: var(--bg); }
.nav-count { font: 400 7px var(--f-mono); }
.nav-bar {
  position: absolute; left: 8px; right: 8px; bottom: 3px; height: 2px;
  background: var(--signal); transform: scaleX(0); transform-origin: 0 50%;
}

.hud-social { top: 20px; right: var(--gutter); display: flex; gap: 4px; }
.hud-social a {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 6px;
  color: var(--fg-64); border: 1px solid transparent;
  transition: color .3s var(--ease-osmo), border-color .3s var(--ease-osmo), background-color .3s var(--ease-osmo);
}
.hud-social a:hover, .hud-social a:focus-visible { color: var(--signal-ink); border-color: var(--fg-16); background: var(--fg-04); }
.hud-social svg { width: 16px; height: 16px; }
.hud-dim { color: var(--fg-64); }
.hud-geo { bottom: 22px; left: var(--gutter); }
.hud-status { bottom: 22px; right: var(--gutter); display: flex; align-items: center; gap: 8px; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); animation: pulse 1.6s var(--ease-osmo) infinite; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }

/* Hover text roll */
.roll { display: inline-block; overflow: hidden; vertical-align: top; }
.roll > span { position: relative; display: block; transition: transform .5s var(--ease-osmo); }
.roll > span::after { content: attr(data-text); position: absolute; left: 0; top: 100%; }
a:hover .roll > span, a:focus-visible .roll > span { transform: translateY(-100%); }

/* ------------------------------------------------------------------
   Sections
------------------------------------------------------------------- */
main { position: relative; z-index: 1; }
section { position: relative; padding: 0 var(--gutter); }
.section-label, .statement-label { color: var(--fg-64); margin: 0 0 40px; }

/* Hero: name, one line, one way forward */
.hero {
  min-height: 100svh; display: grid;
  grid-template-rows: auto 1fr auto auto;
  padding-top: calc(var(--hud) + 48px); padding-bottom: 88px;
}
.hero { isolation: isolate; overflow: clip; }
.hero-bg {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
}
.hero-canvas, .hero-net { -webkit-mask-image: radial-gradient(ellipse 85% 75% at 50% 45%, #000 30%, transparent 100%); mask-image: radial-gradient(ellipse 85% 75% at 50% 45%, #000 30%, transparent 100%); position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-glow {
  position: absolute; right: -10%; top: 10%; width: 60vw; height: 60vw; max-width: 900px; max-height: 900px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--signal) 5%, transparent), transparent);
  animation: glow-float 22s ease-in-out infinite alternate;
}
@keyframes glow-float {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(-12%, 14%) scale(1.15); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-glow { animation: none; }
}

.eyebrow { grid-row: 1; margin: 0; color: var(--fg-64); }
.hero-title {
  grid-row: 3; margin: 0 0 0 -0.04em;
  font: 700 clamp(64px, 11vw, 200px)/0.86 var(--f-display);
  font-stretch: 75%; letter-spacing: -0.045em; text-transform: uppercase;
}
.hero-title .line { display: block; }
.hero-foot {
  grid-row: 4; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--fg-16);
  display: flex; justify-content: space-between; align-items: baseline; gap: 24px;
}
.hero-intro { margin: 0; max-width: 56ch; font-size: 17px; line-height: 1.5; color: var(--fg-64); }
.hero-cta { white-space: nowrap; color: var(--fg); }
.scroll-arrow { display: inline-block; animation: nudge 1.8s var(--ease-osmo) infinite; }
@keyframes nudge { 50% { transform: translateY(4px); } }

/* Statement */
.statement { padding-top: 14vh; padding-bottom: 14vh; }
.statement-text {
  margin: 0; max-width: 30ch;
  font: 500 clamp(22px, 2.6vw, 40px)/1.15 var(--f-display); letter-spacing: -0.02em;
}

/* Work — pinned focus index */
.work { padding: 0; }
.work-inner {
  position: relative; height: 100svh; padding: calc(var(--hud) + 28px) var(--gutter) 72px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr); column-gap: calc(var(--gutter) * 1.5);
}
.work-meta { display: flex; flex-direction: column; justify-content: space-between; gap: 24px; min-width: 0; }
.work-label { color: var(--fg-64); margin: 0; }
.work-spec { margin: 0; display: grid; gap: 14px; }
.work-spec > div { display: grid; grid-template-columns: 72px 1fr; border-top: 1px solid var(--fg-16); padding-top: 9px; }
.work-spec dt { font: 400 9px/1.7 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--fg-64); }
.work-spec dd { margin: 0; font-size: 14px; line-height: 1.4; }
.work-trace { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 7px; }
.work-trace li { display: grid; grid-template-columns: 1fr; gap: 3px; }
.work-trace .mono { font-size: 8.5px; color: var(--fg-64); }
.work-trace .track { height: 5px; }
.work-counter { display: flex; align-items: flex-end; gap: 8px; font: 700 clamp(96px, 10vw, 168px)/1 var(--f-display); font-stretch: 75%; letter-spacing: -0.04em; }
.work-total { padding-bottom: 1.6em; color: var(--fg-64); }

.work-stage { position: relative; align-self: center; height: min(70svh, 640px); }
.card {
  position: absolute; inset: 0; overflow: hidden; border-radius: 6px;
  display: grid; grid-template-rows: auto 1fr auto;
  background: #141415; border: 1px solid var(--fg-16);
  clip-path: inset(100% 0 0 0);
}
.card:first-child { clip-path: inset(0 0 0 0); }
.card-chrome {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border-bottom: 1px solid var(--fg-08); color: var(--fg-64);
}
.card-chrome i { display: flex; gap: 5px; }
.card-chrome i::before, .card-chrome i::after, .card-chrome i b { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--fg-16); display: block; }
.card-url { flex: 1; padding: 4px 10px; border-radius: 3px; background: var(--fg-04); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: none; }
.card-media { position: relative; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.card-foot {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 14px 16px 16px; border-top: 1px solid var(--fg-08);
}
.card-title { margin: 0; font: 600 clamp(28px, 2.8vw, 44px)/0.95 var(--f-display); letter-spacing: -0.03em; }
.card-open { color: var(--signal-ink); white-space: nowrap; }
.card:hover .card-media img { transform: scale(1.02); }
.card-media img { transition: transform .8s var(--ease-expo); }


.work-list { list-style: none; margin: 0; padding: 0; align-self: center; display: grid; gap: 16px; }
.work-item { opacity: .28; transition: opacity .5s var(--ease-osmo); cursor: pointer; padding-left: 16px; position: relative; }
.work-item::before { content: ""; position: absolute; left: 0; top: 4px; width: 4px; height: 0; background: var(--signal); transition: height .5s var(--ease-osmo); }
.work-item.is-active { opacity: 1; }
.work-item.is-active::before { height: calc(100% - 8px); }
.work-item:hover { opacity: .7; }
.work-item.is-active:hover { opacity: 1; }
.work-item-cat { display: block; color: var(--fg-64); margin-bottom: 4px; }
.work-item-name { display: block; font: 600 clamp(20px, 1.8vw, 28px)/1 var(--f-display); letter-spacing: -0.02em; }
.work-item-desc { display: block; max-width: 34ch; margin-top: 8px; font-size: 13px; line-height: 1.45; color: var(--fg-64); }
.work-item:not(.is-active) .work-item-desc { display: none; }

/* Stack — colour wipes */
.stack { padding-top: 22vh; padding-bottom: 12vh; }
.svc-list { list-style: none; margin: 0 calc(var(--gutter) * -1); padding: 0; border-top: 1px solid var(--fg-16); }
.svc { position: relative; border-bottom: 1px solid var(--fg-16); overflow: hidden; }
.svc-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
  padding: 12px var(--gutter) 4px;
}
.svc-name { font: 700 clamp(64px, 11.5vw, 190px)/0.86 var(--f-display); font-stretch: 75%; letter-spacing: -0.04em; text-transform: uppercase; white-space: nowrap; }
.svc-desc { color: var(--fg-64); white-space: nowrap; }
.svc-fill { position: absolute; inset: 0; background: var(--signal); color: #0b0b0c; clip-path: inset(0 100% 0 0); }
.svc:nth-child(even) .svc-fill { background: var(--fg); color: var(--bg); }
.svc-fill .svc-desc { color: inherit; }
.svc-meter {
  position: absolute; top: 14px; left: 0; padding: 4px 7px; border-radius: 2px;
  background: var(--bg); color: var(--fg); border: 1px solid var(--fg-16);
  font-size: 9px; pointer-events: none; font-variant-numeric: tabular-nums;
}

/* About — inverted */
.about { padding-top: 22vh; padding-bottom: 16vh; }
.about-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: 56px; }
.about-lede { grid-column: 1 / 10; margin: 0; font: 500 clamp(32px, 4.2vw, 68px)/1.04 var(--f-display); letter-spacing: -0.03em; }
.about-body { grid-column: 7 / 12; margin: 0; max-width: 46ch; color: var(--fg-64); }
.stats { grid-column: 1 / -1; list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--gutter); }
.stats li { border-top: 1px solid var(--fg-32); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.stats .odo { font: 700 clamp(96px, 14vw, 220px)/1 var(--f-display); font-stretch: 75%; letter-spacing: -0.04em; }
.stat-label { color: var(--fg-64); }

.marquee { margin: 16vh calc(var(--gutter) * -1) 0; overflow: hidden; border-block: 1px solid var(--fg-16); padding: 18px 0; }
.marquee-track { display: flex; width: max-content; align-items: center; gap: 36px; font: 500 clamp(36px, 4.5vw, 72px)/1 var(--f-display); letter-spacing: -0.03em; white-space: nowrap; padding-right: 36px; }
.marquee-track i { width: 1.2em; height: .16em; background: var(--signal); border-radius: 1px; }

/* Contact */
.contact { padding-top: 24vh; padding-bottom: 12vh; text-align: center; display: grid; justify-items: center; }
.contact-cta { display: inline-block; font: 700 clamp(84px, 17vw, 290px)/0.86 var(--f-display); font-stretch: 75%; letter-spacing: -0.045em; text-transform: uppercase; }
.roll--big > span { padding: 0 .08em .04em 0; }
.roll--big > span::after { color: var(--signal); }
.contact-mail { margin: 36px 0 0; font-size: 12px; text-transform: none; }
.contact-mail a { border-bottom: 1px solid var(--fg-32); padding-bottom: 3px; }

/* Viewfinder buttons */
.corner-btns { display: flex; gap: 12px; margin-top: 56px; flex-wrap: wrap; justify-content: center; }
.corner-btn {
  --c: 8px; position: relative; padding: 14px 22px;
  font: 500 12px/1 var(--f-ui); text-transform: uppercase; letter-spacing: .1em;
  transition: color .35s var(--ease-osmo);
}
.corner-btn::before {
  content: ""; position: absolute; inset: 0;
  transition: inset .45s var(--ease-expo), border-color .35s;
  border: 1px solid var(--fg);
  -webkit-mask:
    linear-gradient(#000 0 0) top left / var(--c) var(--c) no-repeat,
    linear-gradient(#000 0 0) top right / var(--c) var(--c) no-repeat,
    linear-gradient(#000 0 0) bottom left / var(--c) var(--c) no-repeat,
    linear-gradient(#000 0 0) bottom right / var(--c) var(--c) no-repeat;
          mask:
    linear-gradient(#000 0 0) top left / var(--c) var(--c) no-repeat,
    linear-gradient(#000 0 0) top right / var(--c) var(--c) no-repeat,
    linear-gradient(#000 0 0) bottom left / var(--c) var(--c) no-repeat,
    linear-gradient(#000 0 0) bottom right / var(--c) var(--c) no-repeat;
}
.corner-btn:hover, .corner-btn:focus-visible { color: var(--signal); }
.corner-btn:hover::before, .corner-btn:focus-visible::before { inset: -5px; border-color: var(--signal); }

/* Footer — padded by the HUD height so nothing hides under it */
.footer { position: relative; padding: 0 var(--gutter) 64px; overflow: hidden; }
.wordmark {
  margin: 0; text-align: center; white-space: nowrap;
  font: 800 clamp(80px, 26vw, 460px)/.8 var(--f-display); font-stretch: 75%; letter-spacing: -0.05em;
}
.footer-meta { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 24px; border-top: 1px solid var(--fg-16); color: var(--fg-64); }

/* ------------------------------------------------------------------
   Responsive
------------------------------------------------------------------- */
@media (max-width: 899px) {
  :root { --hud: 64px; }
  .nav, .hud-geo, .hud-status { display: none; }
  .hud::before { content: ""; position: absolute; inset: 0 0 auto; height: 76px; background: linear-gradient(var(--bg) 40%, transparent); }
  .grid-lines i:nth-child(even) { display: none; }
  .hero { padding-bottom: 48px; }
  .hero-title { font-size: clamp(64px, 23vw, 160px); }
  .hero-foot { flex-direction: column; gap: 20px; }
  .work-inner { height: auto; grid-template-columns: minmax(0, 1fr); row-gap: 28px; padding-bottom: 24px; }
  .work-meta .work-spec, .work-counter, .work-list { display: none; }
  .work-stage { height: auto; display: grid; gap: 18px; }
  .card { position: relative; inset: auto; clip-path: none !important; }
  .card-media { aspect-ratio: 16 / 10; }
  .svc-desc { display: none; }
  .about-lede, .about-body { grid-column: 1 / -1; }
  .stats { grid-template-columns: minmax(0, 1fr); row-gap: 32px; }
  .loader-trace li { grid-template-columns: 72px 1fr; }
  .loader-head span:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .grain, .pulse, .scroll-arrow { animation: none; }
  .loader { display: none; }
}
