/* vxns studio — site styles */

@font-face {
  font-family: "Unbounded";
  src: url("../fonts/unbounded-var.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans-var.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-var.woff2") format("woff2");
  font-weight: 400 500;
  font-display: swap;
}

:root {
  /* palette */
  --abyss: #050a18;
  --deep: #081129;
  --navy: #0d1a3c;
  --indigo: #1f3a8a;
  --line: rgba(148, 172, 230, 0.16);
  --line-strong: rgba(148, 172, 230, 0.3);
  --text: #e6ecf8;
  --muted: #9aa7c7;
  --faint: #6c7a9e;
  --emerald: #34e0a1;
  --emerald-deep: #1aa676;

  /* type */
  --display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --sans: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* rhythm */
  --gutter: clamp(20px, 5vw, 72px);
  --section: clamp(96px, 14vw, 200px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  color-scheme: dark;
}

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

html {
  background: var(--abyss);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: clamp(16px, 0.35vw + 15px, 18px);
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(120% 70% at 85% 0%, rgba(31, 58, 138, 0.35), transparent 60%),
    linear-gradient(180deg, var(--deep) 0%, var(--abyss) 55%, #040815 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg, canvas { display: block; max-width: 100%; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: inherit; text-wrap: balance; }
ul { margin: 0; padding: 0; list-style: none; }

a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--emerald); }

:focus-visible {
  outline: 2px solid var(--emerald);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--emerald); color: var(--abyss); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip {
  position: fixed;
  left: 12px; top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--emerald);
  color: var(--abyss);
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
}
.skip:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: 1360px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.top {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) var(--gutter) 14px;
  transition: background-color 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease;
  border-bottom: 1px solid transparent;
}
.top.is-scrolled {
  background: rgba(5, 10, 24, 0.72);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: var(--line);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4em;
  text-decoration: none;
  padding-block: 6px;
}
.brand-mark {
  font-family: var(--display);
  font-weight: 750;
  letter-spacing: -0.04em;
  font-size: 1.3rem;
  line-height: 1;
}
.brand-word {
  font-size: 0.9rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.top nav ul { display: flex; gap: clamp(14px, 2.4vw, 36px); }
.top nav a {
  display: inline-block;
  padding-block: 8px;
  font-size: 0.92rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.top nav a:hover, .top nav a[aria-current="true"] { color: var(--text); }
.top nav a[aria-current="true"] { box-shadow: inset 0 -1px 0 var(--emerald); }

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

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding-top: 72px;
  padding-bottom: clamp(40px, 7vh, 88px);
  isolation: isolate;
}

.field {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}
.field-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.field.is-live .field-canvas { opacity: 1; }
.field.is-live .field-fallback { opacity: 0; }

/* no-JS / pre-paint fallback: the mark as plain type */
.field-fallback {
  position: absolute;
  left: 0; right: 0;
  top: 16%;
  text-align: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(120px, 27vw, 420px);
  line-height: 1;
  letter-spacing: -0.05em;
  color: transparent;
  background: linear-gradient(180deg, rgba(230, 236, 248, 0.9), rgba(120, 150, 230, 0.35));
  -webkit-background-clip: text;
  background-clip: text;
  transition: opacity 0.6s ease;
  user-select: none;
}
.js .field-fallback { opacity: 0; }
.no-field .field-fallback { opacity: 1 !important; }

.hero-copy {
  grid-row: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: end;
  gap: 24px 64px;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2rem, 4.4vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  max-width: 13ch;
}

.hero-lede {
  max-width: 36ch;
  color: var(--muted);
  font-size: clamp(1rem, 0.5vw + 0.9rem, 1.2rem);
  padding-bottom: 0.4em;
}

.readout {
  position: absolute;
  right: var(--gutter);
  top: calc(84px + env(safe-area-inset-top, 0px));
  display: flex;
  gap: 18px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.readout b { font-weight: 500; color: var(--muted); }
.readout [data-readout="state"] { color: var(--emerald-deep); }
.no-field .readout { display: none; }

/* ── shared section bits ────────────────── */

main > section:not(.hero) { padding-block: var(--section) 0; }

.section-name {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-name::before {
  content: "";
  width: 7px; height: 7px;
  background: var(--emerald);
  flex: none;
}

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags li {
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
}

/* ── about ──────────────────────────────── */

.about {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 40px 24px;
}
.about .section-name { grid-column: 1 / -1; }
.statement {
  grid-column: 1 / span 8;
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.7rem, 3.3vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}
.about-body {
  grid-column: 7 / -1;
  display: grid;
  gap: 1.1em;
  max-width: 54ch;
  color: #c6d0e6;
  margin-top: clamp(8px, 3vw, 40px);
}
.about-body .aside {
  color: var(--muted);
  padding-top: 1.1em;
  border-top: 1px solid var(--line);
}

/* ── areas ──────────────────────────────── */

.area-list {
  margin-top: 40px;
  border-top: 1px solid var(--line);
}
.area {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 16px 48px;
  padding-block: clamp(26px, 3.4vw, 44px);
  border-bottom: 1px solid var(--line);
  position: relative;
}
.area::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  height: 1px; width: 100%;
  background: linear-gradient(90deg, var(--emerald), transparent 70%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.7s var(--ease-out);
}
.area:hover::after { transform: scaleX(1); }
.area h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.5rem, 3.2vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}
.area-detail { display: grid; gap: 16px; align-content: start; padding-top: 0.35em; }
.area-detail p { color: #c6d0e6; max-width: 46ch; }

/* ── lab ────────────────────────────────── */

.lab-head {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 24px 48px;
  align-items: start;
  margin-bottom: clamp(40px, 5vw, 72px);
}
.lab-note { color: var(--muted); max-width: 48ch; }

.entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "head diagram"
    "body diagram";
  gap: 20px 56px;
  padding-block: clamp(32px, 4vw, 56px);
  border-top: 1px solid var(--line);
}
.entry:last-child { border-bottom: 1px solid var(--line); }
.entry-head { grid-area: head; display: grid; gap: 12px; align-content: start; }
.entry-body { grid-area: body; display: grid; gap: 20px; align-content: start; }
.entry-body p { color: #c6d0e6; max-width: 52ch; }
.entry h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.35rem, 2.2vw, 2.1rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--muted);
}
.status .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 3px rgba(52, 224, 161, 0.15);
}

.diagram {
  grid-area: diagram;
  margin: 0;
  align-self: center;
  padding: clamp(14px, 2vw, 28px);
  border: 1px solid var(--line);
  border-radius: 6px;
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 24px 24px,
    rgba(8, 17, 41, 0.6);
  background-blend-mode: normal;
}
.diagram svg { width: 100%; height: auto; overflow: visible; }
.d-node rect { fill: var(--deep); stroke: var(--line-strong); stroke-width: 1; }
.d-core rect { fill: var(--navy); stroke: var(--emerald-deep); }
.d-node text, .d-label {
  font-family: var(--mono);
  font-size: 13px;
  fill: var(--text);
  text-anchor: middle;
}
.d-label { fill: var(--faint); font-size: 11px; }
.d-flow {
  fill: none;
  stroke: var(--emerald);
  stroke-width: 1.5;
  stroke-dasharray: 4 6;
  opacity: 0.8;
}
.d-back { stroke: var(--faint); }
.is-visible .d-flow { animation: flow 1.6s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -20; } }

/* ── contact ────────────────────────────── */

.contact { display: grid; gap: 28px; align-content: start; min-height: 62vh; }
.contact-line {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(1.5rem, 3vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  max-width: 24ch;
}
.contact-sub {
  color: #c6d0e6;
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  max-width: 40ch;
  margin-top: -12px;
}
.contact-action { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.big-link {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.15rem, 3.4vw, 2.6rem);
  letter-spacing: -0.03em;
  color: var(--emerald);
  text-decoration: underline;
  text-decoration-color: rgba(52, 224, 161, 0.35);
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
  transition: text-decoration-color 0.2s ease;
}
.big-link:hover { text-decoration-color: var(--emerald); }
.copy {
  font: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.copy:hover { border-color: var(--emerald); }
.copy:active { transform: scale(0.97); }
.copy-status { color: var(--emerald); font-size: 0.9rem; }
.contact-alt { color: var(--muted); }

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

.foot {
  margin-top: var(--section);
  padding-block: 32px calc(32px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  align-items: baseline;
  font-size: 0.88rem;
  color: var(--faint);
}
.foot-brand { color: var(--text); margin-right: auto; }
.foot-brand .brand-mark { font-size: 1.05rem; }

/* ── reveal (only when JS + motion are on) ─ */

.motion .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}
.motion .reveal.is-visible { opacity: 1; transform: none; }

/* ── responsive ─────────────────────────── */

@media (max-width: 960px) {
  .hero-copy { grid-template-columns: 1fr; }
  .hero h1 { font-size: clamp(2.2rem, 7.4vw, 3.8rem); }
  .about-body { grid-column: 1 / -1; margin-top: 0; }
  .statement { grid-column: 1 / -1; }
  .area, .lab-head { grid-template-columns: 1fr; }
  .entry {
    grid-template-columns: 1fr;
    grid-template-areas: "head" "diagram" "body";
  }
}

@media (max-width: 560px) {
  .d-node text { font-size: 16px; }
  .d-label { font-size: 14px; }
  .brand-word { display: none; }
  .top nav a { font-size: 0.88rem; }
  .readout { top: auto; bottom: auto; right: auto; left: var(--gutter); top: calc(78px + env(safe-area-inset-top, 0px)); gap: 12px; }
  .hero h1 { font-size: clamp(2rem, 9.6vw, 2.6rem); }
}

@media (max-width: 360px) {
  .top nav ul { gap: 12px; }
  .readout [data-readout="state"] { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
