/* ===========================================================
   CIHET Latinoamérica — hoja de estilo
   Identidad: dossier institucional para la economía nocturna.
   Tema único (noche) pintado explícitamente: el fondo, el texto
   y cada acento se declaran, nunca se heredan del host.
   =========================================================== */

:root {
  /* Color ------------------------------------------------- */
  --night:        #0A1330;  /* azul noche — fondo */
  --night-raise:  #0D1A3E;  /* banda alterna */
  --surface:      #13224F;  /* superficie elevada */
  --surface-2:    #1A2B62;  /* hover */
  --rule:         #22336B;  /* hairline */
  --rule-soft:    #17244E;

  --blue:         #2E6BFF;  /* azul de marca — filetes y tipografía grande */
  --blue-deep:    #1B4FD8;  /* fondos sólidos que llevan texto blanco */

  --white:        #FFFFFF;
  --bone:         #F4F7FF;  /* texto principal */
  --muted:        #B3C0E0;  /* texto secundario */
  --dim:          #7B8CB8;  /* metadatos */

  --alert:        #FF6B6B;  /* estado de error — semántico, no de marca */

  /* Tipografía -------------------------------------------- */
  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body:    "Petrona", Georgia, "Times New Roman", serif;

  /* Métrica ----------------------------------------------- */
  --wrap: 1240px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --rail-w: 210px;
  --band-y: clamp(4.5rem, 9vw, 8.5rem);
  --measure: 65ch;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 6rem; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--night);
  color: var(--bone);
  font-family: var(--body);
  font-size: clamp(1rem, .96rem + .2vw, 1.0625rem);
  line-height: 1.66;
  font-weight: 380;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

::selection { background: var(--blue-deep); color: var(--white); }

:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 3px;
  border-radius: 1px;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--blue-deep); color: var(--white);
  padding: .75rem 1.25rem; font-family: var(--display); font-weight: 700;
}
.skip:focus { left: 0; }

/* ── Envoltorio y rejilla ──────────────────────────────── */

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

.band { padding-block: var(--band-y); border-top: 1px solid var(--rule-soft); }
.band-alt { background: var(--night-raise); }
.band-quote { padding-block: clamp(3rem, 6vw, 5rem); }
.band-cta { background: var(--night-raise); }

.grid-sec {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  gap: clamp(1.75rem, 4vw, 4.5rem);
  align-items: start;
}

.rail { position: sticky; top: 6rem; }
.rail-note {
  margin: .9rem 0 0;
  font-size: .875rem;
  line-height: 1.55;
  color: var(--dim);
  max-width: 24ch;
}

.col { min-width: 0; }

/* ── Tipografía base ───────────────────────────────────── */

.eyebrow {
  margin: 0;
  font-family: var(--display);
  font-variation-settings: "wdth" 108, "wght" 620;
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--dim);
  display: flex;
  align-items: center;
  gap: .7rem;
}
.eyebrow::before {
  content: "";
  width: 1.6rem; height: 1px;
  background: var(--rule);
  flex: none;
}
.eyebrow-accent { color: var(--white); }
.eyebrow-accent::before { background: var(--blue); }

.display {
  margin: 1.5rem 0 0;
  font-family: var(--display);
  font-variation-settings: "wdth" 118, "wght" 760;
  font-size: clamp(2.5rem, 1.3rem + 4.6vw, 4.6rem);
  line-height: .98;
  letter-spacing: -.022em;
  text-wrap: balance;
  color: var(--bone);
}

.h2 {
  margin: 0 0 1.5rem;
  font-family: var(--display);
  font-variation-settings: "wdth" 112, "wght" 700;
  font-size: clamp(1.75rem, 1.15rem + 2.1vw, 2.65rem);
  line-height: 1.04;
  letter-spacing: -.018em;
  text-wrap: balance;
  max-width: 20ch;
  color: var(--bone);
}
.h2-big { max-width: 16ch; font-size: clamp(2rem, 1.2rem + 3.2vw, 3.6rem); }

.lede {
  margin: 1.5rem 0 0;
  max-width: 52ch;
  font-size: clamp(1.0625rem, 1rem + .35vw, 1.3rem);
  line-height: 1.55;
  color: var(--muted);
}

.prose { max-width: var(--measure); }
.prose p { margin: 0 0 1.15rem; color: var(--muted); }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--bone); font-weight: 600; }

.foot-note {
  margin: 2.25rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule-soft);
  max-width: var(--measure);
  font-size: .9375rem;
  color: var(--dim);
}

.hl { color: var(--white); font-weight: 600; }

/* ── Botones ───────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 1.4rem;
  font-family: var(--display);
  font-variation-settings: "wdth" 104, "wght" 640;
  font-size: .875rem;
  letter-spacing: .04em;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.btn-solid { background: var(--blue-deep); color: var(--white); }
.btn-solid:hover { background: var(--blue); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--bone); border-color: var(--rule); }
.btn-ghost:hover { border-color: var(--white); color: var(--white); }

/* ── Cabecera ──────────────────────────────────────────── */

.masthead {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--night) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule-soft);
}
.masthead-in {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 4.5rem;
}

.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; margin-right: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong {
  font-family: var(--display);
  font-variation-settings: "wdth" 120, "wght" 800;
  font-size: 1.3rem;
  letter-spacing: .035em;
  color: var(--white);
}
.brand-text span {
  font-family: var(--display);
  font-variation-settings: "wdth" 95, "wght" 500;
  font-size: .6rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--dim);
}

.nav { display: flex; gap: 1.75rem; }
.nav a {
  font-family: var(--display);
  font-variation-settings: "wdth" 100, "wght" 520;
  font-size: .875rem;
  color: var(--muted);
  text-decoration: none;
  padding: .35rem 0;
  border-bottom: 1px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.nav a:hover, .nav a.is-active { color: var(--white); border-bottom-color: var(--blue); }

.burger { display: none; }

/* ── Hero ──────────────────────────────────────────────── */

.hero { position: relative; padding-block: clamp(3rem, 7vw, 6rem) 0; overflow: hidden; }

.bloom {
  position: absolute; inset: -25% -10% auto -10%;
  height: 130%;
  pointer-events: none;
  background:
    radial-gradient(38rem 26rem at 18% 22%, rgba(46, 107, 255, .26), transparent 70%),
    radial-gradient(34rem 24rem at 78% 12%, rgba(46, 107, 255, .16), transparent 70%),
    radial-gradient(30rem 20rem at 60% 70%, rgba(255, 255, 255, .05), transparent 72%);
  animation: drift 28s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translate3d(-2%, 0, 0) scale(1); }
  to   { transform: translate3d(3%, 2%, 0) scale(1.07); }
}

.hero-in {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .85fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: end;
  padding-bottom: clamp(3rem, 6vw, 5rem);
}
.hero-copy { min-width: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2.25rem; }

.hero-figure { margin: 0; max-width: 100%; }
.hero-figure img {
  width: 100%;
  border: 1px solid var(--rule);
  filter: saturate(.92) contrast(1.05);
}
.hero-figure figcaption {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem;
  margin-top: .85rem;
  font-family: var(--display);
  font-variation-settings: "wdth" 96, "wght" 460;
  font-size: .75rem;
  line-height: 1.5;
  color: var(--dim);
}
.tag {
  font-variation-settings: "wdth" 100, "wght" 680;
  font-size: .65rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--blue-deep);
  padding: .18rem .5rem;
  border-radius: 2px;
}

.presence {
  position: relative;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 1.5rem;
  padding-block: 1.35rem;
  border-block: 1px solid var(--rule-soft);
}
.presence-codes { display: flex; gap: .5rem; list-style: none; margin: 0; padding: 0; }
.presence-codes li {
  font-family: var(--display);
  font-variation-settings: "wdth" 112, "wght" 700;
  font-size: .8rem;
  letter-spacing: .06em;
  color: var(--bone);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: .25rem .55rem;
}
.presence-codes abbr { text-decoration: none; }
.presence-note { margin: 0; font-size: .9375rem; color: var(--muted); }
.presence-stamp {
  margin: 0;
  font-family: var(--display);
  font-variation-settings: "wdth" 108, "wght" 620;
  font-size: .72rem;
  letter-spacing: .18em;
  color: var(--white);
  font-variant-numeric: tabular-nums;
}

/* ── Lista de definición ───────────────────────────────── */

.definition { margin-top: clamp(2.5rem, 5vw, 3.75rem); }
.deflist {
  margin: 1.5rem 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(1.25rem, 3vw, 2.5rem);
  border-top: 1px solid var(--rule-soft);
}
.deflist > div {
  padding: 1.25rem 1.5rem 1.25rem 0;
  border-bottom: 1px solid var(--rule-soft);
}
.deflist dt {
  font-family: var(--display);
  font-variation-settings: "wdth" 104, "wght" 640;
  font-size: .9375rem;
  letter-spacing: -.005em;
  color: var(--bone);
  margin-bottom: .3rem;
}
.deflist dd { margin: 0; font-size: .9375rem; line-height: 1.55; color: var(--muted); }
.deflist-tight > div { padding-block: 1rem; }

/* ── Cita ──────────────────────────────────────────────── */

.pullquote {
  margin: 0;
  max-width: 24ch;
  font-family: var(--body);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.6rem, 1rem + 2.6vw, 3.1rem);
  line-height: 1.16;
  letter-spacing: -.015em;
  color: var(--bone);
  text-wrap: balance;
  padding-left: clamp(1rem, 2vw, 1.75rem);
  border-left: 2px solid var(--blue);
}

/* ── Líneas de acción ──────────────────────────────────── */

.lines {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(1.5rem, 4vw, 3.5rem);
  border-top: 1px solid var(--rule);
}
.lines li {
  padding: 1.75rem 1.75rem 2rem 0;
  border-bottom: 1px solid var(--rule-soft);
}
.lines .idx {
  display: block;
  font-family: var(--display);
  font-variation-settings: "wdth" 90, "wght" 600;
  font-size: .72rem;
  letter-spacing: .16em;
  color: var(--white);
  font-variant-numeric: tabular-nums;
  margin-bottom: .85rem;
}
.lines h3 {
  margin: 0 0 .55rem;
  font-family: var(--display);
  font-variation-settings: "wdth" 110, "wght" 680;
  font-size: 1.2rem;
  line-height: 1.15;
  letter-spacing: -.01em;
  color: var(--bone);
}
.lines p { margin: 0; font-size: .9375rem; line-height: 1.6; color: var(--muted); }

/* ── Funciones clave ───────────────────────────────────── */

.functions { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.functions li {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  gap: 1.25rem;
  padding-block: 1.6rem;
  border-bottom: 1px solid var(--rule-soft);
}
.fn-n {
  font-family: var(--display);
  font-variation-settings: "wdth" 118, "wght" 760;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
@supports (-webkit-text-stroke: 1px currentColor) {
  .fn-n { color: transparent; -webkit-text-stroke: 1px var(--dim); }
}

.functions h3 {
  margin: 0 0 .4rem;
  font-family: var(--display);
  font-variation-settings: "wdth" 108, "wght" 660;
  font-size: 1.15rem;
  letter-spacing: -.008em;
  color: var(--bone);
}
.functions h3 em { font-style: normal; color: var(--dim); font-variation-settings: "wdth" 100, "wght" 440; }
.functions p { margin: 0; max-width: var(--measure); color: var(--muted); font-size: .96rem; }
.functions em { font-style: italic; }

/* ── Países ────────────────────────────────────────────── */

.countries {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1px;
  background: var(--rule-soft);
  border: 1px solid var(--rule-soft);
}
.countries li {
  background: var(--night);
  padding: 1.6rem 1.4rem 1.75rem;
  transition: background-color .25s ease;
}
.countries li:hover { background: var(--surface); }
.cc {
  display: inline-block;
  font-family: var(--display);
  font-variation-settings: "wdth" 122, "wght" 800;
  font-size: 2.4rem;
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--blue);
  margin-bottom: 1.1rem;
}
.countries h3 {
  margin: 0 0 .15rem;
  font-family: var(--display);
  font-variation-settings: "wdth" 106, "wght" 660;
  font-size: 1.1rem;
  color: var(--bone);
}
.countries .city { margin: 0 0 .8rem; font-size: .9375rem; color: var(--muted); }
.countries .role {
  margin: 0;
  font-family: var(--display);
  font-variation-settings: "wdth" 94, "wght" 500;
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  line-height: 1.5;
  color: var(--dim);
}

/* ── Estructura ────────────────────────────────────────── */

.levels {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: clamp(1.25rem, 3vw, 2.25rem);
}
.levels li { border-top: 2px solid var(--blue); padding-top: 1.1rem; }
.levels h3 {
  margin: 0 0 .5rem;
  font-family: var(--display);
  font-variation-settings: "wdth" 100, "wght" 680;
  font-size: .78rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--bone);
}
.levels p { margin: 0; font-size: .9375rem; color: var(--muted); }

.secretariat {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 2px;
}
.secretariat-lede { margin: 1rem 0 0; max-width: var(--measure); color: var(--muted); }
.secretariat .deflist { border-top-color: var(--rule); }
.secretariat .deflist > div { border-bottom-color: var(--rule); padding-right: 1.25rem; }

/* ── Conocimiento ──────────────────────────────────────── */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 16rem) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: center;
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 2px;
}
.feature-plate {
  aspect-ratio: 4 / 3;
  max-width: 100%;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: .35rem;
  background:
    radial-gradient(18rem 12rem at 30% 20%, rgba(46, 107, 255, .45), transparent 70%),
    linear-gradient(150deg, #17265C, #0A1330 70%);
  border: 1px solid var(--rule);
}
.feature-word {
  font-family: var(--display);
  font-variation-settings: "wdth" 124, "wght" 820;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: .02em;
  line-height: 1;
  color: var(--bone);
}
.feature-sub {
  font-family: var(--display);
  font-variation-settings: "wdth" 100, "wght" 520;
  font-size: .7rem;
  letter-spacing: .4em;
  text-indent: .4em;
  color: var(--white);
}
.feature-body h3 {
  margin: .9rem 0 .5rem;
  font-family: var(--display);
  font-variation-settings: "wdth" 108, "wght" 680;
  font-size: clamp(1.2rem, 1rem + 1vw, 1.6rem);
  line-height: 1.15;
  letter-spacing: -.012em;
  color: var(--bone);
  text-wrap: balance;
}
.feature-body p { margin: 0; color: var(--muted); font-size: .96rem; }

.pubs { list-style: none; margin: 2rem 0 0; padding: 0; border-top: 1px solid var(--rule); }
.pubs li {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: baseline;
  padding-block: 1.35rem;
  border-bottom: 1px solid var(--rule-soft);
}
.pub-n {
  font-family: var(--display);
  font-variation-settings: "wdth" 90, "wght" 560;
  font-size: .75rem;
  letter-spacing: .1em;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.pubs h3 {
  margin: 0 0 .25rem;
  font-family: var(--display);
  font-variation-settings: "wdth" 104, "wght" 620;
  font-size: 1.02rem;
  letter-spacing: -.005em;
  color: var(--bone);
}
.pubs p { margin: 0; font-size: .9rem; color: var(--muted); }

.status {
  font-family: var(--display);
  font-variation-settings: "wdth" 96, "wght" 620;
  font-size: .65rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: .22rem .55rem;
  border-radius: 2px;
  border: 1px solid;
}
.status-live { color: var(--white); border-color: var(--blue-deep); background: var(--blue-deep); }
.status-soon { color: var(--dim); border-color: var(--rule); background: transparent; }
.feature-body .status { display: inline-block; margin-top: 1rem; }

/* ── Galería ───────────────────────────────────────────── */

.gallery {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(.85rem, 2vw, 1.4rem);
}
.gallery li { display: flex; flex-direction: column; gap: .65rem; }
.gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--rule);
  filter: saturate(.9) contrast(1.04);
  transition: filter .3s ease;
}
.gallery li:hover img { filter: saturate(1.05) contrast(1.04); }
.gallery span {
  font-family: var(--display);
  font-variation-settings: "wdth" 94, "wght" 500;
  font-size: .72rem;
  letter-spacing: .06em;
  color: var(--dim);
}

/* ── Formulario ────────────────────────────────────────── */

.cta-col { min-width: 0; }
.form {
  margin-top: clamp(2.25rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.1rem 1.25rem;
  max-width: 46rem;
}
.field { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field label {
  font-family: var(--display);
  font-variation-settings: "wdth" 98, "wght" 560;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
}
.field input, .field select, .field textarea {
  width: 100%;
  font-family: var(--body);
  font-size: 1rem;
  color: var(--bone);
  background: var(--night);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: .7rem .85rem;
  transition: border-color .2s ease, background-color .2s ease;
}
.field textarea { resize: vertical; min-height: 6rem; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--dim); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); background: var(--surface); }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%); background-position: calc(100% - 1.1rem) 1.15rem, calc(100% - .75rem) 1.15rem; background-size: .35rem .35rem, .35rem .35rem; background-repeat: no-repeat; padding-right: 2.25rem; }
.field select option { background: var(--night); color: var(--bone); }
.field :is(input, textarea)::placeholder { color: var(--dim); }
.field :is(input, select, textarea)[aria-invalid="true"] { border-color: var(--alert); }

.form-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.form-msg { margin: 0; font-size: .9rem; color: var(--muted); }
.form-msg[data-state="error"] { color: var(--alert); }
.form-msg[data-state="ok"] { color: var(--white); }

/* ── Pie ───────────────────────────────────────────────── */

.footer { background: var(--night); border-top: 1px solid var(--rule); padding-block: clamp(2.5rem, 5vw, 3.5rem); }
.footer-in {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}
.footer-full {
  margin: 1rem 0 0;
  font-family: var(--display);
  font-variation-settings: "wdth" 96, "wght" 440;
  font-size: .8rem;
  line-height: 1.6;
  color: var(--dim);
}
.footer-nav { display: flex; flex-direction: column; gap: .55rem; }
.footer-nav a {
  font-family: var(--display);
  font-variation-settings: "wdth" 100, "wght" 520;
  font-size: .875rem;
  color: var(--muted);
  text-decoration: none;
  width: fit-content;
}
.footer-nav a:hover { color: var(--white); }
.footer-meta { text-align: right; }
.footer-sec, .footer-cr {
  margin: 0;
  font-family: var(--display);
  font-variation-settings: "wdth" 96, "wght" 500;
  font-size: .75rem;
  letter-spacing: .05em;
  color: var(--dim);
}
.footer-cr { margin-top: .5rem; letter-spacing: .14em; }

/* ── Adaptaciones ──────────────────────────────────────── */

@media (max-width: 1000px) {
  .grid-sec { grid-template-columns: 1fr; gap: 1.5rem; }
  .rail { position: static; }
  .rail-note { max-width: var(--measure); }
  .hero-in { grid-template-columns: 1fr; align-items: start; }
  .hero-figure { max-width: 30rem; }
  .presence { grid-template-columns: 1fr; gap: .9rem; }
  .footer-in { grid-template-columns: 1fr 1fr; }
  .footer-meta { text-align: left; grid-column: 1 / -1; padding-top: 1.25rem; border-top: 1px solid var(--rule-soft); }
}

@media (max-width: 820px) {
  .masthead-cta { display: none; }
  .burger {
    display: grid; place-content: center; gap: 5px;
    width: 2.5rem; height: 2.5rem;
    background: transparent; border: 1px solid var(--rule); border-radius: 2px;
    cursor: pointer;
  }
  .burger span { display: block; width: 1.05rem; height: 1.5px; background: var(--bone); transition: transform .25s ease, opacity .25s ease; }
  .burger[aria-expanded="true"] span:first-child { transform: translateY(3.25px) rotate(45deg); }
  .burger[aria-expanded="true"] span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

  .masthead-in { flex-wrap: wrap; }
  .nav {
    order: 3;
    flex-basis: 100%;
    flex-direction: column;
    gap: 0;
    display: none;
    border-top: 1px solid var(--rule-soft);
  }
  .nav.is-open { display: flex; }
  .nav a { padding: .85rem 0; border-bottom: 1px solid var(--rule-soft); font-size: 1rem; }
  .nav a:hover, .nav a.is-active { border-bottom-color: var(--rule-soft); }

  .feature { grid-template-columns: 1fr; }
  .feature-plate { aspect-ratio: 16 / 9; }
  .pubs li { grid-template-columns: 2.25rem minmax(0, 1fr); }
  .pubs .status { grid-column: 2; justify-self: start; margin-top: .55rem; }
  .functions li { grid-template-columns: 2.25rem minmax(0, 1fr); gap: 1rem; }
  .fn-n { font-size: 1.4rem; }
}

@media (max-width: 680px) {
  .deflist, .lines, .gallery { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 520px) {
  .deflist > div { padding-right: 0; }
  .lines li { padding-right: 0; }
  .footer-in { grid-template-columns: 1fr; }
}
