:root {
    --green-950: #06130e;
    --hero-left: #002712;
    --hero-right: #14311d;
    --green-900: #0a1b13;
    --green-850: #0c2117;
    --green-800: #10281c;
    --green-700: #163524;
    --gold: #c9a962;
    --gold-soft: #d8c48a;
    --gold-deep: #a8883e;
    --cream: #f3ead6;
    --ivory: #faf7f0;
    --paper: #f6f2ea;
    --ink: #1a1814;
    --muted: #6d675c;
    --line: rgba(201, 169, 98, 0.35);
    --shadow: 0 24px 60px rgba(6, 19, 14, 0.18);
    --header-h: 96px;
    --max: 1180px;
    --serif: "Cormorant Garamond", "Times New Roman", serif;
    --display: "Cinzel", "Cormorant Garamond", serif;
    --sans: "Outfit", "Helvetica Neue", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--ivory);
    font-family: var(--sans);
    font-weight: 400;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, select, input, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 0.6em; }
p { margin: 0 0 1em; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    background: var(--cream);
    color: var(--green-900);
    padding: 0.6rem 1rem;
    z-index: 100;
}
.skip-link:focus { top: 1rem; }

.container {
    width: min(var(--max), calc(100% - 3rem));
    margin-inline: auto;
}

.eyebrow {
    margin: 0 0 1rem;
    color: var(--gold);
    font-family: var(--display);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.32em;
    text-transform: uppercase;
}

.section,
.quote-section,
.cta-section { scroll-margin-top: var(--header-h); }
.section { padding: 6.5rem 0; }

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 3.2rem;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid rgba(26, 24, 20, 0.1);
}
.section-head.light { border-color: rgba(243, 234, 214, 0.12); }
.section-head .eyebrow { margin: 0; }

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--gold-soft);
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}
.text-link.dark { color: var(--ink); }
.text-link:hover { color: var(--gold); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 48px;
    padding: 0.75rem 1.45rem;
    border: 1px solid transparent;
    border-radius: 5px;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    transition: 0.25s ease;
    cursor: pointer;
    background: none;
}
.btn-cream { background: var(--gold-soft); color: var(--green-900); }
.btn-cream:hover { background: var(--gold); }
.btn-gold { background: var(--gold-soft); color: var(--green-950); }
.btn-ghost {
    color: var(--gold-soft);
    background: transparent;
    border-color: var(--gold-soft);
}
.btn-ghost:hover { color: var(--gold); border-color: var(--gold); background: transparent; }
.btn-outline {
    color: var(--ink);
    border-color: rgba(26, 24, 20, 0.18);
}
.btn-outline:hover { border-color: var(--ink); }

/* Header */
.site-header {
    position: absolute;
    inset: 0 0 auto;
    z-index: 40;
    color: var(--cream);
}
.site-header.is-solid {
    position: sticky;
    top: 0;
    background: rgba(6, 19, 14, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(201, 169, 98, 0.12);
}
body:not(.is-home) .site-header {
    position: sticky;
    top: 0;
    background: rgba(6, 19, 14, 0.96);
    border-bottom: 1px solid rgba(201, 169, 98, 0.12);
}
.header-inner {
    width: min(1280px, calc(100% - 2.4rem));
    margin: 0 auto;
    min-height: var(--header-h);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1.5rem;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    color: var(--gold);
}
.brand-mark { width: 72px; height: 72px; flex: 0 0 auto; }
.brand-logo {
    display: block;
    width: 72px;
    height: 72px;
    background-color: var(--gold);
    -webkit-mask-image: url("../img/APRMM-Logo-Black.png");
    mask-image: url("../img/APRMM-Logo-Black.png");
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}
.emblem { width: 100%; height: 100%; display: block; }
.brand-text { display: flex; flex-direction: column; gap: 0.15rem; }
.brand-sigla {
    font-family: var(--display);
    font-size: 0.92rem;
    letter-spacing: 0.22em;
    color: var(--gold-soft);
}
.brand-sub {
    font-size: 0.58rem;
    line-height: 1.35;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(243, 234, 214, 0.72);
}
.nav-list {
    display: flex;
    justify-content: center;
    gap: 1.35rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-link {
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(243, 234, 214, 0.78);
}
.nav-link:hover,
.nav-link.is-active { color: var(--gold-soft); }
.nav-shop {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--gold);
    color: var(--gold-soft);
    padding: 0.4rem 0.7rem;
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
}
.nav-shop:hover { background: rgba(201, 169, 98, 0.14); color: var(--cream); }
.header-tools { display: flex; align-items: center; gap: 0.55rem; }
.icon-btn {
    width: 38px;
    height: 38px;
    border: 0;
    background: none;
    color: var(--cream);
    display: grid;
    place-items: center;
    cursor: pointer;
}
.lang-select {
    appearance: none;
    background: transparent;
    border: 0;
    color: var(--cream);
    letter-spacing: 0.16em;
    padding: 0.3rem 1rem 0.3rem 0.2rem;
    background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position: calc(100% - 8px) 14px, calc(100% - 3px) 14px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}
.lang-select option { color: var(--ink); }
.menu-toggle {
    display: none;
    width: 38px;
    height: 38px;
    border: 0;
    background: none;
    padding: 8px;
    cursor: pointer;
}
.menu-toggle span {
    display: block;
    height: 1px;
    margin: 5px 0;
    background: var(--cream);
}

/* Hero */
.hero {
    position: relative;
    min-height: 95vh;
    display: flex;
    align-items: flex-end;
    color: var(--cream);
    background: var(--hero-left);
    overflow: hidden;
}
.hero-media {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            90deg,
            var(--hero-left) 0%,
            var(--hero-left) 28%,
            color-mix(in srgb, var(--hero-left) 62%, transparent) 46%,
            color-mix(in srgb, var(--hero-right) 42%, transparent) 70%,
            color-mix(in srgb, var(--hero-right) 35%, transparent) 100%
        ),
        url("../img/01_hero_temple.png") right center / auto 100% no-repeat;
}
.page-hero-media {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0, 39, 18, 0.35), rgba(0, 39, 18, 0.78)),
        url("../img/01_hero_temple.png") center 40%/cover no-repeat;
}
.quote-media {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(6, 19, 14, 0.12) 0%, rgba(6, 19, 14, 0.55) 46%, rgba(6, 19, 14, 0.94) 70%),
        url("../img/quote.jpg") 8% 12%/cover no-repeat;
}
.hero-inner {
    position: relative;
    z-index: 1;
    padding: 8.5rem 0 4.2rem;
}
.hero-copy { max-width: 740px; }
.hero h1 {
    font-size: clamp(2.5rem, 5.2vw, 4.7rem);
    font-weight: 500;
    letter-spacing: 0.04em;
    line-height: 1.05;
    text-transform: uppercase;
    color: #f6f0e3;
    margin-bottom: 1.15rem;
}
.hero-kicker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 2rem;
    color: var(--gold);
    font-family: var(--display);
    font-size: 0.72rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
}
.hero-kicker .sep {
    letter-spacing: 0;
    text-transform: none;
    font-size: 0.95em;
    line-height: 1;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-bottom: 3.2rem; }
.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.8rem 2.4rem;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(243, 234, 214, 0.82);
}
.hero-stats li { display: flex; align-items: center; gap: 0.65rem; }
.stat-icon { width: 18px; height: 18px; color: var(--gold); }

/* Lineage */
.lineage-section {
    position: relative;
    overflow: hidden;
    background-color: #f6f1e6;
    padding: 4.5rem 0 6.5rem;
}
.lineage-section::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 52%;
    background: url("../img/pyramids-parchment.png") no-repeat 82% 62%;
    background-size: cover;
    -webkit-mask-image:
        linear-gradient(180deg, transparent 0%, #000 46%),
        linear-gradient(90deg, transparent 0%, #000 32%);
    -webkit-mask-composite: source-in;
    mask-image:
        linear-gradient(180deg, transparent 0%, #000 46%),
        linear-gradient(90deg, transparent 0%, #000 32%);
    mask-composite: intersect;
    pointer-events: none;
}
.lineage-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1.6rem 2rem;
}
.lineage-col p {
    margin: 0 0 1.35rem;
    font-family: var(--serif);
    font-size: clamp(1.08rem, 1.7vw, 1.32rem);
    line-height: 1.35;
    color: #3c3428;
}
.lineage-col p:last-child { margin-bottom: 0; }
.lineage-col span {
    display: block;
    margin-top: 0.2rem;
    color: var(--gold-deep);
}
.lineage-col-left { text-align: right; }
.lineage-col-right { text-align: left; }
.lineage-mark {
    display: grid;
    place-items: center;
}
.lineage-logo {
    width: 500px;
    height: 350px;
    background-color: var(--gold-deep);
}

/* About */
.about-section { background: var(--ivory); }
.about-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 4rem;
    align-items: center;
}
.about-copy h2 {
    font-size: clamp(2rem, 3.4vw, 3.15rem);
    max-width: 16ch;
    margin-bottom: 1.2rem;
}
.about-copy p { color: var(--muted); max-width: 46ch; }
.about-facts {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
    text-align: center;
}
.about-watermark {
    position: absolute;
    inset: -18% -8% auto auto;
    width: 280px;
    color: rgba(201, 169, 98, 0.08);
    pointer-events: none;
}
.fact { position: relative; }
.fact-icon {
    width: 42px;
    height: 42px;
    margin: 0 auto 1rem;
    color: var(--gold);
    display: grid;
}
.fact strong {
    display: block;
    font-family: var(--serif);
    font-size: 2rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
}
.fact span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Path */
.path-section {
    background: var(--green-900);
    color: var(--cream);
}
.path-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}
.path-card { text-align: center; padding: 1rem 1.2rem 0; }
.path-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1.3rem;
    color: var(--gold);
    display: grid;
}
.path-index {
    margin: 0 0 0.35rem;
    color: var(--gold);
    font-family: var(--display);
    font-size: 0.72rem;
    letter-spacing: 0.28em;
}
.path-card h3 {
    font-size: 1.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}
.path-card p { color: rgba(243, 234, 214, 0.7); margin: 0; }

/* Timeline */
.history-section { background: #fff; }
.timeline {
    --timeline-dot: 11px;
    --timeline-pad: 1.4rem;
    list-style: none;
    margin: 0;
    padding: var(--timeline-pad) 0 0;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    position: relative;
}
.timeline::before {
    content: "";
    position: absolute;
    left: calc(var(--timeline-dot) / 2);
    right: calc(100% / 8 - var(--timeline-dot) / 2);
    top: calc(var(--timeline-pad) + (var(--timeline-dot) - 1px) / 2);
    height: 1px;
    background: var(--gold);
}
.timeline-item {
    position: relative;
    padding-top: 1.7rem;
    padding-right: 0.8rem;
}
.timeline-dot {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    width: var(--timeline-dot);
    height: var(--timeline-dot);
    border-radius: 50%;
    background: var(--ivory);
    border: 1px solid var(--gold);
    box-shadow: 0 0 0 4px #fff;
}
.timeline-item strong {
    display: block;
    font-family: var(--serif);
    font-size: 1.35rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}
.timeline-item span {
    display: block;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.4;
}

.history-chronicle-section { background: #fff; }
.history-chronicle-title {
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(1.8rem, 3vw, 2.35rem);
    max-width: 28ch;
    margin: 0 0 1.4rem;
}
.history-entry {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    gap: 0.35rem 1.75rem;
    align-items: start;
    padding: 1.25rem 0;
    border-top: 1px solid rgba(201, 169, 98, 0.35);
}
.history-year {
    margin: 0;
    font-family: var(--serif);
    font-size: 1.35rem;
    font-weight: 500;
    line-height: 1.45;
}
.history-body p {
    margin: 0 0 0.85rem;
    color: #4a453c;
}
.history-body p:last-child { margin-bottom: 0; }
.history-more { margin: 2rem 0 0; }

/* Events */
.events-section { background: var(--paper); }
.event-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.4rem;
}
.event-card {
    background: #fff;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.event-media {
    display: block;
    aspect-ratio: 16 / 11;
    overflow: hidden;
    background: var(--green-800);
}
.event-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}
.event-card:hover img { transform: scale(1.05); }
.event-body { padding: 1.3rem 1.35rem 1.5rem; }
.event-cat {
    margin: 0 0 0.45rem;
    color: var(--gold-deep);
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}
.event-body h3 { font-size: 1.35rem; margin-bottom: 0.45rem; }
.event-body h3 a:hover { color: var(--gold-deep); }
.event-meta { color: var(--muted); font-size: 0.88rem; margin-bottom: 1rem; }

/* Quote */
.quote-section {
    position: relative;
    min-height: 520px;
    display: flex;
    align-items: center;
    color: var(--cream);
    overflow: hidden;
    background: var(--green-950);
}
.quote-media {
    background:
        linear-gradient(90deg, rgba(6, 19, 14, 0.12) 0%, rgba(6, 19, 14, 0.55) 46%, rgba(6, 19, 14, 0.94) 70%),
        url("../img/quote.jpg") 8% 12%/cover no-repeat;
}
.quote-inner {
    position: relative;
    z-index: 1;
    max-width: 620px;
    margin-left: auto;
    padding: 6rem 0;
}
.quote-section blockquote {
    margin: 0 0 2rem;
    font-family: var(--serif);
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-style: italic;
    font-weight: 500;
    line-height: 1.3;
}

/* CTA */
.cta-section {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(201, 169, 98, 0.08), transparent 40%),
        radial-gradient(ellipse at 90% 10%, rgba(201, 169, 98, 0.06), transparent 35%),
        var(--green-950);
    color: var(--cream);
    text-align: center;
    padding: 6.5rem 0 5.5rem;
}
.cta-section::before,
.cta-section::after {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cpath fill='%231a3a28' d='M20 180c30-40 40-90 28-140 22 30 40 70 36 120 24-28 50-40 70-42-30 20-48 50-50 82z'/%3E%3C/svg%3E") no-repeat center/contain;
    opacity: 0.55;
    pointer-events: none;
}
.cta-section::before { left: -40px; bottom: -40px; }
.cta-section::after { right: -40px; top: -20px; transform: scaleX(-1); }
.cta-inner { max-width: 720px; }
.cta-mark {
    width: auto;
    height: auto;
    margin: 0 auto 1.6rem;
    color: var(--gold);
    display: block;
}
.cta-mark .brand-logo,
.cta-mark .brand-mark {
    width: 96px;
    height: 96px;
    margin-inline: auto;
}
.cta-section h2 {
    color: var(--ivory);
    font-weight: 400;
    font-size: clamp(2rem, 4vw, 3.4rem);
    margin-bottom: 2rem;
}

/* Footer */
.site-footer {
    background: #040c09;
    color: rgba(243, 234, 214, 0.72);
    padding: 2.4rem 0;
    border-top: 1px solid rgba(201, 169, 98, 0.1);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1.5rem;
}
.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem 1.3rem;
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.footer-nav a:hover { color: var(--gold-soft); }
.footer-copy {
    margin: 0;
    text-align: right;
    font-size: 0.78rem;
}

/* Inner pages */
.page-hero {
    position: relative;
    min-height: 340px;
    display: flex;
    align-items: flex-end;
    color: var(--cream);
    background: var(--green-950);
    overflow: hidden;
}
.page-hero-media {
    background:
        linear-gradient(180deg, rgba(6, 19, 14, 0.35), rgba(6, 19, 14, 0.78)),
        url("../img/page-hero.jpg") center 40%/cover no-repeat;
}
.page-hero-inner { position: relative; z-index: 1; padding: 5.5rem 0 3rem; }
.page-hero h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); max-width: 16ch; }
.page-hero-lead { max-width: 46ch; color: rgba(243, 234, 214, 0.78); font-size: 1.05rem; }

.prose {
    width: min(760px, 100%);
    margin: 0 auto;
}
.prose.wide { width: min(980px, 100%); }
.prose h2 { font-size: 2rem; margin-top: 2.2rem; }
.prose h3 { font-size: 1.4rem; margin-top: 1.6rem; }
.prose p, .prose li { color: #4a453c; }
.prose blockquote {
    margin: 2rem 0;
    padding-left: 1.4rem;
    border-left: 1px solid var(--gold);
    font-family: var(--serif);
    font-size: 1.45rem;
    font-style: italic;
    color: var(--ink);
}

.value-grid,
.degree-grid,
.org-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
    margin-top: 2.4rem;
}
.value-card,
.degree-card,
.org-card {
    background: #fff;
    padding: 1.6rem 1.4rem;
    border: 1px solid rgba(26, 24, 20, 0.06);
}
.value-card h3,
.degree-card h3,
.org-card h3 { font-size: 1.35rem; }

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 2rem;
}
.filter-chip {
    padding: 0.45rem 0.95rem;
    border: 1px solid rgba(26, 24, 20, 0.12);
    border-radius: 999px;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.filter-chip.is-active,
.filter-chip:hover { border-color: var(--gold-deep); color: var(--gold-deep); }

.event-detail-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 3rem;
    align-items: start;
}
.event-cover {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--green-800);
    margin-bottom: 1.6rem;
}
.event-cover img { width: 100%; height: 100%; object-fit: cover; }

.contact-layout {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 3.5rem;
}
.contact-form {
    display: grid;
    gap: 1rem;
    background: #fff;
    padding: 2rem;
    box-shadow: var(--shadow);
}
.field { display: grid; gap: 0.4rem; }
.field label { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.field input,
.field textarea,
.search-form input {
    width: 100%;
    border: 1px solid rgba(26, 24, 20, 0.12);
    background: var(--ivory);
    padding: 0.85rem 0.95rem;
    outline: none;
}
.field input:focus,
.field textarea:focus,
.search-form input:focus { border-color: var(--gold-deep); }
.errorlist { list-style: none; margin: 0; padding: 0; color: #8a2a2a; font-size: 0.85rem; }
.help-note { color: var(--muted); }

.search-form { display: flex; gap: 0.7rem; }
.search-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
}
.search-modal[hidden] { display: none; }
.search-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 19, 14, 0.72);
}
.search-modal-panel {
    position: relative;
    width: min(640px, calc(100% - 2rem));
    margin: 18vh auto 0;
    background: var(--ivory);
    padding: 1.6rem;
}
.search-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.search-modal-head h2 { margin: 0; }
.search-modal .icon-btn { color: var(--ink); }

.flash-stack { position: relative; z-index: 30; }
.flash {
    margin: 0;
    padding: 0.9rem 1.2rem;
    text-align: center;
    background: #e8f0dc;
}
.flash-error { background: #f3dcdc; }
.empty-note { color: var(--muted); }

.related-list { display: grid; gap: 1rem; }
.related-item { display: grid; grid-template-columns: 92px 1fr; gap: 0.9rem; align-items: center; }
.related-item img { width: 92px; height: 72px; object-fit: cover; }

body.nav-open { overflow: hidden; }

@media (max-width: 980px) {
    .header-inner { grid-template-columns: 1fr auto; gap: 0.75rem; }
    .header-tools { gap: 0.3rem; }
    .nav {
        position: fixed;
        inset: var(--header-h) 0 0;
        background: rgba(6, 19, 14, 0.97);
        transform: translateX(100%);
        transition: transform 0.3s ease;
        padding: 2rem 1.5rem;
    }
    .nav.is-open { transform: none; }
    .nav-list { flex-direction: column; align-items: flex-start; gap: 1.2rem; }
    .nav-link { font-size: 1rem; }
    .menu-toggle { display: block; }
    .lineage-grid,
    .about-grid,
    .path-grid,
    .event-grid,
    .value-grid,
    .degree-grid,
    .org-grid,
    .event-detail-layout,
    .contact-layout,
    .footer-grid { grid-template-columns: 1fr; }
    .lineage-section { padding: 3.4rem 0 5.5rem; }
    .lineage-section::before {
        height: 40%;
        background-position: 78% 60%;
    }
    .lineage-logo { width: 280px; height: 196px; }
    .lineage-col-left,
    .lineage-col-right { text-align: center; }
    .lineage-mark { order: -1; }
    .about-facts { grid-template-columns: 1fr; gap: 2rem; }
    .timeline { grid-template-columns: 1fr 1fr; gap: 1.4rem 1rem; }
    .timeline::before { display: none; }
    .quote-inner { margin-left: 0; }
    .footer-copy { text-align: left; }
}

@media (max-width: 640px) {
    .header-inner { width: calc(100% - 1.2rem); gap: 0.45rem; }
    .brand { gap: 0.5rem; min-width: 0; }
    .brand-sub { display: none; }
    .brand-sigla { font-size: 0.72rem; letter-spacing: 0.08em; }
    .brand-mark,
    .brand-logo { width: 52px; height: 52px; }
    .lineage-logo { width: 200px; height: 140px; }
    .container { width: min(var(--max), calc(100% - 2rem)); }
    .section { padding: 4.2rem 0; }
    .hero-inner { padding-top: 7.5rem; }
    .hero-actions { flex-direction: column; align-items: flex-start; }
    .timeline { grid-template-columns: 1fr; }
    .history-entry { grid-template-columns: 1fr; gap: 0.15rem; }
    .search-form { flex-direction: column; }
}
