/* Southern Mongolia Culture & Language Center
   Final stylesheet
   Clean light/dark theme + unified header icons + improved mobile menu icon
*/

/* =========================
   Theme tokens
========================= */
:root {
    --bg-color: #ffffff;
    --bg-elevated: #ffffff;
    --panel-color: #ffffff;
    --panel-soft: #f4f4f4;

    --text-color: #1f1f1f;
    --heading-color: #111111;
    --muted-color: #666666;

    --header-bg: rgba(255, 255, 255, 0.92);
    --border-color: rgba(0, 0, 0, 0.08);
    --soft-border: rgba(0, 0, 0, 0.05);

    --accent: #8b5a2b;
    --accent-strong: #6f431b;
    --accent-soft: #caa27b;

    --link-color: #8b5a2b;
    --link-hover: #6f431b;

    --hero-bg: linear-gradient(180deg, #fcfcfc 0%, #f7f7f7 100%);
    --hero-text: #141414;
    --hero-subtext: #555555;

    --mission-bg: #ffffff;
    --section-alt-bg: #f9f9f9;
    --featured-bg: #ffffff;

    --card-bg: #ffffff;
    --card-border: rgba(0, 0, 0, 0.08);
    --card-hover-border: rgba(139, 90, 43, 0.22);

    --footer-bg: #f9f9f9;
    --footer-text: #666666;

    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.08);

    --site-width: 1240px;
    --reading-width: 860px;

    --radius-sm: 10px;
    --radius-md: 18px;
    --radius-lg: 28px;

    --header-icon-box: 36px;
    --theme-icon-size: 18px;
    --menu-icon-size: 22px;
    --header-icon-color: var(--text-color);
    --header-icon-hover: #c79a3d;

    --transition: 0.26s ease;
}

html[data-theme="dark"] {
    --bg-color: #15110d;
    --bg-elevated: #1b1612;
    --panel-color: #1c1712;
    --panel-soft: #221b15;

    --text-color: #eee3d5;
    --heading-color: #f7efe4;
    --muted-color: #c1b19f;

    --header-bg: rgba(21, 17, 13, 0.9);
    --border-color: rgba(233, 217, 199, 0.12);
    --soft-border: rgba(233, 217, 199, 0.07);

    --accent: #d3a06d;
    --accent-strong: #ebbe93;
    --accent-soft: #9d7047;

    --link-color: #e2b07e;
    --link-hover: #f1c89e;

    --hero-bg: linear-gradient(180deg, #1d1712 0%, #251d16 100%);
    --hero-text: #fbf3e8;
    --hero-subtext: #d9cab9;

    --mission-bg: #16120f;
    --section-alt-bg: #1b1612;
    --featured-bg: #17130f;

    --card-bg: rgba(29, 23, 18, 0.94);
    --card-border: rgba(233, 217, 199, 0.10);
    --card-hover-border: rgba(211, 160, 109, 0.34);

    --footer-bg: #19140f;
    --footer-text: #c7b7a5;

    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.18);
    --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.24);
    --shadow-lg: 0 22px 50px rgba(0, 0, 0, 0.34);

    --header-icon-color: var(--text-color);
    --header-icon-hover: #e2b45b;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--bg-color);
    color: var(--text-color);
    font-family: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
    font-size: 16px;
    line-height: 1.84;
    letter-spacing: 0.002em;
    transition:
        background-color var(--transition),
        color var(--transition);
}

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

::selection {
    background: rgba(139, 90, 43, 0.16);
}

a {
    color: var(--link-color);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.16em;
    transition:
        color var(--transition),
        text-decoration-color var(--transition);
}

a:hover {
    color: var(--link-hover);
}

.container {
    max-width: var(--site-width);
    margin: 0 auto;
    padding: 0 28px;
}

/* =========================
   Skip link
========================= */
.skip-link {
    position: absolute;
    left: 16px;
    top: -48px;
    z-index: 2000;
    padding: 10px 14px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
}

.skip-link:focus {
    top: 12px;
}

/* =========================
   Header
========================= */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transform: translateY(0);
    opacity: 1;
    transition:
        transform 0.38s ease,
        opacity 0.28s ease,
        background-color var(--transition),
        border-color var(--transition),
        box-shadow var(--transition);
    will-change: transform, opacity;
}

header.header-hidden {
    transform: translateY(calc(-100% - 6px));
    opacity: 0.98;
    box-shadow: none;
}

header.header-scrolled {
    box-shadow: var(--shadow-md);
}

.header-content {
    max-width: var(--site-width);
    margin: 0 auto;
    padding: 15px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    min-width: 0;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    text-decoration: none;
    color: var(--heading-color);
}

.brand-link:hover {
    color: var(--heading-color);
}

.brand-logo {
    width: 50px;
    height: 50px;
    display: block;
    flex: 0 0 auto;
    border-radius: 0;
    box-shadow: var(--shadow-sm);
}

.site-title {
    color: var(--heading-color);
    font-size: 1.7rem;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

/* =========================
   Theme cycle button
========================= */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.theme-cycle {
    width: var(--header-icon-box);
    height: var(--header-icon-box);
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--header-icon-color);
    cursor: pointer;
    font-size: 0;
    line-height: 0;
    transition:
        color var(--transition),
        transform var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    -webkit-tap-highlight-color: transparent;
}

.theme-cycle:hover {
    background: transparent;
    color: var(--header-icon-hover);
}

.theme-cycle::before {
    content: "";
    display: block;
    width: var(--theme-icon-size);
    height: var(--theme-icon-size);
    background-color: currentColor;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-position: center;
    mask-size: contain;
    -webkit-mask-size: contain;
    opacity: 1;
}

.theme-cycle[data-theme-current="auto"],
.theme-cycle[data-theme-current="light"],
.theme-cycle[data-theme-current="dark"] {
    background: transparent;
}

.theme-cycle[data-theme-current="auto"]::before {
    width: calc(var(--theme-icon-size) - 1px);
    height: calc(var(--theme-icon-size) - 1px);
    border-radius: 50%;
    box-sizing: border-box;
    opacity: 1;
    mask-image: none;
    -webkit-mask-image: none;
    background:
        linear-gradient(90deg, currentColor 0 50%, var(--bg-color) 50% 100%);
    border: 1.4px solid currentColor;
}

.theme-cycle[data-theme-current="light"]::before {
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='4'/><path d='M12 2.5v2.2'/><path d='M12 19.3v2.2'/><path d='M2.5 12h2.2'/><path d='M19.3 12h2.2'/><path d='M5.6 5.6l1.6 1.6'/><path d='M16.8 16.8l1.6 1.6'/><path d='M18.4 5.6l-1.6 1.6'/><path d='M7.2 16.8l-1.6 1.6'/></svg>");
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='4'/><path d='M12 2.5v2.2'/><path d='M12 19.3v2.2'/><path d='M2.5 12h2.2'/><path d='M19.3 12h2.2'/><path d='M5.6 5.6l1.6 1.6'/><path d='M16.8 16.8l1.6 1.6'/><path d='M18.4 5.6l-1.6 1.6'/><path d='M7.2 16.8l-1.6 1.6'/></svg>");
}

.theme-cycle[data-theme-current="dark"]::before {
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M20 14.2A8 8 0 1 1 9.8 4 6.5 6.5 0 0 0 20 14.2Z'/></svg>");
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M20 14.2A8 8 0 1 1 9.8 4 6.5 6.5 0 0 0 20 14.2Z'/></svg>");
}

/* =========================
   Menu button
========================= */
.menu-toggle {
    display: none;
    width: var(--header-icon-box);
    height: var(--header-icon-box);
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--header-icon-color);
    cursor: pointer;
    font-size: 0;
    line-height: 0;
    transition:
        color var(--transition),
        transform var(--transition);
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    -webkit-tap-highlight-color: transparent;
}

.menu-toggle:hover {
    background: transparent;
    color: var(--header-icon-hover);
}

.menu-toggle::before {
    content: "";
    display: block;
    width: var(--menu-icon-size);
    height: var(--menu-icon-size);
    background-color: currentColor;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-position: center;
    mask-size: contain;
    -webkit-mask-size: contain;
    opacity: 1;
}

.menu-toggle:not([data-menu-icon])::before,
.menu-toggle[data-menu-icon="menu"]::before {
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'><path d='M4 7h16'/><path d='M4 12h16'/><path d='M4 17h16'/></svg>");
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'><path d='M4 7h16'/><path d='M4 12h16'/><path d='M4 17h16'/></svg>");
}

.menu-toggle[data-menu-icon="close"]::before {
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'><path d='M6 6l12 12'/><path d='M18 6L6 18'/></svg>");
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'><path d='M6 6l12 12'/><path d='M18 6L6 18'/></svg>");
}

.theme-cycle:focus-visible,
.menu-toggle:focus-visible {
    outline: 2px solid var(--header-icon-hover);
    outline-offset: 3px;
}

/* =========================
   Navigation
========================= */
nav {
    border-top: 1px solid var(--soft-border);
}

nav ul {
    max-width: var(--site-width);
    margin: 0 auto;
    padding: 0 28px;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px 10px;
    flex-wrap: wrap;
}

nav li {
    margin: 0;
}

nav a {
    display: block;
    padding: 13px 11px 14px;
    color: var(--text-color);
    text-decoration: none;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.79rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.085em;
    border-bottom: 2px solid transparent;
    transition:
        color var(--transition),
        border-color var(--transition),
        opacity var(--transition);
}

nav a:hover {
    color: var(--link-color);
}

nav a.current {
    color: var(--link-color);
    border-bottom-color: var(--link-color);
}

/* =========================
   Main layout
========================= */
main {
    min-height: calc(100vh - 180px);
    background: var(--bg-color);
}

/* =========================
   Hero
========================= */
.hero {
    position: relative;
    overflow: hidden;
    background: var(--hero-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 104px 20px 96px;
    text-align: center;
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 90, 43, 0.22), transparent);
}

.hero .container {
    max-width: var(--site-width);
}

.hero h1 {
    margin: 0 0 24px;
    color: var(--hero-text);
    font-size: clamp(2.8rem, 5.7vw, 4.8rem);
    line-height: 1.08;
    font-weight: 500;
    letter-spacing: -0.025em;
}

.hero p {
    max-width: 760px;
    margin: 0 auto;
    color: var(--hero-subtext);
    font-size: 1.18rem;
    line-height: 1.92;
}

/* =========================
   Homepage
========================= */
.hero-home {
    padding-top: 104px;
    padding-bottom: 96px;
}

.hero-home .container,
.home-overview .container,
.core-areas .container,
footer .container {
    max-width: var(--site-width);
}

.hero-home-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.9fr);
    gap: 32px;
    align-items: stretch;
}

.hero-home-main {
    max-width: 700px;
    text-align: left;
}

.hero-kicker {
    margin: 0 0 18px;
    color: var(--accent);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero-home h1 {
    max-width: 9ch;
    margin: 0 0 24px;
    color: var(--hero-text);
    font-size: clamp(3.2rem, 5.4vw, 4.9rem);
    line-height: 0.97;
    font-weight: 500;
    letter-spacing: -0.04em;
}

.hero-intro {
    max-width: 660px;
    margin: 0 0 18px;
    color: var(--hero-subtext);
    font-size: 1.14rem;
    line-height: 1.9;
}

.hero-intro-secondary {
    max-width: 660px;
    color: var(--muted-color);
    font-size: 1.03rem;
    line-height: 1.86;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 32px;
}

.hero-home-panel {
    width: 100%;
    max-width: none;
    justify-self: stretch;
    align-self: stretch;
    margin-top: 0;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    box-shadow: var(--shadow-md);
    padding: 30px 28px;
    text-align: left;
}

.hero-home-panel h2 {
    margin: 0 0 20px;
    color: var(--heading-color);
    font-size: 1.22rem;
    line-height: 1.35;
    font-weight: 700;
}

.hero-panel-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hero-panel-list li {
    display: grid;
    gap: 4px;
    padding: 16px 0;
    border-top: 1px solid var(--soft-border);
}

.hero-panel-list li:first-child {
    padding-top: 0;
    border-top: 0;
}

.hero-panel-list strong {
    color: var(--heading-color);
    font-size: 1rem;
}

.hero-panel-list span {
    color: var(--muted-color);
    font-size: 0.97rem;
    line-height: 1.72;
}

.home-overview {
    position: relative;
    z-index: 2;
    margin-top: -18px;
    padding: 32px 20px;
    background: var(--section-alt-bg);
}

.home-overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.9fr);
    gap: 32px;
    align-items: stretch;
}

.overview-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 30px 28px;
    box-shadow: var(--shadow-sm);
}

.overview-label {
    margin: 0 0 10px;
    color: var(--accent);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.overview-card h2 {
    margin: 0 0 12px;
    color: var(--heading-color);
    font-size: 1.42rem;
    line-height: 1.32;
    font-weight: 700;
}

.overview-card p:last-child {
    margin-bottom: 0;
    color: var(--muted-color);
}

/* =========================
   Sections
========================= */
.mission,
.featured,
.updates-preview,
.core-areas,
.ecosystem-highlight {
    padding: 88px 20px;
    border-bottom: 1px solid var(--soft-border);
}

.mission {
    background: var(--mission-bg);
}

.core-areas {
    background: var(--section-alt-bg);
}

.featured,
.updates-preview,
.ecosystem-highlight {
    background: var(--featured-bg);
}

.mission .container,
.featured .container,
.updates-preview .container,
.ecosystem-highlight .container,
.page-content {
    max-width: var(--reading-width);
}

.mission h2,
.featured h2,
.updates-preview h2,
.core-areas h2,
.ecosystem-highlight h2 {
    margin: 0 0 26px;
    color: var(--heading-color);
    font-size: clamp(2rem, 4vw, 2.9rem);
    line-height: 1.16;
    font-weight: 500;
    letter-spacing: -0.02em;
}

.mission p,
.featured p,
.updates-preview p,
.ecosystem-highlight p {
    margin: 0 0 18px;
    color: var(--text-color);
    font-size: 1.08rem;
    line-height: 1.92;
}

.updates-preview ul {
    margin: 0;
    padding-left: 22px;
}

.updates-preview li {
    margin-bottom: 12px;
    color: var(--text-color);
    line-height: 1.82;
}

.updates-preview strong {
    color: var(--heading-color);
}

/* =========================
   Cards
========================= */
.cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.card {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 28px 26px;
    box-shadow: var(--shadow-sm);
    transition:
        transform var(--transition),
        border-color var(--transition),
        box-shadow var(--transition),
        background-color var(--transition);
}

.card::before {
    content: "";
    position: absolute;
    top: 22px;
    left: 22px;
    width: 28px;
    height: 2px;
    border-radius: 999px;
    background: var(--accent);
    opacity: 0.75;
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--card-hover-border);
    box-shadow: var(--shadow-md);
}

.card h3 {
    margin: 10px 0 14px;
    color: var(--heading-color);
    font-size: 1.28rem;
    line-height: 1.34;
    font-weight: 700;
}

.card p {
    margin: 0;
    color: var(--muted-color);
    font-size: 1rem;
    line-height: 1.8;
}

/* =========================
   Content pages
========================= */
.page-content {
    margin: 0 auto;
    padding: 88px 20px;
    background: var(--bg-elevated);
}

.page-content h1 {
    margin: 0 0 34px;
    color: var(--heading-color);
    text-align: center;
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.1;
    font-weight: 500;
    letter-spacing: -0.025em;
}

.page-content h2 {
    margin: 46px 0 16px;
    padding-bottom: 10px;
    color: var(--heading-color);
    font-size: 1.7rem;
    line-height: 1.28;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.page-content p,
.page-content li {
    color: var(--text-color);
    font-size: 1.08rem;
    line-height: 1.94;
}

.page-content p {
    margin: 0 0 18px;
}

.page-content ul {
    margin: 0 0 18px;
    padding-left: 24px;
}

.page-content li {
    margin-bottom: 10px;
}

.page-content article {
    margin-top: 34px;
    padding-top: 8px;
}

.page-content .date {
    margin-bottom: 10px;
    color: var(--muted-color);
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

/* =========================
   Buttons
========================= */
.btn {
    display: inline-block;
    padding: 12px 22px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 600;
    transition:
        background-color var(--transition),
        transform var(--transition),
        box-shadow var(--transition);
}

.btn:hover {
    background: var(--accent-strong);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent-soft);
}

.btn-secondary:hover {
    background: rgba(139, 90, 43, 0.08);
    color: var(--accent-strong);
}

/* =========================
   Footer
========================= */
footer {
    margin-top: 62px;
    padding: 42px 0 24px;
    background: var(--footer-bg);
    border-top: 1px solid var(--border-color);
    color: var(--footer-text);
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    align-items: start;
}

.footer-section {
    min-width: 0;
}

.footer-section h3 {
    margin: 0 0 14px;
    color: var(--heading-color);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.footer-section p {
    margin: 0 0 12px;
    color: var(--footer-text);
    line-height: 1.76;
}

.copyright {
    margin-top: 30px;
    padding-top: 18px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--footer-text);
    font-size: 0.93rem;
}

/* =========================
   Accessibility
========================= */
header:focus-within {
    transform: translateY(0) !important;
    opacity: 1 !important;
}

.overview-card,
.card,
.hero-home-panel,
.page-content {
    transition:
        background-color var(--transition),
        border-color var(--transition),
        box-shadow var(--transition),
        color var(--transition);
}

/* =========================
   Responsive
========================= */
@media (max-width: 1080px) {
    .cards {
        gap: 20px;
    }
}

@media (max-width: 960px) {
    .hero-home {
        padding-top: 86px;
        padding-bottom: 72px;
    }

    .hero-home-grid,
    .home-overview-grid {
        grid-template-columns: 1fr;
    }

    .hero-home-grid {
        gap: 28px;
        align-items: stretch;
    }

    .hero-home-main {
        max-width: none;
    }

    .hero-home h1 {
        max-width: 10ch;
        font-size: clamp(2.8rem, 7.2vw, 4rem);
        line-height: 0.98;
    }

    .hero-home-panel {
        max-width: none;
        width: 100%;
        margin-top: 0;
    }

    .home-overview {
        margin-top: -8px;
        padding: 24px 20px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}

@media (max-width: 820px) {
    .header-content {
        padding: 14px 18px;
    }

    .site-title {
        font-size: 1.55rem;
    }

    .brand-logo {
        width: 31px;
        height: 31px;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    nav {
        position: relative;
    }

    nav ul {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 10px 18px 16px;
        background: var(--header-bg);
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-md);
    }

    nav ul.open {
        display: flex;
    }

    nav a {
        padding: 13px 4px;
        font-size: 0.96rem;
        text-transform: none;
        letter-spacing: 0.01em;
        border-bottom: 1px solid var(--soft-border);
    }

    nav a.current {
        border-bottom-color: var(--link-color);
    }

    .mission,
    .featured,
    .updates-preview,
    .core-areas,
    .ecosystem-highlight,
    .page-content {
        padding: 62px 18px;
    }

    .cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .container {
        padding: 0 16px;
    }

    .header-content {
        padding: 12px 14px;
    }

    .brand-link {
        gap: 8px;
    }

    .brand-logo {
        width: 50px;
        height: 50px;
        border-radius: 0;
    }

    .site-title {
        font-size: 1.38rem;
        letter-spacing: 0.06em;
    }

    .header-right {
        gap: 4px;
    }

    .theme-cycle,
    .menu-toggle {
        width: 34px;
        height: 34px;
    }

    .theme-cycle::before {
        width: 17px;
        height: 17px;
    }

    .theme-cycle[data-theme-current="auto"]::before {
        width: 16px;
        height: 16px;
    }

    .menu-toggle::before {
        width: 21px;
        height: 21px;
    }

    .hero {
        padding: 72px 16px 64px;
    }

    .hero h1 {
        font-size: 2.18rem;
        line-height: 1.1;
    }

    .hero p {
        font-size: 1rem;
        line-height: 1.82;
    }

    .hero-home {
        padding-top: 72px;
        padding-bottom: 56px;
    }

    .hero-home h1 {
        max-width: none;
        font-size: 2.35rem;
        line-height: 1.02;
    }

    .hero-intro,
    .hero-intro-secondary {
        font-size: 1rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn,
    .btn-secondary {
        text-align: center;
    }

    .mission,
    .featured,
    .updates-preview,
    .core-areas,
    .ecosystem-highlight,
    .page-content {
        padding: 48px 16px;
    }

    .mission h2,
    .featured h2,
    .updates-preview h2,
    .core-areas h2,
    .ecosystem-highlight h2 {
        font-size: 1.9rem;
    }

    .page-content h2 {
        font-size: 1.42rem;
    }

    .card,
    .hero-home-panel,
    .overview-card {
        padding: 22px 18px;
    }

    .overview-card h2 {
        font-size: 1.22rem;
    }

    .home-overview {
        margin-top: 0;
        padding: 24px 16px;
    }

    footer {
        margin-top: 48px;
        padding-top: 34px;
    }
}

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

    header,
    .card,
    .btn,
    nav a,
    .theme-cycle,
    .menu-toggle {
        transition: none !important;
    }

    header.header-hidden {
        transform: translateY(0) !important;
        opacity: 1 !important;
    }
}