/* ============================================================
   MARM — Закрытая институция
   Dark renaissance · stone · restrained bronze
   ============================================================ */

:root {
  --graphite:   #101113;
  --charcoal:   #15171a;
  --stone-dark: #1c1f23;
  --line:       rgba(232, 226, 214, 0.10);
  --line-soft:  rgba(232, 226, 214, 0.06);
  --ivory:      #e8e2d6;
  --marble:     #b9b3a6;
  --stone-mute: #8a8475;   /* ≥4.5:1 on graphite — body-size secondary text */
  --bronze:     #8c7351;   /* accent for large type, strokes, surfaces */
  --bronze-lit: #a68e67;   /* ≥4.5:1 on graphite — small bronze text */
  --bronze-dim: #6e5a40;
  --font-d: "Cormorant", "Times New Roman", serif;
  --font-b: "Inter", system-ui, sans-serif;
  --ease: cubic-bezier(.22, .8, .26, .99);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--graphite);
  color: var(--marble);
  font-family: var(--font-b);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--bronze-dim); color: var(--ivory); }

section[id] { scroll-margin-top: 72px; }

:focus-visible {
  outline: 1px solid var(--bronze);
  outline-offset: 3px;
}

h1, h2, h3 { font-family: var(--font-d); font-weight: 500; color: var(--ivory); }

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

body.is-locked { overflow: hidden; }

/* ---------- ceremonial entry ---------- */
.intro {
  position: fixed; inset: 0;
  z-index: 1000;
  background: var(--graphite);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  cursor: pointer;
  transition: opacity 1.3s var(--ease), visibility 1.3s;
}
.intro.is-done { opacity: 0; visibility: hidden; }
.intro__seal { width: 132px; color: var(--bronze); }
.intro__seal circle,
.intro__seal path {
  fill: none;
  stroke: currentColor;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: intro-draw 1.7s var(--ease) forwards;
}
.intro__seal circle:first-child { stroke-width: .8; }
.intro__seal circle:nth-child(2) { stroke-width: .6; animation-delay: .3s; }
.intro__seal path { stroke-width: 2.6; animation-delay: .6s; }
@keyframes intro-draw { to { stroke-dashoffset: 0; } }
.intro__word {
  font-family: var(--font-d);
  font-size: 16px;
  letter-spacing: .62em;
  text-indent: .62em;
  color: var(--ivory);
  opacity: 0;
  animation: intro-word 1.4s var(--ease) 1s forwards;
}
@keyframes intro-word { to { opacity: .92; } }
@media (prefers-reduced-motion: reduce) {
  .intro { display: none; }
}

/* ---------- arrival from the ecosystem gateway ---------- */
.arrive-veil {
  position: fixed;
  inset: 0;
  z-index: 1001;
  pointer-events: none;
  background: radial-gradient(circle at 50% 42%, rgba(216, 201, 168, .55), var(--graphite) 70%);
  opacity: 1;
  animation: arrive 1.2s var(--ease) forwards;
}
@keyframes arrive { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .arrive-veil { animation: none; opacity: 0; }
}

/* ---------- film grain ---------- */
.grain {
  position: fixed; inset: -50%;
  width: 200%; height: 200%;
  pointer-events: none;
  z-index: 999;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 9s steps(6) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); }
  20% { transform: translate(-2%,2%); }
  40% { transform: translate(2%,-1%); }
  60% { transform: translate(-1%,-2%); }
  80% { transform: translate(1%,2%); }
}

/* ---------- reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
  transition-delay: var(--d, 0s);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(24px, 5vw, 64px);
  transition: background .6s var(--ease), padding .6s var(--ease), border-color .6s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(16, 17, 19, 0.82);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line-soft);
  padding-top: 14px;
  padding-bottom: 14px;
}
.nav__mark {
  display: flex; align-items: center; gap: 12px;
  color: var(--ivory);
  text-decoration: none;
  font-family: var(--font-d);
  font-size: 19px;
  letter-spacing: .42em;
  text-indent: .42em;
}
.nav__mark svg { color: var(--bronze); flex-shrink: 0; }
.nav__links { display: flex; gap: clamp(18px, 3vw, 40px); }
.nav__links a {
  color: var(--stone-mute);
  text-decoration: none;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .22em;
  transition: color .4s;
}
.nav__links a:hover { color: var(--ivory); }
.nav__eco { color: var(--bronze-lit) !important; }
.nav__eco:hover { color: var(--bronze) !important; }
.nav__cta {
  color: var(--ivory);
  text-decoration: none;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .22em;
  border: 1px solid var(--bronze-dim);
  padding: 11px 22px;
  transition: background .4s, border-color .4s;
}
.nav__cta:hover { background: rgba(140, 115, 81, .14); border-color: var(--bronze); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-block;
  font-family: var(--font-b);
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .24em;
  text-indent: .24em;
  text-decoration: none;
  padding: 18px 42px;
  border: 1px solid;
  cursor: pointer;
  transition: background .5s var(--ease), border-color .5s var(--ease), color .5s var(--ease);
  text-align: center;
}
.btn--primary {
  color: var(--graphite);
  background: var(--ivory);
  border-color: var(--ivory);
}
.btn--primary:hover { background: var(--bronze); border-color: var(--bronze); color: var(--ivory); }
.btn--ghost {
  color: var(--marble);
  background: transparent;
  border-color: var(--line);
}
.btn--ghost:hover { border-color: var(--bronze); color: var(--ivory); }
.btn--wide { width: 100%; }
.btn--large { padding: 22px 56px; }

/* ============================================================
   01 — HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero__canvas,
.finale__canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}
.hero__veil {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 90% 60% at 50% 110%, rgba(16,17,19,.94), transparent 60%),
    radial-gradient(ellipse 120% 80% at 50% 50%, transparent 30%, rgba(16,17,19,.55) 100%),
    linear-gradient(to bottom, rgba(16,17,19,.55), transparent 30%, transparent 70%, var(--graphite));
  pointer-events: none;
}
.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 120px 24px 80px;
  max-width: 880px;
}

/* — seal — */
.hero__seal { display: flex; justify-content: center; margin-bottom: 44px; }
.seal {
  width: clamp(120px, 16vw, 168px);
  height: auto;
  color: var(--bronze);
  opacity: .92;
  filter: drop-shadow(0 0 24px rgba(140,115,81,.18));
}
.seal__ring--outer { animation: spin 120s linear infinite; transform-origin: 50% 50%; }
.seal__ring--geometry { animation: spin 240s linear infinite reverse; transform-origin: 50% 50%; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero__kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .34em;
  color: var(--stone-mute);
  margin-bottom: 28px;
}
.hero__title {
  font-size: clamp(46px, 8.4vw, 104px);
  line-height: 1.04;
  letter-spacing: .01em;
  display: flex;
  flex-direction: column;
}
.hero__title .reveal--em { color: var(--bronze); font-style: italic; }
.hero__manifesto {
  max-width: 560px;
  margin: 36px auto 0;
  font-size: 15.5px;
  color: var(--marble);
}
.hero__actions {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 52px;
}
.hero__scroll {
  position: absolute;
  bottom: 36px; left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: 1px; height: 64px;
  background: var(--line);
  overflow: hidden;
}
.hero__scroll span {
  position: absolute; top: -40%;
  width: 100%; height: 40%;
  background: var(--bronze);
  animation: descend 2.8s var(--ease) infinite;
}
@keyframes descend { to { top: 110%; } }

/* ============================================================
   SECTIONS — shared
   ============================================================ */
.section { position: relative; padding: clamp(110px, 14vw, 190px) clamp(24px, 6vw, 72px); }
.section__inner { max-width: 1180px; margin: 0 auto; }
.section__inner--narrow { max-width: 820px; }
.section__index {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .34em;
  color: var(--bronze-lit);
  margin-bottom: 26px;
}
.section__index::after {
  content: "";
  display: inline-block;
  width: 56px; height: 1px;
  background: var(--bronze-dim);
  margin-left: 18px;
  vertical-align: middle;
}
.section__title {
  font-size: clamp(36px, 5.6vw, 68px);
  line-height: 1.08;
  margin-bottom: 30px;
}
.section__lead {
  max-width: 580px;
  font-size: 16.5px;
  color: var(--marble);
  margin-bottom: clamp(56px, 8vw, 96px);
}

/* ============================================================
   02 — PHILOSOPHY
   ============================================================ */
.philosophy {
  background:
    radial-gradient(ellipse 70% 50% at 80% 0%, rgba(140,115,81,.05), transparent 60%),
    var(--graphite);
}
.doctrine { border-top: 1px solid var(--line); }
.doctrine__item {
  display: grid;
  grid-template-columns: clamp(96px, 14vw, 200px) 1fr 1.25fr;
  gap: clamp(20px, 4vw, 72px);
  align-items: baseline;
  padding: clamp(38px, 5vw, 64px) clamp(4px, 1vw, 16px);
  border-bottom: 1px solid var(--line-soft);
  transition: background .6s var(--ease);
}
.doctrine__item:hover { background: rgba(232, 226, 214, .018); }
.doctrine__num {
  font-family: var(--font-d);
  font-size: clamp(56px, 7vw, 110px);
  font-weight: 400;
  line-height: .8;
  color: transparent;
  -webkit-text-stroke: 1px rgba(140, 115, 81, .55);
  transition: -webkit-text-stroke-color .6s;
}
.doctrine__item:hover .doctrine__num { -webkit-text-stroke-color: var(--bronze); }
.doctrine__item h3 { font-size: clamp(24px, 2.4vw, 34px); }
.doctrine__item p {
  font-size: 14.5px;
  color: var(--stone-mute);
  max-width: 52ch;
}

/* ============================================================
   03 — THE ORDER
   ============================================================ */
.order { background: var(--charcoal); overflow: hidden; }
.order__bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 90% at 10% 50%, rgba(140,115,81,.06), transparent 55%),
    repeating-linear-gradient(90deg, transparent 0, transparent 119px, var(--line-soft) 119px, var(--line-soft) 120px);
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  pointer-events: none;
}
.order .section__inner { position: relative; }
.order__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: clamp(48px, 8vw, 128px);
  row-gap: clamp(44px, 6vw, 80px);
}
.order__item {
  border-top: 1px solid var(--line);
  padding-top: clamp(24px, 3vw, 38px);
}
.order__item:nth-child(even) { margin-top: clamp(40px, 7vw, 96px); }
.order__item h3 { font-size: 26px; margin-bottom: 14px; }
.order__item h3::before {
  content: "";
  display: block;
  width: 28px; height: 1px;
  background: var(--bronze);
  margin-bottom: 20px;
}
.order__item p { font-size: 14.5px; color: var(--stone-mute); }
.order__credo {
  margin-top: clamp(64px, 8vw, 110px);
  text-align: center;
}
.order__credo p {
  font-family: var(--font-d);
  font-size: clamp(24px, 3.4vw, 38px);
  font-style: italic;
  font-weight: 400;
  color: var(--ivory);
  line-height: 1.4;
  max-width: 760px;
  margin: 0 auto;
}

/* ============================================================
   04 — PROGRAM
   ============================================================ */
.program {
  background:
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(140,115,81,.04), transparent 60%),
    var(--graphite);
}
.ledger { border-top: 1px solid var(--line); }
.ledger__row {
  display: grid;
  grid-template-columns: 72px 1.1fr 1.3fr auto;
  gap: clamp(20px, 3.5vw, 56px);
  align-items: center;
  padding: clamp(36px, 5vw, 60px) clamp(4px, 1vw, 16px);
  border-bottom: 1px solid var(--line-soft);
  transition: background .6s var(--ease);
}
.ledger__row:hover { background: rgba(232, 226, 214, .02); }
.ledger__num {
  font-family: var(--font-d);
  font-size: clamp(28px, 3vw, 42px);
  color: var(--bronze);
  line-height: 1;
  align-self: start;
  padding-top: 6px;
}
.ledger__name h3 { font-size: clamp(28px, 2.8vw, 40px); margin-bottom: 12px; }
.ledger__name p { font-size: 13.5px; color: var(--stone-mute); max-width: 34ch; }
.ledger__attrs { list-style: none; }
.ledger__attrs li {
  font-size: 14px;
  color: var(--marble);
  padding: 8px 0 8px 24px;
  position: relative;
}
.ledger__attrs li::before {
  content: "";
  position: absolute;
  left: 0; top: 16px;
  width: 9px; height: 1px;
  background: var(--bronze);
}
.ledger__access {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 22px;
}
.ledger__fee {
  text-align: right;
  font-family: var(--font-d);
  font-weight: 500;
  font-size: 26px;
  letter-spacing: .01em;
  color: var(--ivory);
  line-height: 1.2;
  font-variant-numeric: tabular-nums lining-nums;   /* lining figures — even height, not old-style */
}
.ledger__fee span {
  display: block;
  font-family: var(--font-b);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .24em;
  color: var(--stone-mute);
  margin-bottom: 8px;
}
.ledger__fee em {
  font-style: normal;
  font-size: 15px;
  color: var(--stone-mute);
}
/* the petition carries the chosen programme, and clears the fixed nav when it opens */
.application { scroll-margin-top: 96px; }
.form { scroll-margin-top: 96px; }
.form__program {
  display: flex; align-items: baseline; gap: 8px 18px; flex-wrap: wrap;
  padding: 18px 22px; margin-bottom: 40px;
  border: 1px solid var(--line); border-left: 2px solid var(--bronze);
  background: rgba(140, 115, 81, .06);
}
.form__program-k { font-size: 10px; text-transform: uppercase; letter-spacing: .24em; color: var(--stone-mute); }
.form__program-v {
  font-family: var(--font-d); font-weight: 500; font-size: 23px; color: var(--bronze-lit);
  letter-spacing: .01em; font-variant-numeric: tabular-nums lining-nums;
}
.ledger__link {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .24em;
  color: var(--ivory);
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 15px 26px;
  white-space: nowrap;
  transition: border-color .4s, color .4s;
}
.ledger__link:hover { border-color: var(--bronze); color: var(--bronze); }
.program__footnote {
  margin-top: clamp(48px, 6vw, 72px);
  text-align: center;
  font-size: 13.5px;
  color: var(--stone-mute);
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================================
   05 — ADMISSION
   ============================================================ */
.admission { background: var(--charcoal); }
.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(28px, 4vw, 56px);
}
.step { position: relative; padding-top: 34px; }
.step::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: -28px;
  height: 1px;
  background: var(--line-soft);
}
.step:last-child::before { right: 0; }
.step::after {
  content: "";
  position: absolute;
  top: -3.5px; left: 0;
  width: 7px; height: 7px;
  background: var(--bronze);
  transform: rotate(45deg);
}
.step__num {
  font-family: var(--font-d);
  font-size: 15px;
  letter-spacing: .2em;
  color: var(--bronze-lit);
}
.step h3 { font-size: 23px; margin: 10px 0 12px; }
.step p { font-size: 13.5px; color: var(--stone-mute); }

/* ============================================================
   06 — APPLICATION
   ============================================================ */
.application {
  background:
    radial-gradient(ellipse 90% 50% at 50% 0%, rgba(140,115,81,.05), transparent 55%),
    var(--graphite);
}
.appgate {
  text-align: center;
  border: 1px solid var(--line-soft);
  background: rgba(28, 31, 35, .4);
  padding: clamp(56px, 8vw, 96px) clamp(24px, 6vw, 72px);
  color: var(--bronze);
}
.appgate__text {
  max-width: 460px;
  margin: 28px auto 36px;
  font-size: 14.5px;
  color: var(--marble);
}
.form { animation: form-in 1.1s var(--ease); }
@keyframes form-in {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: none; }
}
.form fieldset {
  border: 1px solid var(--line-soft);
  padding: clamp(28px, 4vw, 48px);
  margin-bottom: 36px;
  background: rgba(28, 31, 35, .4);
}
.form legend {
  font-family: var(--font-d);
  font-size: 20px;
  color: var(--ivory);
  padding: 0 18px;
  letter-spacing: .06em;
}
.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.form__row .field--s { max-width: 180px; }
.field { display: flex; flex-direction: column; margin-bottom: 22px; }
.field > span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--stone-mute);
  margin-bottom: 10px;
}
.field input,
.field select,
.field textarea {
  font-family: var(--font-b);
  font-size: 15px;
  font-weight: 300;
  color: var(--ivory);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 10px 2px;
  outline: none;
  border-radius: 0;
  transition: border-color .4s;
  resize: vertical;
}
.field select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238c7351' stroke-width='1.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  padding-right: 24px;
}
.field select option { background: var(--stone-dark); color: var(--ivory); }
.field input:focus,
.field select:focus,
.field textarea:focus { border-bottom-color: var(--bronze); }
.field input.is-invalid,
.field select.is-invalid,
.field textarea.is-invalid { border-bottom-color: #8a4b3a; }
.field__hint {
  font-style: normal;
  font-size: 12px;
  color: var(--stone-mute);
  margin-top: 8px;
}
.field__count { color: var(--bronze-lit); white-space: nowrap; }
.form__submit { margin-top: 8px; }
.form__oath {
  font-size: 12.5px;
  color: var(--stone-mute);
  text-align: center;
  max-width: 520px;
  margin: 0 auto 28px;
}
.form__error {
  margin-top: 22px;
  text-align: center;
  font-size: 13px;
  color: #b06a52;
}
.btn[disabled] { opacity: .55; cursor: wait; }
.form__done {
  text-align: center;
  padding: clamp(60px, 8vw, 100px) 24px;
  border: 1px solid var(--line-soft);
  color: var(--bronze);
}
.form__done h3 { font-size: 34px; margin: 26px 0 14px; }
.form__done p { color: var(--stone-mute); max-width: 440px; margin: 0 auto; }

/* ============================================================
   07 — FOUNDER
   ============================================================ */
.founder { background: var(--charcoal); text-align: center; }
.founder__quotes { display: flex; flex-direction: column; gap: clamp(140px, 24vh, 280px); }
.founder__q {
  opacity: .18;
  filter: blur(1px);
  transform: scale(.985);
  transition: opacity 1.2s var(--ease), filter 1.2s var(--ease), transform 1.2s var(--ease);
}
.founder__q.is-focus { opacity: 1; filter: none; transform: none; }
.founder__q p {
  font-family: var(--font-d);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.45;
  color: var(--ivory);
}
@media (prefers-reduced-motion: reduce) {
  .founder__q { opacity: 1; filter: none; transform: none; }
}
.founder__q:nth-child(2) p { color: var(--bronze); }
.founder__sig {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .34em;
  color: var(--stone-mute);
}

/* ============================================================
   08 — FINALE
   ============================================================ */
.finale {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.finale__veil {
  position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, var(--charcoal), transparent 30%),
    radial-gradient(ellipse 100% 70% at 50% 60%, transparent 20%, rgba(16,17,19,.8) 100%),
    linear-gradient(to top, var(--graphite), transparent 36%);
  pointer-events: none;
}
.finale__content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 100px 24px;
}
.finale__kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .34em;
  color: var(--bronze-lit);
  margin-bottom: 30px;
}
.finale__title {
  font-size: clamp(44px, 7.4vw, 92px);
  line-height: 1.06;
  margin-bottom: 52px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer { border-top: 1px solid var(--line-soft); background: var(--graphite); }
.footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 24px clamp(24px, 5vw, 64px);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .24em;
  color: var(--stone-mute);
}

/* Telegram links (public channel + premium access) */
.tg-links { display: inline-flex; align-items: center; gap: clamp(16px, 2vw, 28px); flex-wrap: wrap; }
.tg-links a {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 10px; text-transform: uppercase; letter-spacing: .22em;
  color: var(--stone-mute); text-decoration: none; white-space: nowrap;
  transition: color .4s var(--ease);
}
.tg-links a:hover { color: var(--ivory); }
.tg-links a svg { width: 13px; height: 13px; flex: none; opacity: .8; transition: opacity .4s; }
.tg-links a:hover svg { opacity: 1; }
.tg-links .is-premium { color: var(--bronze-lit); }
.tg-links .is-premium:hover { color: var(--bronze); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .doctrine__item { grid-template-columns: 88px 1fr; }
  .doctrine__item p { grid-column: 2; }
  .ledger__row { grid-template-columns: 56px 1fr; }
  .ledger__attrs { grid-column: 2; }
  .ledger__access { grid-column: 2; align-items: flex-start; }
  .ledger__fee { text-align: left; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .step::before { right: 0; }
}
@media (max-width: 860px) {
  /* on phones the nav is NOT fixed — it scrolls away instead of eating ~14% of the
     viewport and hiding section headings beneath itself when the menu is used */
  .nav { position: absolute; flex-wrap: wrap; row-gap: 6px; padding-top: 14px; padding-bottom: 12px; }
  .nav__links {
    order: 3; flex-basis: 100%;
    flex-wrap: wrap; justify-content: center; gap: 6px 15px;
  }
  .nav__links a { font-size: 10.5px; }
}
@media (max-width: 720px) {
  .doctrine__item { grid-template-columns: 64px 1fr; gap: 16px; }
  .order__grid { grid-template-columns: 1fr; }
  .order__item:nth-child(even) { margin-top: 0; }
  .steps { grid-template-columns: 1fr; }
  .form__row { grid-template-columns: 1fr; gap: 0; }
  .form__row .field--s { max-width: 100%; }
  .hero__actions .btn { width: 100%; }
  /* footer centred (not left-ragged) + comfortable tap targets */
  .footer__inner { justify-content: center; text-align: center; }
  .tg-links a { padding: 10px 4px; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .seal__ring--outer, .seal__ring--geometry, .hero__scroll span, .grain, .form { animation: none; }
}
