/* ============================================================================
   UNYKORN — The Introducer Network
   Liquid glass on obsidian.

   The brand spec is explicit: dark backgrounds only, because the chrome mark
   reads low-contrast on light. So "light" here is light IN the glass — real
   refraction, specular edges, luminance passing through frosted panels —
   rather than a white page. Every colour is painted explicitly; nothing
   borrows from the host.
   ========================================================================= */

:root {
  /* Sampled from the mark. Ground truth, not approximations. */
  --orange-hi: #ff8614;
  --orange: #f5750d;
  --orange-lo: #7b2400;
  --silver-hi: #ffffff;
  --silver: #b7bbbe;
  --silver-lo: #6b7072;
  --ink: #050505;
  --ink-soft: #0a0a0a;

  --text: #eef1f3;
  --text-dim: #9aa1a6;
  --text-faint: #6b7276;

  /* The glass system. Four depths — the whole page is built from these. */
  --glass-1: rgba(255, 255, 255, 0.028);
  --glass-2: rgba(255, 255, 255, 0.055);
  --glass-3: rgba(255, 255, 255, 0.085);
  --edge: rgba(255, 255, 255, 0.10);
  --edge-bright: rgba(255, 255, 255, 0.28);

  --ok: #4ade80;
  --hold: #fbbf24;
  --stop: #f87171;

  --sans: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --serif: "Bodoni Moda", "Didot", "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --r: 18px;
  --r-sm: 12px;
  --maxw: 1140px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 400 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------------------------------------------------------------------------
   THE LIGHT FIELD
   Three slow-drifting radial sources behind everything. This is what the glass
   refracts — without a light source, backdrop-filter has nothing to work with
   and "glass" collapses into a grey box.
   ------------------------------------------------------------------------ */
.field {
  position: fixed;
  inset: -20vh -20vw;
  z-index: -2;
  pointer-events: none;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}
.orb-a {
  width: 52vw; height: 52vw; left: -6vw; top: -4vh;
  background: radial-gradient(circle, rgba(245, 117, 13, 0.30), transparent 68%);
  animation: drift-a 34s ease-in-out infinite;
}
.orb-b {
  width: 46vw; height: 46vw; right: -8vw; top: 22vh;
  background: radial-gradient(circle, rgba(120, 150, 190, 0.24), transparent 68%);
  animation: drift-b 41s ease-in-out infinite;
}
.orb-c {
  width: 40vw; height: 40vw; left: 24vw; bottom: -12vh;
  background: radial-gradient(circle, rgba(255, 134, 20, 0.16), transparent 70%);
  animation: drift-c 47s ease-in-out infinite;
}
@keyframes drift-a { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(7vw,9vh,0) scale(1.14); } }
@keyframes drift-b { 0%,100% { transform: translate3d(0,0,0) scale(1.08); } 50% { transform: translate3d(-9vw,-6vh,0) scale(1); } }
@keyframes drift-c { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(5vw,-8vh,0) scale(1.2); } }

/* Film grain. Without it large blurred gradients band visibly on OLED. */
.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .30;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
}

@media (prefers-reduced-motion: reduce) {
  .orb { animation: none; }
  html { scroll-behavior: auto; }
  * { transition-duration: .01ms !important; }
}

/* ---------------------------------------------------------------------------
   GLASS
   A panel is: translucency + backdrop blur + a bright top edge + an inner
   highlight. The top edge is what sells it — real glass catches the light
   source on its upper rim, and its absence is why most "glassmorphism" reads
   as a grey rectangle.
   ------------------------------------------------------------------------ */
.glass {
  position: relative;
  background: linear-gradient(160deg, var(--glass-2), var(--glass-1));
  backdrop-filter: blur(26px) saturate(165%);
  -webkit-backdrop-filter: blur(26px) saturate(165%);
  border: 1px solid var(--edge);
  border-radius: var(--r);
  box-shadow:
    0 1px 0 0 rgba(255,255,255,.055) inset,
    0 -1px 0 0 rgba(0,0,0,.30) inset,
    0 24px 60px -24px rgba(0,0,0,.85);
  overflow: hidden;
}
/* The specular rim. Brightest at the upper-left, matching the mark's own
   light source, then falling off — a uniform border looks printed on. */
.glass::before {
  content: "";
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  padding: 1px;
  background: linear-gradient(135deg, var(--edge-bright), rgba(255,255,255,.05) 32%, transparent 62%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
}
/* Caustic sheen drifting across the surface. */
.glass::after {
  content: "";
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: radial-gradient(120% 60% at 8% -10%, rgba(255,255,255,.10), transparent 55%);
}

.glass-hi { background: linear-gradient(160deg, var(--glass-3), var(--glass-1)); }

/* ---------------------------------------------------------------------------
   3D — the extruded Gate mark
   Stacked copies of the real SVG on the Z axis with progressive darkening
   gives genuine metal depth, and the whole assembly tilts to the pointer.
   No WebGL, no library, no external request.
   ------------------------------------------------------------------------ */
.stage { perspective: 900px; perspective-origin: 50% 40%; }
.mark3d {
  position: relative;
  transform-style: preserve-3d;
  transition: transform .45s cubic-bezier(.2,.8,.25,1);
  will-change: transform;
}
.mark3d .layer {
  position: absolute; inset: 0;
  display: grid; place-items: center;
}
.mark3d .layer svg { width: 100%; height: 100%; display: block; }
.mark3d .face { position: relative; }
.mark3d .glow {
  position: absolute; inset: -18%;
  background: radial-gradient(circle, rgba(245,117,13,.42), transparent 62%);
  filter: blur(28px);
  transform: translateZ(-42px);
}

/* ------------------------------- layout --------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-inline: 22px; }
section { padding-block: clamp(56px, 9vw, 108px); }

.eyebrow {
  font: 500 10.5px/1 var(--mono);
  letter-spacing: .22em; text-transform: uppercase; color: var(--orange);
  margin: 0 0 16px;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 500; letter-spacing: -.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(38px, 6.4vw, 74px); line-height: 1.03; }
h2 { font-size: clamp(27px, 3.6vw, 42px); line-height: 1.12; }
h3 { font-size: 20px; line-height: 1.25; }
p { margin: 0 0 1.05em; color: var(--text-dim); }
.lede { font-size: clamp(17px, 1.9vw, 20px); color: var(--text); max-width: 62ch; }
strong { color: var(--text); font-weight: 600; }
a { color: var(--orange); }

.grid { display: grid; gap: 18px; }
@media (min-width: 800px) {
  .g2 { grid-template-columns: 1fr 1fr; }
  .g3 { grid-template-columns: repeat(3, 1fr); }
}
.pad { padding: clamp(20px, 3vw, 32px); }

/* --------------------------------- nav ---------------------------------- */
header.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  background: rgba(5,5,5,.62);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.nav-in { display: flex; align-items: center; gap: 18px; padding: 13px 22px; max-width: var(--maxw); margin: 0 auto; }
.nav-links { margin-left: auto; display: flex; gap: 22px; }
.nav-links a { color: var(--text-dim); text-decoration: none; font-size: 13.5px; }
.nav-links a:hover { color: var(--text); }
@media (max-width: 760px) { .nav-links { display: none; } }

.uk-lockup { display: inline-flex; align-items: center; gap: 9px; }
.uk-lockup svg { flex: none; display: block; }
.uk-wordmark { font-weight: 800; letter-spacing: .16em; font-size: 14px; line-height: 1; white-space: nowrap; }
.uk-sub { font: 500 9.5px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; margin-left: 6px; color: var(--orange); }

/* -------------------------------- hero ---------------------------------- */
.hero { padding-top: clamp(48px, 8vw, 92px); }
.hero-grid { display: grid; gap: 44px; align-items: center; }
@media (min-width: 940px) { .hero-grid { grid-template-columns: 1.15fr .85fr; } }
.hero-mark { width: min(340px, 74vw); aspect-ratio: 1; margin-inline: auto; }

/* ------------------------------- buttons -------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 24px; border-radius: 999px; border: 1px solid var(--edge);
  font: 600 14.5px/1 var(--sans); letter-spacing: .01em;
  text-decoration: none; cursor: pointer;
  background: linear-gradient(160deg, var(--glass-3), var(--glass-1));
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  color: var(--text);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.btn:hover { transform: translateY(-1.5px); border-color: rgba(255,255,255,.22); box-shadow: 0 12px 28px -12px rgba(0,0,0,.9); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(150deg, var(--orange-hi), var(--orange) 46%, var(--orange-lo));
  border-color: rgba(255,140,40,.55); color: #120c05; font-weight: 700;
  box-shadow: 0 10px 30px -12px rgba(245,117,13,.75), 0 1px 0 rgba(255,255,255,.35) inset;
}
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* -------------------------------- forms --------------------------------- */
label { display: block; font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 7px; }
input, select, textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--r-sm);
  background: rgba(0,0,0,.34); color: var(--text);
  border: 1px solid rgba(255,255,255,.10);
  font: 400 15px/1.4 var(--sans); outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(245,117,13,.60);
  box-shadow: 0 0 0 3px rgba(245,117,13,.14);
}
select option { background: #0d0d0d; color: var(--text); }
.field-row { display: grid; gap: 14px; margin-bottom: 14px; }
@media (min-width: 700px) { .field-row.two { grid-template-columns: 1fr 1fr; } }

/* --------------------------------- data --------------------------------- */
.num { font: 500 10.5px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--text-faint); }
.figure { font: 600 clamp(30px, 4.4vw, 46px)/1 var(--serif); color: var(--text); letter-spacing: -.02em; }
.figure-orange { color: var(--orange); }

table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid rgba(255,255,255,.065); vertical-align: top; }
th { font: 500 10.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); }
td { color: var(--text-dim); }
td:first-child { color: var(--text); }
tbody tr:last-child td { border-bottom: 0; }
.scroll-x { overflow-x: auto; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px;
  font: 600 10.5px/1.5 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid currentColor;
}
.pill-ok { color: var(--ok); }
.pill-hold { color: var(--hold); }
.pill-stop { color: var(--stop); }

.msg { padding: 13px 16px; border-radius: var(--r-sm); font-size: 14.5px; margin-top: 14px; }
.msg-ok { background: rgba(74,222,128,.09); border: 1px solid rgba(74,222,128,.32); color: #bbf7d0; }
.msg-err { background: rgba(248,113,113,.09); border: 1px solid rgba(248,113,113,.32); color: #fecaca; }

.hair { height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.14), transparent); border: 0; margin: 0; }

/* Numbered steps — only used where content is genuinely a sequence. */
.steps { counter-reset: s; display: grid; gap: 14px; }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 16px; align-items: start; }
.step::before {
  counter-increment: s; content: counter(s);
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font: 600 13px/1 var(--mono); color: var(--orange);
  border: 1px solid rgba(245,117,13,.42);
  background: rgba(245,117,13,.07);
}
.step h3 { margin-bottom: .25em; }
.step p { margin: 0; font-size: 14.5px; }

footer { padding: 44px 0 60px; border-top: 1px solid rgba(255,255,255,.07); color: var(--text-faint); font-size: 13.5px; }
footer a { color: var(--text-dim); text-decoration: none; }
footer a:hover { color: var(--orange); }

.fine { font-size: 12.5px; color: var(--text-faint); line-height: 1.6; }

/* Reveal on scroll. */
.rise { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.25,1); }
.rise.in { opacity: 1; transform: none; }

/* ============================================================================
   LIGHT
   Three states, the standard pattern: explicit choice stamps data-theme on the
   root, and the default "system" setting stamps nothing, so only
   prefers-color-scheme separates the two.

   The brand rule is "dark backgrounds only" for the FULL-COLOUR mark, because
   the chrome gradient reads low-contrast on white. The spec provides the way
   out itself — a monochrome silhouette of the same geometry, and an onLight
   wordmark pair (UNY #14100D / KORN #F5750D). So on light the mark swaps to
   the silhouette rather than the rule being ignored. Same geometry, three ring
   arcs, shard intact.

   Glass on light is a different physical thing from glass on dark: the panel
   sits BRIGHTER than the page and catches a white specular rim, rather than
   darker with a luminous edge. Inverting the dark values would just produce
   grey mud, so the whole set is redefined.
   ========================================================================= */

/* --- the light palette, applied under system-light and explicit light --- */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --text: #14100d;
    --text-dim: #4d5359;
    --text-faint: #7c848b;

    --glass-1: rgba(255, 255, 255, 0.52);
    --glass-2: rgba(255, 255, 255, 0.72);
    --glass-3: rgba(255, 255, 255, 0.86);
    --edge: rgba(20, 16, 13, 0.10);
    --edge-bright: rgba(255, 255, 255, 0.95);
  }
}
:root[data-theme="light"] {
  --text: #14100d;
  --text-dim: #4d5359;
  --text-faint: #7c848b;

  --glass-1: rgba(255, 255, 255, 0.52);
  --glass-2: rgba(255, 255, 255, 0.72);
  --glass-3: rgba(255, 255, 255, 0.86);
  --edge: rgba(20, 16, 13, 0.10);
  --edge-bright: rgba(255, 255, 255, 0.95);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) body { background: #f4f1ee; color: var(--text); }

  /* Softer, warmer light sources — at full dark-mode opacity they bleach out. */
  :root:not([data-theme="dark"]) .orb-a { background: radial-gradient(circle, rgba(245,117,13,.30), transparent 68%); }
  :root:not([data-theme="dark"]) .orb-b { background: radial-gradient(circle, rgba(90,130,190,.26), transparent 68%); }
  :root:not([data-theme="dark"]) .orb-c { background: radial-gradient(circle, rgba(255,134,20,.20), transparent 70%); }
  :root:not([data-theme="dark"]) .grain { opacity: .16; mix-blend-mode: multiply; }

  :root:not([data-theme="dark"]) .glass {
    box-shadow:
      0 1px 0 0 rgba(255,255,255,.90) inset,
      0 -1px 0 0 rgba(20,16,13,.05) inset,
      0 22px 48px -26px rgba(20,16,13,.35);
  }
  :root:not([data-theme="dark"]) .glass::after {
    background: radial-gradient(120% 60% at 8% -10%, rgba(255,255,255,.75), transparent 55%);
  }
  :root:not([data-theme="dark"]) header.nav {
    background: rgba(244,241,238,.72);
    border-bottom-color: rgba(20,16,13,.09);
  }
  :root:not([data-theme="dark"]) input,
  :root:not([data-theme="dark"]) select,
  :root:not([data-theme="dark"]) textarea {
    background: rgba(255,255,255,.80);
    border-color: rgba(20,16,13,.14);
    color: var(--text);
  }
  :root:not([data-theme="dark"]) select option { background: #fff; color: var(--text); }
  :root:not([data-theme="dark"]) th,
  :root:not([data-theme="dark"]) td { border-bottom-color: rgba(20,16,13,.09); }
  :root:not([data-theme="dark"]) .hair { background: linear-gradient(90deg, transparent, rgba(20,16,13,.16), transparent); }
  :root:not([data-theme="dark"]) footer { border-top-color: rgba(20,16,13,.09); }
  :root:not([data-theme="dark"]) .btn { color: var(--text); }
  :root:not([data-theme="dark"]) .mark3d .glow { background: radial-gradient(circle, rgba(245,117,13,.30), transparent 62%); }
  :root:not([data-theme="dark"]) .msg-ok { background: rgba(21,128,61,.10); border-color: rgba(21,128,61,.34); color: #14532d; }
  :root:not([data-theme="dark"]) .msg-err { background: rgba(185,28,28,.09); border-color: rgba(185,28,28,.32); color: #7f1d1d; }
  :root:not([data-theme="dark"]) .pill-ok { color: #15803d; }
  :root:not([data-theme="dark"]) .pill-hold { color: #a16207; }
  :root:not([data-theme="dark"]) .pill-stop { color: #b91c1c; }
}

:root[data-theme="light"] body { background: #f4f1ee; color: var(--text); }
:root[data-theme="light"] .orb-a { background: radial-gradient(circle, rgba(245,117,13,.30), transparent 68%); }
:root[data-theme="light"] .orb-b { background: radial-gradient(circle, rgba(90,130,190,.26), transparent 68%); }
:root[data-theme="light"] .orb-c { background: radial-gradient(circle, rgba(255,134,20,.20), transparent 70%); }
:root[data-theme="light"] .grain { opacity: .16; mix-blend-mode: multiply; }
:root[data-theme="light"] .glass {
  box-shadow:
    0 1px 0 0 rgba(255,255,255,.90) inset,
    0 -1px 0 0 rgba(20,16,13,.05) inset,
    0 22px 48px -26px rgba(20,16,13,.35);
}
:root[data-theme="light"] .glass::after {
  background: radial-gradient(120% 60% at 8% -10%, rgba(255,255,255,.75), transparent 55%);
}
:root[data-theme="light"] header.nav { background: rgba(244,241,238,.72); border-bottom-color: rgba(20,16,13,.09); }
:root[data-theme="light"] input,
:root[data-theme="light"] select,
:root[data-theme="light"] textarea { background: rgba(255,255,255,.80); border-color: rgba(20,16,13,.14); color: var(--text); }
:root[data-theme="light"] select option { background: #fff; color: var(--text); }
:root[data-theme="light"] th,
:root[data-theme="light"] td { border-bottom-color: rgba(20,16,13,.09); }
:root[data-theme="light"] .hair { background: linear-gradient(90deg, transparent, rgba(20,16,13,.16), transparent); }
:root[data-theme="light"] footer { border-top-color: rgba(20,16,13,.09); }
:root[data-theme="light"] .btn { color: var(--text); }
:root[data-theme="light"] .mark3d .glow { background: radial-gradient(circle, rgba(245,117,13,.30), transparent 62%); }
:root[data-theme="light"] .msg-ok { background: rgba(21,128,61,.10); border-color: rgba(21,128,61,.34); color: #14532d; }
:root[data-theme="light"] .msg-err { background: rgba(185,28,28,.09); border-color: rgba(185,28,28,.32); color: #7f1d1d; }
:root[data-theme="light"] .pill-ok { color: #15803d; }
:root[data-theme="light"] .pill-hold { color: #a16207; }
:root[data-theme="light"] .pill-stop { color: #b91c1c; }

/* Explicit dark wins in both directions, so the toggle works from system-light. */
:root[data-theme="dark"] body { background: var(--ink); color: var(--text); }

/* ------------------------------ the toggle ------------------------------ */
.theme-btn {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; flex: none;
  border-radius: 999px; cursor: pointer;
  border: 1px solid var(--edge);
  background: linear-gradient(160deg, var(--glass-3), var(--glass-1));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  color: var(--text-dim);
  transition: color .16s ease, border-color .16s ease, transform .16s ease;
}
.theme-btn:hover { color: var(--orange); border-color: rgba(245,117,13,.45); transform: translateY(-1px); }
.theme-btn svg { width: 16px; height: 16px; display: block; }
.theme-btn .i-sun { display: none; }
:root[data-theme="light"] .theme-btn .i-sun { display: block; }
:root[data-theme="light"] .theme-btn .i-moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-btn .i-sun { display: block; }
  :root:not([data-theme="dark"]) .theme-btn .i-moon { display: none; }
}
