/* ============================================================
   IT Коледж — Public site CSS
   Self-hosted fonts + design tokens + layout styles
   ============================================================ */

/* ---- @font-face: Open Sans ---- */
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/lib/fonts/open-sans/files/open-sans-cyrillic-400-normal.woff2") format("woff2");
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/lib/fonts/open-sans/files/open-sans-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/lib/fonts/open-sans/files/open-sans-cyrillic-600-normal.woff2") format("woff2");
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/lib/fonts/open-sans/files/open-sans-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/lib/fonts/open-sans/files/open-sans-cyrillic-700-normal.woff2") format("woff2");
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/lib/fonts/open-sans/files/open-sans-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/lib/fonts/open-sans/files/open-sans-cyrillic-800-normal.woff2") format("woff2");
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/lib/fonts/open-sans/files/open-sans-latin-800-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- @font-face: Montserrat (heading/display substitute for Gilroy) ---- */
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/montserrat/files/montserrat-cyrillic-600-normal.woff2") format("woff2");
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/montserrat/files/montserrat-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/montserrat/files/montserrat-cyrillic-700-normal.woff2") format("woff2");
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/montserrat/files/montserrat-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/montserrat/files/montserrat-cyrillic-800-normal.woff2") format("woff2");
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/montserrat/files/montserrat-latin-800-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- @font-face: Inter ---- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/lib/fonts/inter/files/inter-cyrillic-400-normal.woff2") format("woff2");
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/lib/fonts/inter/files/inter-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/lib/fonts/inter/files/inter-cyrillic-500-normal.woff2") format("woff2");
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/lib/fonts/inter/files/inter-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/lib/fonts/inter/files/inter-cyrillic-600-normal.woff2") format("woff2");
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/lib/fonts/inter/files/inter-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/lib/fonts/inter/files/inter-cyrillic-700-normal.woff2") format("woff2");
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/lib/fonts/inter/files/inter-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============================================================
   Design tokens
   ============================================================ */

:root {
  /* ---- Brand: Violet (primary) ---- */
  --brand-purple: #600CEB;
  --brand-purple-700: #4809B0;
  --brand-purple-600: #550AC9;
  --brand-purple-500: #600CEB;
  --brand-purple-400: #7E38EF;
  --brand-purple-300: #9D66F3;
  --brand-purple-200: #C4A3F8;
  --brand-purple-100: #E2D0FC;
  --brand-purple-50:  #F2EBFE;
  --brand-purple-61a: rgba(96,12,235,0.61);
  --brand-purple-42a: rgba(96,12,235,0.42);

  /* ---- Brand: Yellow ---- */
  --brand-yellow: #F9DB74;
  --brand-yellow-300: #FBE79A;
  --brand-yellow-200: #FCEFBC;
  --brand-yellow-100: #FDF6DC;
  --brand-yellow-50:  #FEFAEE;

  /* ---- Brand: Sky ---- */
  --brand-blue: #5FBDF7;
  --brand-blue-300: #8BD0F9;
  --brand-blue-200: #B4E1FB;
  --brand-blue-100: #DAF0FD;
  --brand-blue-50:  #EEF8FE;

  /* ---- Brand: Coral / Orange ---- */
  --brand-orange: #E36756;
  --brand-orange-300: #EB9186;
  --brand-orange-200: #F2B8B1;
  --brand-orange-100: #F8DCD8;
  --brand-orange-50:  #FCEEEC;

  /* ---- Neutrals ---- */
  --neutral-0:   #FFFFFF;
  --neutral-50:  #F7F7F8;
  --neutral-100: #F5F5F5;
  --neutral-200: #E4E4E4;
  --neutral-300: #D9D9D9;
  --neutral-400: #B1B1B1;
  --neutral-500: #898989;
  --neutral-600: #606060;
  --neutral-700: #4B4B4B;
  --neutral-900: #1D1D1B;
  --neutral-950: #000000;
  --ink:         #211F54;
  --stroke-cool: #A0A3BD;

  /* ---- White alpha ---- */
  --white-92: rgba(255,255,255,0.92);
  --white-78: rgba(255,255,255,0.78);
  --white-68: rgba(255,255,255,0.68);
  --white-56: rgba(255,255,255,0.56);
  --white-42: rgba(255,255,255,0.42);
  --white-30: rgba(255,255,255,0.30);

  /* ---- Semantic ---- */
  --color-primary:        var(--brand-purple);
  --color-primary-hover:  var(--brand-purple-700);
  --color-primary-soft:   var(--brand-purple-50);
  --color-accent:         var(--brand-orange);
  --color-info:           var(--brand-blue);
  --color-highlight:      var(--brand-yellow);

  --text-strong:     var(--neutral-950);
  --text-body:       #000000;
  --text-heading:    var(--ink);
  --text-muted:      var(--neutral-500);
  --text-on-primary: #FFFFFF;
  --text-link:       var(--brand-purple);

  --surface-page:    #FFFFFF;
  --surface-card:    #FFFFFF;
  --surface-subtle:  var(--neutral-100);
  --surface-primary: var(--brand-purple);
  --surface-inverse: var(--neutral-950);

  --border-subtle: var(--neutral-200);
  --border-strong: var(--neutral-300);
  --border-cool:   var(--stroke-cool);
  --focus-ring:    var(--brand-purple);

  /* ---- Spacing ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 100px;
  --page-gutter: 100px;
  --content-max: 1170px;
  --content-wide: 1440px;

  /* ---- Typography ---- */
  --font-display: "Montserrat", "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body:    "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-ui:      "Inter", "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-logo:    "Montserrat", "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --weight-regular:   400;
  --weight-semibold:  600;
  --weight-bold:      700;
  --weight-extrabold: 800;

  --text-display-2xl: 120px;
  --text-display-xl:  80px;
  --text-display-lg:  55px;
  --text-h1:          55px;
  --text-h2:          34px;
  --text-h3:          25px;
  --text-body-lg:     25px;
  --text-body-size:   17px;
  --text-body-md:     16px;
  --text-caption:     12px;

  --leading-tight:   1.05;
  --leading-snug:    1.2;
  --leading-normal:  1.4;
  --leading-relaxed: 1.6;

  --tracking-tight:  -0.01em;
  --tracking-normal: 0;
  --tracking-wide:   0.02em;

  /* ---- Radii ---- */
  --radius-xs:   6px;
  --radius-sm:   8px;
  --radius-md:   16px;
  --radius-lg:   24px;
  --radius-xl:   45px;
  --radius-pill: 999px;
  --radius-mark: 22.9%;

  /* ---- Shadows ---- */
  --shadow-sm:     0 3px 3px rgba(0,0,0,0.05);
  --shadow-md:     0 3px 5px rgba(0,0,0,0.2);
  --shadow-soft:   0 4px 24px rgba(21,19,99,0.06);
  --shadow-card:   15px 22px 41px 0 rgba(0,0,0,0.15);
  --shadow-violet: 0 18px 40px -12px rgba(96,12,235,0.45);

  /* ---- Gradients ---- */
  --gradient-primary: linear-gradient(269.9deg, #600CEB 0%, rgba(96,12,235,0.42) 43%, rgba(96,12,235,0) 96%);
  --gradient-title:   linear-gradient(90deg, #EBE1FF 0%, #7E38EF 45%, #600CEB 100%);
  --gradient-stroke:  linear-gradient(180deg, #FFFFFF -42.92%, rgba(255,255,255,0.78) 2.95%, rgba(255,255,255,0) 94.69%);
  --gradient-surface: linear-gradient(150deg, #7E38EF 0%, #600CEB 55%, #4809B0 100%);

  /* ---- Motion ---- */
  --ease-out:    cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-decel:  cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 0.18s;
  --dur-base: 0.3s;
  --dur-slow: 0.5s;
  --dur-slower: 0.7s;
  /* ---- Motion (additions for reveal/stagger/hero) ---- */
  --dur-xslow: 0.9s;                 /* hero entrance */
  --reveal-stagger: 70ms;            /* per-item grid stagger step */
  --lift-card: -3px;                 /* unified card hover lift */
  --lift-btn: -1px;                  /* unified button hover lift */
}

/* ============================================================
   Page transitions: universal fade + rise of the main content on each page
   load. An inline head script adds `.js-pagefade` to <html> before paint, so
   content starts hidden (no flash) and fades in. Works identically in every
   browser (Chromium, Firefox, Safari - any version).
   We deliberately do NOT use cross-document View Transitions: they are
   Chromium-only / Safari 18.2+, and @supports can't distinguish "supports the
   view-transition-name property" from "performs MPA navigation transitions",
   so Firefox 140+ / Safari 18.0-18.1 fell through the cracks. This JS-driven
   fade sidesteps all of that.
   ============================================================ */
@keyframes rcitPageFadeSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: no-preference) {
  html.js-pagefade #sp-main-body {
    animation: rcitPageFadeSlideIn 0.34s var(--ease-decel) both;
  }
}

/* ============================================================
   Base reset & global
   ============================================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body-size);
  line-height: var(--leading-relaxed);
  color: var(--text-body);
  background: var(--surface-page);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Sticky footer wrapper: keeps #sp-footer pinned to the bottom on short pages */
#sp-page-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
#sp-footer {
  margin-top: auto;
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--color-primary-hover); }

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  color: var(--text-heading);
  line-height: var(--leading-snug);
  margin: 0 0 var(--space-4);
}

/* ============================================================
   Layout containers
   ============================================================ */

.wrap {
  width: 100%;
  max-width: calc(var(--content-max) + 2 * var(--space-6));
  margin-inline: auto;
  padding-inline: var(--space-6);
}

@media (min-width: 1440px) {
  .wrap {
    padding-inline: var(--page-gutter);
    max-width: calc(var(--content-max) + 2 * var(--page-gutter));
  }
}

/* Legacy .container alias — matches .wrap exactly */
.container {
  width: 100%;
  max-width: calc(var(--content-max) + 2 * var(--space-6));
  margin-inline: auto;
  padding-inline: var(--space-6);
}

@media (min-width: 1440px) {
  .container {
    padding-inline: var(--page-gutter);
    max-width: calc(var(--content-max) + 2 * var(--page-gutter));
  }
}

/* ============================================================
   Brand motif utilities
   ============================================================ */

.it-dots {
  background-image: radial-gradient(var(--brand-purple-200) 2px, transparent 2px);
  background-size: 28px 28px;
}
.it-dots--dense { background-size: 18px 18px; }
.it-dots--on-violet {
  background-image: radial-gradient(rgba(255,255,255,0.22) 2px, transparent 2px);
}

/* Hero constellation canvas - sits below hero text content */
#hero-constellation {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
.block-hero { position: relative; }
.block-hero .it-dots--on-violet,
.block-hero > .container,
.block-hero > .hero-inner { position: relative; z-index: 2; }

.it-title-pill {
  display: inline-flex;
  align-items: center;
  padding: 18px 40px;
  border-radius: var(--radius-pill);
  background: var(--gradient-title);
  color: #fff;
  font-family: var(--font-display);
  font-weight: var(--weight-extrabold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-tight);
  line-height: 1;
}

.it-fade-bar {
  height: 86px;
  border-radius: var(--radius-pill);
  background: var(--gradient-primary);
}

.it-focusable:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ============================================================
   Top contact bar
   ============================================================ */

#sp-top-bar {
  background: var(--neutral-50);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-ui);
  font-size: var(--text-caption);
  color: var(--text-muted);
}

.top-bar-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding-block: var(--space-2);
}

.top-title {
  font-weight: var(--weight-semibold);
  color: var(--text-heading);
  flex: 1 1 auto;
}

.top-search {
  display: flex;
  align-items: center;
}
.top-search form {
  display: flex;
  gap: var(--space-2);
}
.top-search input[type="search"] {
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  font-family: var(--font-ui);
  font-size: var(--text-caption);
  outline: none;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.top-search input[type="search"]:focus {
  border-color: var(--color-primary);
}

.top-lang {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-ui);
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
}
.top-lang a { color: var(--text-muted); }
.top-lang strong { color: var(--color-primary); }

.top-contacts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.top-contacts li { display: flex; align-items: center; gap: var(--space-1); }
.top-contacts .ico { font-size: 1em; }
.top-contacts a { color: var(--text-muted); }
.top-contacts a:hover { color: var(--color-primary); }

/* ============================================================
   Header - Design: white bg, purple text nav, pill active state
   ============================================================ */

#sp-header {
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 var(--border-subtle);
}

.header-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-block: 14px;
  flex-wrap: nowrap;
}

/* Logo lockup */
#sp-logo a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}
#sp-logo .logo-mark {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}
#sp-logo .logo-wordmark {
  height: 32px;
  width: auto;
}
#sp-logo {
  margin-right: var(--space-2);
  flex-shrink: 0;
}

/* Header CTA button */
.header-cta-btn {
  display: inline-flex;
  align-items: center;
  background: var(--brand-purple);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  font-weight: var(--weight-bold);
  font-size: 14px;
  padding: 10px 18px;
  cursor: pointer;
  font-family: var(--font-body);
  text-decoration: none;
  margin-left: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}
.header-cta-btn:hover {
  background: var(--brand-purple-700);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-violet);
}
.header-cta-btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* Mobile toggle */
#offcanvas-toggler {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  margin-left: auto;
  flex-direction: column;
  gap: 5px;
}
#offcanvas-toggler span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out);
}
/* Turn the hamburger into an "X" while the mobile menu is open */
body.nav-open #offcanvas-toggler span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
body.nav-open #offcanvas-toggler span:nth-child(2) {
  opacity: 0;
}
body.nav-open #offcanvas-toggler span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Explicit close button shown inside the open mobile panel (default hidden on desktop) */
#nav-close {
  display: none;
}

/* Navigation */
#sp-menu {
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
}

.megamenu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1px;
  align-items: center;
  flex-wrap: nowrap;
}

.megamenu > .menu-item > a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  padding: 9px clamp(6px, 0.55vw, 11px);
  border-radius: var(--radius-pill);
  color: var(--ink) !important;
  font-family: var(--font-ui);
  font-size: clamp(12px, 0.95vw, 14px);
  font-weight: var(--weight-semibold);
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.megamenu > .menu-item > a:hover {
  color: var(--brand-purple) !important;
  background: var(--brand-purple-50);
}
.megamenu > .menu-item.has-child:hover > a {
  color: var(--brand-purple) !important;
  background: var(--brand-purple-50);
}

/* Chevron indicator for items with children */
.megamenu > .menu-item.has-child > a::after {
  content: '';
  display: inline-block;
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-left: 5px;
  vertical-align: 1px;
  transition: transform var(--dur-base) var(--ease-decel);
}
.megamenu > .menu-item.has-child:hover > a::after,
.megamenu > .menu-item.has-child.dropdown-open > a::after {
  transform: rotate(-135deg);
}

/* --- Light nav animations (vertical-only transforms, so they never add horizontal overflow) --- */
@keyframes rcitDropdownIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes rcitMenuIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes rcitSubmenuIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Dropdown */
.menu-item { position: relative; }
.menu-item .dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 250px;
  max-width: 320px;
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  z-index: 200;
  padding: 8px;
  /* Bridge the gap between trigger and dropdown panel */
  padding-top: 14px;
  margin-top: 0;
}

/* Note: intentionally no max-height/overflow scroll on desktop dropdowns.
   overflow-y:auto forces overflow-x to auto (spurious horizontal scrollbar) and
   would clip fly-out child submenus, so tall menus are left to overflow instead. */
/* Use a pseudo-element bridge to prevent gap hover loss */
.menu-item.has-child > .dropdown::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
}
/* Top-level dropdowns: hover + JS-managed .dropdown-open only (no :focus-within,
   because clicking a top-level link focuses it and :focus-within would keep the
   panel visible even after the JS single-open logic removes .dropdown-open). */
.megamenu > .menu-item:hover > .dropdown,
.megamenu > .menu-item.dropdown-open > .dropdown { display: block; animation: rcitDropdownIn var(--dur-base) var(--ease-decel); }
/* Nested flyout submenus: keep :hover + :focus-within for keyboard accessibility */
.megamenu .dropdown .menu-item:hover > .dropdown,
.megamenu .dropdown .menu-item:focus-within > .dropdown { display: block; animation: rcitDropdownIn var(--dur-base) var(--ease-decel); }

.dropdown-inner { padding: 0; }
.dropdown-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Issue 1: single vertical list (as originally). Long item labels wrap onto
   multiple lines within the panel's max-width instead of forcing a wide panel
   or a multi-column grid. */
.dropdown-items .menu-item > a {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: normal;
  line-height: 1.35;
  padding: 9px 14px;
  border-radius: 10px;
  color: var(--ink) !important;
  font-size: 14px;
  transition: background var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.dropdown-items .menu-item > a:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary) !important;
}

/* Arrow indicator for nested dropdown parents */
.dropdown-items > .menu-item.has-child > a::after {
  content: '';
  display: inline-block;
  flex-shrink: 0;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  margin-left: auto;
}

/* External link icon (shown for items opening in a new tab) */
.ext-ico {
  flex-shrink: 0;
  opacity: 0.6;
}
.menu-item-label { display: inline-block; }

/* Nested (3rd-level) flyout: appears to the right of parent */
.dropdown-items .menu-item > .dropdown {
  top: 0;
  left: 100%;
  margin-top: 0;
  padding-top: 8px;
  margin-left: 4px;
}
/* Hover bridge for nested flyout (covers the gap to the left) */
.dropdown-items .menu-item.has-child > .dropdown::before {
  content: '';
  position: absolute;
  top: 0;
  left: -8px;
  bottom: 0;
  width: 8px;
  height: auto;
  right: auto;
}

/* --- Dropdown viewport-edge flip ----------------------------- */
/* Top-level dropdown: shift to right-align when it overflows */
.megamenu > .menu-item > .dropdown.dropdown--flip {
  left: auto;
  right: 0;
}

/* Nested (3rd-level) flyout: open to the LEFT instead of right */
.dropdown-items .menu-item > .dropdown.dropdown--flip {
  left: auto;
  right: 100%;
  margin-left: 0;
  margin-right: 4px;
}
/* Flip the hover bridge to the right side when flipped */
.dropdown-items .menu-item.has-child > .dropdown.dropdown--flip::before {
  left: auto;
  right: -8px;
}

/* ============================================================
   Page title banner
   ============================================================ */

#sp-page-title {
  background: var(--gradient-surface);
  padding: var(--space-10) 0;
}
#sp-page-title h2 {
  color: #fff;
  font-size: var(--text-h2);
  font-weight: var(--weight-extrabold);
  margin: 0;
}

/* ============================================================
   Main body
   ============================================================ */

#sp-main-body {
  padding: var(--space-12) 0;
}

/* ============================================================
   Section headings & content components
   ============================================================ */

.sec-h {
  font-size: var(--text-h2);
  font-weight: var(--weight-extrabold);
  color: var(--text-heading);
  margin-bottom: var(--space-6);
}

.eyebrow {
  display: block;
  font-family: var(--font-ui);
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-family: var(--font-ui);
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
}

/* Card */
.card {
  background: var(--surface-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  transition: box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.card:hover {
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-2);
  border-radius: var(--radius-xs);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
}

/* Button base */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-pill);
  font-family: var(--font-ui);
  font-size: var(--text-body-md);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: background var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
  border: none;
  text-decoration: none;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}
/* btn-primary and btn-outline now defined in blocks.css */

/* ============================================================
   Footer - Design: dark ink bg, 3-column grid
   ============================================================ */

#sp-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.7);
}

.footer-main {
  padding: 44px 0 26px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
}

.footer-lockup {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}
.footer-logo-mark {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}
.footer-logo-wordmark {
  height: 32px;
  width: auto;
  /* Invert dark wordmark to white for dark footer */
  filter: brightness(0) invert(1);
}

.footer-desc {
  margin-top: 16px;
  max-width: 320px;
  line-height: 1.6;
  font-size: 14px;
  color: rgba(255,255,255,0.7);
}

.footer-nav h4,
.footer-contacts h4 {
  color: #fff;
  font-weight: var(--weight-bold);
  font-size: 15px;
  margin: 0 0 14px;
}

.footer-nav ul,
.footer-contacts ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
}

.footer-nav ul a,
.footer-contacts ul a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: color var(--dur-base) var(--ease-out);
}
.footer-nav ul a:hover,
.footer-contacts ul a:hover {
  color: #fff;
}

.footer-contacts li {
  color: rgba(255,255,255,0.7);
}

.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.social-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255,255,255,0.1);
  font-size: 12px;
  font-weight: var(--weight-bold);
  color: #fff;
  text-decoration: none;
  transition: background var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}
.social-item:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}
.social-item svg { width: 20px; height: 20px; }

/* Partner logos strip */
.footer-partners {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 20px 0;
}
.partner-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}
.partner-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  transition: box-shadow var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}
.partner-chip:hover {
  box-shadow: 0 2px 12px rgba(255,255,255,0.18);
  transform: translateY(-2px);
}
.partner-chip img {
  height: 32px;
  width: auto;
  display: block;
}

.footer-copyright {
  /* background stays full-bleed; border + content constrained via .wrap */
}

.copyright-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  color: rgba(255,255,255,0.85);
  font-family: var(--font-ui);
  font-size: 14px;
  padding-block: 16px;
  border-top: 1px solid rgba(255,255,255,0.12);
}
.admin-link {
  color: rgba(255,255,255,0.42);
  font-size: 13px;
}
.admin-link:hover { color: rgba(255,255,255,0.92); }

/* ============================================================
   Language switcher
   ============================================================ */

.lang-switcher {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-ui);
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
}
.lang-switcher a { color: var(--white-68); }
.lang-switcher a:hover { color: #fff; }
.lang-switcher strong { color: #fff; }
.lang-sep { color: var(--white-42); }

/* ============================================================
   Fallback notices (preserved from original)
   ============================================================ */

.fallback-notice {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--brand-yellow-100);
  border-left: 4px solid var(--brand-yellow);
  border-radius: var(--radius-xs);
  font-size: var(--text-body-md);
  color: var(--text-body);
  margin-bottom: var(--space-4);
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1023px) {
  .top-contacts { display: none; }
  .top-title { display: none; }
  .header-cta-btn { display: none; }

  #offcanvas-toggler { display: flex; }

  /* --- Mobile slide-in panel --- */
  #sp-menu {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--gradient-surface);
    z-index: 300;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: var(--space-16) var(--space-6) var(--space-6);
    padding-top: calc(var(--space-16) + env(safe-area-inset-top, 0px));
    padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
  body.nav-open #sp-menu { display: flex; animation: rcitMenuIn var(--dur-slow) var(--ease-decel); }

  /* Issue 4: Floating close button - fixed position, always reachable */
  #nav-close {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: calc(var(--space-4) + env(safe-area-inset-top, 0px));
    right: calc(var(--space-6) + env(safe-area-inset-right, 0px));
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border: none;
    background: rgba(255,255,255,0.18);
    color: #fff;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 310;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background var(--dur-fast) var(--ease-out),
                transform var(--dur-fast) var(--ease-out);
  }
  #nav-close:hover,
  #nav-close:active {
    background: rgba(255,255,255,0.3);
    transform: scale(1.08);
  }

  /* Issue 6: Mobile menu polish */
  .megamenu {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .megamenu > .menu-item > a {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-radius: 0;
    font-size: var(--text-body-lg);
    border-bottom: 1px solid var(--white-30);
    color: #fff !important;
    white-space: normal;
    transition: background var(--dur-fast) var(--ease-out);
  }
  .megamenu > .menu-item.has-child > a::after {
    margin-left: auto;
  }
  .megamenu > .menu-item > a:hover,
  .megamenu > .menu-item > a:active {
    background: rgba(255,255,255,0.06);
  }
  /* Opened parent highlight */
  .megamenu > .menu-item.open > a {
    background: rgba(255,255,255,0.08);
    border-bottom-color: transparent;
  }

  /* Disable desktop hover/focus/keyboard-open dropdown triggers on mobile.
     Only the JS-driven .open class should control submenu visibility. */
  .menu-item:hover > .dropdown,
  .menu-item:focus-within > .dropdown,
  .menu-item.dropdown-open > .dropdown {
    display: none;
    animation: none;
  }

  /* Submenu panel - flush edges, no floating rounded rectangle.
     Use !important to guarantee the mobile reset beats any desktop
     specificity (.menu-item .dropdown base rule). */
  .menu-item .dropdown {
    position: static !important;
    box-shadow: none !important;
    background: rgba(255,255,255,0.06) !important;
    border-radius: 0 !important;
    border: none !important;
    overflow: hidden;
    margin: 0;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--white-30);
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    opacity: 1;
    visibility: visible;
  }
  /* Only the accordion .open class shows submenus on mobile */
  .menu-item.open > .dropdown {
    display: block !important;
    animation: rcitSubmenuIn var(--dur-base) var(--ease-decel);
  }

  /* Nested (3rd-level) flyout: also reset to in-flow on mobile */
  .dropdown-items .menu-item > .dropdown {
    margin-left: 0;
    margin-right: 0;
    padding-left: var(--space-4);
    border-bottom: none;
  }
  .dropdown-items .menu-item > .dropdown::before {
    display: none;
  }

  .dropdown-items .menu-item > a {
    color: var(--white-92) !important;
    padding: var(--space-3) var(--space-8);
    border-radius: var(--radius-xs);
    margin-inline: var(--space-3);
    /* Mobile: allow long submenu labels to wrap instead of overflowing */
    white-space: normal;
    overflow-wrap: break-word;
    transition: background var(--dur-fast) var(--ease-out);
  }
  .dropdown-items .menu-item > a:hover,
  .dropdown-items .menu-item > a:active {
    background: rgba(255,255,255,0.12);
    color: #fff !important;
  }
  /* Hide desktop flyout arrow on mobile; mobile accordion uses chevron rotation */
  .dropdown-items > .menu-item.has-child > a::after {
    transform: rotate(45deg);
  }
  .dropdown-items > .menu-item.has-child.open > a::after {
    transform: rotate(-135deg);
  }

  /* Disable multi-column on mobile */
  .dropdown-items--columns {
    columns: unset !important;
    max-height: none !important;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
}

@media (max-width: 767px) {
  .wrap { padding-inline: var(--space-4); }
  .top-bar-row { gap: var(--space-2); }
  .top-search { display: none; }
  #sp-main-body { padding: var(--space-8) 0; }
  .sec-h { font-size: var(--text-h3); }
  #sp-page-title h2 { font-size: var(--text-h3); }
}

@media (min-width: 1024px) and (max-width: 1439px) {
  .wrap { padding-inline: var(--space-8); }
}

/* ============================================================
   News listing — card grid  (Task 10.1)
   ============================================================ */

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}

.news-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.news-card__img-wrap {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-primary-soft);
}

.news-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--dur-slow) var(--ease-decel);
}
.news-card:hover .news-card__img { transform: scale(1.04); }

.news-card__img-placeholder {
  aspect-ratio: 16 / 9;
  background: var(--gradient-primary);
  opacity: 0.25;
}

.news-card__body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
}

.news-card__date {
  font-size: var(--text-caption);
  color: var(--text-muted);
  font-family: var(--font-ui);
}

.news-card__title {
  font-size: var(--text-body-lg);
  font-weight: var(--weight-bold);
  color: var(--text-heading);
  line-height: var(--leading-snug);
  margin: 0;
}
.news-card__title a {
  color: inherit;
  text-decoration: none;
}
.news-card__title a:hover { color: var(--color-primary); }

.news-card__excerpt {
  font-size: var(--text-body-md);
  color: var(--text-body);
  line-height: var(--leading-relaxed);
  margin: 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* Fade the text out at the bottom so a clamped excerpt reads as an intentional
     fade rather than a hard mid-line crop (only visible when text reaches the edge). */
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.6em), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 1.6em), transparent);
}

.news-card__link {
  align-self: flex-start;
  margin-top: var(--space-3);
  font-size: var(--text-caption);
  padding: var(--space-2) var(--space-4);
}

/* Override btn-outline (white-on-dark) for news card links on light backgrounds */
.news-card__link.btn-outline {
  color: var(--brand-purple);
  border-color: var(--brand-purple);
  background: transparent;
}
.news-card__link.btn-outline:hover {
  background: var(--brand-purple-50);
  color: var(--brand-purple-700);
}

/* Override btn-outline for article back link on light background */
.article-back .btn-outline {
  color: var(--brand-purple);
  border-color: var(--brand-purple);
  background: transparent;
}
.article-back .btn-outline:hover {
  background: var(--brand-purple-50);
  color: var(--brand-purple-700);
}

/* Override btn-outline on status/error pages (light background) */
.status-code-links .btn-outline {
  color: var(--brand-purple);
  border-color: var(--brand-purple);
  background: transparent;
}
.status-code-links .btn-outline:hover {
  background: var(--brand-purple-50);
  color: var(--brand-purple-700);
}

/* Pagination */
.pagination-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-8);
}

.pagination-counter {
  font-size: var(--text-body-md);
  color: var(--text-muted);
  margin: 0;
}

.pagination {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  justify-content: center;
}

.pagination li a,
.pagination li span {
  min-width: 40px;
  text-align: center;
  padding: var(--space-2) var(--space-3);
}

/* Override btn-outline (white-on-dark) for pagination on light page background */
.pagination li a.btn-outline {
  color: var(--brand-purple);
  border-color: var(--brand-purple);
  background: transparent;
  padding: var(--space-2) var(--space-4);
  font-size: 14px;
}
.pagination li a.btn-outline:hover {
  background: var(--brand-purple-50);
  border-color: var(--brand-purple-700);
  color: var(--brand-purple-700);
}

/* Active page button */
.pagination li.active span.btn-primary {
  background: var(--brand-purple);
  color: #fff;
  border: 1.5px solid var(--brand-purple);
  padding: var(--space-2) var(--space-4);
  font-size: 14px;
}

.pagination li.active span {
  cursor: default;
}

/* Responsive news grid */
@media (max-width: 1023px) {
  .news-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 599px) {
  .news-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Article detail  (Task 10.2)
   ============================================================ */

.article-layout {
  max-width: 820px;
  margin: 0 auto;
}

.article-main {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.article-title {
  font-family: var(--font-display);
  font-weight: var(--weight-extrabold);
  font-size: var(--text-h1);
  color: var(--text-heading);
  line-height: var(--leading-tight);
  margin: 0;
}

.article-meta {
  font-size: var(--text-body-md);
  color: var(--text-muted);
  font-family: var(--font-ui);
}

.article-cover {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: var(--space-4) 0;
}
.article-cover img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  display: block;
}

.article-back {
  margin-top: var(--space-8);
}

/* Prose / typographic containment for imported news HTML */
.prose {
  font-size: var(--text-body-size);
  line-height: var(--leading-relaxed);
  color: var(--text-body);
  overflow-wrap: break-word;
}
/* Best-effort containment of author-pasted inline widths and flex rows on
   small screens. The [style*=...] substring match catches the common cases
   (e.g. width:900px, display:flex) but not min-width or non-flex-container
   uses of the word "width"/"flex". */
.prose [style*="width"] { max-width: 100%; }
.prose [style*="flex"] { flex-wrap: wrap; }
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
  line-height: var(--leading-snug);
}
.prose p { margin: 0 0 var(--space-4); }
.prose img {
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 70vh;
  border-radius: var(--radius-sm);
  display: block;
  margin: var(--space-6) auto;
}
/* Inline icons next to links (e.g. PDF icons) stay small */
.prose a > img,
.prose a > img:only-child {
  display: inline-block;
  vertical-align: middle;
  max-height: 1.4em;
  max-width: 1.4em;
  width: auto;
  margin: 0 4px 0 0;
  border-radius: 0;
}
.prose a { color: var(--text-link); }
.prose a:hover { color: var(--color-primary-hover); }
.prose ul, .prose ol {
  padding-left: var(--space-8);
  margin: 0 0 var(--space-4);
}
.prose li { margin-bottom: var(--space-2); }
.prose blockquote {
  border-left: 4px solid var(--color-primary);
  margin: var(--space-6) 0;
  padding: var(--space-4) var(--space-6);
  background: var(--color-primary-soft);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  font-style: italic;
}
.prose table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
  margin-bottom: var(--space-6);
  font-size: var(--text-body-md);
}
.prose th, .prose td {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-subtle);
  text-align: left;
}
.prose th { background: var(--surface-subtle); font-weight: var(--weight-semibold); }
.prose iframe, .prose video {
  max-width: 100%;
  height: auto;
  display: block;
  margin: var(--space-6) auto;
}

/* ============================================================
   Contacts page  (Task 10.3)
   ============================================================ */

.contacts-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: var(--space-10);
  align-items: start;
  margin-top: var(--space-10);
}

/* Contacts page: feedback form only (contact details come from the page body) */
.contacts-feedback {
  margin-top: var(--space-10);
}

.contacts-info__title {
  font-size: var(--text-h3);
  font-weight: var(--weight-bold);
  color: var(--text-heading);
  margin-top: 0;
  margin-bottom: var(--space-5);
}

.contacts-info__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  font-size: var(--text-body-md);
  color: var(--text-body);
}

.contacts-info__item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.contacts-info__ico {
  font-size: 1.2em;
  flex-shrink: 0;
}

.contacts-form-card {
  padding: var(--space-10);
}

.contacts-form-card__eyebrow {
  margin-bottom: var(--space-2);
}

.contacts-form-card__title {
  font-family: var(--font-display);
  font-weight: var(--weight-extrabold);
  font-size: var(--text-h3);
  color: var(--text-heading);
  margin: 0 0 var(--space-6);
}

/* Form shared styles */
.feedback-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-field label {
  font-family: var(--font-ui);
  font-size: var(--text-body-md);
  font-weight: var(--weight-semibold);
  color: var(--text-heading);
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-xs);
  font-family: var(--font-body);
  font-size: var(--text-body-md);
  color: var(--text-body);
  background: var(--surface-page);
  outline: none;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}
.form-field textarea { resize: vertical; min-height: 120px; }

.field-error {
  font-size: var(--text-caption);
  color: #c0392b;
  font-family: var(--font-ui);
}

.alert-success {
  background: var(--color-primary-soft);
  border: 1px solid var(--color-primary);
  color: var(--text-heading);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-xs);
  font-weight: var(--weight-semibold);
}

.alert-warning {
  background: #fff8e1;
  border: 1px solid #f9a825;
  color: #5a3e00;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-xs);
}

@media (max-width: 767px) {
  .contacts-layout { grid-template-columns: 1fr; }
  .form-row-2 { grid-template-columns: 1fr; }
  .contacts-form-card { padding: var(--space-6); }
}

/* ============================================================
   Search page  (Task 10.4)
   ============================================================ */

.search-form {
  margin-bottom: var(--space-8);
}

.search-form__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}
/* The search input must be able to shrink (min-width:0) so the submit button
   never spills past the viewport on narrow screens. */
.search-form__row input {
  flex: 1 1 auto;
  min-width: 0;
}

.search-form__input {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-xs);
  font-family: var(--font-body);
  font-size: var(--text-body-md);
  color: var(--text-body);
  background: var(--surface-page);
  outline: none;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.search-form__input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.search-summary {
  font-size: var(--text-body-md);
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}

.search-results {
  list-style: none;
  margin: 0 0 var(--space-8);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.search-result-item {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  background: var(--surface-card);
  transition: box-shadow var(--dur-fast) var(--ease-out);
}
.search-result-item:hover {
  box-shadow: var(--shadow-soft);
}

.search-result-item__link {
  font-size: var(--text-body-md);
  font-weight: var(--weight-semibold);
  color: var(--text-link);
  flex: 1;
}
.search-result-item__link:hover { color: var(--color-primary-hover); }

.search-result-item__date {
  font-size: var(--text-caption);
  color: var(--text-muted);
  flex-shrink: 0;
  font-family: var(--font-ui);
}

/* ============================================================
   Generic content page  (Task 10.5)
   ============================================================ */

.prose-page {
  max-width: 820px;
  margin: 0 auto;
}

/* ============================================================
   Library pages  (Task 10.4 extension)
   ============================================================ */

.lib-alphabet {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-8);
}

.lib-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-xs);
  font-family: var(--font-ui);
  font-weight: var(--weight-semibold);
  font-size: var(--text-body-md);
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-link);
}
.lib-letter:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.lib-letter-empty {
  color: var(--text-muted);
  cursor: default;
  pointer-events: none;
}

.lib-letter-current {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  cursor: default;
  pointer-events: none;
}

.lib-section-title {
  font-size: var(--text-h3);
  font-weight: var(--weight-bold);
  color: var(--text-heading);
  margin: var(--space-8) 0 var(--space-5);
}

.lib-periodicals {
  list-style: disc;
  padding-left: var(--space-8);
  margin: 0 0 var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  font-size: var(--text-body-md);
  line-height: var(--leading-relaxed);
}

.lib-list {
  list-style: decimal;
  padding-left: var(--space-8);
  margin: 0 0 var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.lib-entry {
  font-size: var(--text-body-md);
  line-height: var(--leading-relaxed);
}

.lib-citation { color: var(--text-body); }

.lib-view {
  margin-left: var(--space-3);
  font-size: var(--text-caption);
  font-family: var(--font-ui);
  font-weight: var(--weight-semibold);
  color: var(--text-link);
}
.lib-view:hover { color: var(--color-primary-hover); }

.lib-intro {
  margin-top: var(--space-8);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border-subtle);
}

/* ============================================================
   btn-default alias for backward compat
   ============================================================ */

.btn-default {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-xs);
  font-family: var(--font-ui);
  font-size: var(--text-body-md);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  border: 2px solid var(--color-primary);
  background: transparent;
  color: var(--color-primary);
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.btn-default:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary-hover);
}

/* ============================================================
   Responsive article title
   ============================================================ */

@media (max-width: 767px) {
  .article-title { font-size: var(--text-h2); }
  .news-card__title { font-size: var(--text-body-md); }
}

/* ============================================================
   Article carousel
   ============================================================ */

.article-carousel {
  position: relative;
  margin: var(--space-8) 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-muted, #f5f5f5);
}

.article-carousel__track {
  position: relative;
  width: 100%;
  min-height: 300px;
}

/* CSS-first: all slides positioned in the stack; only .active is visible.
   No JS needed to hide slides - no FOUC. */
.article-carousel__slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 350ms ease, transform 350ms ease;
  transform: translateX(8px);
}

.article-carousel__slide.active {
  position: relative; /* reclaim height from the track */
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

/* Slide entering from left (prev direction) */
.article-carousel__slide.entering-prev {
  transform: translateX(-8px);
}

/* Respect reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .article-carousel__slide {
    transition: opacity 150ms ease;
    transform: none !important;
  }
  #sp-menu,
  .menu-item:hover > .dropdown,
  .menu-item:focus-within > .dropdown,
  .menu-item.dropdown-open > .dropdown,
  .menu-item.open > .dropdown {
    animation: none !important;
  }
  /* Neutralize scroll-reveal for reduced-motion users */
  .js-reveal .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  /* Neutralize news card hover lift */
  .news-card {
    transition: none !important;
    transform: none !important;
  }
  .news-card__img {
    transition: none !important;
    transform: none !important;
  }
  /* Neutralize staff-unit-card hover lift */
  .staff-unit-card:hover {
    transform: none !important;
  }
  /* New motion additions - show instantly, no movement */
  .js-reveal .block-hero .hero-eyebrow,
  .js-reveal .block-hero .hero-heading,
  .js-reveal .block-hero .hero-lead,
  .js-reveal .block-hero .hero-actions,
  .js-reveal .block-hero .stat-item {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .js-reveal .block-hero .it-dots--on-violet { animation: none !important; }
  .js-reveal .spec-card.reveal,
  .js-reveal .grants-card.reveal,
  .js-reveal .cycles-item.reveal,
  .js-reveal .partner-logo.reveal,
  .js-reveal .about-card.reveal,
  .js-reveal .staff-unit-card.reveal,
  .js-reveal .staff-card.reveal { transition-delay: 0ms !important; }
}

.article-carousel__slide img {
  max-width: 100%;
  max-height: 600px;
  object-fit: contain;
  margin: 0 auto;
  display: block;
}

.article-carousel__prev,
.article-carousel__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  padding: var(--space-3) var(--space-4);
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: var(--radius-xs);
  z-index: 2;
  transition: background var(--dur-fast) var(--ease-out);
}

.article-carousel__prev:hover,
.article-carousel__next:hover {
  background: rgba(0, 0, 0, 0.75);
}

.article-carousel__prev { left: var(--space-3); }
.article-carousel__next { right: var(--space-3); }

.article-carousel__dots {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) 0;
}

.article-carousel__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--color-primary, #1e40af);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background var(--dur-fast) var(--ease-out);
}

.article-carousel__dot.active {
  background: var(--color-primary, #1e40af);
}

/* ============================================================
   YouTube embed wrapper (responsive 16:9)
   ============================================================ */

.youtube-embed-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  margin: var(--space-6) 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
}

.youtube-embed-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ============================================================
   Tag chips
   ============================================================ */

.tag-chip {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  border-radius: 9999px;
  font-size: var(--text-caption);
  font-weight: var(--weight-semibold);
  background: var(--color-primary-soft, #e0e7ff);
  color: var(--color-primary, #1e40af);
  text-decoration: none;
  transition: background var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}

.tag-chip:hover {
  background: var(--color-primary, #1e40af);
  color: #fff;
  transform: translateY(-1px);
}

.tag-chip--sm {
  font-size: 0.7rem;
  padding: 2px var(--space-2);
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-3) 0;
}

.news-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: var(--space-2) 0;
}

.page-heading {
  font-size: var(--text-h2);
  font-weight: var(--weight-bold);
  color: var(--text-heading);
  margin-bottom: var(--space-8);
}

/* ============================================================
   Editor carousel container preview
   Shows a dashed border around .carousel containers in WYSIWYG
   so editors know which images will become a carousel.
   ============================================================ */

.sun-editor-editable .carousel,
.se-wrapper-inner .carousel {
  border: 2px dashed var(--brand-purple, #600CEB);
  border-radius: var(--radius-sm, 8px);
  padding: var(--space-3, 12px);
  margin: var(--space-4, 16px) 0;
  position: relative;
  min-height: 60px;
}
.sun-editor-editable .carousel::before,
.se-wrapper-inner .carousel::before {
  content: 'Каруселя';
  position: absolute;
  top: -10px;
  left: 12px;
  background: var(--brand-purple, #600CEB);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 4px;
  pointer-events: none;
}

/* ---- Staff / Structure card grid ---- */

.staff-unit-section {
  margin-bottom: 2.5rem;
}
.staff-unit-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-heading, #1a1a2e);
  margin-bottom: 0.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--brand-purple, #600CEB);
}
.staff-unit-desc {
  color: var(--text-muted, #6c757d);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}
.staff-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}
.staff-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  display: flex;
  flex-direction: column;
}
.staff-card:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}
.staff-card-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #f0f0f5;
  display: flex;
  align-items: center;
  justify-content: center;
}
.staff-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.staff-card-no-photo {
  color: #b0b0c0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.staff-card-body {
  padding: 1rem 1.25rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.staff-card-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-heading, #1a1a2e);
  margin: 0 0 0.25rem;
  line-height: 1.3;
}
.staff-card-position {
  font-size: 0.88rem;
  color: var(--brand-purple, #600CEB);
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.staff-card-bio {
  font-size: 0.85rem;
  color: var(--text-muted, #6c757d);
  margin: 0 0 0.75rem;
  line-height: 1.5;
}
.staff-card-degree,
.staff-card-qualification,
.staff-card-subjects {
  margin: 2px 0 0;
  font-size: var(--text-body-md);
  color: var(--text-muted);
  overflow-wrap: break-word;
}
.staff-card-degree { font-style: italic; }
.staff-card-contacts {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.staff-card-contact {
  font-size: 0.82rem;
  color: var(--text-body, #444);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.15s;
}
.staff-card-contact:hover {
  color: var(--brand-purple, #600CEB);
}
.staff-contact-ico {
  font-size: 0.9rem;
  flex-shrink: 0;
}

@media (max-width: 575px) {
  .staff-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
  }
}

/* ============================================================
   Staff unit index (commission/department directory cards)
   Substitutions: --text-h4 -> --text-h3 (no h4 token defined);
                  --color-primary -> --text-link (= var(--brand-purple))
   ============================================================ */
.staff-unit-index {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: var(--space-5);
  margin: var(--space-6) 0;
}
.staff-unit-card {
  display: block;
  position: relative;
  z-index: 0;
  padding: var(--space-5) var(--space-6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-page);
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.staff-unit-card:hover { box-shadow: var(--shadow-md); transform: translateY(var(--lift-btn)); z-index: 1; }
.staff-unit-card-title { margin: 0 0 var(--space-2); font-size: var(--text-h3); color: var(--text-link); }
.staff-unit-card-desc { margin: 0; color: var(--text-muted); font-size: var(--text-body-md); overflow-wrap: break-word; }

/* ============================================================
   Scroll-reveal animations (FIX 3a)
   Only apply the hidden initial state when JS is running
   (the observer adds .js-reveal to <html> first).
   ============================================================ */
.js-reveal .reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity var(--dur-slower) var(--ease-decel), transform var(--dur-slower) var(--ease-decel);
}
.js-reveal .reveal.is-revealed {
  opacity: 1;
  transform: none;
}

/* Staggered news cards: cycling 4-step wave so every grid row animates,
   not just the first (4n+1 gets no delay). Applies only to .news-card -
   homepage section blocks reveal without stagger by design. */
.js-reveal .news-card.reveal:nth-child(4n+2) { transition-delay: .06s; }
.js-reveal .news-card.reveal:nth-child(4n+3) { transition-delay: .12s; }
.js-reveal .news-card.reveal:nth-child(4n) { transition-delay: .18s; }

/* Staggered reveal for card grids (only while JS reveal is active) */
.js-reveal .spec-card.reveal,
.js-reveal .grants-card.reveal,
.js-reveal .cycles-item.reveal,
.js-reveal .partner-logo.reveal,
.js-reveal .about-card.reveal { transition-delay: 0ms; }

.js-reveal .spec-card.reveal:nth-child(6n+2),
.js-reveal .grants-card.reveal:nth-child(6n+2),
.js-reveal .cycles-item.reveal:nth-child(6n+2),
.js-reveal .partner-logo.reveal:nth-child(6n+2),
.js-reveal .about-card.reveal:nth-child(6n+2) { transition-delay: calc(var(--reveal-stagger) * 1); }
.js-reveal .spec-card.reveal:nth-child(6n+3),
.js-reveal .grants-card.reveal:nth-child(6n+3),
.js-reveal .cycles-item.reveal:nth-child(6n+3),
.js-reveal .partner-logo.reveal:nth-child(6n+3),
.js-reveal .about-card.reveal:nth-child(6n+3) { transition-delay: calc(var(--reveal-stagger) * 2); }
.js-reveal .spec-card.reveal:nth-child(6n+4),
.js-reveal .grants-card.reveal:nth-child(6n+4),
.js-reveal .cycles-item.reveal:nth-child(6n+4),
.js-reveal .partner-logo.reveal:nth-child(6n+4),
.js-reveal .about-card.reveal:nth-child(6n+4) { transition-delay: calc(var(--reveal-stagger) * 3); }
.js-reveal .spec-card.reveal:nth-child(6n+5),
.js-reveal .grants-card.reveal:nth-child(6n+5),
.js-reveal .cycles-item.reveal:nth-child(6n+5),
.js-reveal .partner-logo.reveal:nth-child(6n+5),
.js-reveal .about-card.reveal:nth-child(6n+5) { transition-delay: calc(var(--reveal-stagger) * 4); }
.js-reveal .spec-card.reveal:nth-child(6n+6),
.js-reveal .grants-card.reveal:nth-child(6n+6),
.js-reveal .cycles-item.reveal:nth-child(6n+6),
.js-reveal .partner-logo.reveal:nth-child(6n+6),
.js-reveal .about-card.reveal:nth-child(6n+6) { transition-delay: calc(var(--reveal-stagger) * 5); }

/* Hero entrance (fires on load; above the fold) */
@keyframes heroIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.js-reveal .block-hero .hero-eyebrow,
.js-reveal .block-hero .hero-heading,
.js-reveal .block-hero .hero-lead,
.js-reveal .block-hero .hero-actions,
.js-reveal .block-hero .stat-item {
  opacity: 0;
  animation: heroIn var(--dur-xslow) var(--ease-decel) forwards;
}
.js-reveal .block-hero .hero-eyebrow { animation-delay: 0.05s; }
.js-reveal .block-hero .hero-heading { animation-delay: 0.15s; }
.js-reveal .block-hero .hero-lead    { animation-delay: 0.28s; }
.js-reveal .block-hero .hero-actions { animation-delay: 0.40s; }
.js-reveal .block-hero .stat-item             { animation-delay: 0.52s; }
.js-reveal .block-hero .stat-item:nth-child(2){ animation-delay: 0.60s; }
.js-reveal .block-hero .stat-item:nth-child(3){ animation-delay: 0.68s; }
.js-reveal .block-hero .stat-item:nth-child(4){ animation-delay: 0.76s; }

/* Subtle continuous drift on the brand dot-grid motif */
@keyframes dotDrift {
  from { background-position: 0 0; }
  to   { background-position: 30px 30px; }
}
.js-reveal .block-hero .it-dots--on-violet {
  animation: dotDrift 24s linear infinite;
  will-change: background-position;
}

/* ============================================================
   News card hover polish (FIX 3c) - gentle lift + shadow
   ============================================================ */
.news-card {
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.news-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* ============================================================
   Search result hover lift (Issue 2)
   ============================================================ */
.search-result-item {
  transition: box-shadow var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}
.search-result-item:hover {
  transform: translateY(-2px);
}

/* ============================================================
   Animated link underlines - left-to-right wipe on hover/focus
   Nav (desktop only) + in-content prose links.
   ============================================================ */

/* Nav: underline wipe-in via ::before (scaleX from the left).
   Uses a pseudo-element, NOT a background-image, because the existing :hover
   pill sets the `background` shorthand which would reset a background-image
   underline to none. The ::before is independent, so pill + underline coexist. */
@media (min-width: 1024px) {
  .megamenu > .menu-item > a { position: relative; }
  .megamenu > .menu-item > a::before {
    content: '';
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 4px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform var(--dur-fast) var(--ease-out);
    pointer-events: none;
  }
  .megamenu > .menu-item > a:hover::before,
  .megamenu > .menu-item > a:focus-visible::before,
  .megamenu > .menu-item.dropdown-open > a::before {
    transform: scaleX(1);
  }
}
@media (min-width: 1024px) and (prefers-reduced-motion: reduce) {
  .megamenu > .menu-item > a::before { transition: none; }
}

/* Prose links: wipe-in underline */
.prose a {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: bottom left;
  background-size: 0% 2px;
  transition: background-size var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
  text-decoration: none;
}
.prose a:hover,
.prose a:focus-visible {
  background-size: 100% 2px;
}

/* Reduced-motion: show underline instantly, no wipe */
@media (prefers-reduced-motion: reduce) {
  .megamenu > .menu-item > a,
  .prose a {
    background-size: 0% 2px !important;
    transition: none !important;
  }
  .megamenu > .menu-item > a:hover,
  .megamenu > .menu-item > a:focus-visible,
  .megamenu > .menu-item.dropdown-open > a,
  .prose a:hover,
  .prose a:focus-visible {
    background-size: 100% 2px !important;
  }
}

/* ============================================================
   Scroll-to-top button (Issue 5)
   ============================================================ */
.scroll-top-btn {
  position: fixed;
  bottom: calc(var(--space-6) + env(safe-area-inset-bottom, 0px));
  right: calc(var(--space-6) + env(safe-area-inset-right, 0px));
  z-index: 90;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--brand-purple);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity var(--dur-base) var(--ease-out),
              visibility var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out),
              background var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.scroll-top-btn.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.scroll-top-btn:hover {
  background: var(--brand-purple-700);
  transform: translateY(-2px);
  box-shadow: var(--shadow-violet);
}
.scroll-top-btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}
.scroll-top-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Move scroll-to-top left when admin edit pill is present */
body:has(.rcit-edit-pill) .scroll-top-btn {
  right: calc(var(--space-6) + 100px + env(safe-area-inset-right, 0px));
}

/* ============================================================
   Task 12 – Scroll progress bar
   ============================================================ */
#scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--gradient-primary, linear-gradient(90deg, #600CEB 0%, #9B59F5 100%));
  z-index: 9999;
  pointer-events: none;
  /* No CSS transition – updated via rAF directly */
}

/* ============================================================
   Task 12 – Button shine/press
   ============================================================ */
.btn-primary,
.btn-primary-violet {
  position: relative;
  overflow: hidden;
}

.btn-primary::after,
.btn-primary-violet::after {
  content: '';
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    120deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.32) 50%,
    rgba(255,255,255,0) 100%
  );
  transform: skewX(-20deg);
  transition: left 0.45s var(--ease-decel, cubic-bezier(0.22,1,0.36,1));
  pointer-events: none;
}

.btn-primary:hover::after,
.btn-primary-violet:hover::after {
  left: 125%;
}

.btn-primary:active,
.btn-primary-violet:active {
  transform: translateY(var(--lift-btn, -1px)) scale(0.98);
}

/* ============================================================
   Extended prefers-reduced-motion (Issue 2 - accessibility)
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  /* Disable all custom transitions and animations globally */
  .btn,
  .header-cta-btn,
  .social-item,
  .partner-chip,
  .tag-chip,
  .search-result-item,
  .card,
  .dropdown-items .menu-item > a,
  .megamenu > .menu-item > a,
  .scroll-top-btn {
    transition: none !important;
    transform: none !important;
  }
  .scroll-top-btn.is-visible {
    transform: none !important;
  }
  .megamenu > .menu-item > a::before {
    transition: none !important;
  }
  /* Neutralize scroll-to-top fade animation */
  .scroll-top-btn {
    opacity: 0;
    visibility: hidden;
  }
  .scroll-top-btn.is-visible {
    opacity: 1;
    visibility: visible;
  }
  /* Task 12 reduced-motion: no shine sweep; keep only press state */
  .btn-primary::after,
  .btn-primary-violet::after {
    display: none;
  }
  /* Card tilt disabled in CSS on devices that prefer no motion */
  .spec-card,
  .grants-card {
    transform: none !important;
  }
}

