/* miao — organization site
   Dark, technical, four-colour identity derived from the miao framework. */

:root {
  --bg: #05070e;
  --bg-soft: #080c16;
  --panel: #070b14;
  --text: #eef2fa;
  --text-soft: #b7c1d3;
  --muted: #93a0b5;
  --faint: #66738a;
  --line: rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.055);

  --m: #3d86ff;
  --i: #a86bff;
  --a: #ff9a2e;
  --o: #2ed98a;

  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --shell: 1180px;
  --radius: 22px;
  --header-h: 68px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.nav-open {
  overflow: hidden;
}

::selection {
  background: rgba(124, 92, 255, 0.35);
  color: #fff;
}

a {
  color: inherit;
}

svg {
  display: block;
}

:focus-visible {
  outline: 2px solid #86b4ff;
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 20px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: 10px;
  background: #eef2fa;
  color: #05070e;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: top 0.25s var(--ease);
}

.skip-link:focus {
  top: 16px;
}

/* ---------- Global texture ---------- */

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.032) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 95% 65% at 50% 0%, #000 5%, transparent 78%);
  mask-image: radial-gradient(ellipse 95% 65% at 50% 0%, #000 5%, transparent 78%);
  opacity: 0.65;
}

.shell {
  width: min(var(--shell), calc(100% - 48px));
  margin-inline: auto;
}

main {
  position: relative;
  z-index: 1;
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  padding: 14px 0;
  border-bottom: 1px solid transparent;
  transition:
    background 0.35s ease,
    border-color 0.35s ease,
    padding 0.35s ease,
    backdrop-filter 0.35s ease;
}

.site-header.is-scrolled {
  padding: 10px 0;
  background: rgba(5, 7, 14, 0.72);
  border-bottom-color: var(--line-soft);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  width: 30px;
  height: 30px;
  flex: none;
}

.brand-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.16em;
  line-height: 1;
  background: linear-gradient(90deg, #8fd2ff, #b18cff 42%, #ffb264 70%, #57e6a5);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-sub {
  padding-left: 10px;
  border-left: 1px solid var(--line);
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav > a {
  position: relative;
  padding: 9px 13px;
  border-radius: 8px;
  color: var(--text-soft);
  font-size: 13.5px;
  font-weight: 400;
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav > a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.045);
}

.nav > a.is-active {
  color: #fff;
}

.nav > a.is-active::after {
  content: "";
  position: absolute;
  right: 13px;
  bottom: 3px;
  left: 13px;
  height: 1px;
  background: linear-gradient(90deg, var(--m), var(--i), var(--a), var(--o));
  opacity: 0.8;
}

.nav .nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: 10px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: var(--text);
  font-weight: 500;
}

.nav-cta svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.25s var(--ease);
}

.nav-cta:hover {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.06);
}

.nav-cta:hover svg {
  transform: translate(2px, -2px);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

.nav-toggle-bars {
  display: grid;
  gap: 4px;
  width: 14px;
}

.nav-toggle-bars i {
  display: block;
  height: 1px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars i:first-child {
  transform: translateY(2.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars i:last-child {
  transform: translateY(-2.5px) rotate(-45deg);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(126px, 16vh, 176px) 0 0;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto;
  height: 75%;
  z-index: -2;
  background: radial-gradient(ellipse 60% 60% at 50% 20%, rgba(88, 110, 255, 0.16), transparent 70%);
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  z-index: -1;
  width: min(52vw, 720px);
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.32;
  pointer-events: none;
}

.hero-glow-m {
  left: -14%;
  bottom: -18%;
  background: radial-gradient(circle, rgba(61, 134, 255, 0.85), transparent 66%);
}

.hero-glow-i {
  left: 24%;
  bottom: -30%;
  width: min(40vw, 560px);
  background: radial-gradient(circle, rgba(168, 107, 255, 0.65), transparent 66%);
  opacity: 0.26;
}

.hero-glow-a {
  right: 18%;
  bottom: -28%;
  width: min(38vw, 540px);
  background: radial-gradient(circle, rgba(255, 154, 46, 0.6), transparent 66%);
  opacity: 0.22;
}

.hero-glow-o {
  right: -16%;
  bottom: -16%;
  background: radial-gradient(circle, rgba(46, 217, 138, 0.75), transparent 66%);
  opacity: 0.28;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: #a7b2c5;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow-sep {
  color: #47536a;
}

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--o);
  box-shadow: 0 0 0 3px rgba(46, 217, 138, 0.12), 0 0 12px rgba(46, 217, 138, 0.8);
  animation: pulse 3.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.wordmark-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: clamp(16px, 2.5vw, 28px);
  padding: 0.6vw 0;
}

.orbit {
  position: absolute;
  left: 50%;
  top: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  pointer-events: none;
}

.orbit-outer {
  width: 94%;
  height: 86%;
  transform: translate(-50%, -50%) rotate(-6deg);
  border-top-color: rgba(255, 255, 255, 0.18);
  border-right-color: rgba(255, 255, 255, 0.04);
}

.orbit-inner {
  width: 72%;
  height: 52%;
  transform: translate(-50%, -50%) rotate(9deg);
  border-color: rgba(255, 255, 255, 0.055);
  border-bottom-color: rgba(255, 255, 255, 0.13);
}

.wordmark {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: clamp(0px, 0.6vw, 10px);
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(4.6rem, 19.5vw, 15.5rem);
  line-height: 0.8;
  letter-spacing: -0.035em;
}

.letter {
  display: block;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.letter-m {
  background-image: linear-gradient(158deg, #a9e6ff 0%, #4a95ff 42%, #1647d8 100%);
  filter: drop-shadow(0 0 26px rgba(61, 134, 255, 0.45)) drop-shadow(0 18px 55px rgba(25, 70, 200, 0.35));
}

.letter-i {
  background-image: linear-gradient(158deg, #e0c4ff 0%, #b078ff 40%, #6b2bd8 100%);
  filter: drop-shadow(0 0 26px rgba(168, 107, 255, 0.45)) drop-shadow(0 18px 55px rgba(105, 40, 210, 0.35));
}

.letter-a {
  background-image: linear-gradient(158deg, #ffe7b8 0%, #ffa63c 42%, #e35a08 100%);
  filter: drop-shadow(0 0 26px rgba(255, 154, 46, 0.4)) drop-shadow(0 18px 55px rgba(210, 85, 10, 0.32));
}

.letter-o {
  background-image: linear-gradient(158deg, #b5ffd6 0%, #3ce49a 42%, #059a5c 100%);
  filter: drop-shadow(0 0 26px rgba(46, 217, 138, 0.42)) drop-shadow(0 18px 55px rgba(5, 150, 90, 0.34));
}

.hero-name {
  margin: clamp(18px, 2.6vw, 30px) 0 0;
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.15vw, 1.5rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #dbe3f1;
  text-wrap: balance;
}

.c-m { color: #6aa8ff; }
.c-i { color: #b98bff; }
.c-a { color: #ffab52; }
.c-o { color: #4fe0a0; }

.hero-name .punc {
  color: #7b879c;
}

.hero-name .amp {
  margin: 0 0.12em;
  color: #7b879c;
}

.hero-lede {
  max-width: 660px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.45vw, 1.1rem);
  font-weight: 400;
  line-height: 1.72;
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform 0.25s var(--ease),
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.25s var(--ease);
}

.btn-primary {
  background: #eef3ff;
  color: #060a14;
  box-shadow: 0 6px 30px rgba(140, 170, 255, 0.18);
}

.btn-primary:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(140, 170, 255, 0.28);
}

.btn-primary:hover svg {
  transform: translateY(2px);
}

.btn-ghost {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.055);
  transform: translateY(-2px);
}

.btn-ghost:hover svg {
  transform: translate(2px, -2px);
}

.hero-note {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 34px 0 0;
  color: #6f7c92;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-note span:not(:first-child)::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 3px;
  margin: 0 16px 2px;
  border-radius: 50%;
  background: #3c485e;
}

.rail {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 100%;
  margin-top: clamp(44px, 7vh, 80px);
  border-top: 1px solid var(--line);
  text-align: left;
}

.rail-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 18px 24px;
  border-right: 1px solid var(--line-soft);
  text-decoration: none;
  transition: background 0.25s ease;
}

.rail-item:last-child {
  border-right: 0;
}

.rail-item::before {
  content: "";
  position: absolute;
  inset: -1px 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.rail-item:nth-child(1) { color: var(--m); }
.rail-item:nth-child(2) { color: var(--i); }
.rail-item:nth-child(3) { color: var(--a); }
.rail-item:nth-child(4) { color: var(--o); }

.rail-item:hover {
  background: rgba(255, 255, 255, 0.025);
}

.rail-item:hover::before {
  opacity: 0.7;
}

.rail-letter {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 0 20px currentColor;
}

.rail-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.rail-text strong {
  color: #dde5f2;
  font-size: 13px;
  font-weight: 500;
}

.rail-text span {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rail-index {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.18);
  font-family: var(--font-mono);
  font-size: 9px;
}

/* ---------- Shared section furniture ---------- */

.section {
  position: relative;
  padding: clamp(84px, 11vh, 132px) 0;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  column-gap: clamp(32px, 6vw, 80px);
  align-items: end;
  margin-bottom: clamp(36px, 5vw, 56px);
}

.kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  grid-column: 1 / -1;
  margin: 0 0 16px;
  color: #8a97ac;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.kicker span {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #6b7890;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.kicker .brand-name {
  text-transform: none;
}

.section h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.15rem, 4.4vw, 3.55rem);
  font-weight: 600;
  line-height: 1.03;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.section-lede {
  max-width: 460px;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.97rem;
  line-height: 1.75;
  text-wrap: pretty;
}

/* ---------- Pillars ---------- */

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.pillar {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 420px;
  padding: 28px 24px 20px;
  background: var(--panel);
  transition: background 0.35s ease;
}

.pillar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--pc), transparent);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.pillar::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, var(--pc-soft), transparent 70%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.pillar > * {
  position: relative;
  z-index: 1;
}

.pillar-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.pillar-letter {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: var(--pc-soft);
  box-shadow: inset 0 0 24px var(--pc-soft);
  color: var(--pc);
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 0 22px currentColor;
}

.pillar-num {
  color: rgba(255, 255, 255, 0.24);
  font-family: var(--font-mono);
  font-size: 9.5px;
}

.pillar h3 {
  margin: 22px 0 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.pillar .zh {
  display: block;
  margin-top: 4px;
  color: var(--faint);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.1em;
}

.pillar-key {
  margin: 14px 0 16px;
  padding-left: 11px;
  border-left: 1px solid var(--pc);
  color: #98a5ba;
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.9;
  letter-spacing: 0.02em;
}

.pillar-copy {
  margin: 0 0 22px;
  color: #8d99ad;
  font-size: 13px;
  line-height: 1.72;
}

.diagram {
  margin: auto 0 0;
  padding-top: 14px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  color: var(--pc);
  opacity: 0.85;
}

.diagram svg {
  width: 100%;
  height: auto;
}

@media (hover: hover) {
  .pillar:hover {
    background: #0a0f1a;
  }

  .pillar:hover::before,
  .pillar:hover::after {
    opacity: 1;
  }
}

/* ---------- Loop ---------- */

.loop-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(30px, 4.5vw, 58px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(ellipse 55% 70% at 15% 0%, rgba(61, 134, 255, 0.1), transparent 65%),
    radial-gradient(ellipse 45% 60% at 90% 10%, rgba(168, 107, 255, 0.08), transparent 65%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008));
}

.loop-head {
  max-width: 580px;
}

.loop-orbit {
  position: absolute;
  top: 40px;
  right: 44px;
  width: clamp(210px, 22vw, 290px);
  opacity: 0.9;
  pointer-events: none;
}

.loop-orbit svg {
  width: 100%;
  height: auto;
}

.loop-head h2 {
  margin-top: 4px;
}

.loop-head .section-lede {
  margin-top: 20px;
}

.stages {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(16px, 2.5vw, 30px);
  margin: clamp(38px, 5vw, 56px) 0 0;
  padding: 0;
  list-style: none;
}

.stage {
  position: relative;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.stage::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sc);
  box-shadow: 0 0 12px var(--sc);
}

.stage:nth-child(1) { --sc: var(--m); }
.stage:nth-child(2) { --sc: var(--i); }
.stage:nth-child(3) { --sc: var(--a); }
.stage:nth-child(4) { --sc: var(--o); }

.stage::after {
  content: "→";
  position: absolute;
  top: 9px;
  right: -13px;
  color: rgba(255, 255, 255, 0.22);
  font-family: var(--font-mono);
  font-size: 12px;
}

.stage:last-child::after {
  display: none;
}

.stage-num {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
}

.stage h3 {
  margin: 10px 0 8px;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.stage p {
  margin: 0 0 12px;
  color: #8f9bb0;
  font-size: 12.5px;
  line-height: 1.7;
}

.stage-tag {
  display: inline-block;
  margin-top: 2px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--sc);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.feedback {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: clamp(30px, 4vw, 42px);
  padding-top: 18px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  color: #7d8aa0;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.feedback svg {
  width: 17px;
  height: 17px;
  flex: none;
  fill: none;
  stroke: var(--o);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Work ---------- */

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.work-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 248px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.018);
  text-decoration: none;
  transition:
    transform 0.35s var(--ease),
    border-color 0.35s ease,
    background 0.35s ease;
}

.work-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.work-tag {
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  color: #8d99ad;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.work-arrow {
  color: #67748a;
  font-size: 16px;
  line-height: 1;
  transition: transform 0.3s var(--ease), color 0.3s ease;
}

.work-card h3 {
  margin: 22px 0 8px;
  font-family: var(--font-mono);
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #e6ecf8;
}

.work-card p {
  margin: 0 0 20px;
  color: #8f9bb0;
  font-size: 12.5px;
  line-height: 1.7;
}

.work-meta {
  display: flex;
  gap: 12px;
  margin: auto 0 0 !important;
  color: #5f6c82;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.work-meta span + span::before {
  content: "/";
  margin-right: 12px;
  color: #3e4a5f;
}

@media (hover: hover) {
  .work-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.035);
  }

  .work-card:hover .work-arrow {
    transform: translate(2px, -2px);
    color: #cdd7e8;
  }
}

.work-note {
  margin: 28px 0 0;
  color: #6f7c92;
  font-size: 12.5px;
}

.work-note a {
  color: #b9c6da;
  text-decoration-color: rgba(185, 198, 218, 0.4);
  text-underline-offset: 3px;
}

.work-note a:hover {
  color: #fff;
  text-decoration-color: #fff;
}

/* ---------- Open ---------- */

.open-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: 42px clamp(32px, 5vw, 64px);
  align-items: center;
  overflow: hidden;
  padding: clamp(36px, 6vw, 78px) clamp(24px, 5.5vw, 72px);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 30px;
  background:
    linear-gradient(120deg, rgba(61, 134, 255, 0.14), rgba(168, 107, 255, 0.1) 38%, rgba(255, 154, 46, 0.07) 63%, rgba(46, 217, 138, 0.12)),
    #070b14;
}

.open-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 80% 30%, #000, transparent 70%);
  mask-image: radial-gradient(ellipse 70% 80% at 80% 30%, #000, transparent 70%);
  pointer-events: none;
}

.open-glow {
  position: absolute;
  top: -40%;
  right: -10%;
  width: 55%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(46, 217, 138, 0.22), transparent 65%);
  filter: blur(40px);
  pointer-events: none;
}

.open-panel > *:not(.open-glow) {
  position: relative;
  z-index: 1;
}

.open-panel h2 {
  margin: 8px 0 24px;
  font-family: var(--font-display);
  font-size: clamp(2.9rem, 7vw, 5rem);
  font-weight: 600;
  line-height: 0.96;
  letter-spacing: -0.045em;
}

.open-lede {
  max-width: 580px;
  margin: 0;
  color: #b9c4d6;
  font-size: 1rem;
  line-height: 1.75;
  text-wrap: pretty;
}

.join-form {
  min-width: 0;
  width: 100%;
  padding: 30px;
  border: 1px solid rgba(167, 188, 218, .18);
  border-radius: 22px;
  background: linear-gradient(150deg, rgba(19, 27, 43, .97), rgba(7, 12, 21, .97));
  box-shadow: 0 20px 60px rgba(0, 0, 0, .2), inset 0 1px rgba(255, 255, 255, .035);
}

.join-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.join-icon { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid rgba(132, 170, 255, .22); border-radius: 12px; background: rgba(98, 135, 255, .09); color: #a4c6ff; }
.join-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
.join-badge { display: inline-flex; align-items: center; gap: 6px; color: #b0d7c7; font-size: 10px; }
.join-badge > span { width: 5px; height: 5px; border-radius: 50%; background: var(--o); }
.join-form h3 { margin: 0; font: 600 1.75rem/1.2 var(--font-display); letter-spacing: -.035em; }
.join-form p { margin: 0; font-size: 12px; line-height: 1.65; }
.join-form .join-intro { margin: 8px 0 26px; color: var(--muted); font-size: 13px; }
.join-label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; gap: 10px; }
.join-label-row label { color: #d6dfef; font-size: 12px; font-weight: 500; }
.join-label-row > span { color: #8290a6; font-size: 10px; }
.join-email-control { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 13px; border: 1px solid rgba(156, 175, 209, .24); border-radius: 10px; background: rgba(3, 8, 16, .7); transition: border-color 150ms ease, box-shadow 150ms ease; }
.join-email-control:focus-within { border-color: #8eafff; box-shadow: 0 0 0 3px rgba(89, 137, 255, .13); }
.join-email-control > svg { flex: 0 0 17px; width: 17px; height: 17px; fill: none; stroke: #7e8da6; stroke-width: 1.3; }
.join-email-control input {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 13px 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.join-email-control input::placeholder { color: #61718b; }
.join-email-control input:focus-visible { outline: none; }
.join-email-control input:disabled { opacity: .6; cursor: wait; }
.join-form .join-help { margin-top: 8px; color: #8998b0; font-size: 10px; }
.join-verification { display: grid; place-items: center; min-height: 70px; margin: 22px 0 16px; }
[data-join-challenge] { width: 100%; }
.join-submit { width: 100%; min-height: 46px; border-radius: 10px; gap: 10px; font: 500 13px var(--font-body); box-shadow: 0 3px 16px rgba(140, 170, 255, .12); cursor: pointer; }
.join-submit:disabled { color: #91a0bb; background: #263249; border-color: rgba(143, 169, 213, .09); box-shadow: none; cursor: not-allowed; }
.join-submit:disabled:hover { transform: none; }
.join-submit .join-arrow { width: 17px; height: 17px; }
.join-spinner { display: none; width: 15px; height: 15px; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; }
.join-form[data-state="sending"] .join-spinner { display: inline-block; }
.join-form[data-state="sending"] .join-arrow { display: none; }
.join-form .join-status { min-height: 38px; margin: 14px 0 18px; color: #95a5bf; font-size: 11px; overflow-wrap: anywhere; }
.join-form[data-state="ready"] .join-status { color: #a4d4bd; }
.join-form[data-state="success"] .join-status { padding: 12px 14px; color: #b4ebce; border: 1px solid rgba(46, 217, 138, .2); border-radius: 9px; background: rgba(46, 217, 138, .07); }
.join-form .join-status.is-error { padding: 12px 14px; color: #ffc1b7; border: 1px solid rgba(255, 154, 135, .2); border-radius: 9px; background: rgba(255, 154, 135, .05); }
.join-form .join-privacy { padding-top: 16px; border-top: 1px solid var(--line); color: #8f9cb2; font-size: 10px; }
.join-steps { display: grid; gap: 13px; margin: 28px 0 0; padding: 0; list-style: none; }
.join-steps li { display: flex; align-items: center; gap: 12px; color: #c7d1e3; font-size: 12px; }
.join-steps li > span { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid rgba(171, 191, 222, .15); border-radius: 7px; color: #879bb9; font: 9px var(--font-mono); }
.open-link { display: inline-flex; gap: 7px; align-items: center; min-height: 36px; color: #9faec6; font-size: 11px; text-decoration: none; text-underline-offset: 5px; }
.open-link span { color: #70819e; }
@media (hover: hover) and (pointer: fine) {
  .open-link:hover { color: var(--text); text-decoration: underline; }
  .join-submit:not(:disabled):hover { transform: translateY(-1px); }
  .join-submit:not(:disabled):hover .join-arrow { transform: translateX(2px); }
}
.join-submit:not(:disabled):active { transform: scale(.98); }
@media (prefers-reduced-motion: no-preference) {
  .join-form[data-state="sending"] .join-spinner { animation: join-spin .6s linear infinite; }
  @keyframes join-spin { to { transform: rotate(360deg); } }
}
@media (max-width: 980px) {
  .open-panel { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .open-intro { max-width: 580px; }
  .join-form { max-width: 540px; }
  .join-email-control input { font-size: 16px; }
}
@media (max-width: 480px) {
  .join-form { padding: 20px; border-radius: 16px; }
  .join-card-head { margin-bottom: 20px; }
  .join-badge { font-size: 9px; }
  .join-form h3 { font-size: 1.6rem; }
}

.open-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.open-facts {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: clamp(24px, 5vw, 56px);
  margin: 0;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.open-facts div {
  display: flex;
  flex-direction: column-reverse;
  gap: 6px;
}

.open-facts dt {
  color: #8b98ad;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.open-facts dd {
  margin: 0;
  color: #e2e9f5;
  font-size: 13.5px;
}

/* ---------- Footer ---------- */

.open-panel-home { grid-template-columns: minmax(0, 1fr); }
.open-panel-home .open-intro { max-width: 670px; }
.open-panel-home .open-actions { align-items: center; gap: 12px 22px; }
.join-page-main { position: relative; padding-top: calc(var(--header-h) + 48px); padding-bottom: 48px; min-height: calc(100svh - 74px); display: grid; align-items: center; }
.join-page-panel { padding: clamp(28px, 5vw, 64px); gap: 40px clamp(32px, 6vw, 80px); border-radius: 26px; }
.join-page h1 { margin: 14px 0 26px; font: 600 clamp(2.7rem, 5.3vw, 4.4rem)/1.04 var(--font-display); letter-spacing: -.055em; text-wrap: balance; }
.join-page .open-lede { max-width: 420px; color: var(--text-soft); font-size: 15px; }
.join-destination { display: flex; align-items: center; gap: 10px; margin-top: 30px; color: #a7bfbd; font: 10px var(--font-mono); letter-spacing: .04em; }
.join-destination > span:not(.status-dot) { color: #52647a; }
.join-back { margin-top: 22px; }
.join-page-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding-top: 22px; padding-bottom: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.join-page-footer a { text-decoration: none; }
@media (max-width: 980px) {
  .join-page-panel { justify-items: center; }
  .join-page .open-intro, .join-page .join-form { width: 100%; max-width: 540px; }
  .join-page h1 { font-size: clamp(2.7rem, 7vw, 4rem); }
}
@media (max-width: 480px) {
  .join-page-main { padding-top: calc(var(--header-h) + 28px); padding-bottom: 28px; }
  .join-page-panel { padding: 22px 16px; gap: 28px; border-radius: 18px; }
  .join-page .kicker { font-size: 8px; letter-spacing: .12em; }
  .join-page .open-lede { font-size: 13px; }
  .join-page h1 { font-size: 2.7rem; }
}

.site-footer {
  position: relative;
  z-index: 1;
  padding: 56px 0 22px;
  border-top: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.22);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.6fr 1fr;
  gap: 32px;
  align-items: start;
}

.brand-word-lg {
  font-size: 1.5rem;
}

.footer-brand p {
  margin: 14px 0 0;
  color: var(--faint);
  font-size: 12.5px;
  line-height: 1.7;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-nav a {
  width: fit-content;
  color: #929fb3;
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-nav a:hover {
  color: #fff;
}

.footer-meta {
  text-align: right;
  color: #6b788e;
  font-size: 11.5px;
}

.footer-meta p {
  margin: 0 0 10px;
}

.footer-line {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 40px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  color: #5f6c82;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.footer-bottom a {
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-bottom a:hover {
  color: #dbe4f2;
}

/* ---------- Reveal + hero motion ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 0.8s var(--ease),
    transform 0.8s var(--ease);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

.pillar:nth-child(2) { transition-delay: 0.06s; }
.pillar:nth-child(3) { transition-delay: 0.12s; }
.pillar:nth-child(4) { transition-delay: 0.18s; }

.work-card:nth-child(2) { transition-delay: 0.05s; }
.work-card:nth-child(3) { transition-delay: 0.1s; }
.work-card:nth-child(5) { transition-delay: 0.05s; }
.work-card:nth-child(6) { transition-delay: 0.1s; }

@media (prefers-reduced-motion: no-preference) {
  .js .letter {
    opacity: 0;
    animation: letter-in 1.1s var(--ease) forwards;
  }

  .js .letter-i { animation-delay: 0.08s; }
  .js .letter-a { animation-delay: 0.16s; }
  .js .letter-o { animation-delay: 0.24s; }

  @keyframes letter-in {
    from {
      opacity: 0;
      transform: translateY(26px) scale(0.98);
    }
    to {
      opacity: 1;
      transform: 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;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .pillar-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pillar {
    min-height: 390px;
  }

  .stages {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 34px;
  }

  .stage:nth-child(2)::after {
    display: none;
  }

  .work-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-meta {
    grid-column: 1 / -1;
    padding-top: 20px;
    border-top: 1px solid var(--line-soft);
    text-align: left;
  }

  .footer-line {
    justify-content: flex-start;
  }
}

@media (max-width: 1100px) {
  .open-ring {
    display: none;
  }
}

@media (max-width: 980px) {
  .loop-orbit {
    display: none;
  }
}

@media (max-width: 900px) {
  .brand-sub {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    position: fixed;
    top: 72px;
    left: 16px;
    right: 16px;
    z-index: 60;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background: rgba(8, 12, 22, 0.96);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s var(--ease), visibility 0.25s;
  }

  .nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav > a {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
  }

  .nav > a.is-active::after {
    right: auto;
    left: 14px;
    width: 26px;
  }

  .nav .nav-cta {
    justify-content: center;
    margin: 8px 0 0;
    padding: 11px 14px;
  }

  .section-head {
    grid-template-columns: 1fr;
    row-gap: 22px;
    align-items: start;
  }

  .section-lede {
    max-width: 600px;
  }

  .hero-note {
    gap: 6px 0;
  }
}

@media (max-width: 720px) {
  .shell {
    width: calc(100% - 36px);
  }

  .hero {
    padding-top: 112px;
  }

  .wordmark {
    font-size: clamp(4rem, 22vw, 8rem);
  }

  .orbit-outer {
    width: 104%;
    height: 80%;
  }

  .hero-lede {
    max-width: 520px;
  }

  .rail {
    grid-template-columns: repeat(2, 1fr);
    margin-top: 40px;
  }

  .rail-item {
    padding: 16px 12px 18px;
    border-bottom: 1px solid var(--line-soft);
  }

  .rail-item:nth-child(2) {
    border-right: 0;
  }

  .rail-item:nth-child(3),
  .rail-item:nth-child(4) {
    border-bottom: 0;
  }

  .rail-index {
    display: none;
  }

  .pillar {
    padding: 24px 20px 18px;
  }

  .loop-panel {
    border-radius: 22px;
  }

  .work-grid {
    grid-template-columns: 1fr;
  }

  .work-card {
    min-height: 0;
  }

  .open-panel {
    border-radius: 24px;
  }

  .open-facts {
    gap: 24px 36px;
  }

  .open-actions .btn {
    flex: 1;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-width: 560px) {
  .pillar-grid {
    grid-template-columns: 1fr;
  }

  .pillar {
    min-height: 0;
  }

  .pillar-copy {
    margin-bottom: 18px;
  }

  .diagram {
    max-width: 300px;
  }

  .stages {
    grid-template-columns: 1fr;
    row-gap: 28px;
  }

  .stage::after {
    display: none;
  }

  .hero-actions {
    width: 100%;
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .hero-note {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-meta {
    grid-column: auto;
  }

  .eyebrow {
    font-size: 9px;
    letter-spacing: 0.12em;
  }
}

@media (max-width: 380px) {
  .rail {
    grid-template-columns: 1fr;
  }

  .rail-item {
    border-right: 0;
  }

  .rail-item:nth-child(3) {
    border-bottom: 1px solid var(--line-soft);
  }
}
