/* ==========================================================
   Ratt Nest Industries — site styles
   Aerospace direction: dark, full-bleed imagery, wide uppercase
   type, sharp edges. Brand colors from the RNI logo
   (#132728 / #CAD0BD) with an icy atmospheric accent.
   ========================================================== */

:root {
  --void: #050a0b;
  --bg: #081011;
  --bg-2: #0b1617;
  --panel: #0f1d1e;
  --brand: #132728;

  --fg: #e3e7da;
  --fg-2: rgba(227, 231, 218, 0.68);
  --fg-3: rgba(227, 231, 218, 0.42);
  --sage: #cad0bd;
  --line: rgba(227, 231, 218, 0.12);
  --line-2: rgba(227, 231, 218, 0.26);

  --ice: #8fd8e2;
  --ice-dim: rgba(143, 216, 226, 0.14);

  --font-display: "Archivo", "Arial Black", system-ui, sans-serif;
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-brand: "Jost", "Futura", "Century Gothic", sans-serif;

  --max: 1320px;
  --gutter: clamp(16px, 4.5vw, 64px);
  --nav-h: 80px;
  --ease: cubic-bezier(.16, .8, .24, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 8px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--ice); color: var(--void); }
:focus-visible { outline: 1px solid var(--ice); outline-offset: 4px; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200; padding: 10px 16px;
  background: var(--fg); color: var(--void); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

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

/* ---------- Type ---------- */
.title, h1, h2, h3 {
  font-family: var(--font-display); font-stretch: 125%; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.01em; margin: 0; line-height: 1.04;
}
.t-xl { font-size: clamp(34px, 6.2vw, 92px); }
.t-lg { font-size: clamp(28px, 4.2vw, 60px); }
.t-md { font-size: clamp(22px, 2.6vw, 34px); }

.kicker {
  display: block; font-family: var(--font-body); font-weight: 600; font-size: 13px;
  letter-spacing: 0.32em; text-transform: uppercase; color: var(--fg-2);
}
.kicker b { color: var(--ice); font-weight: 600; }

.lead { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.6; color: var(--fg-2); font-weight: 400; }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 14px;
  min-height: 54px; padding: 0 30px; border: 1px solid var(--line-2); background: transparent;
  font-family: var(--font-body); font-size: 14px; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--fg); text-decoration: none; cursor: pointer; overflow: hidden; isolation: isolate;
  transition: color .35s var(--ease), border-color .35s var(--ease);
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--fg);
  transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease);
}
.btn:hover { color: var(--void); border-color: var(--fg); }
.btn:hover::before { transform: scaleX(1); }
.btn-solid { background: var(--fg); color: var(--void); border-color: var(--fg); }
.btn-solid::before { background: var(--ice); }
.btn-solid:hover { border-color: var(--ice); }
.btn svg { width: 16px; height: 16px; }
.btn-sm { min-height: 42px; padding: 0 20px; font-size: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: background-color .4s var(--ease), border-color .4s var(--ease), height .4s var(--ease);
}
.site-header.scrolled, .site-header.solid {
  background: rgba(5, 10, 11, 0.78);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--line);
}
.site-header .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--fg); flex: none; }
.brand img { height: 38px; width: auto; }
.brand-name { display: flex; flex-direction: column; line-height: 1.1; font-family: var(--font-brand); text-transform: uppercase; }
.brand-name b { font-weight: 500; font-size: 15px; letter-spacing: 0.3em; }
.brand-name small { font-size: 10px; letter-spacing: 0.5em; color: var(--fg-2); margin-top: 3px; }

.nav { display: flex; align-items: center; gap: 40px; }
.nav-links { display: flex; gap: 34px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  position: relative; font-size: 13px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
  text-decoration: none; color: var(--fg-2); padding: 8px 0; transition: color .25s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--ice);
  transform: scaleX(0); transition: transform .35s var(--ease);
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--fg); }
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { transform: scaleX(1); }

.nav-toggle {
  display: none; width: 46px; height: 46px; border: 1px solid var(--line-2); background: transparent;
  color: var(--fg); cursor: pointer; place-items: center; padding: 0;
}
.nav-toggle svg { width: 20px; height: 20px; }

@media (max-width: 960px) {
  .nav-toggle { display: grid; }
  .nav {
    position: fixed; inset: var(--nav-h) 0 auto 0; display: none; flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(5, 10, 11, 0.97); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 28px;
  }
  .nav.open { display: flex; }
  .site-header:has(.nav.open) { background: rgba(5, 10, 11, 0.97); }
  .nav-links { flex-direction: column; gap: 0; }
  .nav-links li { border-bottom: 1px solid var(--line); }
  .nav-links a { display: block; padding: 18px 0; font-size: 14px; }
  .nav-links a::after { display: none; }
  .nav .btn { margin-top: 24px; }
}
@media (max-width: 400px) { .brand-name small { display: none; } .brand-name b { font-size: 13px; letter-spacing: 0.22em; } }

/* ---------- Full-bleed media panels ---------- */
.panel { position: relative; overflow: hidden; isolation: isolate; background: var(--void); }
.panel > .media { position: absolute; inset: 0; z-index: -2; }
.panel > .media img { width: 100%; height: 100%; object-fit: cover; }
.panel::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; }

/* Hero */
.hero { min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; }
.hero > .media img { object-position: 62% 100%; transform: scale(1.06); animation: settle 2.4s var(--ease) forwards; }
@keyframes settle { to { transform: scale(1); } }
.hero::before {
  background:
    linear-gradient(180deg, rgba(5, 10, 11, 0.65) 0%, rgba(5, 10, 11, 0) 28%),
    linear-gradient(0deg, rgba(5, 10, 11, 0.92) 0%, rgba(5, 10, 11, 0.35) 32%, rgba(5, 10, 11, 0) 55%);
}
.hero-inner { padding-bottom: clamp(56px, 9vh, 96px); }
.hero .kicker { margin-bottom: 28px; }
.hero h1 { max-width: 15ch; margin-bottom: 40px; color: #fff; }
.hero h1 span { color: var(--sage); }
.hero-foot { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 32px; }
.hero-foot p { margin: 0; max-width: 440px; color: var(--fg-2); }
.scroll-cue {
  display: flex; align-items: center; gap: 14px; margin-top: clamp(40px, 7vh, 72px);
  font-size: 12px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--fg-3); text-decoration: none;
}
.scroll-cue i { display: block; width: 1px; height: 44px; background: linear-gradient(var(--ice), transparent); animation: cue 2.4s ease-in-out infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }
@media (max-width: 700px) {
  .hero > .media img { object-position: 72% 100%; }
  .hero-foot .actions { width: 100%; }
  .hero-foot .btn { flex: 1 1 100%; }
}

/* ---------- Sections ---------- */
.section { padding: clamp(96px, 13vw, 180px) 0; position: relative; }
.section + .section { border-top: 1px solid var(--line); }
.bg-2 { background: var(--bg-2); }

.head { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: end; margin-bottom: clamp(56px, 7vw, 96px); }
.head .kicker { margin-bottom: 24px; }
.head p { margin: 0; }
@media (max-width: 860px) { .head { grid-template-columns: 1fr; align-items: start; } }

/* Mission */
.mission { text-align: center; }
.mission .mark { width: 56px; height: auto; margin: 0 auto 40px; opacity: 0.9; }
.mission h2 { max-width: 22ch; margin: 24px auto 32px; }
.mission .lead { max-width: 680px; margin: 0 auto; }
.figures { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: clamp(72px, 9vw, 120px); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.figure { padding: 40px 16px; text-align: center; }
.figure + .figure { border-left: 1px solid var(--line); }
.figure b { display: block; font-family: var(--font-display); font-stretch: 125%; font-weight: 300; font-size: clamp(48px, 6vw, 84px); line-height: 1; color: #fff; }
.figure span { display: block; margin-top: 14px; font-size: 13px; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; color: var(--fg-2); }
@media (max-width: 760px) {
  .figures { grid-template-columns: 1fr 1fr; }
  .figure:nth-child(3) { border-left: 0; }
  .figure:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

/* Principles */
.principles { display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line-2); }
.principle { position: relative; padding: 36px 28px 8px 0; }
.principle + .principle { padding-left: 28px; border-left: 1px solid var(--line); }
.principle::before {
  content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 1px; background: var(--ice);
  transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease);
}
.principle:hover::before { transform: scaleX(1); }
.principle svg { width: 28px; height: 28px; color: var(--ice); margin-bottom: 56px; }
.principle .no { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.28em; color: var(--fg-3); margin-bottom: 14px; }
.principle h3 { font-size: 17px; line-height: 1.2; letter-spacing: 0.06em; margin-bottom: 14px; color: #fff; }
.principle p { margin: 0; font-size: 16px; color: var(--fg-2); line-height: 1.55; }
@media (max-width: 1100px) {
  .principles { grid-template-columns: repeat(3, 1fr); }
  .principle { padding: 32px 24px 32px 0 !important; border-left: 0 !important; border-bottom: 1px solid var(--line); }
  .principle:nth-child(3n+2), .principle:nth-child(3n+3) { padding-left: 24px !important; border-left: 1px solid var(--line) !important; }
  .principle svg { margin-bottom: 32px; }
}
@media (max-width: 640px) {
  .principles { grid-template-columns: 1fr; }
  .principle, .principle:nth-child(n) { padding: 28px 0 !important; border-left: 0 !important; }
  .principle svg { margin-bottom: 20px; }
}

/* Motto band */
.band { min-height: clamp(560px, 92vh, 860px); display: flex; align-items: center; }
.band > .media img { object-position: 78% 50%; }
.band::before {
  background:
    linear-gradient(90deg, rgba(5, 10, 11, 0.92) 0%, rgba(5, 10, 11, 0.5) 46%, rgba(5, 10, 11, 0) 72%),
    linear-gradient(180deg, var(--bg) 0%, rgba(5, 10, 11, 0) 18%, rgba(5, 10, 11, 0) 82%, var(--bg) 100%);
}
.band blockquote { margin: 0; max-width: 820px; }
.band .lines { margin: 28px 0 0; font-family: var(--font-display); font-stretch: 125%; font-weight: 600; text-transform: uppercase; font-size: clamp(30px, 4.6vw, 66px); line-height: 1.06; color: #fff; }
.band .lines span { display: block; }
.band .lines span:last-child { color: var(--ice); }
.band cite { display: block; margin-top: 36px; font-style: normal; font-size: 13px; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; color: var(--fg-3); }
@media (max-width: 760px) { .band > .media img { object-position: 88% 50%; opacity: 0.5; } }

/* Chain of command: stacked hierarchy */
.hierarchy { list-style: none; margin: 0 auto; padding: 0; display: grid; gap: 10px; }
.level {
  position: relative; margin: 0 auto; width: 100%;
  display: grid; grid-template-columns: 90px 1fr 1.3fr; align-items: center; gap: 24px;
  padding: 28px 32px; border: 1px solid var(--line); background: linear-gradient(90deg, rgba(19, 39, 40, 0.55), rgba(15, 29, 30, 0.2));
  transition: border-color .35s var(--ease), background-color .35s var(--ease);
}
.level:hover { border-color: var(--line-2); }
.level:nth-child(1) { max-width: 64%; border-color: rgba(143, 216, 226, 0.45); background: linear-gradient(90deg, rgba(143, 216, 226, 0.12), rgba(19, 39, 40, 0.5)); }
.level:nth-child(2) { max-width: 76%; }
.level:nth-child(3) { max-width: 88%; }
.level:nth-child(4) { max-width: 100%; }
.level .no { font-family: var(--font-display); font-stretch: 125%; font-weight: 300; font-size: 40px; line-height: 1; color: var(--fg-3); }
.level:nth-child(1) .no { color: var(--ice); }
.level h3 { font-size: clamp(16px, 1.6vw, 21px); line-height: 1.2; color: #fff; }
.level h3 small { display: block; margin-top: 8px; font-family: var(--font-body); font-stretch: 100%; font-size: 12px; font-weight: 600; letter-spacing: 0.24em; color: var(--fg-3); }
.level:nth-child(1) h3 small { color: var(--ice); }
.level p { margin: 0; font-size: 16px; color: var(--fg-2); }
.hierarchy-note { margin: 48px auto 0; max-width: 640px; text-align: center; color: var(--fg-2); }
@media (max-width: 900px) {
  .level, .level:nth-child(n) { max-width: 100%; grid-template-columns: 60px 1fr; padding: 24px; }
  .level p { grid-column: 2; }
  .level .no { font-size: 30px; }
}

/* Code of conduct index */
.index { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-2); }
.index a {
  position: relative; display: grid; grid-template-columns: 90px 1fr 1.1fr 40px; gap: 24px; align-items: center;
  padding: 26px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--fg);
  transition: padding .45s var(--ease), color .25s;
}
.index a::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, var(--ice-dim), transparent 70%);
  opacity: 0; transition: opacity .35s;
}
.index li { position: relative; isolation: isolate; }
.index a:hover { padding-left: 20px; }
.index a:hover::before { opacity: 1; }
.index .no { font-family: var(--font-display); font-stretch: 125%; font-size: 15px; color: var(--ice); }
.index .t { font-family: var(--font-display); font-stretch: 125%; font-weight: 600; text-transform: uppercase; font-size: clamp(15px, 1.4vw, 19px); letter-spacing: 0.02em; color: #fff; }
.index .d { color: var(--fg-2); font-size: 16px; }
.index svg { width: 20px; height: 20px; color: var(--fg-3); justify-self: end; transition: color .25s, transform .35s var(--ease); }
.index a:hover svg { color: var(--ice); transform: translateX(4px); }
.index-foot { margin-top: 48px; }
@media (max-width: 860px) {
  .index a { grid-template-columns: 56px 1fr 24px; }
  .index .d { display: none; }
}

/* Join */
.join { display: flex; align-items: center; padding: clamp(110px, 14vw, 180px) 0; }
.join > .media img { object-position: 30% 100%; transform: scaleX(-1); }
.join::before {
  background:
    linear-gradient(180deg, var(--bg-2) 0%, rgba(5, 10, 11, 0.55) 30%, rgba(5, 10, 11, 0.3) 60%, rgba(5, 10, 11, 0.85) 100%);
}
.join-inner { text-align: center; }
.join h2 { margin: 24px auto 28px; max-width: 16ch; color: #fff; }
.join .lead { max-width: 620px; margin: 0 auto 56px; }
.steps { list-style: none; margin: 0 auto 56px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); max-width: 1040px; border-top: 1px solid var(--line-2); text-align: left; }
.step { padding: 28px 28px 0 0; }
.step + .step { padding-left: 28px; border-left: 1px solid var(--line); }
.step .no { font-size: 12px; font-weight: 600; letter-spacing: 0.28em; text-transform: uppercase; color: var(--ice); }
.step h3 { font-size: 16px; line-height: 1.25; letter-spacing: 0.04em; margin: 14px 0 10px; color: #fff; }
.step p { margin: 0; font-size: 16px; color: var(--fg-2); }
.join .actions { justify-content: center; }
@media (max-width: 800px) {
  .steps { grid-template-columns: 1fr; }
  .step, .step + .step { padding: 24px 0; border-left: 0; border-bottom: 1px solid var(--line); }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--void); border-top: 1px solid var(--line); padding: clamp(72px, 9vw, 110px) 0 40px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 48px; padding-bottom: 64px; }
.footer-logo { width: 170px; height: auto; }
.footer-grid h4 { margin: 0 0 20px; font-size: 12px; font-weight: 600; letter-spacing: 0.28em; text-transform: uppercase; color: var(--fg-3); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.footer-grid ul a { text-decoration: none; color: var(--fg-2); font-size: 15px; letter-spacing: 0.04em; transition: color .2s; }
.footer-grid ul a:hover { color: var(--ice); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-top: 28px; border-top: 1px solid var(--line); }
.footer-bottom p { margin: 0; font-size: 13px; color: var(--fg-3); max-width: 72ch; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > div:first-child { grid-column: 1 / -1; } }

/* ==========================================================
   Code of Conduct page
   ========================================================== */
.page-hero { min-height: 78svh; display: flex; align-items: flex-end; padding: calc(var(--nav-h) + 80px) 0 clamp(56px, 8vw, 96px); }
.page-hero > .media img { object-position: 85% 45%; }
.page-hero::before {
  background:
    linear-gradient(90deg, rgba(5, 10, 11, 0.94) 0%, rgba(5, 10, 11, 0.55) 52%, rgba(5, 10, 11, 0.1) 100%),
    linear-gradient(0deg, var(--bg) 0%, rgba(5, 10, 11, 0) 40%);
}
.page-hero h1 { margin: 24px 0 28px; color: #fff; }
.page-hero .lead { max-width: 580px; margin: 0; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 0; margin: 44px 0 0; padding: 0; list-style: none; border: 1px solid var(--line-2); width: fit-content; max-width: 100%; }
.doc-meta li { padding: 12px 20px; font-size: 12px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--fg-2); }
.doc-meta li + li { border-left: 1px solid var(--line-2); }
.doc-meta li.hl { color: var(--ice); }
@media (max-width: 640px) { .doc-meta li { padding: 10px 14px; font-size: 11px; } .doc-meta li:nth-child(n+2) { display: none; } }

.doc-layout { display: grid; grid-template-columns: 270px 1fr; gap: clamp(40px, 6vw, 110px); padding: clamp(64px, 8vw, 110px) 0 clamp(96px, 11vw, 150px); }

.toc { position: sticky; top: calc(var(--nav-h) + 36px); align-self: start; }
.toc h2 { font-family: var(--font-body); font-stretch: 100%; font-size: 12px; letter-spacing: 0.3em; color: var(--fg-3); margin-bottom: 20px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a {
  display: grid; grid-template-columns: 30px 1fr; padding: 9px 0 9px 18px; margin-left: -1px; border-left: 1px solid transparent;
  text-decoration: none; color: var(--fg-2); font-size: 15px; line-height: 1.4; transition: color .2s, border-color .2s;
}
.toc a .n { font-size: 12px; font-weight: 600; color: var(--fg-3); padding-top: 2px; }
.toc a:hover { color: var(--fg); }
.toc a.active { color: #fff; border-left-color: var(--ice); }
.toc a.active .n { color: var(--ice); }
.toc .part { font-size: 11px; font-weight: 600; letter-spacing: 0.28em; text-transform: uppercase; color: var(--fg-3); padding: 24px 0 6px 18px; }
.toc .part:first-child { padding-top: 4px; }
@media (max-width: 980px) {
  .doc-layout { grid-template-columns: 1fr; }
  .toc { position: static; border: 1px solid var(--line); padding: 24px; }
}

.doc-part { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: end; padding-bottom: 24px; border-bottom: 1px solid var(--line-2); }
.doc-body > .doc-part:not(:first-child) { margin-top: 110px; }
.doc-part .pn { font-family: var(--font-display); font-stretch: 125%; font-weight: 200; font-size: clamp(56px, 7vw, 96px); line-height: .8; color: var(--ice); }
.doc-part h2 { font-size: clamp(18px, 2vw, 26px); color: #fff; }
.doc-part p { margin: 10px 0 0; color: var(--fg-2); font-size: 16px; }

.article { padding: 56px 0; border-bottom: 1px solid var(--line); }
.article:last-child { border-bottom: 0; padding-bottom: 0; }
.article-head { display: flex; align-items: baseline; gap: 20px; margin-bottom: 24px; }
.article-head .n { font-size: 13px; font-weight: 600; letter-spacing: 0.2em; color: var(--ice); flex: none; }
.article h3 { font-size: clamp(20px, 2.2vw, 28px); line-height: 1.15; color: #fff; }
.article p { margin: 0 0 1em; max-width: 68ch; color: var(--fg-2); }
.callout { margin: 28px 0 0 !important; padding: 22px 26px; border: 1px solid var(--line); border-left: 2px solid var(--ice); background: linear-gradient(90deg, var(--ice-dim), transparent 80%); color: var(--fg) !important; max-width: 68ch; }

.terms { list-style: none; margin: 24px 0; padding: 0; max-width: 72ch; border-top: 1px solid var(--line); }
.terms li { display: grid; grid-template-columns: 28px 1fr; padding: 16px 0; border-bottom: 1px solid var(--line); color: var(--fg-2); }
.terms li::before { content: ""; width: 10px; height: 1px; margin-top: 14px; background: var(--ice); }
.terms strong { color: #fff; font-weight: 600; }

.numbered { list-style: none; margin: 24px 0; padding: 0; counter-reset: n; max-width: 72ch; border-top: 1px solid var(--line); }
.numbered li { counter-increment: n; display: grid; grid-template-columns: 52px 1fr; padding: 16px 0; border-bottom: 1px solid var(--line); color: var(--fg-2); }
.numbered li::before { content: counter(n, decimal-leading-zero); font-family: var(--font-display); font-stretch: 125%; font-size: 14px; color: var(--ice); padding-top: 3px; }

.doc .hierarchy { margin: 32px 0 12px; }
.doc .level { grid-template-columns: 60px 1fr; max-width: 100% !important; padding: 22px 24px; }
.doc .level p { grid-column: 2; }
.doc .level .no { font-size: 28px; }
.doc h4 { margin: 40px 0 0; font-size: 12px; font-weight: 600; letter-spacing: 0.28em; text-transform: uppercase; color: var(--fg-3); }

.ladder { list-style: none; margin: 32px 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); }
.ladder li { padding: 26px 22px; position: relative; }
.ladder li + li { border-left: 1px solid var(--line); }
.ladder .lvl { display: flex; gap: 4px; margin-bottom: 22px; }
.ladder .lvl i { flex: 1; height: 3px; background: var(--line); }
.ladder li:nth-child(1) .lvl i:nth-child(-n+1),
.ladder li:nth-child(2) .lvl i:nth-child(-n+2),
.ladder li:nth-child(3) .lvl i:nth-child(-n+3),
.ladder li:nth-child(4) .lvl i { background: var(--ice); }
.ladder li:nth-child(4) { background: var(--ice-dim); }
.ladder strong { display: block; font-family: var(--font-display); font-stretch: 125%; font-weight: 600; text-transform: uppercase; font-size: 14px; letter-spacing: 0.04em; color: #fff; margin-bottom: 10px; line-height: 1.3; }
.ladder span.d { display: block; font-size: 15px; color: var(--fg-2); line-height: 1.5; }
@media (max-width: 860px) {
  .ladder { grid-template-columns: 1fr 1fr; }
  .ladder li:nth-child(3) { border-left: 0; }
  .ladder li:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 460px) {
  .ladder { grid-template-columns: 1fr; }
  .ladder li + li { border-left: 0; border-top: 1px solid var(--line); }
  .ladder li:nth-child(-n+2) { border-bottom: 0; }
}

.final { position: relative; margin-top: 40px; padding: clamp(36px, 5vw, 64px); border: 1px solid var(--line-2); overflow: hidden; isolation: isolate; }
.final::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse 80% 120% at 100% 0%, rgba(143, 216, 226, 0.16), transparent 60%), var(--panel); }
.final .lines { margin: 0 0 24px; font-family: var(--font-display); font-stretch: 125%; font-weight: 600; text-transform: uppercase; font-size: clamp(20px, 2.6vw, 32px); line-height: 1.15; color: #fff; }
.final .lines span { display: block; }
.final .lines span:last-child { color: var(--ice); }
.final .ack { margin: 0 !important; font-size: 16px; }

.doc-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 40px; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .1s; } .reveal.d2 { transition-delay: .2s; } .reveal.d3 { transition-delay: .3s; } .reveal.d4 { transition-delay: .4s; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero > .media img { animation: none; transform: none; }
  .scroll-cue i { animation: none; }
}

/* ---------- Print ---------- */
@media print {
  body { background: #fff; color: #111; font-size: 11pt; }
  :root { --fg: #111; --fg-2: #333; --fg-3: #666; --line: #ccc; --line-2: #999; --ice: #1d6b75; }
  .site-header, .toc, .site-footer, .doc-actions, .skip-link, .page-hero > .media, .page-hero::before { display: none !important; }
  .page-hero { min-height: 0; padding: 0 0 16pt; background: #fff; }
  .page-hero h1, .article h3, .doc-part h2, .terms strong, .final .lines, .ladder strong { color: #111 !important; }
  .doc-layout { display: block; padding: 0; }
  .article { break-inside: avoid; }
  .reveal { opacity: 1 !important; transform: none !important; }
}
