/* ==========================================================================
   Nexus Limited
   ========================================================================== */

:root {
  --bg: #050505;
  --fg: #ecebe7;
  --fg-2: #b4b3ae;
  --muted: #74736f;
  --line: rgba(236, 235, 231, 0.1);
  --line-2: rgba(236, 235, 231, 0.22);
  --accent: #cdb88f;

  --sans: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --gutter: clamp(16px, 3.2vw, 48px);
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-io: cubic-bezier(0.76, 0, 0.24, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.is-loading { overflow: hidden; }
/* Nothing but the loader is shown until the opening takes over (prevents a flash of the hero) */
body.is-loading main, body.is-loading .header, body.is-loading .footer, body.is-loading .progress { opacity: 0; }
body:not(.is-booted) .loader__foot { opacity: 0; }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
ul { list-style: none; margin: 0; padding: 0; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }

.mono {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.4;
}
.muted { color: var(--muted); }

/* Underline link */
.ulink {
  width: fit-content;
  background: linear-gradient(currentColor, currentColor) 100% 100% / 0 1px no-repeat;
  transition: background-size .7s var(--ease), color .4s;
}
.ulink:hover { background-size: 100% 1px; background-position: 0 100%; color: var(--fg); }

/* Rolling text (built by JS) */
.roll { display: inline-flex; flex-direction: column; overflow: hidden; height: 1.3em; line-height: 1.3em; vertical-align: top; }
.roll > span { transition: transform .7s var(--ease); }
[data-roll]:hover .roll > span, [data-roll]:focus-visible .roll > span { transform: translateY(-100%); }

/* ---------- Canvas & atmosphere ---------- */
#gl { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
.progress { position: fixed; right: 18px; top: 50%; width: 1px; height: 120px; margin-top: -60px; background: var(--line); z-index: 30; }
.progress span { display: block; width: 100%; height: 100%; background: var(--fg); transform-origin: top; transform: scaleY(0); }

main, .footer { position: relative; z-index: 2; }

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  pointer-events: none;
}
.loader.no-gl { background: var(--bg); }
.loader__name {
  display: inline-block;
  font-size: 13px; letter-spacing: 0.5em; text-transform: uppercase; font-weight: 400;
  padding-left: .5em;
}
/* The wordmark appears straight away (pure CSS, before any script loads) */
.loader__center { animation: loaderIn 1.4s cubic-bezier(.19,1,.22,1) .15s both; }
@keyframes loaderIn { from { opacity: 0; transform: translateY(8px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.loader__name em { text-transform: none; letter-spacing: 0; font-size: 17px; color: var(--muted); margin-left: .2em; }
.loader__foot {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: var(--gutter);
  display: flex; justify-content: space-between; color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Cursor ---------- */
.cursor { position: fixed; top: 0; left: 0; z-index: 90; pointer-events: none; }
.cursor__dot, .cursor__ring { position: fixed; top: 0; left: 0; border-radius: 50%; will-change: transform; }
.cursor__dot { width: 4px; height: 4px; margin: -2px 0 0 -2px; background: var(--fg); transition: opacity .3s; }
.cursor__ring {
  width: 30px; height: 30px; margin: -15px 0 0 -15px;
  border: 1px solid rgba(236,235,231,.28);
  display: grid; place-items: center;
  transition: width .6s var(--ease), height .6s var(--ease), margin .6s var(--ease), background .5s, border-color .5s, backdrop-filter .5s;
}
.cursor__label { font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg); opacity: 0; transform: scale(.8); transition: opacity .4s, transform .6s var(--ease); white-space: nowrap; }
.cursor.is-hover .cursor__ring { width: 48px; height: 48px; margin: -24px 0 0 -24px; border-color: rgba(236,235,231,.5); }
.cursor.is-label .cursor__ring {
  width: 88px; height: 88px; margin: -44px 0 0 -44px;
  background: rgba(5,5,5,.25); border-color: rgba(236,235,231,.35);
}
.cursor.is-label .cursor__label { opacity: 1; transform: none; }
.cursor.is-label .cursor__dot { opacity: 0; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ---------- Header ---------- */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 24px var(--gutter);
  transition: transform .8s var(--ease);
}
.header.is-hidden { transform: translateY(-110%); }
.logo { display: inline-flex; align-items: center; gap: 12px; justify-self: start; }
.logo__mark { width: 32px; height: 19px; fill: none; stroke: var(--fg); stroke-width: 1.1; }
.logo__type { font-size: 13px; font-weight: 500; letter-spacing: 0.36em; text-transform: uppercase; display: flex; align-items: baseline; gap: 8px; }
.logo__sub { font-family: var(--serif); font-style: italic; text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 15px; color: var(--muted); }

.nav {
  display: flex; gap: 6px; padding: 5px;
  border: 1px solid var(--line); border-radius: 100px;
  background: rgba(10,10,10,.35);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.nav__link { font-size: 13px; letter-spacing: .01em; padding: 7px 16px; border-radius: 100px; color: var(--fg-2); transition: color .4s, background .4s; }
.nav__link:hover, .nav__link.is-active { color: var(--fg); background: rgba(236,235,231,.06); }

.header__right { justify-self: end; display: flex; align-items: center; gap: 24px; }
.header__clock { display: flex; align-items: center; gap: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: pulse 2.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

.pill {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; padding: 10px 20px; border-radius: 100px;
  border: 1px solid var(--line-2);
  transition: background .5s var(--ease), color .5s var(--ease), border-color .5s;
}
.pill:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.pill--lg { font-size: 15px; padding: 16px 30px; }

/* ---------- Shared type ---------- */
.line { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.line > span { display: inline-block; will-change: transform; }

.section-label { display: flex; align-items: center; gap: 20px; color: var(--muted); margin-bottom: clamp(40px, 7vw, 96px); }
.section-label span:first-child { color: var(--fg); }
.section-label i { flex: 1; height: 1px; background: var(--line); transform-origin: left; }

.h2 {
  font-size: clamp(40px, 6.2vw, 104px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: 300;
  margin: 0;
  text-wrap: balance;
}
.h2 em { letter-spacing: -0.02em; }

section { padding: clamp(110px, 18vh, 200px) var(--gutter); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: space-between;
  padding-top: 120px; padding-bottom: 40px;
}
.hero__stage { position: absolute; inset: 0; z-index: 0; cursor: grab; touch-action: pan-y; }
.hero__stage:active { cursor: grabbing; }
.hero > *:not(.hero__stage) { position: relative; z-index: 1; pointer-events: none; }
.hero a { pointer-events: auto; }
.hero__top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
.hero__hint { display: inline-flex; align-items: center; gap: 10px; color: var(--fg-2); }
.hero__hint i { width: 18px; height: 18px; border: 1px solid var(--line-2); border-radius: 50%; position: relative; }
.hero__hint i::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--fg); animation: hint 2.4s var(--ease-io) infinite; }
@keyframes hint { 0%, 100% { transform: translateX(-3px); } 50% { transform: translateX(3px); } }
.hero__bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 48px; }
.hero__title {
  margin: 0;
  font-size: clamp(38px, 5.4vw, 100px);
  line-height: 0.98;
  letter-spacing: -0.05em;
  font-weight: 300;
}
.hero__title em { letter-spacing: -0.025em; padding-right: .04em; }
.hero__aside { display: flex; flex-direction: column; align-items: flex-start; gap: 28px; max-width: 340px; }
.hero__lede { margin: 0; color: var(--fg-2); font-size: 15px; line-height: 1.6; }

.scroll-cue { display: flex; align-items: center; gap: 16px; color: var(--fg-2); }
.scroll-cue__line { width: 1px; height: 36px; background: var(--line); position: relative; overflow: hidden; }
.scroll-cue__line::after {
  content: ""; position: absolute; inset: 0; background: var(--fg);
  animation: cue 2.4s var(--ease-io) infinite;
}
@keyframes cue { 0% { transform: translateY(-100%); } 55%, 100% { transform: translateY(100%); } }

/* ---------- Marquee ---------- */
.marquee {
  position: relative; z-index: 2;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  overflow: hidden; padding: 26px 0;
}
.marquee__track {
  display: flex; gap: 56px; width: max-content; align-items: center;
  font-size: clamp(22px, 2.6vw, 38px); letter-spacing: -0.03em; white-space: nowrap;
  color: var(--fg-2);
  animation: marquee 55s linear infinite;
}
.marquee__track em { color: var(--fg); font-size: 1.12em; }
.marquee__track i { width: 6px; height: 6px; border: 1px solid var(--accent); border-radius: 50%; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Manifesto ---------- */
.manifesto { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.manifesto__text {
  margin: 0;
  max-width: min(1000px, 62vw);
  font-size: clamp(28px, 4vw, 64px);
  line-height: 1.12;
  letter-spacing: -0.035em;
  text-wrap: pretty;
}
.manifesto__text .w { opacity: 0.12; transition: opacity .5s ease; }
.manifesto__text .w.is-on { opacity: 1; }

/* ---------- Companies ---------- */
.companies__head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 32px; margin-bottom: clamp(56px, 8vw, 110px); }
.companies__intro { max-width: 340px; margin: 0; color: var(--fg-2); }

.co-list { border-top: 1px solid var(--line); }
.co {
  position: relative;
  display: grid;
  grid-template-columns: 72px 1fr 220px 48px;
  align-items: center;
  gap: 24px;
  padding: clamp(26px, 3.2vw, 42px) 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  outline: none;
}
.co::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, var(--accent), rgba(205,184,143,.15));
  transform: scaleX(0); transform-origin: left;
  transition: transform 1s var(--ease);
}
.co:hover::after, .co:focus-visible::after { transform: scaleX(1); }
.co__idx { color: var(--muted); transition: color .5s; }
.co__name {
  font-size: clamp(30px, 4.6vw, 76px);
  line-height: 1; letter-spacing: -0.045em;
  transition: transform .9s var(--ease), opacity .6s var(--ease);
}
.co__name em { font-size: .58em; color: var(--muted); letter-spacing: -0.01em; }
.co__cat { font-family: var(--serif); font-style: italic; font-size: 20px; color: var(--muted); transition: color .5s; }
.co__arrow {
  justify-self: end; width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--line-2); display: grid; place-items: center;
  transition: background .5s var(--ease), border-color .5s, transform .9s var(--ease);
}
.co__arrow svg { width: 16px; height: 16px; fill: none; stroke: var(--fg); stroke-width: 1.2; transition: stroke .5s, transform .9s var(--ease); transform: rotate(-45deg); }
.co:hover .co__name, .co:focus-visible .co__name { transform: translateX(20px); }
.co:hover .co__idx, .co:focus-visible .co__idx { color: var(--accent); }
.co:hover .co__cat, .co:focus-visible .co__cat { color: var(--fg); }
.co:hover .co__arrow, .co:focus-visible .co__arrow { background: var(--fg); border-color: var(--fg); }
.co:hover .co__arrow svg, .co:focus-visible .co__arrow svg { stroke: var(--bg); transform: rotate(0); }
.co-list:hover .co:not(:hover) .co__name { opacity: .22; }
.companies__note { color: var(--muted); margin-top: 32px; }

/* ---------- Interlude ---------- */
.interlude { height: 300vh; padding: 0 var(--gutter); }
.interlude__sticky {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
}
.interlude__eyebrow { color: var(--muted); margin: 0 0 40px; }
.interlude__text {
  margin: 0; font-weight: 300;
  font-size: clamp(44px, 8.4vw, 150px);
  line-height: 0.96; letter-spacing: -0.055em;
}
.interlude__text em { letter-spacing: -0.03em; }

/* ---------- Approach ---------- */
.approach .h2 { margin-bottom: clamp(64px, 9vw, 130px); }
.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(28px, 4vw, 72px); }
.pillar { border-top: 1px solid var(--line); padding-top: 32px; }
.pillar__n { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--accent); }
.pillar h3 { font-weight: 400; font-size: clamp(22px, 2vw, 28px); letter-spacing: -0.03em; margin: 28px 0 14px; }
.pillar p { color: var(--fg-2); margin: 0; max-width: 360px; }

/* ---------- Contact ---------- */
.contact { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.contact__big {
  display: block; width: fit-content; margin-top: 0; font-weight: 300;
  font-size: clamp(56px, 11vw, 210px);
  line-height: 0.9; letter-spacing: -0.06em;
  margin-bottom: clamp(64px, 9vw, 130px);
}

/* Enquiry form */
.enquiry { max-width: min(1000px, 60vw); border-top: 1px solid var(--line); padding-top: 40px; }
.enquiry__topics { border: 0; margin: 0 0 44px; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.enquiry__topics legend { padding: 0; margin-bottom: 18px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block; font-size: 14px; padding: 10px 20px; border-radius: 100px;
  border: 1px solid var(--line-2); color: var(--fg-2);
  transition: background .5s var(--ease), color .5s var(--ease), border-color .5s;
}
.chip:hover span { border-color: var(--fg-2); color: var(--fg); }
.chip input:checked + span { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chip input:focus-visible + span { outline: 1px solid var(--accent); outline-offset: 3px; }

.enquiry__fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 36px 40px; }
.field { position: relative; display: block; padding-top: 18px; }
.field--full { grid-column: 1 / -1; }
.field input, .field textarea {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line-2);
  color: var(--fg); font: inherit; font-size: clamp(17px, 1.4vw, 20px); font-weight: 300;
  padding: 10px 0 12px; outline: none; border-radius: 0; resize: none;
  transition: border-color .5s;
}
.field textarea { min-height: 52px; field-sizing: content; }
.field > span {
  position: absolute; left: 0; top: 28px; color: var(--muted);
  font-size: clamp(17px, 1.4vw, 20px); pointer-events: none;
  transform-origin: left top;
  transition: transform .6s var(--ease), color .4s;
}
.field > span i { font-style: normal; font-size: .75em; }
.field input:focus ~ span, .field textarea:focus ~ span,
.field input:not(:placeholder-shown) ~ span, .field textarea:not(:placeholder-shown) ~ span {
  transform: translateY(-26px) scale(.62); color: var(--fg-2);
}
.field::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform .9s var(--ease);
}
.field:focus-within::after { transform: scaleX(1); }
.field.is-invalid input, .field.is-invalid textarea { border-bottom-color: #c25a4a; }
.field.is-invalid > span { color: #d07a6a; }

.enquiry__trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.enquiry__foot { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-top: 48px; }
.enquiry__status { color: var(--fg-2); margin: 0; min-height: 1.4em; }
.enquiry__status.is-error { color: #d07a6a; }
.enquiry__status.is-ok { color: var(--accent); }
.enquiry__send { background: none; cursor: pointer; }
.enquiry__send:disabled { opacity: .5; pointer-events: none; }
.enquiry.is-sent .enquiry__fields, .enquiry.is-sent .enquiry__topics { opacity: .35; pointer-events: none; transition: opacity .8s; }

/* ---------- Footer ---------- */
.footer { padding: 0 var(--gutter); overflow: hidden; }
.footer__row {
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding: 28px 0; border-top: 1px solid var(--line); color: var(--muted);
}
.footer__links { display: flex; gap: 28px; }
.footer__word {
  font-size: 27vw; line-height: .78; font-weight: 300;
  letter-spacing: -0.06em; text-align: center;
  margin: 2vw -0.04em -0.06em;
  background: linear-gradient(to bottom, rgba(236,235,231,.16), rgba(236,235,231,0) 85%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  user-select: none;
}

/* ---------- Panel ---------- */
.panel { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.panel.is-open { pointer-events: auto; }
.panel__backdrop { position: absolute; inset: 0; background: rgba(5,5,5,.55); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); opacity: 0; transition: opacity .8s var(--ease); }
.panel.is-open .panel__backdrop { opacity: 1; }
.panel__inner {
  position: absolute; top: 12px; right: 12px; bottom: 12px;
  width: min(680px, calc(100% - 24px));
  background: rgba(14,14,14,.92);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: clamp(28px, 4.4vw, 56px);
  overflow-y: auto;
  transform: translateX(calc(100% + 24px));
  transition: transform 1s var(--ease-io);
}
.panel.is-open .panel__inner { transform: none; }
.panel__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: clamp(56px, 10vh, 120px); }
.panel__idx { color: var(--accent); }
.panel__close { background: none; border: 0; cursor: pointer; padding: 6px 0; display: flex; gap: 10px; align-items: center; color: var(--fg-2); transition: color .4s; }
.panel__close:hover { color: var(--fg); }
.panel__close span { transition: transform .6s var(--ease); }
.panel__close:hover span { transform: rotate(90deg); }
.panel__title { font-weight: 300; font-size: clamp(40px, 5.4vw, 72px); line-height: .98; letter-spacing: -0.045em; margin: 0 0 18px; }
.panel__title em { display: block; font-size: .55em; color: var(--muted); margin-top: .1em; }
.panel__cat { color: var(--muted); }
.panel__desc { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.5; color: var(--fg-2); margin: 48px 0; }
.panel__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; border-top: 1px solid var(--line); padding-top: 28px; margin-bottom: 56px; }
.panel__cols ul { margin-top: 16px; display: grid; gap: 10px; }
.panel__cols li::before { content: "—"; color: var(--muted); margin-right: 10px; }
.panel__cols p { margin: 16px 0 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .header { grid-template-columns: 1fr auto; }
  .nav, .header__clock, .progress { display: none; }
  .hide-sm { display: none; }
  .hero__bottom { flex-direction: column; align-items: flex-start; }
  .hero__hint { display: none; }
  .manifesto__text { max-width: none; }
  .co { grid-template-columns: 32px 1fr; gap: 8px 14px; }
  .co__cat { grid-column: 2; font-size: 17px; }
  .co__arrow { display: none; }
  .co:hover .co__name { transform: none; }
  .co-list:hover .co:not(:hover) .co__name { opacity: 1; }
  .pillars, .panel__cols, .enquiry__fields { grid-template-columns: 1fr; }
  .enquiry { max-width: none; }
  .enquiry__foot { flex-direction: column-reverse; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__hint i::after, .marquee__track, .dot, .scroll-cue__line::after { animation: none; }
  .manifesto__text .w { opacity: 1; }
}
