/* =========================================================
   BASE / RESET
   ========================================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* =========================================================
   THEME VARIABLES
   ========================================================= */
:root {
  --hero-h: 100px;
  --hero-fade: 120px;

  --page-bg: #0b1d33;
  --page-bg-light: #f4f7fb;

  --text: #dbe6f5;
  --text-soft-strong: rgba(235,245,255,0.90);
  --text-soft: rgba(219,230,245,0.94);

  --border-soft: rgba(255,255,255,0.12);
  --page-gutter: 15%;

  --text-column: 760px;
  --section-maxw: var(--text-column);

  --card-bg: linear-gradient(to bottom, #0f1e37, #0c192d);
 
  --header-bg: linear-gradient(
    to bottom,
    rgba(5,15,30,0.95),
    rgba(5,15,30,0.8)
  );

  --bg: #0b1d33;
  --bg-soft: #0e223d;

  --fs-0: clamp(0.95rem, 0.92rem + 0.2vw, 1rem);
  --fs-1: clamp(1.15rem, 1.05rem + 0.4vw, 1.3rem);
  --fs-2: clamp(1.6rem, 1.35rem + 0.8vw, 2.2rem);
  --fs-3: clamp(2.2rem, 1.8rem + 1.4vw, 3rem);

  --lh-tight: 1.2;
  --lh-normal: 1.6;
  --lh-relaxed: 1.75;

  --section-pt: clamp(32px, 4vw, 56px);
  --section-pb: clamp(28px, 3.5vw, 52px);

  --section-pt-internal: clamp(26px, 3.2vw, 44px);
  --section-pb-internal: clamp(24px, 3vw, 40px);

  --wide-maxw: 1100px;
}

/* Responsive gutters — OUTSIDE :root (valid CSS) */
@media (max-width: 1024px){
  :root{ --page-gutter: 10%; }
}

@media (max-width: 640px){
  :root{ --page-gutter: 6%; }
}

body.light {
  color: #0b1d33;

  --page-bg: var(--page-bg-light);

  --bg: #f4f7fb;
  --bg-soft: #f4f7fb;

  --text: #0b1d33;
  --text-soft: rgba(11,29,51,0.9);
  
  --text-soft-strong: rgba(11,29,51,0.92);
  --border-soft: rgba(0,0,0,0.08);
  --card-bg: #ffffff;

  --header-bg: linear-gradient(
    to bottom,
    rgba(255,255,255,0.98),
    rgba(244,247,251,0.92)
  );
}

/* =========================================
   FINAL — SECTION RHYTHM (MASTER)
   ========================================= */

body.internal{
  --section-pt: var(--section-pt-internal);
  --section-pb: var(--section-pb-internal);

  --hero-h: 260px;
  --hero-fade: 160px;
}

.section > *:first-child{
  margin-top: 0;
}

/* =========================================================
   BASE
   ========================================================= */

body {
  position: relative;
  font-family: "Inter", "Segoe UI", sans-serif;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: var(--page-bg);
  color: var(--text);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

main {
  position: relative;
  z-index: 0;
  isolation: isolate; /* ⬅️ важно: държи псевдо-елементите "вътре" */
}

.section {
  background: linear-gradient(
    to bottom,
    rgba(11,29,51,0) 0px,
    var(--bg-soft) 90px
  );
  position: relative;
  z-index: 0;
  padding: var(--section-pt) var(--page-gutter) var(--section-pb);
}

/* =========================================================
   SMOOTH HERO → SECTION TRANSITION (remove sharp seam)
   ========================================================= */

/* Dark/default */
body.internal main > .section:first-of-type::before{
  content:"";
  position:absolute;
  left:0; right:0;
  top: calc(var(--hero-h) * 0.28);
  height: var(--hero-fade);
  pointer-events:none;
  z-index: 0;

  background: linear-gradient(
    to bottom,
    rgba(11,29,51,0) 0%,
    var(--bg-soft) 72%,
    var(--bg-soft) 100%
  );
}

body.light .section {
  background: linear-gradient(
    to bottom,
    rgba(244,247,251,0) 0px,
    var(--bg-soft) 90px
  );
}

/* Light mode (за да няма сивкав ръб от transparent-black) */
body.light.internal main > .section:first-of-type::before{
  background: linear-gradient(
    to bottom,
    rgba(244,247,251,0) 0%,
    var(--bg-soft) 72%,
    var(--bg-soft) 100%
  );
}

/* =========================================================
   MAIN PSEUDO-LAYERS – base (NO layout influence)
   ========================================================= */

/* HERO base layers */
body:not(.home) main::before,
body:not(.home) main::after{
  content:"";
  position:absolute;
  top:0; left:0;
  width:100%;
  height:var(--hero-h);
  pointer-events:none;
  display:block;
}

/* 1) Image layer: звездите си остават ярки, но долният ръб “изчезва” плавно */
body:not(.home) main::before{
  z-index: -2;
  height: var(--hero-h);
  background: url("images/deep-space.png") center / cover no-repeat;

  /* лек “астро” контраст – пази звездите */
  filter: brightness(1.06) contrast(1.18) saturate(1.08);

  /* ✅ ключът: премахва рязката черта (feather към прозрачно) */
  -webkit-mask-image: linear-gradient(to bottom,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,1) 60%,
    rgba(0,0,0,0) 100%
  );
  mask-image: linear-gradient(to bottom,
    rgba(0,0,0,1) 0%,
    rgba(0,0,0,1) 60%,
    rgba(0,0,0,0) 100%
  );
}

/* 2) Overlay: удължаваме го под hero, за да се слее с фона на страницата */
body:not(.home) main::after{
  z-index: -1;
  height: calc(var(--hero-h) + var(--hero-fade));

  background:
    linear-gradient(to bottom,
      rgba(5,15,30,0.05) 0%,
      rgba(5,15,30,0.28) 35%,
      rgba(11,29,51,0.92) 100%
    ),
    radial-gradient(140% 120% at 50% 0%,
      rgba(0,0,0,0.00) 0%,
      rgba(0,0,0,0.18) 70%,
      rgba(0,0,0,0.34) 100%
    );

  /* микро-blur = още по-мек преход (много “академично”) */
  filter: blur(3px);
}

body.light:not(.home) main::before{
  /* в light не искаме прекалено “твърд” контраст */
  filter: brightness(1.02) contrast(1.05) saturate(1.00);
}

body.light:not(.home) main::after{
  z-index: -1;
  top: 0;
  height: calc(var(--hero-h) + var(--hero-fade));

  background:
    linear-gradient(to bottom,
      rgba(255,255,255,0.00) 0%,
      rgba(238,245,255,0.10) 30%,
      rgba(236,244,255,0.22) 60%,
      rgba(244,247,251,0.55) 80%,
      rgba(244,247,251,0.85) 100%
    );

  filter: none;
}


/* =========================================================
   TYPOGRAPHY
   ========================================================= */

h1, h2{
  letter-spacing: -0.01em;
}

h1{
  font-size: var(--fs-3);
  font-weight: 600;
  line-height: var(--lh-tight);
}

h2 {
  font-size: var(--fs-2);
  font-weight: 500;
  line-height: var(--lh-tight);
}

h3 {
  font-size: var(--fs-1);
  font-weight: 500;
}

p {
  font-size: var(--fs-0);
  font-weight: 400;
  line-height: var(--lh-normal);
}

/* =========================================================
   TYPOGRAPHIC POLICY — HYPHENS & LINE BREAKS
   ========================================================= */

/* 🔹 Default: без сричкопренасяне (UI, карти, кратки текстове) */
p,
li,
.card p,
.book-meta,
.instrument-item p,
.bio-note-body p {
  hyphens: none;
  -webkit-hyphens: none;
  -moz-hyphens: none;
  -ms-hyphens: none;

  word-break: normal;
  overflow-wrap: break-word;
}


/* =========================================================
   HEADER — FINAL CLEAN (NAV CENTERED + ORIGINAL TOGGLE STYLE) 1:1
   (toggle frame removed)
   ========================================================= */

.header{
  position: sticky;
  top: 0;
  z-index: 100;

  display: flex;
  align-items: center;
  gap: 28px;

  padding: 18px clamp(20px, 4vw, 64px);
  background: var(--header-bg);
  color: var(--text);

  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);

  border-bottom: 1px solid var(--border-soft);

  transition:
    padding 0.25s ease,
    background 0.25s ease,
    box-shadow 0.25s ease;
}

/* compact on scroll (single source of truth) */
.header.header-scrolled{
  padding: 12px clamp(20px, 4vw, 64px);
  box-shadow: 0 4px 18px rgba(0,0,0,0.45);
}

body.light .header.header-scrolled{
  box-shadow: 0 4px 18px rgba(0,0,0,0.10);
}


/* Light mode: slightly stronger header separation (clean, not "UI") */
body.light .header{
  border-bottom-color: rgba(0,0,0,0.06);
}

/* ---------------------------------------------------------
   Logo (single-line, university tone)
   --------------------------------------------------------- */

.logo{
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.logo img{
  height: 36px;
}

.logo span,
.logo .logo__text{
  font-style: italic;
  letter-spacing: 0.01em;
  opacity: 0.95;
}

/* ---------------------------------------------------------
   Navigation — CENTERED
   --------------------------------------------------------- */

.header nav{
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  white-space: nowrap;
}

.header nav a{
  text-decoration: none;
  color: var(--text);

  opacity: 0.88;
  letter-spacing: 0.06em;
  font-size: 0.92rem;

  padding-bottom: 6px;
  border-bottom: 1px solid transparent;

  transition: opacity 0.2s ease, border-color 0.2s ease;
}

.header nav a:hover{
  opacity: 1;
  text-decoration: none; /* avoid global nav underline rules */
}

.header nav a.active{
  opacity: 1;
  border-bottom-color: currentColor;
}

/* ---------------------------------------------------------
   Theme toggle — ORIGINAL ICON STYLE (NO FRAME)
   --------------------------------------------------------- */

.theme-toggle{
  flex: 0 0 auto;
  padding: 0;
  line-height: 1;

  background: none !important;
  border: none !important;
  box-shadow: none !important;

  cursor: pointer;
  font-size: 1.35rem;
  opacity: 0.75;

  transform: scale(0.85);
  transform-origin: center;

  transition: opacity 0.2s ease, transform 0.2s ease;
}

.theme-toggle:hover{
  opacity: 1;
  transform: scale(0.85) rotate(15deg);
}


/* original icons */
.theme-toggle::before{ content: "🌙"; }
body.light .theme-toggle::before{ content: "☀️"; }

/* Light mode refinement */
body.light .header nav a{
  opacity: 0.92;
  font-weight: 500;
}

body.light .header nav a.active{
  border-bottom-width: 2px;
  border-bottom-color: rgba(11,29,51,0.55);
}

.header nav a:focus-visible{
  text-decoration: none;
  outline: 2px solid rgba(148,163,184,0.85);
  outline-offset: 4px;
  border-radius: 6px;
}

.theme-toggle:focus-visible{
  outline: 2px solid rgba(148,163,184,0.85);
  outline-offset: 4px;
  border-radius: 6px;
}

/* =========================================================
   SECTIONS — OXFORD / ERC RHYTHM (SINGLE SOURCE OF TRUTH)
   ========================================================= */

.internal main > .hero + .section{
  padding-top: 3px;
}

.section > *:last-child{ margin-bottom: 0; }

.section > :where(h2){
  max-width: var(--section-maxw);
  margin-inline: auto;
}

.section h2 + *{
  margin-top: 16px;
}

.section > p{
  max-width: var(--section-maxw);
  margin-inline: auto;
}

.section-intro + .section-intro{
  margin-top: 12px;
}


.section-inner{
  max-width: var(--text-column);
  margin-inline: auto;
}

.section-inner > * + *{
  margin-top: 24px;
}

.section-inner > *:last-child{
  margin-bottom: 0;
}

.section-wide{
  max-width: var(--wide-maxw);
  margin-inline: auto;
}

.section h2{
  margin-top: 0;
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 6px rgba(0,0,0,0.28);
}

.section h2::after{
  content:"";
  display:block;
  width: 36px;
  height: 1px;
  margin-top: 8px;
  background: var(--border-soft);
  opacity: 0.55;
}

.section p{
  margin-top: 0;
  line-height: 1.8;
  letter-spacing: 0.01em;
  color: var(--text-soft);

}

.section p + p{ margin-top: 12px; }

/* Premium subtle divider between sections */
.section + .section::before{
  content:"";
  position:absolute;
  top: 0;
  left:50%;
  transform: translate(-50%, -50%);
  width:min(760px, 58%);
  height:1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(255,255,255,0.08),
    transparent
  );
  opacity: 0.55;
  pointer-events:none;
}

.page-policies .section + .section::before{ display:none; }

body.light .section + .section::before{
  background: linear-gradient(to right, transparent, rgba(0,0,0,0.08), transparent);
}


/* =========================================================
   HERO — SINGLE SOURCE OF TRUTH (CLEAN) 1:1
   ========================================================= */

/* Default hero (home / generic) */
.hero{
  text-align: center;
  padding-top: calc(var(--hero-h) * 0.86);
  padding-bottom: 20px;
}

/* Keep hero text centered ONLY where needed */
body:not(.internal) .hero-title,
body:not(.internal) .hero-text{
  text-align: center;
}

.hero-text p{
  text-align: inherit;
}

/* Home hero text — aligned with Mission intro quality */
body.home .hero-text{
  max-width: var(--text-column);
  margin-left: auto;
  margin-right: auto;
}

body.home .hero-text p{
  margin-top: clamp(20px, 3vw, 32px);
  margin-bottom: 10px;
  font-size: 1.12rem;
  line-height: 1.8;
  letter-spacing: 0.01em;
  font-weight: 450;
  color: var(--text-soft-strong);
}

body.home .hero-text p + p{
  margin-top: 12px;
}

body.light.home .hero-text p{
  color: rgba(11,29,51,0.90);
}

/* Internal pages hero: institutional left layout */
body.internal .hero{
  text-align: left;
  padding-top: 92px;
  padding-bottom: 6px;
}

/* Internal hero container aligns with section gutters */
body.internal .hero-inner{
  padding-left: var(--page-gutter);
  padding-right: var(--page-gutter);
}

/* Internal page title */
body.internal .page-title{
  margin: 0;
  font-size: clamp(30px, 3.2vw, 36px);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.18;
  min-height: 1.2em;

  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
  color: transparent;
  -webkit-text-fill-color: transparent;
  background: linear-gradient(180deg, #ffffff, rgba(255,255,255,0.85));
  -webkit-background-clip: text;
}

body.internal .page-title::after{
  content:"";
  display:block;
  width: 44px;
  height: 1px;
  margin-top: 12px;
  background: rgba(255,255,255,0.14);
}


/* =========================================================
   CARDS
   ========================================================= */

.cards{
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 28px;
}

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

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



/* LIGHT MODE – better card text contrast */
body.light .card p {
  color: #1f2d3d;
  font-weight: 450;     /* нормално, четимо */
  line-height: 1.6;
  letter-spacing: 0.01em;
}


.card {
  height: 100%;
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  overflow: hidden;
  text-align: center;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  min-width: 0;
}

/* Light mode shadow refinement for cards */
body.light .card {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.10);
}


.card:hover {
  transform: translateY(-4px);
}

.card h3 {
  margin: 20px 0 12px;
  text-align: center;
}

.card p {
  max-width: 300px;               /* по-тясна колонка за по-хубави редове */
  margin: 0 auto 28px;            /* центрира колонката и дава долен отстъп */
  padding: 0 20px;
  text-align: center;                  
  color: var(--text-soft);
  line-height: 1.6;
  letter-spacing: 0.015em;
}

.card p + p {
  margin-top: 10px;
}

/* ==============================
   ETHICS – policy style (no italic)
   ============================== */

.ethics-text{
  font-style: normal;
  color: inherit;
  line-height: 1.75;
}

/* Lead = normative statement */
.ethics-text--lead{
  font-weight: 520;
  letter-spacing: 0.012em;
  position: relative;
}

/* spacing logic */
.ethics-text--lead + .ethics-text{
  margin-top: 10px;
}

.ethics-text + .ethics-text{
  margin-top: 14px;
}


/* ==============================
   ETHICS – refined academic link
   ============================== */

.ethics-link{
  margin-top: 18px;
}

.ethics-link a{
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-soft);
  border-bottom: 1px solid rgba(255,255,255,0.35);
  padding-bottom: 3px;
  opacity: 0.85;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

.ethics-link a:hover{
  opacity: 1;
  border-color: rgba(255,255,255,0.6);
}

/* ==============================
   POLICIES — INLINE LINKS (ICMJE etc.)
   ============================== */

.policies__desc a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.25);
  transition: border-color 0.2s ease;
}

.policies__desc a:hover {
  border-bottom: 1px solid rgba(255,255,255,0.6);
}

body.light .policies__desc a {
  border-bottom-color: rgba(11,29,51,0.25);
}

body.light .policies__desc a:hover {
  border-bottom-color: rgba(11,29,51,0.5);
}

body.light .ethics-link a{
  border-bottom-color: rgba(11,29,51,0.24);
}

body.light .ethics-link a:hover{
  border-bottom-color: rgba(11,29,51,0.42);
}

body.light.internal .hero .page-title::after{
  background: rgba(11,29,51,0.16);
}

/* =========================================
   MISSION — FINAL (ACADEMIC + MONUMENTAL)
   ========================================= */

.page-about .mission .mission-subtitle{
  margin-top: 0;
  margin-bottom: 24px;
  font-weight: 460;
  max-width: var(--text-column);
  font-size: 1.12rem;
  line-height: 1.75;
  letter-spacing: 0.012em;
  color: var(--text-soft-strong);
}

.page-about .mission .mission-subtitle::first-line{
  font-weight: 500;
}

/* Mission grid */
.page-about .mission .mission-row{
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(340px, 0.88fr);
  column-gap: 60px;
  align-items: stretch;
  margin-top: 0;
}

/* Left: image */
.page-about .mission .mission-image{
  margin: 8px 0 14px;
  overflow: hidden;
  border-radius: 14px;
  aspect-ratio: 4 / 3;
}

.page-about .mission .mission-image img{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  transform: scale(1.03);
}

/* Right column */
.page-about .mission .mission-text{
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
  max-width: 42ch;
  justify-self: end;
  padding-top: 6px;
  padding-bottom: 2px;
  text-align: left;
}

/* Statement */
.page-about .mission .mission-statement{
  margin: 0;
  margin-bottom: 2px;
  padding: 0;
  background: none;
  border: none;
  font-size: 1.08rem;
  line-height: 1.7;
  letter-spacing: normal;
  color: rgba(240,245,255,0.86);
}

.page-about .mission .mission-statement strong{
  font-weight: 480;
  letter-spacing: 0.2px;
}

/* =========================================
   MISSION — CAPTION
   ========================================= */

.page-about .mission .mission-text .image-caption{
  margin-top: auto;
  transform: translateY(-5px);
  margin-bottom: 0;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.10);

  font-size: 0.9rem;
  line-height: 1.65;
  font-style: italic;
  color: rgba(220,230,245,0.66);

  max-width: 42ch;
  text-underline-offset: 2px;
}

/* Meta line */
.page-about .mission .mission-text .image-caption .caption-meta{
  display: block;
  margin-bottom: 6px;
  letter-spacing: 0.01em;
  font-style: normal;
}

/* Historical photograph */
.page-about .mission .mission-text .image-caption strong{
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(235,245,255,0.88);
}

/* Source — delicate hierarchy */
.page-about .mission .mission-text .image-caption .credit{
  color: rgba(220,230,245,0.58);
  font-weight: 400;
  letter-spacing: 0.01em;
  margin-left: 2px;
}

/* Optional body wrapper */
.page-about .mission .mission-text .image-caption .caption-body{
  display: block;
  text-wrap: pretty;
}

/* LIGHT MODE */
body.light.page-about .mission .mission-subtitle{
  color: rgba(11,29,51,0.92);
}

body.light.page-about .mission .mission-statement{
  color: rgba(11,29,51,0.82);
}

body.light.page-about .mission .mission-text .image-caption{
  border-top-color: rgba(11,29,51,0.12);
  color: rgba(11,29,51,0.78);
}

body.light.page-about .mission .mission-text .image-caption strong{
  color: rgba(11,29,51,0.9);
}

body.light.page-about .mission .mission-text .image-caption .credit{
  color: rgba(11,29,51,0.62);
}

/* =========================================
   MISSION — RESPONSIVE
   ========================================= */

@media (max-width: 980px){
  .page-about .mission .mission-row{
    grid-template-columns: 1fr;
    row-gap: 24px;
  }

  .page-about .mission .mission-text{
    padding-top: 0;
    max-width: none;
  }

  .page-about .mission .mission-text .image-caption{
    max-width: none;
    transform: none;
  }
}

/* =========================================================
   LEADERSHIP — PROFILE BLOCK + BIOGRAPHICAL NOTE
   Base layout
   ========================================================= */

.leadership-block{
  margin-bottom: 0;
}

.leadership-block .top-row{
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  column-gap: 32px;
  row-gap: 24px;     /* (контролира въздуха над снимката) */
  align-items: start;
  margin-bottom: 16px;
}

.leadership-block .portrait{
  width: 100%;
  max-width: 260px;
  display: block;
}

.leadership-block .role-text{
  max-width: var(--text-column);
  margin: 0;
  line-height: 1.6;
}

.leadership-block .role-text h3{
  margin: 0 0 10px;
  font-weight: 650;
  letter-spacing: 0.035em;
  color: rgba(235,245,255,0.95);
}

body.light .leadership-block .role-text h3{
  color: rgba(11,29,51,0.92);
}

.leadership-block .bio-under{
  margin-top: 8px;
  margin-bottom: 14px;
  max-width: 860px;
  font-size: 0.95rem;
  line-height: 1.55;
}

/* =========================================
   BIOGRAPHICAL NOTE — READ MORE
   ========================================= */

.bio-note{
  max-width: var(--section-maxw);
  margin: 0 auto;
}

.bio-note .bio-note-label{
  margin: 0 0 6px;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.65;
}

.bio-note .bio-note-body{
  overflow: hidden;
  height: auto;
  margin: 0;
  white-space: normal;
  transition: height 0.35s ease;
}

.bio-note.bio-expanded .bio-note-body{
  white-space: pre-line;
}

.bio-note .bio-note-body p{
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text-soft);
}

.bio-note .bio-note-body p + p{
  margin-top: 10px;
}

.bio-note .bio-note-body a{
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(148,163,184,0.35);
  text-underline-offset: 2px;
}

.bio-note .bio-note-body a:hover{
  text-decoration-color: currentColor;
}

.bio-note .bio-toggle{
  margin-top: 0;
  margin-bottom: 4px;
  padding: 2px 0;
  border: none;
  background: none;
  opacity: 0.75;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-soft);
  cursor: pointer;
  position: relative;
}

.bio-note .bio-toggle::after{
  content: "";
  display: block;
  width: 64px;
  height: 1px;
  margin-top: 2px;
  background: var(--text-soft);
  opacity: 0.55;
  transition: width 0.25s ease, opacity 0.25s ease;
}

.bio-note .bio-toggle:hover::after,
.bio-note .bio-toggle:focus-visible::after{
  width: 92px;
  opacity: 0.9;
}

.bio-note .bio-toggle:focus-visible{
  outline: 2px solid rgba(148,163,184,0.8);
  outline-offset: 3px;
  border-radius: 4px;
}

body.light .bio-note .bio-note-body p{
  color: #334155;
}

body.light .bio-note .bio-toggle{
  color: #475569;
}

body.light .bio-note .bio-toggle::after{
  background: #94a3b8;
}

/* =========================================
   Assessments
   ========================================= */

.assessments{
  max-width: var(--section-maxw);
  margin: 0 auto;
}

/* Section title */
.assessments > .bio-note-label{
  display: block;
  font-size: 0.95rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  opacity: 0.82;
  margin-bottom: 12px;
}

/* Individual quote block */
.assessments .bio-note{
  margin-top: 12px;
  padding-left: 14px;
  padding-top: 4px;
  border-left: 1px solid transparent;
  border-image: linear-gradient(
    to bottom,
    rgba(255,255,255,0),
    rgba(255,255,255,0.16),
    rgba(255,255,255,0)
  );
  border-image-slice: 1;
}

.assessments .bio-note:first-of-type{
  margin-top: 0;
}

/* Author / name */
.assessments .bio-note .bio-note-label{
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 2px;
  padding-left: 12px;

  border-left: 2px solid transparent;
  border-image: linear-gradient(
    to bottom,
    rgba(255,255,255,0),
    rgba(255,255,255,0.22),
    rgba(255,255,255,0)
  );
  border-image-slice: 1;
}

/* Quote text */
.assessments .quote-text{
  font-style: italic;
  font-weight: 400;
  line-height: 1.5;
  margin-top: 0;
  margin-left: 4px;
  max-width: 640px;
  color: var(--text-soft);
  margin-bottom: 2px;
  text-indent: -0.6em;
  padding-left: 0.6em;
  letter-spacing: 0.01em;
  opacity: 0.92;
}

/* Source */
.assessments .quote-source{
  display: block;
  font-style: normal;
  font-size: 0.82em;
  opacity: 0.62;
  margin-top: 0;
  line-height: 1.45;
  max-width: 520px;
  margin-left: 2px;
  padding-left: 0;
  text-indent: 0;
  border-left: 0;
}

/* Paragraph rhythm inside quotes */
.assessments .bio-note-body p{
  margin: 0;
}

.section p + .assessments{
  margin-top: 18px;
}

.assessments + p{
  margin-top: 18px;
}

/* Light mode — Assessments */
body.light .assessments .bio-note{
  border-left-color: rgba(40,60,100,0.22);
  border-image: linear-gradient(
    to bottom,
    rgba(40,60,100,0),
    rgba(40,60,100,0.28),
    rgba(40,60,100,0)
  );
  border-image-slice: 1;
}

body.light .assessments > .bio-note-label{
  color: rgba(11,29,51,0.78);
}

body.light .assessments .bio-note .bio-note-label{
  color: rgba(11,29,51,0.72);
  border-left-color: rgba(40,60,100,0.30);
  border-image: linear-gradient(
    to bottom,
    rgba(40,60,100,0),
    rgba(40,60,100,0.38),
    rgba(40,60,100,0)
  );
  border-image-slice: 1;
}

body.light .assessments .quote-text{
  color: rgba(11,29,51,0.90);
}

body.light .assessments .quote-source{
  color: rgba(11,29,51,0.62);
}


/* =========================================================
   ABOUT — FRAMEWORK / FOUNDER PORTRAIT POLISH
   Page-scoped overrides only
   ========================================================= */

.page-about .section-framework{
  margin-top: 14px;
}

.page-about .leadership-block .top-row{
  grid-template-columns: 260px minmax(0, 1fr);
  column-gap: 32px;
  row-gap: 22px;
  align-items: start;
}

.page-about .portrait-wrap{
  display: flex;
  flex-direction: column;
  width: 260px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.page-about .section-framework .portrait,
.page-about .section-founder .portrait{
  width: 100%;
  max-width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  border-radius: 18px;
  margin-bottom: 6px;
}

body.light .page-about .portrait-wrap{
  border-bottom: 1px solid rgba(0,0,0,0.12);
}

.page-about .section-framework .portrait{
  object-position: 50% 40%;
}

.page-about .section-founder .portrait{
  object-position: 50% 52%;
}

.page-about .section-framework .role-text,
.page-about .section-founder .role-text{
  margin-top: 0;
  padding-top: 3px;
}

.page-about .section-framework .role-text h3,
.page-about .section-founder .role-text h3{
  margin-top: 0;
  margin-bottom: 12px;
  line-height: 1.08;
}

.page-about .section-framework .role-text p,
.page-about .section-founder .role-text p{
  margin-top: 0;
}

.page-about .section-framework .role-text p + p,
.page-about .section-founder .role-text p + p{
  margin-top: 14px;
}

body:not(.light) .page-about .section-framework .role-text h3,
body:not(.light) .page-about .section-founder .role-text h3{
  color: rgba(235,245,255,0.96);
}

body.light .page-about .section-framework .role-text h3,
body.light .page-about .section-founder .role-text h3{
  color: rgba(11,29,51,0.92);
}

body:not(.light) .page-about .section-framework .role-text p,
body:not(.light) .page-about .section-founder .role-text p{
  color: rgba(219,230,245,0.82);
}

body.light .page-about .section-framework .role-text p,
body.light .page-about .section-founder .role-text p{
  color: rgba(11,29,51,0.82);
}

.page-about .portrait-caption{
  width: 100%;
  max-width: 100%;
  margin-top: 12px;
  padding-top: 10px;
  font-style: normal;
  font-size: 13px;
  line-height: 1.5;
  letter-spacing: 0.012em;
}

body:not(.light) .page-about .portrait-caption{
  color: rgba(210,220,235,0.74);
  border-top: 1px solid rgba(255,255,255,0.08);
}

body.light.page-about .portrait-caption{
  color: rgba(11,29,51,0.92);
  font-weight: 500;
  border-top: 1px solid rgba(0,0,0,0.06);
}

.page-about .bio-under{
  margin-top: 10px;
  margin-bottom: 14px;
  max-width: 860px;
  font-size: 0.95rem;
  line-height: 1.55;
}

.page-about .bio-note{
  max-width: 100%;
  margin: 0;
}

.page-about .bio-note .bio-note-label{
  margin: 0 0 10px;
  padding-top: 10px;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.72;
}

body:not(.light) .page-about .bio-note .bio-note-label{
  color: rgba(210,220,235,0.68);
  border-top: 1px solid rgba(255,255,255,0.08);
}

body.light.page-about .bio-note .bio-note-label{
  color: rgba(11,29,51,0.68);
  border-top: 1px solid rgba(0,0,0,0.06);
}

/* optional image cleanup inside About only */
.page-about .bio-image,
.page-about .profile-photo,
.page-about .about-photo{
  margin-bottom: 0;
}

@media (max-width: 768px){
  .page-about .leadership-block .top-row{
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .page-about .leadership-block .portrait{
    max-width: 300px;
  }

  .page-about .portrait-wrap{
    width: 100%;
  }

  .page-about .section-framework .portrait,
  .page-about .section-founder .portrait,
  .page-about .portrait-caption{
    max-width: 300px;
  }
}

/* =========================================
   SCIENTIFIC LEGACY – INSTRUMENT FLIP CARDS
   ========================================= */

.legacy-section .section-intro{
  max-width: var(--section-maxw);
  font-size: 1.02rem;
  line-height: 1.75;
  letter-spacing: 0.01em;
  color: var(--text-soft);
}

body.light .legacy-section .section-intro{
  color: rgba(11,29,51,0.82);
}

/* =========================================
   LEGACY — VERTICAL RHYTHM
   ========================================= */

.legacy-section h2{
  margin-bottom: 14px;
}

.legacy-section h2 + .section-intro{
  margin-top: 0;
  margin-bottom: 24px;
}

.legacy-section .instruments-grid{
  margin-top: 0;
}

.instruments-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  margin-top: 32px;
}

.instrument-item.instrument-flip{
  perspective: 1200px;
  cursor: pointer;
  align-items: stretch;
}

/* важна промяна: 320px */
.instrument-flip-inner{
  position: relative;
  width: 100%;
  height: 320px;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(.4,.2,.2,1);
}

.instrument-flip:hover .instrument-flip-inner{
  transform: rotateY(180deg);
}

.instrument-flip:focus-within .instrument-flip-inner{
  transform: rotateY(180deg);
}

.instrument-flip:focus-visible{
  outline: 2px solid rgba(148,163,184,0.85);
  outline-offset: 6px;
  border-radius: 12px;
}

.instrument-front,
.instrument-back{
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 12px;
  overflow: hidden;

  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  box-shadow: 0 18px 40px rgba(0,0,0,0.45);

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;

  padding: 20px;
}

.instrument-front{
  background: radial-gradient(
    circle at center,
    rgba(255,255,255,0.06),
    rgba(5,15,30,0.85)
  );
}

.instruments-grid .instrument-front img{
  width: 100%;
  height: 210px;
  object-fit: cover;
  object-position: center;

  border-radius: 12px;
  display: block;

  /* въздух снимка → заглавие */
  margin: 0 auto 20px;

  box-shadow: 0 18px 32px rgba(0,0,0,0.45);
  filter: saturate(0.95) contrast(1.02);
}

.instruments-grid .instrument-front h3{
  font-size: 1.05rem;
  text-align: center;
  width: 100%;
  line-height: 1.25;

  /* държи височината стабилна без “празно поле” */
  min-height: 2.2em;
  margin: 0 0 2px;

  display: flex;
  align-items: center;
  justify-content: center;
}

.instruments-grid .instrument-front p{
  font-size: 0.92rem;
  margin: 0;
}

/* Back side */
.instrument-back{
  transform: rotateY(180deg);
  text-align: left;
}

.instrument-back h3{
  font-size: 1.02rem;
  margin-bottom: 14px;       /* ✅ повече въздух под заглавието */
}

.instrument-back p{
  font-size: 0.94rem;
  line-height: 1.65;         /* ✅ малко по-добро четене */
  max-width: 260px;
  margin: 0 auto;
  color: var(--text-soft);
}

.instrument-back .image-credit{
  width: 100%;
  margin-top: 18px;
  text-align: left;
  max-width: none;
  font-size: 0.82rem;
  line-height: 1.5;
  opacity: 0.6;
  letter-spacing: 0.02em;
}

body.light .instrument-back p{
  color: #475569;
}

body.light .instrument-back .image-credit{
  color: #64748b;
  opacity: 1;
}

/* Touch */
.instrument-flip:active .instrument-flip-inner{
  transform: rotateY(180deg);
}


@media (hover: none) and (pointer: coarse){
  .instrument-flip{
    cursor: default;
  }

  .instrument-flip:hover .instrument-flip-inner{
    transform: none;
  }
}

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

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

/* =========================================
   BOOKS SECTION – LAYOUT + FLIP CARDS
   ========================================= */


.books-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  margin-top: 0;
  justify-items: center;
}

.books-section .section-intro{
  margin-bottom: 24px;
}

body.light .books-section .book-meta{
  color: #475569;
}

.books-section .flip-card{
  display: block;
  perspective: 1200px;
  max-width: 280px;
  width: 100%;
  min-width: 0;
  cursor: pointer;
  justify-self: center;
}

.books-section .flip-card-inner{
  position: relative;
  width: 100%;
  height: 370px;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.books-section .flip-card:hover .flip-card-inner{
  transform: rotateY(180deg);
}

.books-section .flip-card:focus-within .flip-card-inner{
  transform: rotateY(180deg);
}

.books-section .flip-card:focus-visible{
  outline: 2px solid rgba(148,163,184,0.85);
  outline-offset: 6px;
  border-radius: 12px;
}

.books-section .flip-card-front,
.books-section .flip-card-back{
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 12px;
  overflow: hidden;

  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  box-shadow: 0 18px 40px rgba(0,0,0,0.45);

  display: flex;
  flex-direction: column;
  align-items: center;
}

.books-section .flip-card-front{
  padding: 16px;
  justify-content: flex-start;
}

.books-section .flip-card-front .book-cover{
  width: 100%;
  height: 270px;
  object-fit: contain;
  object-position: center;
  display: block;

  border-radius: 12px;
  margin: 6px auto 12px;
  box-shadow: 0 18px 32px rgba(0,0,0,0.45);
}

.books-section .flip-card-front .book-title{
  margin: 0;
  width: 100%;
  text-align: center;

  min-height: 2.4em;
  line-height: 1.3;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  font-size: 1.05rem;
}

.books-section .flip-card-back{
  transform: rotateY(180deg);
  padding: 22px 18px 20px;
  justify-content: flex-start;
  align-items: flex-start;
}

.books-section .flip-card-back .book-title{
  margin: 0 0 14px;
  text-align: left;
  width: 100%;
}

.books-section .book-meta{
  max-width: 220px;
  margin: 4px auto 0;
  text-align: left;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-soft);
}

.books-section .flip-card-back .book-meta{
  margin: 0;
  line-height: 1.65;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding: 0 6px 0 0;
}

/* =========================================
   LIGHT MODE — CARDS (INSTRUMENTS + BOOKS)
   ========================================= */

/* Base card styling (shared) */
body.light .instrument-front,
body.light .instrument-back,
body.light .books-section .flip-card-front,
body.light .books-section .flip-card-back{
  background: #ffffff;
  border-color: rgba(0,0,0,0.06);
}

/* Instruments shadow */
body.light .instrument-front,
body.light .instrument-back{
  box-shadow: 0 10px 30px rgba(0,0,0,0.10);
}

/* Books shadow (slightly tighter) */
body.light .books-section .flip-card-front,
body.light .books-section .flip-card-back{
  box-shadow: 0 12px 28px rgba(0,0,0,0.12);
}

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

@media (max-width: 640px){
  .books-grid{
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (hover: hover) and (pointer: fine){
  .books-section .flip-card-inner{
    will-change: transform;
  }
}

@media (hover: none) and (pointer: coarse){
  .books-section .flip-card{
    cursor: default;
  }

  .books-section .flip-card:hover .flip-card-inner{
    transform: none;
  }
}

/* =========================================
   MILESTONES – YEAR-BASED TIMELINE
   ========================================= */

.milestones h2{ 
  margin-bottom: 0; 
}

/* Section container – леко стегнат layout за About */
.milestones .timeline-years{
  position: relative;
  margin-top: 16px;
  padding-left: 24px;          /* място за вертикалната линия */
  max-width: 900px;            /* по-четим стълб за текст */
  margin-left: auto;
  margin-right: auto;
}

/* вертикална линия (dark theme по подразбиране) */
.milestones .timeline-years::before{
  content: "";
  position: absolute;
  left: 10px;
  top: 4px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    to bottom,
    rgba(219,230,245,0.7),
    rgba(219,230,245,0.08)
  );
  opacity: 0.9;
}

/* блок за всяка година */
.timeline-year-block {
  position: relative;
  margin-bottom: 24px;
  padding-left: 16px; /* отстояние от вертикалната линия */
}

.timeline-year-block:last-child{
  margin-bottom: 0;
}

/* премахваме bullet-ите на списъка */
.timeline-year-block ul {
  list-style: none !important;
  margin: 0;
  padding: 0;
}

/* точка по линията */
.timeline-year-block .timeline-dot {
  display: block;
  position: absolute;
  left: -4px;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: radial-gradient(
    circle at 30% 30%,
    #ffffff,
    rgba(219,230,245,0.2)
  );
  border: 1px solid rgba(255,255,255,0.4);
  box-shadow: 0 0 8px rgba(90,175,255,0.5);
}

/* година (заглавие на блока) */
.timeline-year{
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: rgba(219,230,245,0.95);
  scroll-margin-top: 80px;
  font-size: 0.95rem;
}

/* събитията под годината */
.timeline-year-block li {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-soft);
  font-weight: 400;
}

/* абзацът за архивите под timeline-а */
/* Milestone archives – align to main 720px text column */
.milestones .milestone-archives{
  margin-top: 32px;
  max-width: var(--text-column);
  margin-left: auto;
  margin-right: auto;
  padding-left: 0;         /* махаме timeline offset-а */
  font-size: 0.94rem;
  line-height: 1.7;
  color: var(--text-soft);
}

.milestone-archives a{
  color: inherit;
  text-decoration: none;
}

/* Milestones email – same hover color as footer */
.milestone-archives a:hover{
  color: #ffffff;
}

body.light .milestone-archives a:hover{
  color: rgba(11,29,51,1);
}


/* =========================================
   MILESTONES – LIGHT THEME OVERRIDES
   ========================================= */

body.light .milestones .timeline-years::before{
  /* по-тъмна линия за светъл фон */
  background: linear-gradient(
    to bottom,
    rgba(40,60,100,0.45),
    rgba(40,60,100,0.15)
  );
}

body.light .timeline-year-block .timeline-dot {
  background: radial-gradient(
    circle at 30% 30%,
    #ffffff,
    #dbe6f5
  );
  border-color: rgba(60,80,120,0.9);
  box-shadow: 0 0 6px rgba(80,120,180,0.7);
}

body.light .timeline-year{
  color: #1b2536;
}

body.light .timeline-year-block li{
  color: #2c3850;
}

/* светла „картичка“ за всяка година в light тема */
body.light .timeline-year-block{
  border-radius: 10px;
  padding: 12px 16px 12px 16px;
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.04);
}

/* При големи екрани слагаме повече вертикален въздух */
@media (min-width: 1024px){
  .timeline-year-block{
    margin-bottom: 32px;
  }

  .timeline-year-block:last-child{
    margin-bottom: 0;
  }
}

/* =========================================
   RESEARCH SECTION
   ========================================= */

.research-section{
  padding-top: 0;
  padding-bottom: 0;
}

.page-research .research-section + .research-body::before{
  display: none;
}

.page-research .research-grid{
  margin-top: 18px;
  margin-bottom: 28px;
}

.research-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  max-width: var(--text-column);
  margin-left: auto;
  margin-right: auto;
}

.research-body{
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.page-research .research-body{
  padding-top: 8px;
}

.page-research .research-body .section-intro{
  max-width: var(--text-column);
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.page-research .research-body .section-intro:first-child{
  margin-top: 0;
}

/* =========================================
   RESEARCH – CARD BASE
   ========================================= */

.research-card{
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;

  justify-content: flex-start;

  width: 100%;
  min-width: 0;
  height: 100%;

  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;

  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);

  padding: 36px 24px 28px;

  box-shadow:
    0 20px 40px rgba(0,0,0,0.35),
    0 6px 12px rgba(0,0,0,0.25);

  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.research-card:hover{
  transform: translateY(-6px);
  box-shadow:
    0 28px 50px rgba(0,0,0,0.45),
    0 10px 18px rgba(0,0,0,0.35);
}

/* =========================================
   RESEARCH – ICONS
   ========================================= */

.research-card .card-icon{
  width: 96px;
  height: 96px;
  object-fit: contain;
  margin-top: 6px;
  margin-bottom: 12px;

  background: radial-gradient(
    circle,
    rgba(0, 200, 255, 0.12) 0%,
    transparent 65%
  );

  filter: drop-shadow(0 6px 14px rgba(0, 120, 255, 0.35));
  transition: filter 0.25s ease, transform 0.25s ease;
}

.research-card:hover .card-icon{
  filter: drop-shadow(0 0 22px rgba(0, 200, 255, 0.50));
  transform: translateY(-1px);
}

/* =========================================
   RESEARCH – TITLE & TEXT
   ========================================= */

.research-card h3{
  margin: 0 20px 16px;
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.02em;
  text-wrap: balance;
  min-height: calc(1.3em * 2);
}

.research-card p{
  margin: 0 auto 24px;
  text-align: center;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--text-soft);
  flex-grow: 1;
}

/* =========================================
   RESEARCH – LIGHT MODE
   ========================================= */

body.light .research-card{
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow:
    0 10px 30px rgba(0,0,0,0.08),
    0 4px 10px rgba(0,0,0,0.05);
  backdrop-filter: none;
}

body.light .research-card:hover{
  box-shadow:
    0 20px 32px rgba(0,0,0,0.14),
    0 6px 14px rgba(0,0,0,0.08);
}

body.light .research-card .card-icon{
  background: none;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.15));
}

body.light .research-card h3{
  color: #0b1d33;
}

body.light .research-card p{
  color: rgba(11,29,51,0.85);
}

/* =========================================
   RESEARCH – RESPONSIVE
   ========================================= */

@media (max-width: 1024px){
  .research-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
  }

  .research-card{
    padding: 20px 20px 24px;
  }
}

@media (max-width: 640px){
  .page-research .research-grid{
    margin-top: 28px;
    margin-bottom: 28px;
  }

  .research-grid{
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .research-card{
    padding: 18px 18px 22px;
  }

  .research-card .card-icon{
    width: 80px;
    height: 80px;
    margin-top: 0;
    margin-bottom: 10px;
  }

  .research-card h3{
    font-size: 1.05rem;
    margin: 0 12px 12px;
  }

  .research-card p{
    font-size: 0.95rem;
  }
}

/* =========================================
   PUBLICATIONS
   ========================================= */

/* Section spacing */
.page-publications main > .hero + .section{
  padding-top: 12px;
}

/* Intro text */
.page-publications .section-intro{
  max-width: 68ch;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 42px;
  font-size: 1.02rem;
  line-height: 1.72;
}

/* Section titles */
.page-publications .section h2{
  max-width: 68ch;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 18px;
  font-size: clamp(1.75rem, 1.5rem + 0.65vw, 2.15rem);
  letter-spacing: 0.025em;
  font-weight: 600;
}

/* vertical rhythm fix */
.page-publications .research-themes{
  margin-bottom: 42px;
}

/* Extra air only above the first heading */
.page-publications .section-intro + h2{
  margin-top: 36px;
}

/* Second heading spacing */
.page-publications .publications-subheading{
  margin-top: 32px;
  padding-top: 6px;
  border-top: 1px solid var(--border-soft);
}

/* Lists container */
.page-publications .publications-list{
  max-width: 68ch;
  margin-left: auto;
  margin-right: auto;
  margin-top: 10px;
}

/* Individual item */
.page-publications .publication-item{
  display: block;
  
  padding-left: 1.5em;
  text-indent: -1.5em;

  padding-top: 3px;
  padding-bottom: 6px;
  margin-bottom: 0;

  font-size: 1.02rem;
  line-height: 1.72;
  letter-spacing: normal;

  overflow-wrap: break-word;
  text-wrap: pretty;
  color: var(--text-soft);
  font-variant-numeric: oldstyle-nums;
}

/* Subtle hierarchy */
.page-publications .publication-item em{
  opacity: 0.94;
  font-style: italic;
}

.page-publications .publication-item strong{
  font-weight: 600;
}

/* Bullet */
.page-publications .publication-item::before{
  content: "•";
  margin-right: 0.5em;
  color: rgba(255,255,255,0.5);
  font-size: 0.9em;
  opacity: 0.7;
}

/* Divider */
.page-publications .publication-item:not(:last-child){
  border-bottom: 1px solid rgba(255,255,255,0.02);
}

/* =========================================
   PUBLICATIONS — LIGHT MODE
   ========================================= */

body.light.page-publications .publication-item,
body.light.page-publications .publication-item strong,
body.light.page-publications .publication-item em{
  color: rgba(11,29,51,0.88);
  opacity: 1;
}

body.light.page-publications .publication-item::before{
  color: rgba(11,29,51,0.38);
}

body.light.page-publications .publication-item em{
  opacity: 0.94;
}

body.light.page-publications .publication-item:not(:last-child){
  border-bottom: 1px solid rgba(0,0,0,0.05);
}


/* =========================================
   PUBLICATIONS — LIGHT HERO
   ========================================= */

body.light.page-publications .hero{
  padding-top: 96px;
  padding-bottom: 10px;
}

/* =========================================
   MOBILE
   ========================================= */

@media (max-width: 640px){

  .page-publications .section-intro{
    margin-bottom: 16px;
    font-size: 0.98rem;
    line-height: 1.68;
  }

  .page-publications .section-intro + h2{
    margin-top: 24px;
  }

  .page-publications .section h2{
    margin-bottom: 16px;
  }

  .page-publications .publications-list{
    margin-top: 14px;
  }

   .page-publications .publication-item{
     padding-left: 1.6em;
     text-indent: -1.6em;
     font-size: 0.98rem;
     line-height: 1.68;
     padding-bottom: 8px;
  }

}

/* =========================================================
   STAFF – VERTICAL LIST (BAS / INSTITUTE STYLE)
   ========================================================= */

.staff-core{
  margin-bottom: 72px;
}

.staffv-subtitle{
  font-size: clamp(1.15rem, 1.25vw, 1.3rem);
  line-height: 1.75;
  margin-bottom: 26px;
  max-width: var(--text-column);
  color: var(--text-soft-strong);
}

/* -------------------------
   Affiliated note / criteria
   ------------------------- */

.staffv-note{
  max-width: var(--text-column);
  margin: 8px 0 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}

.staffv-note-label{
  margin-bottom: 10px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.58);
}

.staffv-note p{
  margin: 0;
  font-size: 0.97rem;
  line-height: 1.78;
  letter-spacing: 0.01em;
  color: var(--text-soft);
}

.staffv-note p + p{
  margin-top: 12px;
}

body.light .staffv-note{
  border-top-color: rgba(0,0,0,0.08);
}

body.light .staffv-note-label{
  color: rgba(11,29,51,0.56);
}

body.light .staffv-note p{
  color: rgba(11,29,51,0.82);
}

/* -------------------------
   Lists
   ------------------------- */

.staffv-list{
  max-width: 900px;
  margin: 16px auto 0;
}

/* Core Team: 2 cards */
.staffv-list-core{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  margin-top: 10px;
  padding-top: 0;
  border-top: none;
  align-items: start;
}

/* Affiliated: vertical list */
.staffv-list-associated{
  display: flex;
  flex-direction: column;
  margin-top: 18px;
  padding-top: 6px;
}

/* -------------------------
   Core Team cards
   ------------------------- */

.staffv-item-core > div:last-child{
  width: 100%;
}


/* Core Team photo */
.staffv-item-core .staffv-photo{
  width: 152px;
  height: 152px;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(0,0,0,0.05);
  margin: 4px auto 22px;
  flex-shrink: 0;
}

.staffv-item-core .staffv-photo img{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* -------------------------
   Affiliated Researchers items
   ------------------------- */

.staffv-list-associated .staffv-item{
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  padding: 22px 0 30px;
  border-bottom: 1px solid var(--border-soft);
  align-items: start;
}

.staffv-list-associated .staffv-item:last-child{
  border-bottom: none;
}

.staffv-list-associated .staffv-photo{
  width: 150px;
  height: 200px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(0,0,0,0.05);
}

.staffv-list-associated .staffv-photo img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Individual photo adjustments */

.buchvarova-photo {
  object-fit: cover;
  object-position: 50% 20%;
}

.draganov-photo{
  object-position: center 24%;
}

.chapkanov-photo{
  object-position: center 12%;
}


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

.staffv-header{
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.staffv-name{
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.staffv-meta{
  font-size: 13px;
  opacity: 0.85;
  line-height: 1.35;
}

/* -------------------------
   Definition list
   ------------------------- */

.staffv-dl{
  margin: 0;
  display: grid;
  gap: 8px;
}

.staffv-row{
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 10px;
  font-size: 13px;
  line-height: 1.45;
}

.staffv-row dt{
  font-weight: 700;
  opacity: 0.9;
}

.staffv-row dd{
  margin: 0;
  opacity: 0.92;
  overflow-wrap: anywhere;
}

.staffv-row a{
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.staffv-bullets{
  margin: 0;
  padding-left: 16px;
  line-height: 1.32;
}

.staffv-bullets li{
  margin-bottom: 4px;
}

/* prevent text overflow */
.staffv-item > *{
  min-width: 0;
}

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

@media (max-width: 1024px){
  .staffv-list-core{
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px){
  .staffv-list-associated .staffv-item{
    grid-template-columns: 1fr;
    padding: 18px 0;
  }

  .staffv-list-core{
    gap: 26px;
  }

  .staffv-row{
    grid-template-columns: 1fr;
  }

  .staffv-list-associated .staffv-photo{
    width: 140px;
    height: 187px;
    margin-bottom: 10px;
  }

   .staffv-list-core .staffv-header{
     margin-bottom: 18px;
     align-items: center;
     text-align: center;
   }
}

/* =========================================================
   CORE TEAM – photo top left layout
   ========================================================= */

.staffv-list-core .staffv-item{
  display: flex;
  flex-direction: column;
  padding: 36px 28px 28px;
  gap: 0;
  height: 100%;

  border-bottom: none;
  border-radius: 18px;
  border: 1px solid var(--border-soft);

  background:
    linear-gradient(
      180deg,
      rgba(255,255,255,0.045),
      rgba(255,255,255,0.015)
    ),
    var(--card-bg);

  box-shadow: 0 8px 24px rgba(0,0,0,0.22);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.staffv-list-core .staffv-item:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(0,0,0,0.28);
}


body:not(.light) .staffv-list-core .staffv-item{
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.14);
}

/* Label above value (clean academic rhythm) */
.staffv-list-core .staffv-row{
  grid-template-columns: 1fr;
  gap: 5px;
}


/* =========================================================
   CORE TEAM – softer spacing & rhythm
   ========================================================= */


.staffv-list-core .staffv-dl{
  gap: 14px;
  flex: 1;
}

.staffv-list-core .staffv-row:last-child{
  margin-top: auto;
}

/* =========================================================
   CORE TEAM – institutional email styling
   ========================================================= */

.staffv-list-core .staffv-row a{
  color: inherit;
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, opacity 0.2s ease;
}

.staffv-list-core .staffv-row a:hover{
  border-bottom-color: rgba(0,0,0,0.4);
  opacity: 0.85;
}

/* dark mode */
body:not(.light) .staffv-list-core .staffv-row a{
  border-bottom-color: transparent;
}

body:not(.light) .staffv-list-core .staffv-row a:hover{
  border-bottom-color: rgba(255,255,255,0.32);
}

.staffv-list-core .staffv-name{
  font-size: 22px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.staffv-list-core .staffv-meta{
  font-size: 14px;
  opacity: 0.7;
}

.staffv-list-core .staffv-row dt{
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
}

.staffv-list-core .staffv-row dd{
  line-height: 1.55;
}

/* =========================================================
   STAFF – Section titles (Core / Affiliated)
   ========================================================= */

.staffv-section-title{
  font-size: var(--fs-2);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 48px 0 14px;
  position: relative;
}

.staff-core .staffv-section-title{
  margin-top: 0;
}

/* фин, академичен underline */
.staffv-section-title::after{
  content: "";
  display: block;
  width: 36px;
  height: 1px;
  margin-top: 10px;
  background: rgba(0,0,0,0.2);
}

.page-staff main > .hero + .section{
  padding-top: 4px;
}

body:not(.light) .staffv-section-title::after{
  background: rgba(255,255,255,0.25);
}

/* =========================================================
   POLICIES — INSTITUTIONAL FRAMEWORK
   ========================================================= */

.page-policies{
  --policy-divider: rgba(255,255,255,0.09);
  --policy-border-soft: rgba(255,255,255,0.06);
  --policy-border-faint: rgba(255,255,255,0.04);
  --policy-border-strong: rgba(255,255,255,0.14);

  --policy-card-bg: #ffffff;
  --policy-card-border: rgba(20,46,86,0.06);
  --policy-card-shadow: 0 6px 18px rgba(0,0,0,0.04);
  --policy-card-shadow-hover: 0 12px 28px rgba(0,0,0,0.06);

  --policy-card-title: #13233d;
  --policy-card-text: #4a5a70;
  --policy-text-muted: rgba(255,255,255,0.55);
  --policy-signature-text: #c9d4e5;
  --policy-accent: rgba(160,190,230,0.20);
  --policy-accent-strong: rgba(160,190,230,0.45);
}

body.light.page-policies{
  --policy-divider: rgba(0,0,0,0.08);
  --policy-border-soft: rgba(0,0,0,0.06);
  --policy-border-faint: rgba(0,0,0,0.05);
  --policy-border-strong: rgba(0,0,0,0.14);

  --policy-card-bg: #ffffff;
  --policy-card-border: rgba(20,46,86,0.08);
  --policy-card-shadow: 0 8px 20px rgba(0,0,0,0.04);
  --policy-card-shadow-hover: 0 12px 28px rgba(0,0,0,0.06);

  --policy-card-title: #13233d;
  --policy-card-text: #4a5a70;
  --policy-text-muted: rgba(11,29,51,0.48);
  --policy-signature-text: #4a5a70;
  --policy-accent: rgba(90,130,180,0.18);
  --policy-accent-strong: rgba(90,130,180,0.40);
}

.page-policies .policies__kicker{
  margin: 0 0 8px;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.78);
}

body.light.page-policies .policies__kicker{
  color: rgba(11,29,51,0.72);
}

.page-policies .policies__lede{
  margin: 0 0 8px;
  margin-inline: auto;
  font-size: 16px;
  line-height: 1.9;
  opacity: 0.92;
  max-width: 760px;
}

.page-policies .policies__note{
  margin: 0;
  margin-inline: auto;
  font-size: 13.5px;
  line-height: 1.85;
  opacity: 0.75;
  max-width: 760px;
  font-style: italic;
  letter-spacing: 0.01em;
}

.page-policies .policies__lede + .policies__note{
  margin-top: 0;
}

.page-policies .policies__section{
  margin-top: clamp(36px, 6vw, 48px);
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
}

.page-policies .policies__section + .policies__section .policies__h2{
  padding-top: 4px;
  border-top: 1px solid var(--policy-border-faint);
}

.page-policies .policies__h2{
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.65;
  line-height: 1.1;
}

.page-policies .policies__row{
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  padding: 6px 0;
  align-items: start;
  margin: 0;
}

.page-policies .policies__row + .policies__row{
  border-top: 1px solid var(--policy-border-soft);
  margin-top: 0;
}

.page-policies .policies__row--header{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 0;
}

.page-policies .policies__row--expanded{
  padding-top: 42px;
}

.page-policies .policies__main{
  min-width: 0;
}

.page-policies .policies__h3{
  margin: 0 0 6px;
  font-size: 16.5px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.page-policies .policies__main > .policies__h3 + .policies__desc{
  margin-top: 10px;
}

.page-policies .policies__main > .policies__desc + .policies__h3{
  margin-top: 22px;
}
  
.page-policies .policies__meta{
  margin: 0 0 12px;
  font-size: 10px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  font-weight: 500;
  opacity: 0.58;
  line-height: 1.3;
}

.page-policies .policies__desc{
  margin: 0;
  font-size: 14.6px;
  line-height: 1.82;
  opacity: 0.9;
  max-width: 760px;
}

.page-policies .policies__desc + .policies__desc{
  margin-top: 6px;
}

.page-policies .policies__list{
  margin-top: 6px;
  margin-bottom: 24px;
  padding-left: 18px;
  list-style-position: inside;
}

.page-policies .policies__list li{
  margin: 6px 0;
  line-height: 1.55;
}

.page-policies .policies__list li::marker{
  font-size: 0.85em;
  opacity: 0.6;
}

.page-policies .policies__action{
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  align-self: start;
}

.page-policies .policies__action--stacked{
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.page-policies .policies__link{
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: inherit;
  opacity: 0.58;
  border-bottom: 1px solid var(--policy-border-strong);
  padding-bottom: 6px;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.page-policies .policies__link:hover{
  opacity: 1;
}

.page-policies .policies__action .policies__link:first-child{
  font-weight: 600;
}

.page-policies .policies__section--adoption{
  margin-top: 42px;
  padding-top: 12px;
}

.page-policies .policies__adoption{
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.page-policies main > .hero + .section{
  padding-top: 8px;
}

.page-policies .policy-upgrade{
  position: relative;
  max-width: 980px;
  margin: 0 auto;
}

.page-policies .policy-upgrade .policies__action--stacked{
  position: absolute;
  top: 0;
  right: 0;
}

.page-policies .policy-upgrade .policies__row--header{
  display: block;
  margin-bottom: 0;
  padding-right: clamp(72px, 8vw, 96px);
}

.page-policies .policy-upgrade .policies__desc{
  max-width: 760px;
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.8;
  letter-spacing: 0.01em;
}

.page-policies .policy-upgrade .policies__desc + .policy-cards{
  margin-top: 18px;
}

.page-policies .policy-upgrade .policy-cards{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 32px;
}

.page-policies .policy-card{
  position: relative;
  overflow: hidden;
  background: var(--policy-card-bg);
  border: 1px solid var(--policy-card-border);
  border-radius: 16px;
  padding: 26px 28px;
  box-shadow: var(--policy-card-shadow), inset 0 1px 0 rgba(255,255,255,0.6);
  transition: all 0.25s ease;
  line-height: 1.65;
  outline: 1px solid rgba(0,0,0,0.03);
}

.page-policies .policy-card::before{
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(to bottom, var(--policy-accent-strong), var(--policy-accent));
  transition: width 0.25s ease, background 0.25s ease;
}

.page-policies .policy-card:hover{
  transform: translateY(-4px);
  box-shadow: var(--policy-card-shadow-hover);
}

.page-policies .policy-card:hover::before{
  width: 4px;
}

.page-policies .policy-card:nth-child(1)::before { background: linear-gradient(to bottom, rgba(70,110,170,0.34), rgba(70,110,170,0.16)); }
.page-policies .policy-card:nth-child(2)::before { background: linear-gradient(to bottom, rgba(90,130,180,0.34), rgba(90,130,180,0.16)); }
.page-policies .policy-card:nth-child(3)::before { background: linear-gradient(to bottom, rgba(110,150,190,0.34), rgba(110,150,190,0.16)); }
.page-policies .policy-card:nth-child(4)::before { background: linear-gradient(to bottom, rgba(130,170,210,0.34), rgba(130,170,210,0.16)); }
.page-policies .policy-card:nth-child(5)::before { background: linear-gradient(to bottom, rgba(150,185,220,0.34), rgba(150,185,220,0.16)); }
.page-policies .policy-card:nth-child(6)::before { background: linear-gradient(to bottom, rgba(170,200,230,0.34), rgba(170,200,230,0.16)); }

.page-policies .policy-card h4{
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.35;
  color: #1a2a44;
}

.page-policies .policy-card p{
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
  letter-spacing: 0.015em;
  color: #4a5a70;
}

.page-policies .policy-principle{
  margin-top: 18px;
  margin-bottom: 12px;
}

.page-policies .policy-label{
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--policy-text-muted);
  margin-bottom: 6px;
}

.page-policies .policy-signature{
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--policy-signature-text);
  max-width: 780px;
  font-style: italic;
  letter-spacing: 0.2px;
  border-left: 2px solid var(--policy-border-strong);
  padding-left: 12px;
}

@media (max-width: 900px){
  .page-policies .policy-upgrade .policy-cards{
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px){
  .page-policies .policies__row{
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 6px 0;
  }

  .page-policies .policies__row--header{
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .page-policies .policies__action{
    justify-content: flex-start;
    margin-top: 6px;
  }

  .page-policies .policies__action--stacked{
    align-items: flex-start;
  }

  .page-policies .policies__link{
    letter-spacing: 0.14em;
    opacity: 0.58;
  }

  .page-policies .policy-upgrade .policy-cards{
    grid-template-columns: 1fr;
  }

  .page-policies .policy-card{
    padding: 17px 16px 17px 18px;
  }

  .page-policies .policy-upgrade .policies__desc{
    max-width: none;
  }
}

/* --- Core principle ONLY for Criteria --- */
.page-policies .policies__section--criteria .policies__desc:first-of-type{
  font-weight: 520;
  letter-spacing: 0.01em;
  opacity: 1;
}

.page-policies .policies__section--criteria .policies__desc:first-of-type::before{
  content: "";
  display: block;
  width: 36px;
  height: 1px;
  background: rgba(255,255,255,0.35);
  margin-bottom: 10px;
  margin-top: 6px;
}

/* =========================================================
   FOOTER
   ========================================================= */

.site-footer {
  margin-top: auto;
  padding: 60px 15% 36px;

  background: linear-gradient(
    to top,
    rgba(5,15,30,0.85),
    rgba(5,15,30,0.65)
  );

  color: rgba(219,230,245,0.95);
  font-size: 0.85rem;
  line-height: 1.6;

  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* декоративна линия отгоре */
.site-footer::before {
  content: "";
  display: block;
  height: 1px;
  margin-bottom: 32px;
  background: linear-gradient(
    to right,
    transparent,
    var(--border-soft),
    transparent
  );
}

/* layout */
.footer-content {
  display: flex;
  justify-content: space-between;
  gap: 60px;
  align-items: flex-end;
  flex-wrap: wrap;
}

/* лява част */
.footer-left strong {
  display: block;
  margin-bottom: 10px;
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.015em;
  color: rgba(255,255,255,0.95);
}

.footer-right span {
  display: block;
  color: rgba(219,230,245,0.8);
}

.footer-left,
.footer-right {
  min-width: 220px;
}

.footer-right a {
  display: block;
  
  font-size: 0.82rem;
  color: rgba(219,230,245,0.92);
  text-decoration: none;
}

.footer-right a:hover {
  color: #ffffff;
}

.footer-left span,
.footer-right span,
.footer-right a {
  display: block;
  margin-top: 4px;
  line-height: 1.6;
}

/* долна линия */
.footer-bottom {
  margin-top: 42px;
  padding-top: 6px;
  text-align: center;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: rgba(219,230,245,0.8);
}

.site-contact {
  margin-top: 6px;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: rgba(219,230,245,0.75);
}

.site-contact span {
  display: block;
  margin-bottom: 2px;
  opacity: 0.75;
}

.site-contact a {
  color: inherit;
  text-decoration: none;
}

.site-contact a:hover {
  opacity: 0.8;
}

/* Light mode */
body.light .site-contact {
  color: rgba(11,29,51,0.75);
}

.footer-left span {
  color: rgba(219,230,245,0.85);
}

/* =========================================================
   FOOTER – LIGHT MODE
   ========================================================= */

body.light .site-footer {
  background: linear-gradient(
    to top,
    rgba(255,255,255,0.95),
    rgba(255,255,255,0.85)
  );

  color: rgba(11,29,51,0.9);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.light .site-footer::before {
  background: linear-gradient(
    to right,
    transparent,
    rgba(0,0,0,0.15),
    transparent
  );
}

body.light .footer-left strong {
  color: rgba(11,29,51,0.95);
}

body.light .footer-left span,
body.light .footer-right span {
  color: rgba(11,29,51,0.85);
}

body.light .footer-right a {
  color: rgba(11,29,51,0.9);
}

body.light .footer-right a:hover {
  color: rgba(11,29,51,1);
}

body.light .footer-bottom {
  color: rgba(11,29,51,0.85);
}

/* =========================================================
   RESPONSIVE (CLEAN — matches new Header + Sections)
   ========================================================= */
@media (max-width: 900px){
  :root{
    --page-gutter: 8%;
    --section-pt: clamp(24px, 5vw, 40px);
    --section-pb: clamp(24px, 5vw, 40px);
  }

  /* Header: stacked layout */
  .header{
    padding: 12px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .header.header-scrolled{
    padding: 10px 16px;
  }

  .logo img{
    height: 32px;
  }

  .header nav{
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 16px;
  }

  .header nav a{
    font-size: 0.82rem;
    letter-spacing: 0.05em;
    padding-bottom: 5px;
  }

  .theme-toggle{
    align-self: flex-end;
  }

  body:not(.home) main::after{
    filter: none;
  }
}

/* =========================================================
   ACCESSIBILITY / FOCUS POLISH
   ========================================================= */

/* Show focus only for keyboard navigation */
:focus:not(:focus-visible) {
  outline: none;
}

/* Universal focus style */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 4px;
  border-radius: 4px;
}

/* Match hover and focus for navigation */
main .section a:hover,
main .section a:focus-visible{
  text-decoration: underline;
}


.header nav a:hover,
.header nav a:focus-visible{
  text-decoration: none;
}

/* Theme toggle focus */
.theme-toggle:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 4px;
}

/* =========================================================
   RESPONSIVE — MASTER BREAKPOINTS
   1024 / 768 / 640
   ========================================================= */

@media (max-width: 768px){

  .footer-content{
    flex-direction: column;
    gap: 32px;
  }

  .site-footer{
    padding: 48px 10% 28px;
  }

  .milestones .timeline-years{
    padding-left: 22px;
  }

  .timeline-year-block{
    margin-bottom: 20px;
  }

  .timeline-year-block li{
    font-size: 0.92rem;
  }

  body.internal .section p,
  body.internal .ethics-text,
  body.internal .milestones .timeline-year-block li,
  body.internal .milestone-archives{
    text-align: left;
  }
}

/* =========================================================
   PRINT STYLESHEET (Merged & Clean)
   ========================================================= */
@media print {

  /* --------- Global --------- */
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 12pt;
    line-height: 1.5;
  }

  /* Remove background overlays & gradients */
  body::before,
  main::before,
  main::after {
    display: none !important;
  }

  /* Remove website UI */
  .header,
  .theme-toggle,
  nav,
  .site-footer {
    display: none !important;
  }

  main {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }

  /* Typography */
  h1, h2, h3 {
    color: #000000 !important;
    page-break-after: avoid;
  }

  .section p,
  .hero-text p,
  .ethics-text {
    color: #000000 !important;
    max-width: 100% !important;
  }

  a {
    color: #000000 !important;
    text-decoration: underline !important;
  }

  /* --------- Cards (Research / Legacy cards) --------- */
  .cards {
    display: block !important;
  }

  .card {
    background: #ffffff !important;
    border: 1px solid #cccccc !important;
    margin-bottom: 16px !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    page-break-inside: avoid !important;
  }

  .card h3,
  .card p {
    color: #111111 !important;
  }


  /* --------- Milestones Timeline --------- */
  .timeline-years::before {
    background: #999999 !important;
  }

  .timeline-year,
  .timeline-year-block li,
  .milestone-archives,
  .timeline-year-block {
    color: #111111 !important;
  }

  .timeline-year-block {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    page-break-inside: avoid !important;
  }

  /* Archive footer text */
  .milestone-archives {
    font-size: 11pt !important;
    line-height: 1.5 !important;
    margin-top: 24px !important;
  }

  /* Improve print layout spacing */
  .section,
  .timeline-year {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
}

/* =========================================================
   PROJECTS — WIDE IMAGE LEFT, TEXT RIGHT
   ========================================================= */

.projects-list{
  display: flex;
  flex-direction: column;
  gap: 36px;        /* малко повече въздух между проектите */
  margin-top: 28px; /* леко отделяне от заглавието */
}

/* =========================================================
   CARD
   ========================================================= */

.project-row{
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 20px;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid var(--border-soft);
  background: rgba(15,30,55,0.55);
  backdrop-filter: blur(6px);

  align-items: start;   /* ← този ред */

  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

body.light .project-row{
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.page-projects .project-row p{
  text-align: left;
  hyphens: none;
}

/* =========================================================
   MEDIA
   ========================================================= */

.project-row-media{
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.14);
  background: radial-gradient(
    circle at 30% 20%,
    rgba(255,255,255,0.10),
    rgba(11,29,51,0.85) 55%,
    rgba(0,0,0,0.55)
  );
  box-shadow: 0 14px 40px rgba(0,0,0,0.45);
  transition:
    transform 0.45s ease,
    box-shadow 0.45s ease,
    border-color 0.45s ease;
}

.project-row:hover .project-row-media{
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.22);
  box-shadow:
    0 18px 52px rgba(0,0,0,0.55),
    inset 0 0 0 1px rgba(255,255,255,0.06);
}

.project-row-media::after{
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 16px;
  opacity: 1;
  transition: opacity 0.45s ease;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.10) 0%,
    rgba(0,0,0,0.18) 55%,
    rgba(0,0,0,0.30) 100%
  );
}

.project-row:hover .project-row-media::after{
  opacity: 0.55;
}

body.light .project-row-media{
  border-color: rgba(11,29,51,0.14);
  background: radial-gradient(
    circle at 30% 20%,
    rgba(11,29,51,0.06),
    rgba(255,255,255,0.92)
  );
  box-shadow: 0 12px 30px rgba(0,0,0,0.10);
}

body.light .project-row:hover .project-row-media{
  border-color: rgba(11,29,51,0.22);
  box-shadow:
    0 18px 44px rgba(0,0,0,0.16),
    inset 0 0 0 1px rgba(11,29,51,0.08);
}

body.light .project-row-media::after{
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0) 0%,
    rgba(11,29,51,0.05) 60%,
    rgba(11,29,51,0.10) 100%
  );
}

body.light .project-row:hover .project-row-media::after{
  opacity: 0.65;
}

/* Default image behaviour */
.project-row-media img{
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  filter: contrast(1.05) saturate(1.05);
  transition: filter 0.45s ease;
}

.project-row:hover .project-row-media img{
  filter: contrast(1.08) saturate(1.08);
}

/* Banner / diagram image modes */
.project-row-media.is-banner img{
  object-fit: contain;
  padding: 12px;
  background: transparent;
}


/* =========================================================
   FEATURED: FIRST PROJECT CARD
   ========================================================= */

.projects-list > .project-row:first-of-type{
  border-color: rgba(255,255,255,0.22);
  box-shadow: 0 18px 60px rgba(0,0,0,0.30);
  transform: translateY(-3px);
}

.projects-list > .project-row:first-of-type .project-row-media{
  border-color: rgba(255,255,255,0.20);
  box-shadow:
    0 20px 60px rgba(0,0,0,0.55),
    inset 0 0 0 1px rgba(255,255,255,0.08);
}

.projects-list > .project-row:first-of-type:hover .project-row-media{
  box-shadow:
    0 22px 66px rgba(0,0,0,0.62),
    inset 0 0 0 1px rgba(255,255,255,0.08);
}

body.light .projects-list > .project-row:first-of-type{
  border-color: rgba(11,29,51,0.18);
  box-shadow: 0 18px 55px rgba(0,0,0,0.12);
}

body.light .projects-list > .project-row:first-of-type .project-row-media{
  border-color: rgba(11,29,51,0.18);
  box-shadow:
    0 18px 48px rgba(0,0,0,0.18),
    inset 0 0 0 1px rgba(11,29,51,0.10);
}

body.light .projects-list > .project-row:first-of-type:hover .project-row-media{
  box-shadow:
    0 20px 56px rgba(0,0,0,0.20),
    inset 0 0 0 1px rgba(11,29,51,0.10);
}

/* =========================================================
   TEXT / META
   ========================================================= */

.project-row-body,
.project-row-clean .project-right{
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 60ch;
}

.project-row-title{
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.25;
}

.project-row-desc{
  margin: 0;
  line-height: 1.65;
  color: var(--text-soft);
  hyphens: none;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

.project-row-meta{
  margin: 0;
  color: var(--text-soft);
}

/* =========================================================
   BADGES / TAGS / BUTTONS
   ========================================================= */

.project-row-badges,
.project-tags,
.project-row-actions{
  display: flex;
  flex-wrap: wrap;
}

.project-row-badges,
.project-tags{
  gap: 8px;
}

.project-row-actions{
  gap: 10px;
  margin-top: 6px;
}

.project-badge,
.project-tag{
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
}

.project-badge{
  border: 1px solid var(--border-soft);
  background: rgba(11,29,51,0.65);
  color: rgba(219,230,245,0.92);
}

.project-tag{
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: rgba(219,230,245,0.82);
  letter-spacing: 0.02em;
}

body.light .project-badge{
  background: rgba(11,29,51,0.05);
  color: rgba(11,29,51,0.9);
}

body.light .project-tag{
  background: rgba(11,29,51,0.04);
  border-color: rgba(11,29,51,0.10);
  color: rgba(11,29,51,0.78);
}

.project-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 11px;
  border-radius: 11px;
  border: 1px solid var(--border-soft);
  background: rgba(255,255,255,0.06);
  color: rgba(219,230,245,0.95);
  font-size: 0.92rem;
  text-decoration: none;
  transition: background 0.2s ease;
}

.project-btn:hover{
  background: rgba(255,255,255,0.10);
}

.project-btn.project-btn-ghost{
  background: transparent;
}

body.light .project-btn{
  background: rgba(11,29,51,0.04);
  color: rgba(11,29,51,0.92);
}

body.light .project-btn:hover{
  background: rgba(11,29,51,0.08);
}

/* =========================================================
   CLEAN LAYOUT
   ========================================================= */

.project-row-clean{
  grid-template-columns: 1.07fr 1fr;
  align-items: start;
}

.project-row-clean .project-left{
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 0;
}

.project-left-meta{
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.4;
  color: rgba(219,230,245,0.85);
}

body.light .project-left-meta{
  color: rgba(11,29,51,0.85);
}

.participants-names{
  display: inline-block;
  margin-left: 10px;
  vertical-align: top;
}

.project-row-clean .project-left .project-row-actions{
  margin-top: 18px;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 900px){
  .project-row{
    grid-template-columns: 1fr;
  }

  .project-row-media img{
    aspect-ratio: 2 / 1;
    object-fit: cover;
  }

  .project-row-media.is-banner img{
    aspect-ratio: 16 / 9;
    object-fit: contain;
    padding: 6px;
    background: transparent;
  }

  .project-row-clean .project-left{
    padding-top: 0;
  }
}
