/* ==========================================================================
   NEXUS-V · Base
   Tokens, reset, type, buttons, cursor, grain, loader, navigation
   ========================================================================== */

:root {
  --bg: #0b0a09;
  --bg-1: #0e0d0b;
  --bg-2: #12110e;
  --bg-3: #1a1815;
  --panel: rgba(236, 228, 214, 0.025);
  --panel-2: rgba(236, 228, 214, 0.045);
  --line: rgba(236, 228, 214, 0.075);
  --line-2: rgba(236, 228, 214, 0.13);
  --line-3: rgba(236, 228, 214, 0.22);
  --ink: #ece6dc;
  --ink-2: rgba(236, 230, 220, 0.68);
  --ink-3: rgba(236, 230, 220, 0.58);
  --ink-4: rgba(236, 230, 220, 0.24);

  /* Colour system
     Base: espresso black + bone ivory. Warm neutrals read as calm and
     crafted (paper, stone, leather) instead of synthetic, and they sit well
     next to the warm-toned demo screenshots.
     Accent: antique brass, only for emphasis (one word per headline, active
     states, focus, progress). Roughly 60% base, 30% ink, under 10% accent. */
  --accent: #c9ad84;
  --accent-rgb: 201, 173, 132;
  --ok: var(--accent);
  --grad: var(--accent);
  --grad-soft: linear-gradient(180deg, rgba(201, 173, 132, 0.06), rgba(201, 173, 132, 0.015));

  --sans: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Instrument Serif", "Iowan Old Style", "Times New Roman", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-back: cubic-bezier(0.34, 1.56, 0.64, 1);

  --gutter: clamp(18px, 4vw, 64px);
  --shell: 1480px;
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --nav-h: 84px;
}

/* ── Reset ─────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
  color-scheme: dark;
  scroll-padding-top: 90px;
}
html.lenis,
html.lenis body {
  height: auto;
}
.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}
.lenis.lenis-stopped {
  overflow: hidden;
}
.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -0.005em;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
html.is-locked,
body.is-locked {
  overflow: hidden;
}
html {
  scrollbar-color: rgba(236, 228, 214, 0.22) transparent;
  scrollbar-width: thin;
}
img,
svg,
video,
canvas,
iframe {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
h1,
h2,
h3,
h4,
p,
ul,
ol,
figure,
fieldset,
legend {
  margin: 0;
  padding: 0;
}
fieldset {
  border: 0;
  min-width: 0;
}
ul,
ol {
  list-style: none;
}
::selection {
  background: rgba(var(--accent-rgb), 0.38);
  color: var(--ink);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
[hidden] {
  display: none !important;
}

.skip {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 1000;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  transform: translateY(-200%);
  transition: transform 0.3s var(--ease);
}
.skip:focus {
  transform: none;
}
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Layout + type helpers ─────────────────────────────────────────────── */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section {
  position: relative;
  padding-block: clamp(96px, 13vw, 190px);
}
.label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.label .idx {
  color: var(--ink);
  margin-right: 10px;
}
.serif {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.015em;
}
.grad-text {
  color: var(--accent);
}
.muted {
  color: var(--ink-2);
}

.sec-head {
  display: grid;
  gap: 26px;
  margin-bottom: clamp(48px, 6vw, 88px);
}
.sec-head--row {
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: end;
  gap: 40px;
}
.sec-title {
  font-size: clamp(40px, 6.2vw, 96px);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.045em;
  max-width: 15ch;
  margin-top: 22px;
  text-wrap: balance;
}
.sec-title .serif {
  letter-spacing: -0.03em;
}
.sec-lede {
  max-width: 44ch;
  font-size: clamp(16px, 1.25vw, 19px);
  line-height: 1.55;
  color: var(--ink-2);
  text-wrap: pretty;
}
@media (max-width: 900px) {
  .sec-head--row {
    grid-template-columns: 1fr;
    gap: 22px;
  }
}

/* masked line reveal (lines created by SplitText or by hand) */
.line-mask {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}
.line-mask > span {
  display: block;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  --h: 54px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: var(--h);
  padding: 0 26px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  isolation: isolate;
  overflow: hidden;
  transition: color 0.45s var(--ease), border-color 0.45s var(--ease), background-color 0.45s var(--ease);
  will-change: transform;
}
.btn--sm {
  --h: 42px;
  padding: 0 18px;
  font-size: 14px;
  gap: 8px;
}
.btn--lg {
  --h: 64px;
  padding: 0 34px;
  font-size: 16px;
}
.btn--light {
  background: var(--ink);
  color: #0b0a09;
}
.btn--light::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--grad);
  transform: translateY(102%);
  transition: transform 0.6s var(--ease);
}
.btn--light:hover::before,
.btn--light:focus-visible::before {
  transform: none;
}
.btn--ghost {
  border: 1px solid var(--line-2);
  background: rgba(236, 228, 214, 0.025);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.btn--ghost::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--ink);
  transform: scale(0.2);
  opacity: 0;
  transition: transform 0.6s var(--ease), opacity 0.4s var(--ease);
}
.btn--ghost:hover {
  color: #0b0a09;
  border-color: var(--ink);
}
.btn--ghost:hover::before {
  transform: none;
  opacity: 1;
}
/* rolling label */
.roll {
  position: relative;
  display: inline-block;
  overflow: hidden;
  line-height: 1.25;
  vertical-align: top;
}
.roll > span {
  display: block;
  transition: transform 0.6s var(--ease);
}
.roll > span::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 100%;
}
a:hover > .roll > span,
button:hover > .roll > span,
.btn:hover .roll > span {
  transform: translateY(-100%);
}
.btn__icon {
  width: 16px;
  height: 16px;
  flex: none;
  transition: transform 0.6s var(--ease);
}
.btn:hover .btn__icon--ne {
  transform: rotate(45deg);
}
.btn:hover .btn__icon--down {
  transform: translateY(2px);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  color: var(--ink);
  transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease), color 0.35s var(--ease);
}
.icon-btn:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}
.icon-btn svg {
  width: 16px;
  height: 16px;
}

/* ── Ambient layers ────────────────────────────────────────────────────── */
.grain {
  position: fixed;
  inset: -10%;
  z-index: 200;
  pointer-events: none;
  opacity: 0.055;
  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='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate3d(0, 0, 0); }
  17% { transform: translate3d(-3%, 2%, 0); }
  34% { transform: translate3d(2%, -3%, 0); }
  51% { transform: translate3d(-3%, -2%, 0); }
  68% { transform: translate3d(3%, 3%, 0); }
  85% { transform: translate3d(-1%, 3%, 0); }
  100% { transform: translate3d(0, 0, 0); }
}
@media (hover: none), (max-width: 760px) {
  .grain {
    animation: none;
  }
}
.guides {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.guides span {
  border-left: 1px solid rgba(236, 228, 214, 0.028);
}
.guides span:last-child {
  border-right: 1px solid rgba(236, 228, 214, 0.028);
}
@media (max-width: 760px) {
  .guides {
    grid-template-columns: repeat(2, 1fr);
  }
  .guides span:nth-child(n + 3) {
    display: none;
  }
}
.progress {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 120;
  width: 100%;
  height: 2px;
  pointer-events: none;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: var(--grad);
}
main,
.footer {
  position: relative;
  z-index: 1;
}

/* ── Cursor ────────────────────────────────────────────────────────────── */
.cursor {
  display: none;
}
@media (hover: hover) and (pointer: fine) {
  html.has-cursor,
  html.has-cursor a,
  html.has-cursor button,
  html.has-cursor label,
  html.has-cursor [role="button"] {
    cursor: none;
  }
  html.has-cursor input,
  html.has-cursor textarea {
    cursor: text;
  }
  html.has-cursor .cursor {
    display: block;
  }
}
.cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 400;
  pointer-events: none;
}
.cursor__dot,
.cursor__ring {
  position: fixed;
  left: 0;
  top: 0;
  border-radius: 50%;
  will-change: transform;
}
.cursor__dot {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  background: var(--ink);
  transition: opacity 0.3s, width 0.3s var(--ease), height 0.3s var(--ease), margin 0.3s var(--ease);
}
.cursor__ring {
  width: 38px;
  height: 38px;
  margin: -19px 0 0 -19px;
  display: grid;
  place-items: center;
}
.cursor__ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(236, 230, 220, 0.38);
  transition: transform 0.5s var(--ease), background-color 0.4s var(--ease), border-color 0.4s var(--ease);
}
.cursor__label {
  position: relative;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #0b0a09;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.3s var(--ease), transform 0.5s var(--ease);
  white-space: nowrap;
}
.cursor.is-link .cursor__ring::before {
  transform: scale(1.55);
  background: rgba(236, 230, 220, 0.08);
  border-color: rgba(236, 230, 220, 0.6);
}
.cursor.is-link .cursor__dot {
  opacity: 0;
}
.cursor.is-label .cursor__ring::before {
  transform: scale(2.5);
  background: var(--ink);
  border-color: var(--ink);
}
.cursor.is-label .cursor__label {
  opacity: 1;
  transform: none;
}
.cursor.is-label .cursor__dot {
  opacity: 0;
}
.cursor.is-text .cursor__ring::before {
  transform: scale(0.4);
  opacity: 0;
}
.cursor.is-hidden .cursor__dot,
.cursor.is-hidden .cursor__ring {
  opacity: 0;
}
.cursor.is-down .cursor__ring::before {
  transform: scale(0.8);
}
.cursor.is-label.is-down .cursor__ring::before {
  transform: scale(2.2);
}

/* ── Loader ────────────────────────────────────────────────────────────── */
.loader {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--ink);
  clip-path: inset(0 0 0 0);
}
html:not(.js) .loader {
  display: none;
}
.loader__ring {
  position: relative;
  width: min(300px, 62vw);
  aspect-ratio: 1;
}
.loader__ring svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.loader__track {
  fill: none;
  stroke: rgba(236, 228, 214, 0.08);
  stroke-width: 1.2;
}
.loader__arc {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.loader__tip {
  fill: var(--ink);
  filter: drop-shadow(0 0 8px rgba(201, 173, 132, 0.8));
}
.loader__in {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
}
.loader__mark {
  width: 46px;
  height: 46px;
}
.loader__count {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.loader__foot {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 28px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.loader__word {
  position: absolute;
  top: 28px;
  left: var(--gutter);
  right: var(--gutter);
  display: flex;
  justify-content: space-between;
}

/* ── Brand ─────────────────────────────────────────────────────────────── */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.02em;
}
.brand__mark {
  width: 30px;
  height: 30px;
  flex: none;
}
.brand__word b {
  font-weight: 600;
  color: var(--accent);
}

/* ── Navigation ────────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 150;
  height: var(--nav-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
  transition: transform 0.7s var(--ease), background-color 0.5s var(--ease);
}
.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(11, 10, 9, 0.82), rgba(11, 10, 9, 0));
  opacity: 0;
  transition: opacity 0.5s var(--ease);
  pointer-events: none;
}
.nav.is-scrolled::before {
  opacity: 1;
}
.nav.is-hidden {
  transform: translateY(-110%);
}
.nav__links {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(20, 18, 15, 0.55);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}
.nav__links a {
  position: relative;
  z-index: 1;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--ink-2);
  transition: color 0.35s var(--ease);
}
.nav__links a:hover,
.nav__links a.is-active {
  color: var(--ink);
}
.nav__pill {
  position: absolute;
  z-index: 0;
  top: 5px;
  bottom: 5px;
  left: 0;
  width: 0;
  border-radius: 999px;
  background: rgba(236, 228, 214, 0.08);
  border: 1px solid rgba(236, 228, 214, 0.07);
  opacity: 0;
  transition: transform 0.6s var(--ease), width 0.6s var(--ease), opacity 0.4s var(--ease);
}
.nav__right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
}
.status i {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(201, 173, 132, 0.6);
}
.status i::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  animation: ping 2.2s var(--ease) infinite;
}
@keyframes ping {
  0% { transform: scale(0.4); opacity: 0.9; }
  80%, 100% { transform: scale(1.8); opacity: 0; }
}
.nav__burger {
  display: none;
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: rgba(20, 18, 15, 0.55);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.nav__burger span {
  position: absolute;
  left: 14px;
  right: 14px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.5s var(--ease), top 0.5s var(--ease);
}
.nav__burger span:nth-child(1) {
  top: 18px;
}
.nav__burger span:nth-child(2) {
  top: 26px;
}
.nav__burger[aria-expanded="true"] span:nth-child(1) {
  top: 22px;
  transform: rotate(45deg);
}
.nav__burger[aria-expanded="true"] span:nth-child(2) {
  top: 22px;
  transform: rotate(-45deg);
}

@media (max-width: 1100px) {
  .status {
    display: none;
  }
}
@media (max-width: 900px) {
  .nav {
    grid-template-columns: 1fr auto;
    --nav-h: 72px;
  }
  .nav__links {
    display: none;
  }
  .nav__right .btn {
    display: none;
  }
  .nav__burger {
    display: block;
  }
}

/* ── Mobile menu ───────────────────────────────────────────────────────── */
.menu {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  align-content: end;
  gap: 40px;
  padding: 110px max(var(--gutter), env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  background: rgba(11, 10, 9, 0.96);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.8s var(--ease);
  visibility: hidden;
}
.menu.is-open {
  clip-path: inset(0 0 0 0);
  visibility: visible;
}
.menu__links a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 6px 0;
  font-size: clamp(42px, 11vw, 76px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1;
  border-bottom: 1px solid var(--line);
  transform: translateY(30px);
  opacity: 0;
  transition: transform 0.8s var(--ease), opacity 0.6s var(--ease);
}
.menu__links a span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}
.menu.is-open .menu__links a {
  transform: none;
  opacity: 1;
}
.menu.is-open .menu__links li:nth-child(2) a { transition-delay: 0.05s; }
.menu.is-open .menu__links li:nth-child(3) a { transition-delay: 0.1s; }
.menu.is-open .menu__links li:nth-child(4) a { transition-delay: 0.15s; }
.menu.is-open .menu__links li:nth-child(5) a { transition-delay: 0.2s; }
.menu__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ── Reveal states (only when motion is on) ────────────────────────────── */
html.motion [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
}
html.motion [data-reveal="fade"] {
  transform: none;
}

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