/* Mariam Amiri — Literary Glassmorphism */

:root {
  /* پس‌زمینه‌ها */
  --bg-base: #F2E9DD;
  --bg-hero: linear-gradient(145deg, #FFFAF4 0%, #F8EDD9 35%, #EEE0CB 65%, #E6D4BA 100%);
  --bg-stats: linear-gradient(160deg, #DFF3EE 0%, #CAE9E0 50%, #D8F0E8 100%);
  --bg-section: #FDFAF6;
  --bg-section-alt: #EDE0CE;
  --bg-cta: linear-gradient(135deg, #D8F0EB 0%, #F0E4D5 50%, #E6DDF5 100%);
  --bg-footer: #E8DDD0;
  --bg-footer-bar: #F0E9DF;
  --bg-page-hero: linear-gradient(180deg, rgba(255, 252, 247, 0.98) 0%, rgba(240, 228, 210, 0.95) 100%);
  --bg-page-band: #EDE4D8;
  --bg-form: #FAF6F0;

  /* Glass surfaces */
  --glass-white: rgba(255, 255, 255, 0.62);
  --glass-white-strong: rgba(255, 255, 255, 0.82);
  --glass-teal: rgba(13, 148, 136, 0.06);
  --glass-border: rgba(255, 255, 255, 0.75);
  --glass-border-subtle: rgba(255, 255, 255, 0.45);

  --paper: #FFFCF8;
  --subtle: #EDE4D8;
  --surface: #FFFFFF;
  --ink: #1A2533;
  --muted: #5A6880;
  --line: #DDE5F0;
  --accent: #0D9488;
  --accent-dark: #0F766E;
  --accent-light: #14B8A6;
  --accent-soft: #EDFAF8;
  --accent-glow: rgba(13, 148, 136, 0.18);
  /* Premium visual enhancements */
  @import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

  :root {
    --color-bg: #F2E9DD;
    --color-accent: hsl(260,70%,55%);
    --color-text: #1A2533;
    --color-card-bg: rgba(255,255,255,0.85);
  }

  body, html[lang="fa"] body, html[lang="en"] body {
    font-family: 'Vazirmatn', system-ui, sans-serif;
  }

  .glass-card {
    background: var(--color-card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,0.75);
    transition: transform .2s ease, box-shadow .2s ease;
  }
  .glass-card:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  }

  .btn-primary, .btn-secondary {
    transition: background .2s ease, transform .2s ease;
  }
  .btn-primary:hover, .btn-secondary:hover {
    transform: translateY(-2px);
  }
  --tab-active-sky: linear-gradient(165deg, #F0FDFA 0%, #CCFBF1 42%, #99F6E4 100%);
  --tab-active-sky-soft: linear-gradient(180deg, #F0FDFA 0%, #E0F7FA 100%);
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-2xl: 32px;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.07);
  --shadow-md: 0 8px 32px rgba(15, 23, 42, 0.11);
  --shadow-lg: 0 20px 60px rgba(15, 23, 42, 0.14);
  --shadow-glow: 0 0 40px rgba(13, 148, 136, 0.14);
  --header-h: 4rem;
  --max-w: 68rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-base);
  background-image:
    radial-gradient(ellipse 80% 55% at 0% 0%, rgba(255, 248, 238, 0.95) 0%, transparent 52%),
    radial-gradient(ellipse 65% 50% at 100% 20%, rgba(200, 235, 225, 0.5) 0%, transparent 48%),
    radial-gradient(ellipse 50% 40% at 55% 90%, rgba(215, 195, 175, 0.3) 0%, transparent 45%),
    radial-gradient(ellipse 35% 30% at 80% 75%, rgba(13, 148, 136, 0.06) 0%, transparent 40%);
  color: var(--ink);
  line-height: 1.7;
}

body > main, body > .home-page, body > .page-main { flex: 1 0 auto; }

html[lang="fa"] body { font-family: 'Vazirmatn', Tahoma, sans-serif; }
html[lang="en"] body { font-family: 'Vazirmatn', system-ui, sans-serif; }

.font-display,
.section-title, .page-hero-title, .writing-title, .card-title,
.cta-banner-title, .related-title, .hero-title, .brand-name, .footer-logo {
  font-family: 'Lora', Georgia, serif;
}

.container-wide {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: 0.75rem;
}

@media (min-width: 640px) { .container-wide { padding-inline: 1.5rem; } }
@media (min-width: 1024px) { .container-wide { padding-inline: 2rem; } }

/* Header */
.site-header { position: fixed; inset-block-start: 0; inset-inline: 0; z-index: 50; }

.header-bar {
  background: rgba(255, 251, 244, 0.78);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--glass-border-subtle);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

#header.scrolled .header-bar {
  background: rgba(255, 250, 242, 0.88);
  border-bottom-color: rgba(220, 210, 195, 0.55);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}

.site-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  text-decoration: none;
  color: var(--ink);
  line-height: 1.25;
}

.brand-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--accent);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name { font-size: 1.125rem; font-weight: 600; }
.brand-role { font-size: 0.75rem; color: var(--muted); }

.header-nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
}

@media (min-width: 1024px) {
  .header-nav {
    display: flex;
    flex: 1;
    justify-content: center;
    margin-inline: 1rem;
  }
}

.nav-link {
  position: relative;
  padding: 0.35rem 0.5rem 0.55rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  background: transparent;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  inset-inline: 0.35rem;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: transparent;
  transform: scaleX(0);
  transition: transform 0.25s ease, background 0.2s ease;
}

.nav-link:hover { color: var(--ink); }

.nav-link:hover::after {
  background: var(--line);
  transform: scaleX(1);
}

.nav-link.active {
  color: var(--ink);
  font-weight: 600;
}

.nav-link.active::after {
  height: 3px;
  background: var(--accent);
  transform: scaleX(1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.menu-toggle {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  cursor: pointer;
  flex-shrink: 0;
}

.menu-toggle-icon { width: 1.25rem; height: 1.25rem; }

@media (min-width: 1024px) {
  .menu-toggle { display: none; }
}

.mobile-menu {
  background: var(--bg-section);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

.mobile-menu-inner {
  display: flex;
  flex-direction: column;
  padding-block: 0.5rem 1rem;
}

.mobile-nav-link {
  display: block;
  padding: 0.75rem 0.5rem 0.75rem 0.85rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-radius: var(--radius);
  border-inline-start: 3px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease, padding 0.2s ease;
}

.mobile-nav-link:hover {
  color: var(--ink);
  border-inline-start-color: var(--line);
  padding-inline-start: 1rem;
}

.mobile-nav-link.active {
  color: var(--ink);
  font-weight: 600;
  border-inline-start-color: var(--accent);
  padding-inline-start: 1rem;
  background: linear-gradient(90deg, rgba(13, 148, 136, 0.08) 0%, transparent 72%);
}

html[dir="ltr"] .mobile-nav-link.active {
  background: linear-gradient(270deg, rgba(13, 148, 136, 0.08) 0%, transparent 72%);
}

@media (max-width: 1023px) {
  .brand-role { display: none; }
  .header-inner { gap: 0.5rem; }
  .site-brand { min-width: 0; flex-shrink: 1; }
  .brand-name {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  .brand-role { display: block; }
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover { background: var(--accent-dark); }
.btn-primary--sm { padding: 0.5rem 1rem; font-size: 0.8125rem; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.68rem 1.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.lang-btn {
  display: grid;
  place-items: center;
  height: 2.5rem;
  min-width: 2.5rem;
  padding: 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.lang-btn:hover { color: var(--accent-dark); border-color: var(--accent); }

/* Sections */
.section-alt {
  background: var(--bg-section-alt);
  border-block: 1px solid rgba(210, 190, 170, 0.35);
}

.section-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
}

.section-desc {
  font-size: 1rem;
  color: var(--muted);
  margin-top: 0.5rem;
  max-width: 36rem;
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 768px) {
  .section-head {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.section-head--stack { align-items: flex-start; }

.section-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.section-link:hover { color: var(--accent-dark); text-decoration: underline; }

.tag {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: 999px;
}

.badge-year {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
}

/* Home hero */
.home-page { padding-top: var(--header-h); }

.home-hero {
  padding: 3.5rem 0 3rem;
  background: var(--bg-hero);
  border-bottom: 1px solid rgba(210, 190, 170, 0.35);
  position: relative;
  overflow: hidden;
}

/* Glassmorphism ambient orbs behind the hero */
.home-hero::before {
  content: '';
  position: absolute;
  top: -6rem;
  inset-inline-end: -4rem;
  width: 32rem;
  height: 32rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(13, 148, 136, 0.12) 0%, rgba(13, 148, 136, 0.03) 55%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: orb-drift 12s ease-in-out infinite alternate;
}

.home-hero::after {
  content: '';
  position: absolute;
  bottom: -4rem;
  inset-inline-start: -5rem;
  width: 26rem;
  height: 26rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(180, 150, 110, 0.10) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
  animation: orb-drift 16s ease-in-out infinite alternate-reverse;
}

.home-hero > * { position: relative; z-index: 1; }

@keyframes orb-drift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(2.5rem, 1.5rem) scale(1.08); }
}

.hero-grid {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 2.5rem;
}

/* RTL: تغییر دایرکشن فلکس در چپ‌چین (چون توی سورس دومه، چپ میفته) */
html[dir="ltr"] .hero-grid {
  flex-direction: column-reverse;
}

.hero-content {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
}

.hero-visual {
  flex: 0 0 auto;
  width: clamp(14rem, 60vw, 340px);
  max-width: 340px;
}

@media (min-width: 960px) {
  .hero-grid {
    flex-direction: row;
    gap: 3.5rem;
    align-items: center;
  }

  html[dir="ltr"] .hero-grid {
    flex-direction: row-reverse;
  }

  .hero-content {
    text-align: right;
  }

  html[dir="ltr"] .hero-content {
    text-align: left;
  }

  .hero-visual {
    width: 340px;
  }
}

.hero-eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.hero-lead {
  font-size: 1.0625rem;
  color: var(--muted);
  max-width: 32rem;
  margin-bottom: 1.5rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }

@media (min-width: 960px) {
  .hero-actions { justify-content: flex-start; }
}

.hero-photo-wrap {
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid rgba(255, 255, 255, 0.92);
  box-shadow:
    0 0 0 1px rgba(13, 148, 136, 0.18),
    0 20px 60px rgba(15, 23, 42, 0.16),
    0 0 0 12px rgba(13, 148, 136, 0.05),
    var(--shadow-glow);
  aspect-ratio: 1;
  max-width: 340px;
  margin-inline: auto;
  position: relative;
}

.hero-portrait-img, .about-preview-photo, .about-page-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  display: block;
}

.hero-quote {
  margin-top: 2.5rem;
  padding: 1.35rem 1.75rem;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid var(--glass-border);
  border-inline-start: 4px solid var(--accent);
  border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.07);
}

html[dir="ltr"] .hero-quote {
  border-inline-start: none;
  border-inline-end: 4px solid var(--accent);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.hero-quote p {
  margin: 0;
  font-family: 'Lora', Georgia, serif;
  font-size: 1.125rem;
  font-style: italic;
  color: var(--ink);
  line-height: 1.6;
}

/* Stats */
.home-stats {
  padding: 2.25rem 0;
  background: var(--bg-stats);
  border-block: 1px solid rgba(160, 205, 190, 0.3);
  position: relative;
  overflow: hidden;
}

.home-stats::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 80% at 50% 50%, rgba(255,255,255,0.25) 0%, transparent 70%);
  pointer-events: none;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  position: relative;
}

@media (min-width: 640px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

.stat-item {
  text-align: center;
  padding: 1.25rem 1rem;
  background: var(--glass-white);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255,255,255,0.8);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.stat-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(13, 148, 136, 0.12), inset 0 1px 0 rgba(255,255,255,0.9);
}

.stat-number {
  display: block;
  font-family: 'Lora', Georgia, serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent);
}

.stat-label {
  display: block;
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* Home sections */
.home-section {
  padding: 4rem 0;
  background: var(--bg-section);
}

.home-section.section-alt {
  background: var(--bg-section-alt);
}

.about-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

html[dir="rtl"] .about-preview {
  flex-direction: column;
}

.about-preview-media {
  flex: 0 0 auto;
  width: clamp(12rem, 50vw, 260px);
  max-width: 260px;
}

.about-preview-text {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
  align-items: center;
}

.about-preview-text ul {
  justify-content: center;
}

.about-preview-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 1.0625rem;
  line-height: 1.75;
}

.about-preview-photo-wrap {
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  aspect-ratio: 4 / 5;
  width: 100%;
}

@media (min-width: 768px) {
  .about-preview {
    flex-direction: row;
    gap: 2.5rem;
    align-items: center;
  }
  html[dir="rtl"] .about-preview {
    flex-direction: row-reverse;
  }
  .about-preview-text {
    text-align: right;
    align-items: flex-start;
  }
  html[dir="ltr"] .about-preview-text {
    text-align: left;
  }
  .about-preview-text ul {
    justify-content: flex-start;
  }
}

/* About page — bio: circular portrait left of text (not in hero) */
.about-page-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

html[dir="rtl"] .about-page-intro {
  flex-direction: column;
}

.about-page-portrait-wrap {
  flex: 0 0 auto;
  width: clamp(12rem, 50vw, 17rem);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0 0 0 1px var(--line),
    0 16px 40px rgba(15, 23, 42, 0.12);
  background: var(--bg-section-alt);
}

.about-page-intro-text {
  flex: 1 1 0;
  min-width: 0;
}

@media (min-width: 768px) {
  .about-page-intro {
    gap: 2.5rem;
    align-items: center;
  }

  .about-page-portrait-wrap {
    width: clamp(11rem, 22vw, 17rem);
  }
}

/* Cards */
.card-grid { display: grid; gap: 1.5rem; align-items: stretch; }
.card-grid--3 { grid-template-columns: 1fr; }
@media (min-width: 768px) { .card-grid--3 { grid-template-columns: repeat(3, 1fr); } }

.card-grid--activity { grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .card-grid--activity { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .card-grid--activity { grid-template-columns: repeat(3, 1fr); }
}

.preview-card, .card, .writing-card, .activity-card, .glass-card,
.value-card, .pub-card, .ach-preview-card {
  background: var(--glass-white-strong);
  backdrop-filter: blur(10px) saturate(1.15);
  -webkit-backdrop-filter: blur(10px) saturate(1.15);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255,255,255,0.85);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.preview-card:hover, .writing-card:hover, .activity-card:hover, .ach-preview-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.13), 0 0 0 1px rgba(13,148,136,0.1), inset 0 1px 0 rgba(255,255,255,0.9);
}

.preview-card, .ach-preview-card { display: flex; flex-direction: column; height: 100%; }

.preview-card--horizontal {
  display: grid;
  grid-template-columns: 1fr;
  height: 100%;
}

@media (min-width: 640px) {
  .preview-card--horizontal {
    grid-template-columns: 130px 1fr;
    align-items: stretch;
  }

  .preview-card--horizontal .preview-card-img {
    aspect-ratio: unset;
    height: 100%;
    min-height: 100%;
  }
}

.preview-card--horizontal .preview-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.preview-card-img {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  position: relative;
}

.preview-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.preview-card:hover .preview-card-img img { transform: scale(1.03); }

.preview-card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.preview-card-title {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
}

.preview-card-title a { color: inherit; text-decoration: none; }
.preview-card-title a:hover { color: var(--accent); }

.preview-card-text {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.preview-card-readmore {
  display: inline-block;
  margin-top: auto;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}
.preview-card-readmore:hover {
  color: var(--accent-dark);
}
.preview-card-readmore::after {
  content: ' ←';
  font-size: 0.75rem;
  display: inline-block;
}
[dir="ltr"] .preview-card-readmore::after {
  content: ' →';
}

.writing-cat {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.writing-cat--overlay {
  position: absolute;
  bottom: 0.5rem;
  inset-inline-start: 0.5rem;
  padding: 0.25rem 0.5rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius);
  color: var(--accent-dark);
}

.ach-preview-card { padding: 1.5rem; }

/* Media page — top band */
.media-top-band {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-bottom: 1px solid rgba(210, 190, 170, 0.45);
}

.media-band-visual {
  position: relative;
  width: 100%;
  min-height: clamp(17rem, 46vh, 27rem);
  overflow: hidden;
}

.media-band-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.media-band-img.is-active {
  opacity: 1;
}

.media-band-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    112deg,
    rgba(255, 252, 247, 0.98) 0%,
    rgba(255, 252, 247, 0.88) 30%,
    rgba(255, 252, 247, 0.4) 50%,
    rgba(13, 148, 136, 0.15) 75%,
    rgba(30, 45, 42, 0.35) 100%
  );
  pointer-events: none;
}

html[dir="ltr"] .media-band-shade {
  background: linear-gradient(
    -112deg,
    rgba(255, 252, 247, 0.98) 0%,
    rgba(255, 252, 247, 0.88) 30%,
    rgba(255, 252, 247, 0.4) 50%,
    rgba(13, 148, 136, 0.15) 75%,
    rgba(30, 45, 42, 0.35) 100%
  );
}

.media-band-content {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0.85rem 1.25rem clamp(2rem, 5vw, 3.25rem);
  pointer-events: none;
}

.media-band-content > * {
  pointer-events: auto;
}

@media (min-width: 640px) {
  .media-band-content { padding-inline: 2rem; }
}

.media-band-text {
  max-width: 36rem;
  padding: clamp(1.2rem, 3vw, 1.85rem) clamp(1.35rem, 3.5vw, 2rem);
  background: rgba(255, 252, 247, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-xl);
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.1);
  border-inline-start: 4px solid var(--accent);
}

html[dir="ltr"] .media-band-text {
  border-inline-start: none;
  border-inline-end: 4px solid var(--accent);
}

.media-band-breadcrumb-wrap {
  position: absolute;
  inset-inline: 0;
  top: 0;
  z-index: 2;
  padding: 0.85rem 1.25rem 0;
  pointer-events: none;
}

.media-band-breadcrumb-wrap > * {
  pointer-events: auto;
}

@media (min-width: 640px) {
  .media-band-breadcrumb-wrap { padding-inline: 2rem; }
}

.media-top-band .page-hero-deco {
  z-index: 1;
}

.media-band-label {
  color: var(--accent);
}

.media-band-title {
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(1.875rem, 5vw, 3rem);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.12;
  margin-top: 0.2rem;
}

.media-band-desc {
  color: var(--muted);
  font-size: clamp(0.9375rem, 2vw, 1.0625rem);
  margin-top: 0.5rem;
  max-width: 32rem;
  line-height: 1.65;
}

.media-band-rule {
  width: 3.25rem;
  height: 3px;
  margin-top: 1.1rem;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, rgba(13, 148, 136, 0.15) 100%);
}

.media-tabs-bar {
  display: flex;
  width: 100%;
  margin-bottom: 1.75rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.media-tabs-bar .media-tab {
  flex: 1 1 50%;
  margin: 0;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  border: none;
  border-radius: 0;
  border-inline-end: 1px solid var(--line);
  color: var(--muted);
  background: var(--paper);
  transition: color 0.25s ease, background 0.3s ease, box-shadow 0.25s ease;
}

.media-tabs-bar .media-tab:last-child { border-inline-end: none; }

.media-tabs-bar .media-tab:hover:not(.active) {
  color: var(--ink);
  background: var(--subtle);
}

.media-tabs-bar .media-tab.active {
  color: var(--accent-dark);
  font-weight: 700;
  background: var(--tab-active-sky);
  box-shadow:
    inset 0 0 0 2px rgba(13, 148, 136, 0.45),
    inset 0 -3px 0 var(--accent);
}

.media-page-content { padding-top: 2rem; }

/* Home — horizontal gallery marquee */
.gallery-marquee,
.gallery-marquee-track,
.gallery-marquee-strip {
  direction: ltr;
}

.gallery-marquee--home {
  margin-top: 1.5rem;
  max-width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.gallery-marquee {
  overflow: hidden;
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    #000 4%,
    #000 96%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    #000 4%,
    #000 96%,
    transparent 100%
  );
}

.gallery-marquee-track {
  display: flex;
  gap: 1rem;
  width: max-content;
  animation: gallery-marquee var(--marquee-duration, 70s) linear infinite;
  will-change: transform;
}

.gallery-marquee:hover .gallery-marquee-track {
  animation-play-state: paused;
}

.gallery-marquee-strip {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 1rem;
  padding-inline: 0.35rem;
}

.gallery-marquee-item {
  flex: 0 0 auto;
  width: 11.5rem;
  aspect-ratio: 1;
  overflow: hidden;
}

.gallery-marquee-item--wide {
  width: 18rem;
  aspect-ratio: 2 / 1;
}

.gallery-marquee-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes gallery-marquee {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(var(--marquee-shift, -50%), 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-marquee-track {
    animation: none;
    flex-wrap: wrap;
    width: 100%;
    justify-content: center;
    gap: 1rem;
  }

  .gallery-marquee-strip[aria-hidden="true"] { display: none; }

  .gallery-marquee {
    mask-image: none;
    -webkit-mask-image: none;
  }
}

/* Media */
button.media-item {
  padding: 0;
  font: inherit;
  color: inherit;
  background: none;
  cursor: pointer;
  width: 100%;
  text-align: inherit;
}

.media-item {
  position: relative;
  display: block;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
}

.media-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.media-item:hover img,
.media-item:focus-visible img {
  transform: scale(1.04);
}

.media-item:hover,
.media-item:focus-visible {
  box-shadow: var(--shadow-md);
}

.media-item-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.75rem;
  background: linear-gradient(
    180deg,
    rgba(26, 40, 38, 0.45) 0%,
    rgba(26, 40, 38, 0.15) 40%,
    rgba(26, 40, 38, 0.75) 100%
  );
  color: #fff;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.media-item:hover .media-item-overlay,
.media-item:focus-visible .media-item-overlay {
  opacity: 1;
}

.media-item-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-self: flex-start;
  text-align: start;
  max-width: 100%;
}

.media-item-date {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  opacity: 0.9;
}

.media-item-title {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.media-item-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  align-self: center;
  margin-block: auto 0.25rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  background: rgba(255, 252, 247, 0.18);
  backdrop-filter: blur(6px);
  font-size: 0.75rem;
  font-weight: 600;
}

.media-item-view .icon {
  width: 1.5rem;
  height: 1.5rem;
}

.icon--lg {
  width: 1.5rem;
  height: 1.5rem;
}

@media (min-width: 640px) {
  .media-item-title { font-size: 0.875rem; }
  .media-item-overlay { padding: 1rem; }
}

/* Media lightbox */
.media-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.media-lightbox.hidden { display: none; }

body.lightbox-open { overflow: hidden; }

.media-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 40, 38, 0.88);
  cursor: pointer;
}

.media-lightbox-dialog {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 56rem);
  max-height: 92vh;
  width: 100%;
  animation: ach-feature-in 0.3s ease;
}

.media-lightbox.is-video .media-lightbox-dialog {
  max-width: min(96vw, 64rem);
}

.media-lightbox-close {
  position: absolute;
  inset-block-start: -0.25rem;
  inset-inline-end: -0.25rem;
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

.media-lightbox-close:hover { background: var(--accent-soft); color: var(--accent-dark); }

.media-lightbox-figure { margin: 0; }

.media-lightbox-img {
  display: block;
  width: 100%;
  max-height: calc(92vh - 4rem);
  object-fit: contain;
  border-radius: var(--radius-lg);
  background: var(--ink);
}

.media-lightbox.is-video .media-lightbox-img {
  display: none;
}

.media-lightbox-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
}

.media-lightbox-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.media-lightbox-caption {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #fff;
  line-height: 1.5;
}

.tab-bar, .filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.media-tab, .filter-pill {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.media-tab.active, .filter-pill.active {
  color: var(--accent-dark);
  font-weight: 600;
  background: var(--tab-active-sky-soft);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(13, 148, 136, 0.2);
}

button.video-thumb {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  width: 100%;
  display: block;
}

.video-thumb {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.video-thumb:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.video-poster { width: 100%; height: 100%; object-fit: cover; }
.video-overlay {
  position: absolute;
  inset: 0;
  background: rgba(30, 41, 59, 0.25);
}

.video-badge {
  position: absolute;
  bottom: 0.5rem;
  inset-inline-start: 0.5rem;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border-radius: var(--radius);
}

.video-card-body {
  margin-top: 0.75rem;
}

.video-card-date {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.video-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}

/* CTA */
.home-cta {
  padding: 3rem 0 4rem;
  background: var(--bg-base);
}

.cta-banner {
  padding: clamp(0.75rem, 3vw, 1.85rem) clamp(0.75rem, 3.5vw, 2rem);
  background: var(--bg-cta);
  border: 1px solid rgba(200, 220, 210, 0.5);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
}

.cta-banner-title { font-size: 1.5rem; font-weight: 600; }
.cta-banner-desc { color: var(--muted); margin-top: 0.5rem; }
.cta-banner--compact .cta-banner-content { max-width: 36rem; }

@media (min-width: 768px) {
  .cta-banner:not(.cta-banner--compact),
  .cta-banner--with-visual {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    align-items: center;
  }
}

/* CTA — contact icon animation */
.cta-banner-visual {
  justify-self: center;
  margin-top: 1.25rem;
}

@media (min-width: 768px) {
  .cta-banner-visual {
    margin-top: 0;
  }

  .cta-banner--with-visual .cta-banner-visual {
    margin-top: 0;
  }
}

.cta-visual {
  display: grid;
  place-items: center;
  padding: 0.5rem;
}

.cta-visual--compact .cta-visual-anim {
  width: 8.5rem;
  height: 8.5rem;
}

.cta-visual-anim {
  position: relative;
  width: 11rem;
  height: 11rem;
}

.cta-visual-glow {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(13, 148, 136, 0.22) 0%, transparent 70%);
  animation: cta-glow 3.2s ease-in-out infinite;
}

.cta-visual-orbit {
  position: absolute;
  inset: 0;
  animation: cta-orbit-spin 14s linear infinite;
}

.cta-visual-orbit-item {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  margin: -1.175rem;
  color: var(--accent-dark);
  background: var(--paper);
  border: 1px solid rgba(13, 148, 136, 0.2);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transform: rotate(calc(var(--orbit-i) * 120deg)) translateY(-4.25rem) rotate(calc(var(--orbit-i) * -120deg));
}

.cta-visual--compact .cta-visual-orbit-item {
  width: 2rem;
  height: 2rem;
  margin: -1rem;
  transform: rotate(calc(var(--orbit-i) * 120deg)) translateY(-3.35rem) rotate(calc(var(--orbit-i) * -120deg));
}

.cta-visual-orbit-item .icon {
  width: 1.1rem;
  height: 1.1rem;
  stroke: currentColor;
  fill: none;
}

.cta-visual-orbit-item .icon--brand {
  fill: currentColor;
  stroke: none;
}

.cta-visual-core {
  position: absolute;
  inset: 22%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--accent) 0%, var(--accent-dark) 100%);
  border-radius: 50%;
  box-shadow: 0 10px 28px rgba(13, 148, 136, 0.35);
  animation: cta-core-float 3s ease-in-out infinite;
}

.icon--cta-main {
  width: 2.35rem;
  height: 2.35rem;
}

.cta-visual--compact .icon--cta-main {
  width: 1.9rem;
  height: 1.9rem;
}

@keyframes cta-orbit-spin {
  to { transform: rotate(360deg); }
}

@keyframes cta-core-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes cta-glow {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  .cta-visual-orbit,
  .cta-visual-core,
  .cta-visual-glow {
    animation: none;
  }
}

/* Inner pages */
.page-main { padding-top: var(--header-h); }

.page-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-bottom: 1px solid rgba(210, 190, 170, 0.45);
}

.page-hero-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.page-hero-backdrop--plain {
  background: var(--bg-hero);
}

.page-hero-backdrop-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
  display: block;
  transform: scale(1);
  transition: transform 10s ease-out;
}

.page-hero:hover .page-hero-backdrop-img {
  transform: scale(1.04);
}

@media (prefers-reduced-motion: reduce) {
  .page-hero-backdrop-img {
    transition: none;
  }
  .page-hero:hover .page-hero-backdrop-img {
    transform: none;
  }
}

.page-hero-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    112deg,
    rgba(255, 252, 247, 0.98) 0%,
    rgba(255, 252, 247, 0.9) 28%,
    rgba(255, 252, 247, 0.45) 48%,
    rgba(13, 148, 136, 0.12) 72%,
    rgba(30, 45, 42, 0.2) 100%
  );
}

html[dir="ltr"] .page-hero-shade {
  background: linear-gradient(
    -112deg,
    rgba(255, 252, 247, 0.98) 0%,
    rgba(255, 252, 247, 0.9) 28%,
    rgba(255, 252, 247, 0.45) 48%,
    rgba(13, 148, 136, 0.12) 72%,
    rgba(30, 45, 42, 0.2) 100%
  );
}

.page-hero-breadcrumb {
  position: relative;
  z-index: 2;
  padding: 0.85rem 0 0;
  border: none;
  background: transparent;
}

.page-hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 0.75rem 0 clamp(2rem, 5vw, 3.25rem);
}

.page-hero-card {
  max-width: 36rem;
  padding: clamp(0.75rem, 3vw, 1.85rem) clamp(0.75rem, 3.5vw, 2rem);
  background: rgba(255, 252, 247, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-xl);
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.1);
  border-inline-start: 4px solid var(--accent);
}

html[dir="ltr"] .page-hero-card {
  border-inline-start: none;
  border-inline-end: 4px solid var(--accent);
}

.page-hero-eyebrow {
  margin-bottom: 0.4rem;
}

.page-hero-title {
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(1.875rem, 5vw, 3rem);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 0.6rem;
  color: var(--ink);
}

.page-hero-desc {
  margin: 0;
  font-size: clamp(0.9375rem, 2vw, 1.0625rem);
  color: var(--muted);
  line-height: 1.65;
  max-width: 32rem;
}

.page-hero-rule {
  width: 4.5rem;
  height: 6px;
  margin-top: 1.5rem;
  background-color: transparent;
  background-image: radial-gradient(circle at center, var(--accent) 40%, transparent 50%);
  background-size: 12px 6px;
  background-repeat: space;
  background-position: center;
  opacity: 0.9;
}

.page-hero-deco {
  position: absolute;
  z-index: 1;
  inset-inline-end: clamp(1rem, 8vw, 5rem);
  inset-block-end: clamp(0.5rem, 8vw, 3rem);
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(4.5rem, 16vw, 10rem);
  line-height: 1;
  color: var(--accent);
  opacity: 0.1;
  pointer-events: none;
  user-select: none;
}

@media (min-width: 768px) {
  .page-hero-inner {
    display: flex;
    align-items: flex-end;
  }
}

.page-hero--with-photo .page-hero-backdrop-img {
  filter: blur(10px) saturate(1.05);
  transform: scale(1.08);
}

.page-hero--with-photo .page-hero-shade {
  background: linear-gradient(
    112deg,
    rgba(255, 252, 247, 0.96) 0%,
    rgba(255, 252, 247, 0.88) 40%,
    rgba(255, 252, 247, 0.55) 58%,
    rgba(13, 148, 136, 0.08) 100%
  );
}

html[dir="ltr"] .page-hero--with-photo .page-hero-shade {
  background: linear-gradient(
    -112deg,
    rgba(255, 252, 247, 0.96) 0%,
    rgba(255, 252, 247, 0.88) 40%,
    rgba(255, 252, 247, 0.55) 58%,
    rgba(13, 148, 136, 0.08) 100%
  );
}

.page-hero-inner--split {
  display: grid;
  gap: 1.75rem;
  align-items: end;
}

@media (min-width: 768px) {
  .page-hero-inner--split {
    grid-template-columns: 1fr min(300px, 36%);
    gap: 2.5rem;
  }
}

.page-hero-visual {
  order: -1;
  max-width: 280px;
  margin-inline: auto;
  width: 100%;
}

@media (min-width: 768px) {
  .page-hero-visual {
    order: unset;
    max-width: none;
    margin-inline: 0;
  }
}

.page-hero-photo-wrap {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.14);
}

.page-hero-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  display: block;
}

.page-hero--with-photo .page-hero-card {
  max-width: none;
}

@media (min-width: 768px) {
  .page-hero--with-photo:hover .page-hero-backdrop-img {
    transform: scale(1.1);
  }
}

/* Full-bleed photo hero (no portrait) — About page */
.page-hero--immersive {
  min-height: 80vh;
}

.page-hero--immersive .page-hero-backdrop-img {
  object-position: center 40%;
}

.page-hero--immersive .page-hero-shade,
html[dir="ltr"] .page-hero--immersive .page-hero-shade {
  background: linear-gradient(
    180deg,
    rgba(30, 45, 42, 0.2) 0%,
    rgba(30, 45, 42, 0.35) 35%,
    rgba(255, 252, 247, 0.6) 72%,
    rgba(255, 252, 247, 0.75) 100%
  );
}

.page-hero--immersive .page-hero-inner {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  flex: 1;
  min-height: 80vh;
  padding-top: 2.5rem;
}

.page-hero--immersive .page-hero-card {
  max-width: 40rem;
}

html[dir="ltr"] .page-hero--immersive .page-hero-card {
  margin-left: auto;
}

.page-breadcrumb {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  background: var(--bg-page-band);
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.8125rem;
}

.breadcrumb-list a { color: var(--muted); text-decoration: none; }
.breadcrumb-list a:hover { color: var(--accent); }
.breadcrumb-sep { color: var(--line); }
.breadcrumb-current { color: var(--ink); font-weight: 500; }

.page-section {
  padding: 3rem 0;
  background: var(--bg-section);
}

.page-section.section-alt {
  background: var(--bg-section-alt);
}

.page-container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: 0.75rem;
}

@media (min-width: 640px) { .page-container { padding-inline: 1.5rem; } }
@media (min-width: 1024px) { .page-container { padding-inline: 2rem; } }

.content-image {
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--line);
}

.writing-card {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  scroll-margin-top: calc(var(--header-h) + 1rem);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

@media (min-width: 640px) {
  .writing-card { grid-template-columns: 180px 1fr; }
}

.writing-card:target { outline: 2px solid var(--accent); outline-offset: 4px; }

.writing-card-thumb {
  aspect-ratio: 4/3;
  overflow: hidden;
  transition: aspect-ratio 0.4s ease, min-height 0.4s ease;
}

.writing-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.writing-card-content { padding: 1.25rem; }

.writing-title { font-size: 1.25rem; font-weight: 600; margin: 0.25rem 0; }
.writing-excerpt {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.writing-body {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
  line-height: 1.9;
  color: var(--ink);
  white-space: pre-line;
}

.writing-card.is-expanded {
  border-color: rgba(13, 148, 136, 0.35);
  box-shadow: var(--shadow-md);
  grid-template-columns: 1fr;
  gap: 0;
}

.writing-card.is-expanded .writing-card-thumb {
  aspect-ratio: 16/9;
  min-height: 12.5rem;
}

@media (min-width: 640px) {
  .writing-card.is-expanded .writing-card-thumb {
    min-height: 17.5rem;
    aspect-ratio: 2.15/1;
  }
}

@media (min-width: 1024px) {
  .writing-card.is-expanded .writing-card-thumb {
    min-height: 20rem;
    aspect-ratio: 2.35/1;
  }
}

.writing-card.is-expanded .writing-card-thumb img {
  transform: scale(1.04);
}

.writing-card.is-expanded .writing-excerpt {
  display: none;
}

.writing-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  margin-top: 0.75rem;
  display: inline-block;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

.writing-link:hover { text-decoration: underline; color: var(--accent-dark); }

.activity-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.activity-card-img { aspect-ratio: 16/9; overflow: hidden; flex-shrink: 0; }
.activity-card-img img { width: 100%; height: 100%; object-fit: cover; }

.activity-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.activity-card-body .meta-list { margin-top: auto; }

.card-body { padding: 1.25rem; }

.activities-status {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.95rem;
}

.activities-status--error {
  color: #9a4a4a;
}

.card-title { font-size: 1.125rem; font-weight: 600; }
.card-text {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Modal Styles */
.site-modal[open] {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  z-index: 99990;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius-xl);
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  position: relative;
  display: flex;
  flex-direction: column;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: none;
  background: var(--glass-white);
  backdrop-filter: blur(4px);
  color: var(--ink);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--glass-white-strong);
  transform: scale(1.05);
}

.modal-img {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

.modal-body {
  padding: 1.5rem 2rem;
  overflow-y: auto;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0.5rem 0 1rem;
}

.modal-text {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--muted);
  white-space: pre-line;
}

.modal-meta {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  .site-modal { width: 95%; max-height: 90vh; }
  .modal-img { height: 200px; }
  .modal-body { padding: 1.25rem 1rem; }
  .modal-title { font-size: 1.25rem; }
  .modal-close { top: 0.5rem; right: 0.5rem; width: 2rem; height: 2rem; font-size: 1.25rem; }
}

.meta-list { font-size: 0.85rem; margin-top: 0.75rem; }
.meta-list div { display: flex; gap: 0.5rem; margin-top: 0.25rem; }
.meta-list dt { color: var(--muted); }
.meta-list dd { font-weight: 500; }

.value-grid {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

@media (min-width: 768px) { .value-grid { grid-template-columns: repeat(3, 1fr); } }

.value-card { padding: 1.5rem; }
.value-card-title { font-size: 1.0625rem; font-weight: 600; }
.value-card-text { font-size: 0.9rem; color: var(--muted); margin-top: 0.35rem; }

.icon { width: 1.25rem; height: 1.25rem; }
.icon--sm { width: 1rem; height: 1rem; }

.icon--brand {
  fill: currentColor;
  stroke: none;
}

.icon-box {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
}

.contact-form-wrap {
  padding: clamp(0.75rem, 3vw, 1.85rem) clamp(0.75rem, 3.5vw, 2rem);
  background: var(--bg-form);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
}

@media (max-width: 639px) {
  .contact-form-wrap, .info-panel, .page-hero-card, .cta-banner, .footer-panel, .ach-card,
  .writing-card, .activity-card, .preview-card, .pub-card {
    margin-inline: calc(-0.75rem + 7px);
    border-radius: var(--radius-lg);
  }
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.form-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 0.9375rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  margin-bottom: 0.25rem;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.form-status { font-size: 0.875rem; margin-top: 0.5rem; }
.form-status.is-error { color: #DC2626; }
.form-status.is-success { color: var(--accent-dark); }

.info-panel {
  padding: clamp(0.75rem, 3vw, 1.85rem) clamp(0.75rem, 3.5vw, 2rem);
  background: var(--bg-form);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
}

.info-panel-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.75rem; }
.info-panel-sub { font-size: 0.875rem; font-weight: 600; margin-bottom: 0.5rem; }
.info-card-label { font-size: 0.75rem; color: var(--muted); }
.info-card-value { font-weight: 600; color: var(--accent); text-decoration: none; display: block; margin-top: 0.15rem; word-break: break-all; }
.info-card-note { font-size: 0.8125rem; color: var(--muted); margin-top: 0.5rem; }

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.social-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* We use border on each timeline-item to form the continuous line */
.timeline-line {
  display: none !important;
}

.cv-timeline {
  position: relative;
  /* Removed container border */
}

.timeline-item { 
  position: relative; 
  padding-right: 1.75rem; 
  padding-bottom: 1.5rem; 
  border-right: 2px solid var(--accent); /* This forms the continuous line! */
}

/* Optional: if we don't want the line to continue after the last dot */
.timeline-item--last,
.timeline-item:last-child {
  border-right-color: transparent;
}

.ach-item {
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

.timeline-dot {
  position: absolute;
  right: -7px; /* Adjusted offset */
  top: 0.4rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--paper);
  z-index: 1;
  box-sizing: border-box;
}

.timeline-card { padding: 1.25rem; }

.timeline-item--last { padding-bottom: 0; }

/* Achievement — expandable cards */
.ach-card.timeline-card { padding: 0; }

.ach-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  text-align: inherit;
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  transition: border-color 0.35s ease, box-shadow 0.35s ease, background 0.35s ease;
}

.ach-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.ach-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ach-card.is-expanded {
  border-color: var(--accent);
  background: var(--bg-section);
  box-shadow: var(--shadow-md);
}

.ach-card-feature {
  display: grid;
  grid-template-rows: 0fr;
  width: 100%;
  overflow: hidden;
  transition: grid-template-rows 0.5s cubic-bezier(0.33, 1, 0.68, 1);
}

.ach-card.is-expanded .ach-card-feature {
  grid-template-rows: 1fr;
}

.ach-card-feature-inner {
  min-height: 0;
  display: flex;
  justify-content: center;
  padding: 0 1.25rem;
  opacity: 0;
  transform: translateY(-10px) scale(0.98);
  transition:
    opacity 0.45s ease 0.06s,
    transform 0.5s cubic-bezier(0.33, 1, 0.68, 1) 0.04s,
    padding 0.5s cubic-bezier(0.33, 1, 0.68, 1);
}

.ach-card.is-expanded .ach-card-feature-inner {
  opacity: 1;
  transform: translateY(0) scale(1);
  padding: 0.75rem 1rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 12rem;
  aspect-ratio: 16 / 10;
  background: var(--subtle);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .ach-card.is-expanded .ach-card-feature-inner {
    min-height: 14rem;
    aspect-ratio: 2.1 / 1;
    padding: 1rem 1.25rem 0;
  }
}

@media (min-width: 1024px) {
  .ach-card.is-expanded .ach-card-feature-inner {
    min-height: 17rem;
    aspect-ratio: 2.25 / 1;
  }
}

.ach-card-feature-img {
  width: min(100%, 14rem);
  height: min(14rem, 42vw);
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 2px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: width 0.45s ease, height 0.45s ease, max-height 0.45s ease, object-fit 0.35s ease;
}

.ach-card.is-expanded .ach-card-feature-img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  background: transparent;
}

.ach-card-layout {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  padding: 1.25rem;
}

.ach-card.is-expanded .ach-card-layout {
  padding: 0 1.25rem 1.25rem;
  gap: 0;
  flex-direction: column;
  align-items: stretch;
  transition: padding 0.45s ease, gap 0.45s ease;
}

@media (min-width: 640px) {
  .ach-card:not(.is-expanded) .ach-card-layout {
    flex-direction: row;
    align-items: flex-start;
  }
}

.ach-card-thumb {
  width: 6rem;
  height: 6rem;
  max-width: 6rem;
  max-height: 6rem;
  border-radius: var(--radius-lg);
  object-fit: cover;
  border: 2px solid var(--line);
  flex-shrink: 0;
  opacity: 1;
  transition:
    opacity 0.35s ease,
    max-width 0.45s cubic-bezier(0.33, 1, 0.68, 1),
    max-height 0.45s cubic-bezier(0.33, 1, 0.68, 1),
    width 0.45s cubic-bezier(0.33, 1, 0.68, 1),
    height 0.45s cubic-bezier(0.33, 1, 0.68, 1),
    margin 0.45s ease,
    border-width 0.35s ease;
}

.ach-card.is-expanded .ach-card-thumb {
  opacity: 0;
  width: 0;
  height: 0;
  max-width: 0;
  max-height: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border-width: 0;
  overflow: hidden;
  pointer-events: none;
}

.ach-card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  flex: 1;
  min-width: 0;
}

.ach-card-title {
  display: block;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}

.ach-card-summary {
  display: block;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--muted);
  margin-top: 0.15rem;
}

.ach-card-detail {
  display: grid;
  grid-template-rows: 0fr;
  width: 100%;
  overflow: hidden;
  margin-top: 0;
  transition: grid-template-rows 0.5s cubic-bezier(0.33, 1, 0.68, 1) 0.1s;
}

.ach-card.is-expanded .ach-card-detail {
  grid-template-rows: 1fr;
  margin-top: 0.5rem;
}

.ach-card-detail-inner {
  min-height: 0;
  overflow: hidden;
  display: block;
  font-size: 0.875rem;
  line-height: 1.75;
  color: var(--ink);
  padding-top: 0;
  border-top: 1px dashed transparent;
  opacity: 0;
  transform: translateY(-6px);
  transition:
    opacity 0.4s ease 0.15s,
    transform 0.45s cubic-bezier(0.33, 1, 0.68, 1) 0.12s,
    padding 0.45s ease 0.1s,
    border-color 0.35s ease 0.12s;
}

.ach-card.is-expanded .ach-card-detail-inner {
  opacity: 1;
  transform: translateY(0);
  padding-top: 0.75rem;
  border-top-color: var(--line);
}

.ach-card-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent-dark);
}

.ach-hint-more,
.ach-hint-less {
  transition: opacity 0.25s ease;
}

.ach-card.is-expanded .ach-hint-more {
  display: none;
  opacity: 0;
}

.ach-card.is-expanded .ach-hint-less {
  display: inline;
  opacity: 1;
}

.ach-card:not(.is-expanded) .ach-hint-less {
  display: none;
  opacity: 0;
}

.ach-card-action::after {
  content: '';
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  border-inline-end: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s;
  margin-inline-start: 0.15rem;
}

[dir="rtl"] .ach-card-action::after { transform: rotate(-135deg); }

.ach-card.is-expanded .ach-card-action::after {
  transform: rotate(-135deg);
}

[dir="rtl"] .ach-card.is-expanded .ach-card-action::after {
  transform: rotate(45deg);
}

.ach-hint-global { max-width: 36rem; }

@media (prefers-reduced-motion: reduce) {
  .ach-card,
  .ach-card-feature,
  .ach-card-feature-inner,
  .ach-card-detail,
  .ach-card-detail-inner,
  .ach-card-thumb,
  .ach-hint-more,
  .ach-hint-less {
    transition: none;
  }
}

/* About — CV blocks */
.cv-layout {
  display: grid;
  gap: 2.5rem;
  margin-top: 0.5rem;
}

@media (min-width: 1024px) {
  .cv-layout { grid-template-columns: 1fr 1fr; gap: 3rem; }
}

.cv-block-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 1.25rem;
}

.cv-block-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--accent);
}

.cv-entry { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); }

.cv-period {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent-dark);
  background: var(--accent-soft);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.cv-entry-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}

.cv-entry-org {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
}

.cv-entry-desc {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--muted);
}

.cv-extras {
  display: grid;
  gap: 1.25rem;
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
}

@media (min-width: 768px) {
  .cv-extras { grid-template-columns: 1fr 1fr; }
  .cv-extra-card--wide { grid-column: 1 / -1; }
}

.cv-extra-card {
  padding: 1.25rem 1.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.cv-extra-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 1rem;
}

.cv-skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.cv-lang-list,
.cv-members-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cv-lang-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.cv-lang-list li:last-child { padding-bottom: 0; border-bottom: none; }

.cv-lang-name { font-weight: 600; color: var(--ink); }

.cv-lang-level { font-size: 0.875rem; color: var(--muted); }

.cv-members-list li {
  position: relative;
  padding-inline-start: 1rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--muted);
}

.cv-members-list li::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 0.55em;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: var(--accent);
}

.publications-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .publications-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.publications-grid--home {
  margin-top: 0.5rem;
}

#publications {
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
}

.home-section-cta {
  display: flex;
  justify-content: center;
  margin-top: 1.75rem;
}

.pub-card { display: grid; }
@media (min-width: 640px) { .pub-card { grid-template-columns: 100px 1fr; } }
a.pub-card {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
a.pub-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}
a.pub-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.pub-card-img { aspect-ratio: 3/4; overflow: hidden; }
.pub-card-img img { width: 100%; height: 100%; object-fit: cover; }
.pub-card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.pub-card-title { font-size: 1rem; font-weight: 600; }
.pub-card-desc {
  font-size: 0.8125rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pub-card-action {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent-dark);
}
a.pub-card:hover .pub-card-action { text-decoration: underline; }

.page-stats {
  padding: 1.5rem 0;
  background: var(--bg-stats);
}

.page-related {
  padding: 2.5rem 0;
  background: var(--bg-section-alt);
}

.page-cta-band {
  padding: 2rem 0 3rem;
  background: var(--bg-base);
}
.related-title { font-size: 1.125rem; font-weight: 600; margin-bottom: 1rem; }
.related-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.related-link {
  padding: 0.4rem 0.85rem;
  font-size: 0.875rem;
  color: var(--accent);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
}

.related-link:hover { background: var(--accent-soft); border-color: var(--accent); }

/* Footer — editorial panel */
.site-footer {
  margin-top: auto;
  padding: 2.5rem 0 2rem;
  background: var(--bg-base);
}

.footer-shell {
  max-width: 72rem;
}

.footer-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(13, 148, 136, 0.12);
  border-radius: 1.25rem;
  background: var(--paper);
  box-shadow: 0 18px 40px rgba(30, 41, 59, 0.06);
}

.footer-accent {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent) 0%, #5EEAD4 55%, var(--accent-dark) 100%);
}

.footer-panel-body {
  padding: 2rem clamp(0.75rem, 3vw, 1.85rem) 1.35rem;
}

@media (min-width: 768px) {
  .footer-panel-body {
    padding: 2.25rem 2.25rem 1.5rem;
  }
}

.footer-layout {
  display: grid;
  gap: 2rem;
}

@media (min-width: 900px) {
  .footer-layout {
    grid-template-columns: 1.15fr 1fr 0.95fr;
    gap: 2.5rem;
    align-items: start;
  }

  .footer-menu,
  .footer-connect {
    padding-inline-start: 2rem;
    border-inline-start: 1px solid var(--line);
  }
}

.footer-logo {
  display: inline-block;
  font-size: 1.625rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  color: var(--ink);
  transition: color 0.2s ease;
}

.footer-logo:hover {
  color: var(--accent-dark);
}

.footer-role {
  margin: 0.4rem 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.footer-motto {
  margin: 1.1rem 0 0;
  padding: 0.75rem 0 0;
  border-top: 1px dashed var(--line);
  font-family: 'Lora', Georgia, serif;
  font-size: 0.9375rem;
  font-style: italic;
  line-height: 1.65;
  color: var(--accent-dark);
}

.footer-label {
  margin: 0 0 0.9rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

.footer-menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-menu-list a {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  background: var(--subtle);
  border: 1px solid transparent;
  border-radius: 999px;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.footer-menu-list a:hover {
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-color: rgba(13, 148, 136, 0.2);
}

.footer-mail {
  display: inline-block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  word-break: break-all;
  transition: color 0.2s ease;
}

.footer-mail:hover {
  color: var(--accent-dark);
}

.footer-mail-note {
  margin: 0.45rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--muted);
}

.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.15rem;
}

.footer-social-btn {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  color: var(--accent-dark);
  background: var(--accent-soft);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.footer-social-btn .icon,
.social-link .icon--brand {
  width: 1.15rem;
  height: 1.15rem;
}

.footer-social-btn:hover {
  color: #fff;
  background: var(--accent);
  transform: translateY(-2px);
}

.footer-divider {
  height: 1px;
  margin: 1.75rem 0 1.15rem;
  background: linear-gradient(
    to right,
    transparent,
    var(--line) 15%,
    var(--line) 85%,
    transparent
  );
}

.footer-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem 1.5rem;
}

.footer-copy {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.5;
}

.footer-bar-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent-dark);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-bar-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.site-toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--ink);
  color: #fff;
  font-size: 0.875rem;
  border-radius: var(--radius);
  opacity: 0;
  transition: transform 0.25s, opacity 0.25s;
}

.site-toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Site loader */
html.is-loading,
html.is-loading body {
  overflow: hidden;
}

.site-loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-base);
  background-image:
    radial-gradient(ellipse 90% 60% at 0% 0%, rgba(255, 248, 240, 0.95) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 30%, rgba(220, 238, 232, 0.5) 0%, transparent 50%);
  opacity: 1;
  visibility: visible;
}

.site-loader.is-hiding {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.site-loader-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
}

.site-loader-photo-wrap {
  width: 9.5rem;
  height: 9.5rem;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(13, 148, 136, 0.12);
  animation: site-loader-pulse 2s ease-in-out infinite;
}

.site-loader-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.site-loader-brand {
  margin: 0;
  font-size: 1.35rem;
  color: var(--ink);
  letter-spacing: 0.02em;
}

@keyframes site-loader-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

@media (prefers-reduced-motion: reduce) {
  .site-loader-photo-wrap { animation: none; }
  .site-loader { transition-duration: 0.2s; }
}

/* JS toggle (mobile menu, tabs, filters) — do not use !important; it breaks Tailwind lg:/md: utilities */
.hidden { display: none; }
.text-muted { color: var(--muted); }
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.footer-menu-list a:hover {
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-color: rgba(13, 148, 136, 0.2);
}

.footer-mail {
  display: inline-block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  word-break: break-all;
  transition: color 0.2s ease;
}

.footer-mail:hover {
  color: var(--accent-dark);
}

.footer-mail-note {
  margin: 0.45rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--muted);
}

.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.15rem;
}

.footer-social-btn {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  color: var(--accent-dark);
  background: var(--accent-soft);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.footer-social-btn .icon,
.social-link .icon--brand {
  width: 1.15rem;
  height: 1.15rem;
}

.footer-social-btn:hover {
  color: #fff;
  background: var(--accent);
  transform: translateY(-2px);
}

.footer-divider {
  height: 1px;
  margin: 1.75rem 0 1.15rem;
  background: linear-gradient(
    to right,
    transparent,
    var(--line) 15%,
    var(--line) 85%,
    transparent
  );
}

.footer-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem 1.5rem;
}

.footer-copy {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.5;
}

.footer-bar-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent-dark);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-bar-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.site-toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--ink);
  color: #fff;
  font-size: 0.875rem;
  border-radius: var(--radius);
  opacity: 0;
  transition: transform 0.25s, opacity 0.25s;
}

.site-toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Site loader */
html.is-loading,
html.is-loading body {
  overflow: hidden;
}

.site-loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-base);
  background-image:
    radial-gradient(ellipse 90% 60% at 0% 0%, rgba(255, 248, 240, 0.95) 0%, transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 30%, rgba(220, 238, 232, 0.5) 0%, transparent 50%);
  opacity: 1;
  visibility: visible;
}

.site-loader.is-hiding {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.site-loader-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
}

.site-loader-photo-wrap {
  width: 9.5rem;
  height: 9.5rem;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(13, 148, 136, 0.12);
  animation: site-loader-pulse 2s ease-in-out infinite;
}

.site-loader-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.site-loader-brand {
  margin: 0;
  font-size: 1.35rem;
  color: var(--ink);
  letter-spacing: 0.02em;
}

@keyframes site-loader-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

@media (prefers-reduced-motion: reduce) {
  .site-loader-photo-wrap { animation: none; }
  .site-loader { transition-duration: 0.2s; }
}

/* JS toggle (mobile menu, tabs, filters) — do not use !important; it breaks Tailwind lg:/md: utilities */
.hidden { display: none; }
.text-muted { color: var(--muted); }
.relative { position: relative; }

/* Hide old decorative elements */
.hero-blob, .hero-photo-ring, .hero-photo-stage, .hero-quote-mark,
.brand-initial, .brand-mark, .celestial-glow { display: none !important; }
/* Donate button in header - enhanced styling */
.donate-header-btn {
  display: none;
  background: linear-gradient(45deg, #ff6b6b, #ff8a5b);
  color: #fff;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  text-decoration: none;
  transition: background 0.25s ease, transform 0.1s ease;
  box-shadow: 0 4px 6px rgba(0,0,0,0.12);
  cursor: pointer;
}
.donate-header-btn:hover {
  background: linear-gradient(45deg, #e55a5a, #ff7a4a);
  transform: translateY(-2px);
}
.header-actions .donate-header-btn { margin-right: 0.5rem; }

@media (min-width: 640px) {
  .donate-header-btn {
    display: inline-block;
  }
}

/* Custom Fast Tooltip */
.fast-tooltip {
  position: relative;
}
.fast-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  padding: 4px 8px;
  font-size: 0.75rem;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.1s ease-in, transform 0.1s ease-in;
  z-index: 100;
  margin-bottom: 6px;
}
.fast-tooltip:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* --- DARK MODE & ANIMATIONS --- */
html.dark {
  --bg-base: #0F172A;
  --bg-hero: linear-gradient(145deg, #1E293B 0%, #0F172A 35%, #020617 100%);
  --bg-stats: linear-gradient(160deg, #1E293B 0%, #0F172A 50%, #020617 100%);
  --bg-section: #0B1120;
  --bg-section-alt: #101827;
  --bg-cta: linear-gradient(135deg, #1E293B 0%, #0F172A 50%, #020617 100%);
  --bg-footer: #020617;
  --bg-footer-bar: #0F172A;
  --bg-page-hero: linear-gradient(180deg, rgba(15,23,42,0.98) 0%, rgba(2,6,23,0.95) 100%);
  --bg-page-band: #1E293B;
  --bg-form: #0F172A;

  --glass-white: rgba(30, 41, 59, 0.62);
  --glass-white-strong: rgba(30, 41, 59, 0.82);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-border-subtle: rgba(255, 255, 255, 0.05);

  --paper: #1E293B;
  --subtle: #334155;
  --surface: #0F172A;
  --ink: #F8FAFC;
  --muted: #94A3B8;
  --line: #334155;
  
  --color-bg: #0F172A;
  --color-text: #F8FAFC;
  --color-card-bg: rgba(30, 41, 59, 0.85);
}

/* Animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Filtering Fade */
.writing-card.hidden {
  display: none !important;
}

/* Dark Mode fixes for hero cards */
html.dark .page-hero-card,
html.dark .hero-quote {
  background: rgba(30, 41, 59, 0.85) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3) !important;
}

/* Dark mode fixes for orbs and photo borders */
html.dark .home-hero::before {
  background: radial-gradient(circle, rgba(13, 148, 136, 0.15) 0%, rgba(13, 148, 136, 0) 70%) !important;
}
html.dark .home-hero::after {
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, rgba(99, 102, 241, 0) 70%) !important;
}
html.dark .hero-photo-wrap,
html.dark .page-hero-photo-wrap {
  border-color: rgba(30, 41, 59, 0.8) !important;
}

/* Dark Mode fixes for navbar */
html.dark .header-bar {
  background: rgba(15, 23, 42, 0.78) !important;
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}
html.dark #header.scrolled .header-bar {
  background: rgba(15, 23, 42, 0.88) !important;
  border-bottom-color: rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4) !important;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(13, 148, 136, 0.3);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(13, 148, 136, 0.6);
}

/* --- Reading Progress Bar --- */
.reading-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 9999;
  pointer-events: none;
}
.reading-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, var(--accent), #14b8a6);
  transition: width 0.1s ease-out;
}
html[dir="rtl"] .reading-progress-bar {
  background: linear-gradient(to left, var(--accent), #14b8a6);
}

/* --- Custom Cursor --- */
@media (pointer: fine) {

  .custom-cursor-dot {
    position: fixed;
    top: 0; left: 0;
    width: 8px; height: 8px;
    background-color: var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 999999;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
  }
  .custom-cursor-outline {
    position: fixed;
    top: 0; left: 0;
    width: 40px; height: 40px;
    border: 1px solid var(--accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 999998;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background-color 0.2s, border-color 0.2s;
  }
  .custom-cursor-dot.hover {
    width: 12px; height: 12px;
    background-color: var(--accent-light);
  }
  .custom-cursor-outline.hover {
    width: 60px; height: 60px;
    background-color: rgba(13, 148, 136, 0.1);
    border-color: transparent;
  }
}

/* --- 3D Tilt Card Base --- */
.tilt-card {
  transform-style: preserve-3d;
  transform: perspective(1000px);
  transition: transform 0.1s ease;
  will-change: transform;
}
.tilt-card.tilt-active {
  transition: none;
}
/* Glare effect inside tilt card */
.tilt-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 60%);
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 10;
  mix-blend-mode: overlay;
}
.tilt-card.tilt-active::before {
  opacity: 1;
}

/* Base styles for search modal */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 2rem;
}
.search-modal.is-active {
  opacity: 1;
  visibility: visible;
}
.search-modal-close {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0.5rem;
}
.search-modal-close:hover {
  color: var(--ink);
}
.search-container {
  max-width: 600px;
  width: 100%;
  margin: 4rem auto 0;
}
.search-input-wrap {
  position: relative;
  margin-bottom: 2rem;
}
.search-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--line);
  padding: 1rem 0;
  font-size: 1.5rem;
  color: #F8FAFC;
  outline: none;
  font-family: inherit;
}
.search-input:focus {
  border-color: var(--accent);
}
.search-results {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 60vh;
  overflow-y: auto;
}
.search-result-item {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-md);
  color: #F8FAFC;
  text-decoration: none;
  transition: background 0.2s ease;
}
.search-result-item:hover {
  background: rgba(255, 255, 255, 0.1);
}
.search-result-title {
  font-weight: bold;
  margin-bottom: 0.25rem;
}
.search-result-desc {
  font-size: 0.875rem;
  color: var(--muted);
}
html[dir="rtl"] .search-modal-close {
  right: auto;
  left: 2rem;
}

/* --- Interactive Timeline Animations --- */
.timeline-item {
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.5s ease-out, transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
html[dir="rtl"] .timeline-item {
  transform: translateX(20px);
}
.timeline-item.is-visible {
  opacity: 1;
  transform: translateX(0);
}
.timeline-dot {
  transform: scale(0);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.timeline-item.is-visible .timeline-dot {
  transform: scale(1);
}
.timeline-line {
  
  
  
}


}

.footer-credit-container { position: relative; display: inline-block; cursor: pointer; }
.footer-email-tooltip { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(10px); background-color: var(--accent); color: #fff; padding: 0.4rem 0.8rem; border-radius: 0.5rem; font-size: 0.85rem; font-family: sans-serif; white-space: nowrap; opacity: 0; visibility: hidden; transition: all 0.3s ease; box-shadow: 0 4px 12px rgba(0,0,0,0.15); pointer-events: none; z-index: 10; }
.footer-email-tooltip::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border-width: 5px; border-style: solid; border-color: var(--accent) transparent transparent transparent; }
.footer-credit-container:hover .footer-email-tooltip { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(-5px); }
