/* REFRAKT · concept studio site
   Static-first: base styles render a normal stacked document.
   html.conductor (added by JS when motion is allowed) pins panels
   over the WebGL canvas and lets scroll drive the timeline. */

:root {
  --bg: #050607;
  --bg2: #0c0e10;
  --ink: #e8e4dc;
  --mut: #9ba098;
  --volt: #c8ff2e;
  --paper: #ece8de;
  --paper-ink: #15160f;
  --mono: 'Martian Mono', ui-monospace, 'Cascadia Mono', monospace;
  --disp: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
}

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

html { scroll-behavior: smooth; }
html.conductor { scroll-behavior: auto; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--volt); color: #050607; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--volt);
  outline-offset: 3px;
}
a:focus-visible,button:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,[tabindex]:focus-visible{outline:3px solid currentColor;outline-offset:2px}
.light :focus-visible, .panel-mission :focus-visible {
  outline-color: #4a5d00;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* ---------- skip link + plain-view toggle (visible on focus) ---------- */
.skip-link {
  position: fixed; top: 10px; left: 16px; transform: translateY(-300%);
  z-index: 200; background: var(--ink); color: #050607;
  font-family: var(--mono); font-size: 12px; padding: 10px 16px;
  text-decoration: none;
}
.skip-link:focus-visible { transform: none; }

.plain-toggle {
  position: fixed; top: 10px; left: 50%; transform: translate(-50%, -300%);
  z-index: 200; background: var(--volt); color: #050607;
  font-family: var(--mono); font-size: 12px; padding: 10px 16px;
  text-decoration: none;
}
.plain-toggle:focus-visible { transform: translate(-50%, 0); }

/* ---------- loader ---------- */
#loader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg); display: none;
  align-items: flex-end; padding: 5vmin;
}
.conductor #loader { display: flex; }
#loader.done { opacity: 0; visibility: hidden; transition: opacity .45s ease, visibility 0s .45s; }
.loader-mark {
  position: absolute; top: 5vmin; left: 5vmin;
  font-family: var(--disp); font-weight: 900; font-size: 18px; letter-spacing: .35em;
}
.loader-pct {
  font-family: var(--disp); font-weight: 900;
  font-size: clamp(80px, 22vw, 240px); line-height: .8;
  color: var(--ink); font-variant-numeric: tabular-nums;
}
.loader-log {
  position: absolute; right: 5vmin; bottom: 5vmin; text-align: right;
  display: grid; gap: 4px; font-size: 11px; color: var(--mut);
  text-transform: uppercase; letter-spacing: .2em;
}
.loader-log span::before { content: '· '; }
.loader-log span.ok { color: var(--volt); }
.loader-log span.ok::before { content: '+ '; }

/* ---------- canvas + grid overlay ---------- */
#gl { display: none; }
.conductor #gl {
  display: block; position: fixed; inset: 0;
  width: 100%; height: 100%; z-index: 0;
}
#gridlayer {
  display: none; position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    repeating-linear-gradient(to right, transparent 0 95px, rgba(155,160,152,.10) 95px 96px),
    repeating-linear-gradient(to bottom, transparent 0 95px, rgba(155,160,152,.10) 95px 96px);
  mix-blend-mode: screen;
}
.conductor #gridlayer.on { display: block; }

/* ---------- HUD chrome ---------- */
.hud-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; mix-blend-mode: normal;
}
.mark {
  font-family: var(--disp); font-weight: 900; font-size: 20px;
  letter-spacing: .3em; text-decoration: none; display: flex; align-items: center; gap: 8px;
}
.mark-glyph { color: var(--volt); font-size: 14px; }
.hud-top nav { display: flex; gap: 28px; }
.hud-top nav a, .contact-cta {
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  text-decoration: none; padding: 10px 2px; position: relative;
}
.hud-top nav a::after {
  content: ''; position: absolute; left: 0; right: 100%; bottom: 6px;
  height: 1px; background: var(--volt); transition: right .25s ease;
}
.hud-top nav a:hover::after { right: 0; }
.contact-cta { color: var(--volt); }
.contact-cta:hover { background: var(--volt); color: #050607; }

/* light-section chrome flip */
html.on-light .hud-top, html.on-light .rail, html.on-light .readout, html.on-light .console { color: var(--paper-ink); }
html.on-light .mark-glyph, html.on-light .contact-cta { color: #4a5d00; }
html.on-light .contact-cta:hover { background: #4a5d00; color: var(--paper); }

/* ---------- left rail ---------- */
.rail {
  position: fixed; left: 24px; top: 50%; transform: translateY(-50%);
  z-index: 20; display: none; flex-direction: column; gap: 14px;
}
.conductor .rail { display: flex; }
.rail a {
  font-size: 10px; letter-spacing: .22em; text-decoration: none;
  color: var(--mut); display: flex; gap: 8px; padding: 4px 2px;
  transition: color .3s ease;
}
.rail a i { font-style: normal; color: currentColor; opacity: .55; }
.rail a.active { color: var(--volt); }
html.on-light .rail a.active { color: #4a5d00; }
.rail-track {
  position: absolute; left: -12px; top: 0; bottom: 0; width: 1px;
  background: rgba(155,160,152,.25);
}
.rail-fill {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: var(--volt); transform-origin: top; transform: scaleY(0);
}
html.on-light .rail-fill { background: #4a5d00; }

/* ---------- readout + console ---------- */
.readout {
  position: fixed; left: 24px; bottom: 20px; z-index: 20;
  display: none; gap: 18px; font-size: 10px; letter-spacing: .16em; color: var(--mut);
}
.conductor .readout { display: flex; }
.console {
  position: fixed; right: 24px; bottom: 20px; z-index: 20;
  display: none; align-items: center; gap: 16px;
  font-size: 10px; letter-spacing: .16em; color: var(--mut);
  border: 1px solid rgba(155,160,152,.3); padding: 10px 14px;
  background: rgba(5,6,7,.55); backdrop-filter: blur(4px);
}
.conductor .console { display: flex; }
html.on-light .console { background: rgba(236,232,222,.55); border-color: rgba(21,22,15,.3); }
.console-title { color: var(--volt); }
html.on-light .console-title { color: #4a5d00; }
.console label { display: flex; align-items: center; gap: 6px; cursor: pointer; min-height: 24px; }
.console input[type=range] { width: 90px; height: 24px; accent-color: var(--volt); }
.console input[type=checkbox] { accent-color: var(--volt); width: 15px; height: 15px; }
@media (pointer: coarse), (max-width: 760px) {
  .console input[type=checkbox] { width: 24px; height: 24px; }
  .console label { min-height: 32px; }
}
.console output { font-variant-numeric: tabular-nums; }

/* ---------- scroll spacer ---------- */
.spacer { display: none; }
.conductor .spacer { display: block; height: 1100vh; }

/* ---------- panels: static-first ---------- */
.panel {
  position: relative; min-height: 100vh;
  padding: 120px 24px 80px; max-width: 1100px; margin: 0 auto;
  display: flex; flex-direction: column; justify-content: center;
}
.conductor .panel {
  position: fixed; inset: 0; max-width: none;
  padding: 90px max(6vw, 64px);
  opacity: 0; visibility: hidden; z-index: 2;
  will-change: opacity;
}
@media (min-width: 761px) {
  /* keep panel text clear of the left rail */
  .conductor .panel { padding-left: clamp(150px, 12vw, 210px); }
  .conductor .hero-foot, .conductor .work-card, .conductor .site-foot { left: clamp(150px, 12vw, 210px); }
}

/* hero */
.hero-title {
  font-family: var(--disp); font-weight: 900;
  font-size: clamp(64px, 17vw, 260px); line-height: .82; letter-spacing: .02em;
}
/* in conductor mode the canvas draws the wordmark; the h1 becomes sr-only
   (class added by app.js so the plain document keeps its visible h1) */
.hero-foot {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 24px; flex-wrap: wrap; margin-top: 40px;
}
.conductor .hero-foot { position: absolute; left: max(6vw,64px); right: max(6vw,64px); bottom: 12vh; margin: 0; }
.hero-tag { font-size: 13px; max-width: 34ch; }
.hero-meta { font-size: 10px; letter-spacing: .2em; color: var(--mut); }
.scroll-hint {
  display: none; position: absolute; left: 50%; bottom: 3vh; transform: translateX(-50%);
  font-size: 9px; letter-spacing: .3em; color: var(--mut);
  flex-direction: column; align-items: center; gap: 6px;
}
.conductor .scroll-hint { display: flex; }
.scroll-hint i {
  width: 1px; height: 34px; background: var(--mut); display: block;
  animation: hint 1.6s ease-in-out 3;
  transform-origin: top;
}
@keyframes hint { 0% {transform: scaleY(0)} 55% {transform: scaleY(1)} 100% {transform: scaleY(1); opacity: 0} }

/* works intro */
.panel-works-intro { display: none; }
.conductor .panel-works-intro { display: flex; align-items: center; justify-content: center; }
.wi-word {
  font-family: var(--disp); font-weight: 900;
  font-size: clamp(120px, 34vw, 560px); line-height: 1;
  color: transparent; -webkit-text-stroke: 1px rgba(232,228,220,.85);
  white-space: nowrap; will-change: transform;
}
.wi-sub {
  position: absolute; bottom: 18vh; left: 50%; transform: translateX(-50%);
  font-size: 11px; letter-spacing: .3em; color: var(--mut);
}

/* works */
/* scrim so card text reads over the carousel planes */
.conductor .panel-works::before {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 46%;
  background: linear-gradient(to bottom, transparent, rgba(5,6,7,.9));
  pointer-events: none;
}
.works-counter {
  display: none; position: absolute; right: max(6vw,64px); bottom: 12vh;
  font-family: var(--disp); font-weight: 700; font-size: 44px; color: var(--mut);
}
.works-counter span { color: var(--volt); }
.conductor .works-counter { display: block; }
.works-list { list-style: none; display: grid; gap: 70px; }
.conductor .works-list { display: block; }
.work-card { max-width: 640px; }
.conductor .work-card {
  position: absolute; left: max(6vw,64px); bottom: 12vh; max-width: 480px;
  opacity: 0; visibility: hidden; transform: translateY(14px);
  transition: opacity .35s ease, transform .35s ease, visibility 0s .35s;
}
.conductor .work-card.on {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .35s ease .1s, transform .35s ease .1s;
}
.work-fig img { width: min(360px, 80vw); height: auto; display: block; margin-bottom: 18px; border: 1px solid rgba(155,160,152,.25); }
.conductor .work-fig { display: none; }
.work-date { font-size: 10px; letter-spacing: .25em; color: var(--volt); }
.work-title {
  font-family: var(--disp); font-weight: 900;
  font-size: clamp(34px, 5vw, 64px); line-height: .95; margin: 6px 0 10px;
}
.work-fact { color: var(--ink); max-width: 44ch; }
.work-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.work-tags li {
  font-size: 9px; letter-spacing: .18em; text-transform: uppercase;
  border: 1px solid rgba(155,160,152,.4); padding: 4px 8px; color: var(--mut);
}

/* mission (light) */
.panel-mission { background: var(--paper); color: var(--paper-ink); }
.conductor .panel-mission { background: transparent; }
.kicker { font-size: 10px; letter-spacing: .3em; color: inherit; opacity: .55; margin-bottom: 18px; }
.mission-title {
  font-family: var(--disp); font-weight: 900;
  font-size: clamp(44px, 9vw, 140px); line-height: .88; max-width: 8ch;
}
.mission-body { max-width: 52ch; margin-top: 28px; font-size: 15px; }
.mission-glyph {
  width: 180px; margin-top: 40px; color: var(--paper-ink); opacity: .6;
}
.conductor .mission-glyph { display: none; }

/* services */
.service-list { list-style: none; display: grid; gap: 48px; margin-top: 10px; }
@media (min-width: 900px) {
  .service-list { grid-template-columns: repeat(3, 1fr); gap: 40px; }
  .conductor .service-list { margin-top: 6vh; }
}
.service-num { font-size: 11px; letter-spacing: .25em; color: var(--volt); display: block; margin-bottom: 14px; }
.service-list h3 {
  font-family: var(--disp); font-weight: 900; font-size: clamp(26px, 3vw, 40px);
  line-height: .95; margin-bottom: 12px;
}
.service-list p { color: var(--mut); max-width: 38ch; }

/* contact */
.contact-title {
  font-family: var(--disp); font-weight: 900;
  font-size: clamp(64px, 14vw, 220px); line-height: .84;
}
.contact-line { margin-top: 26px; font-size: 14px; color: var(--ink); }
.site-foot { margin-top: 60px; color: var(--mut); font-size: 12px; max-width: 62ch; }
.conductor .site-foot { position: absolute; right: max(6vw,64px); bottom: 5vh; margin: 0; max-width: 60ch; }
@media (min-width: 761px) { .conductor .site-foot { padding-right: 300px; } }
.site-foot a { color: var(--ink); }
.foot-legal { letter-spacing: .18em; font-size: 10px; margin-top: 10px; }

/* ---------- reticle cursor ---------- */
#reticle { display: none; }
@media (pointer: fine) {
  .conductor #reticle {
    display: block; position: fixed; z-index: 60; pointer-events: none;
    left: 0; top: 0;
    width: 34px; height: 34px; margin: -17px 0 0 -17px;
    border: 1px solid rgba(200,255,46,.65); border-radius: 50%;
    transition: border-color .3s ease;
  }
  .conductor #reticle i {
    position: absolute; left: 50%; top: 50%; width: 3px; height: 3px;
    margin: -1.5px 0 0 -1.5px; background: var(--volt); display: block;
  }
  .conductor #reticle.hot { border-color: rgba(200,255,46,1); }
  html.on-light #reticle { border-color: rgba(74,93,0,.7); }
  html.on-light #reticle i { background: #4a5d00; }
}

/* ---------- static (plain) mode niceties ---------- */
html:not(.conductor) .panel { border-bottom: 1px solid rgba(155,160,152,.15); }
html:not(.conductor) .hud-top { position: static; padding: 24px; }
html:not(.conductor) .plain-toggle {
  position: static; transform: none; display: inline-block;
  margin: 16px 24px 0; background: transparent; color: var(--volt);
  border: 1px solid var(--volt); text-decoration: none;
}

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .hud-top nav { display: none; }
  .rail { display: none !important; }
  .readout { display: none !important; }
  .conductor .panel { padding: 80px 22px; }
  .conductor .work-card { left: 22px; right: 22px; bottom: 14vh; max-width: none; }
  .conductor .works-counter { right: 22px; bottom: 5vh; font-size: 30px; }
  .conductor .hero-foot { left: 22px; right: 22px; }
  .conductor .site-foot { left: 22px; right: 22px; }
  .console { right: 22px; bottom: 16px; gap: 10px; }
  .console-fx { display: none; }
}

/* ---------- reduced motion: kill everything ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  html { scroll-behavior: auto; }
}
