/* BASE CSS (genes.md 9.1) */
* { box-sizing: border-box; padding: 0; margin: 0; line-height: 1em }
html { -webkit-text-size-adjust: 100% }
html, body { overflow-x: clip }
@media (max-width: 639px) { html { font-size: 3.125vw } }
@media (min-width: 640px) and (max-width: 1279px) { html { font-size: 1.5625vw } }
@media (min-width: 1280px) { html { font-size: .78125vw } }
img, svg, video, canvas { display: block; max-width: 100% }
button, input, textarea, select { font: inherit; border: 0 }
ul, ol { list-style: none }
table { border-collapse: collapse }
* { scrollbar-width: thin; scrollbar-color: #999 transparent }
*::-webkit-scrollbar { width: .6rem; height: .6rem }
*::-webkit-scrollbar-track { background: transparent }
*::-webkit-scrollbar-thumb { background: #999; border-radius: 1rem }
*::-webkit-scrollbar-thumb:hover { background: #777 }

/* Layout presets (genes.md 9.2) */
.g-landing { width: 128rem; min-height: 100vh; padding: 0 6.4rem }
.g-blog { display: grid; grid-template-columns: 76.8rem 32rem; gap: 6.4rem; width: 115.2rem }
.g-dashboard { display: grid; grid-template-columns: 20rem 36rem 72rem; width: 128rem; height: 100vh }
.g-nav, .g-main, .g-side { overflow-y: auto; padding: 2.4rem }

/* Design tokens */
:root {
    --bg: #fbfaf7;
    --surface: #f1efe9;
    --line: #dedad0;
    --text: #1b1d1c;
    --muted: #595c58;
    --accent: #1d5c4b;
    --on-accent: #ffffff;
    --danger: #a3341f;
    --radius: .8rem;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 1.6rem }
p, li, dd, dt, label, input, textarea, select { line-height: 1.5 }
h1, h2, h3 { line-height: 1.15; font-weight: 700; letter-spacing: -.01em }
a { color: inherit }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
    outline: .2rem solid var(--accent); outline-offset: .2rem
}
.muted { color: var(--muted) }
.link { color: var(--accent); font-weight: 600; text-decoration: none }
.link:hover { text-decoration: underline }

/* Header */
.header { display: flex; align-items: center; gap: 4.8rem; padding: 3.2rem 0; border-bottom: 1px solid var(--line) }
.brand { font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; text-decoration: none }
.nav { display: flex; flex-wrap: wrap; gap: 3.2rem; margin-right: auto }
.nav a, .languages a { color: var(--muted); font-size: 1.5rem; line-height: 1.5; text-decoration: none }
.nav a:hover, .languages a:hover { color: var(--text) }
.nav a[aria-current="page"] { color: var(--text); box-shadow: 0 .2rem 0 var(--accent) }
.languages { display: flex; gap: 1.6rem }
.languages a[aria-current] { color: var(--text); font-weight: 700 }

/* Buttons */
.button { display: inline-flex; align-items: center; min-height: 4.4rem; padding: 0 2.4rem; background: var(--accent); color: var(--on-accent);
    border-radius: var(--radius); font-size: 1.5rem; font-weight: 600; text-decoration: none; cursor: pointer }
.button:hover { background: var(--text) }
.button-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line) }
.button-ghost:hover { background: var(--surface) }
.button-small { min-height: 3.6rem; padding: 0 1.6rem; font-size: 1.4rem }
.button-danger { background: var(--danger) }
.link-button { background: none; color: inherit; font-size: inherit; text-decoration: underline; cursor: pointer }

/* Hero and page heads */
.hero { padding: 9.6rem 0 }
.eyebrow { color: var(--accent); font-size: 1.3rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 2.4rem }
.hero h1 { font-size: 7.2rem; max-width: 96rem; margin-bottom: 3.2rem }
.lead { color: var(--muted); font-size: 2rem; max-width: 64rem }
.actions { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: 4.8rem }
.page-head { padding: 9.6rem 0 4.8rem }
.page-head h1 { font-size: 4.8rem; margin-bottom: 2.4rem }
.prose { max-width: 64rem }
.prose p { font-size: 1.7rem }
.prose p + p { margin-top: 1.6rem }

/* Stats */
.stats { display: grid; grid-template-columns: 36.8rem 36.8rem 36.8rem; gap: 2.4rem; padding: 4.8rem 0; border-top: 1px solid var(--line) }
.stat-value { font-size: 4.8rem; font-weight: 700; line-height: 1.1; color: var(--accent) }
.stat-label { color: var(--muted); margin-top: .8rem }

/* Sections and cards */
.section { padding: 9.6rem 0; border-top: 1px solid var(--line) }
.section-flush { padding-top: 0; border-top: 0 }
.section-head { margin-bottom: 4.8rem }
.section-head h2 { font-size: 3.2rem; margin-bottom: 1.6rem }
.section-head p { color: var(--muted); max-width: 64rem }
.section-head-row { display: flex; justify-content: space-between; align-items: baseline }
.cards { display: grid; grid-template-columns: 36.8rem 36.8rem 36.8rem; gap: 2.4rem }
.card { padding: 3.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius) }
.card h2, .card h3 { font-size: 2rem; margin-bottom: 1.2rem }
.card p { color: var(--muted) }
.card a { color: var(--text) }
.news-card img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); margin-bottom: 2.4rem }
.news-card h3 a { text-decoration: none }
.news-card h3 a:hover { text-decoration: underline }
.date { color: var(--muted); font-size: 1.3rem; margin-bottom: .8rem }

/* Services */
.service-list { display: grid; grid-template-columns: 56.4rem 56.4rem; gap: 2.4rem }
.service { display: block; padding: 3.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none }
.service:hover { border-color: var(--accent) }
.service h2 { font-size: 2.8rem; margin-bottom: 1.6rem }
.service p { color: var(--muted); margin-bottom: 2.4rem }

/* Articles */
.article { padding: 6.4rem 0 9.6rem }
.back { display: inline-block; color: var(--muted); font-size: 1.4rem; text-decoration: none; margin-bottom: 4.8rem }
.back:hover { color: var(--text) }
.article h1 { font-size: 4.8rem; margin-bottom: 2.4rem }
.article .lead { margin-bottom: 4.8rem }
.article-image { width: 100%; height: auto; border-radius: var(--radius); margin-bottom: 4.8rem }

/* People */
.people { display: grid; grid-template-columns: 36.8rem 36.8rem 36.8rem; gap: 2.4rem }
.people li { padding-top: 2.4rem; border-top: .2rem solid var(--accent) }
.person-name { font-size: 2rem; font-weight: 700 }
.person-role { color: var(--muted) }

/* Call to action */
.cta { margin: 0 0 9.6rem; padding: 6.4rem; background: var(--accent); color: var(--on-accent); border-radius: var(--radius) }
.cta h2 { font-size: 3.2rem; margin-bottom: 1.6rem }
.cta p { max-width: 64rem; opacity: .9 }
.cta .button { margin-top: 3.2rem; background: var(--on-accent); color: var(--accent) }
.cta .button:hover { background: var(--surface) }

/* Contact and forms */
.contact { display: grid; grid-template-columns: 68.8rem 41.6rem; gap: 4.8rem; padding-bottom: 9.6rem }
.contact-details { display: grid; gap: 1.6rem; align-content: start }
.form { display: grid; gap: 2.4rem }
.field { display: grid; gap: .8rem }
.field > span { font-size: 1.4rem; font-weight: 600 }
.field input:not([type="checkbox"]):not([type="file"]), .field textarea, .field select, .admin-filters input, .admin-filters select {
    width: 100%; min-height: 4.4rem; padding: 0 1.6rem; background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: var(--radius)
}
.field textarea { padding: 1.2rem 1.6rem; resize: vertical }
.field input:hover, .field textarea:hover, .field select:hover { border-color: var(--muted) }
.help { color: var(--muted); font-size: 1.3rem }
.error { color: var(--danger); font-size: 1.3rem; font-weight: 600 }
.check { display: flex; align-items: center; gap: .8rem; font-size: 1.4rem }
.notice { padding: 1.6rem 2.4rem; border-radius: var(--radius); margin-bottom: 2.4rem; font-weight: 600 }
.notice-sent { background: #e2efe9; color: #134235 }
.notice-invalid, .notice-limited { background: #f7e5e0; color: #7a2615 }
.hp { position: absolute; left: -100rem }

/* Pagination */
.pagination { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 4.8rem }
.pagination a { display: inline-flex; align-items: center; justify-content: center; min-width: 4.4rem; min-height: 4.4rem; padding: 0 1.2rem;
    border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none }
.pagination a:hover { border-color: var(--muted) }
.pagination a[aria-current] { background: var(--text); color: var(--bg); border-color: var(--text) }

/* Footer */
.footer { display: grid; grid-template-columns: 48rem 30.4rem 30.4rem; gap: 3.2rem; padding: 6.4rem 0 4.8rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 1.4rem }
.footer .brand { display: inline-block; color: var(--text); margin-bottom: 1.6rem }
.footer h2 { color: var(--text); font-size: 1.4rem; margin-bottom: 1.2rem }
.footer p + p { margin-top: 1.2rem }
.footer strong { color: var(--text) }
.footer-rights { grid-column: 1 / -1; padding-top: 3.2rem; border-top: 1px solid var(--line); font-size: 1.3rem }

/* Admin */
body.admin { background: var(--surface); font-size: 1.5rem }
.admin .g-nav { display: flex; flex-direction: column; gap: .4rem; background: var(--text); color: var(--bg) }
.admin .g-main { background: var(--surface); border-right: 1px solid var(--line) }
.admin .g-side { background: var(--bg) }
.admin-brand { font-size: 2rem; font-weight: 800; margin-bottom: 2.4rem }
.admin-brand span { font-weight: 400; opacity: .7 }
.admin-nav-title { margin-top: 2.4rem; font-size: 1.2rem; letter-spacing: .1em; text-transform: uppercase; opacity: .6 }
.admin-nav a { display: block; padding: .8rem 1.2rem; border-radius: var(--radius); text-decoration: none }
.admin-nav a:hover { background: rgba(255, 255, 255, .08) }
.admin-nav a[aria-current] { background: rgba(255, 255, 255, .16); font-weight: 600 }
.admin-user { margin-top: auto; padding-top: 2.4rem; font-size: 1.4rem; opacity: .8 }
.admin-user a, .admin-user .link-button { display: block; padding: .4rem 0 }
.admin-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2.4rem }
.admin-head h1 { font-size: 2.8rem }
.admin-filters { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 2.4rem }
.admin-filters input { flex: 1 1 14rem; min-height: 3.6rem }
.admin-filters select { width: auto; min-height: 3.6rem }
.admin-list { display: grid; gap: .8rem }
.admin-list a { display: block; padding: 1.2rem 1.6rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none }
.admin-list a:hover { border-color: var(--muted) }
.admin-list a[aria-current] { border-color: var(--accent); box-shadow: inset .4rem 0 0 var(--accent) }
.admin-list-title { display: block; font-weight: 600; line-height: 1.3 }
.admin-list-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-top: .8rem; color: var(--muted); font-size: 1.3rem; line-height: 1.5 }
.badge { display: inline-block; padding: 0 .8rem; border-radius: var(--radius); font-size: 1.2rem; font-weight: 600; background: var(--line); color: var(--text) }
.badge-published, .badge-new { background: #d5e8e0; color: #134235 }
.admin-back { margin-bottom: 2.4rem }
.editor-head { display: flex; justify-content: space-between; align-items: center; gap: 2.4rem }
.editor-head h2 { font-size: 2.8rem }
.editor-row { display: grid; grid-template-columns: 20.8rem 20.8rem 20.8rem; gap: 2.4rem }
.locale-group { display: grid; gap: 1.6rem; padding: 2.4rem; border: 1px solid var(--line); border-radius: var(--radius) }
.locale-group legend { padding: 0 .8rem; font-size: 1.3rem; font-weight: 700; color: var(--accent) }
.editor-image { width: 28.8rem; height: auto; border-radius: var(--radius) }
.danger { margin-top: 4.8rem; padding-top: 2.4rem; border-top: 1px solid var(--line) }
.danger summary { color: var(--danger); font-weight: 600; cursor: pointer; line-height: 1.5 }
.danger p { margin: 1.6rem 0 }
.event h2 { font-size: 2.8rem; margin-bottom: 2.4rem }
.event h3 { font-size: 1.6rem; margin: 3.2rem 0 1.2rem }
.event-meta { display: grid; grid-template-columns: 16rem 46.4rem; gap: .8rem 2.4rem }
.event-meta dt { color: var(--muted) }
.admin-auth .auth-card { width: 44.8rem; margin: 9.6rem auto; padding: 4.8rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius) }
.auth-card h1 { font-size: 2.8rem; margin-bottom: 1.6rem }
.auth-card .muted { margin-bottom: 2.4rem }
.auth-card .form { margin-top: 2.4rem }

/* Tablet */
@media (min-width: 640px) and (max-width: 1279px) {
    .g-landing { width: 64rem; padding: 0 3.2rem }
    .g-blog { grid-template-columns: 57.6rem; gap: 4.8rem; width: 57.6rem }
    .g-dashboard { grid-template-columns: 20rem 44rem; width: 64rem }
    .g-side { display: none }
    .g-dashboard.is-open .g-main { display: none }
    .g-dashboard.is-open .g-side { display: block }

    body { font-size: 1.4rem }
    .header { flex-wrap: wrap; gap: 2.4rem 3.2rem; padding: 2.4rem 0 }
    .nav { gap: 2.4rem }
    .hero { padding: 6.4rem 0 }
    .hero h1 { font-size: 5.6rem }
    .lead { font-size: 1.8rem }
    .page-head { padding: 6.4rem 0 3.2rem }
    .page-head h1, .article h1 { font-size: 4rem }
    .prose p { font-size: 1.5rem }
    .stats { grid-template-columns: 17.6rem 17.6rem 17.6rem; gap: 2.4rem; padding: 3.2rem 0 }
    .stat-value { font-size: 4rem }
    .section { padding: 6.4rem 0 }
    .section-head h2 { font-size: 2.8rem }
    .cards, .people, .service-list { grid-template-columns: 57.6rem; gap: 1.6rem }
    .card, .service { padding: 2.4rem }
    .card h2, .card h3 { font-size: 1.8rem }
    .service h2 { font-size: 2.2rem }
    .article { padding: 4.8rem 0 6.4rem }
    .cta { padding: 4.8rem; margin-bottom: 6.4rem }
    .cta h2 { font-size: 2.8rem }
    .contact { grid-template-columns: 57.6rem; gap: 3.2rem; padding-bottom: 6.4rem }
    .footer { grid-template-columns: 27.6rem 27.6rem; gap: 2.4rem }
    .footer-about { grid-column: 1 / -1 }

    .editor-row { grid-template-columns: 39.2rem; gap: 1.6rem }
    .event-meta { grid-template-columns: 12rem 24.8rem }
}

/* Mobile */
@media (max-width: 639px) {
    .g-landing { width: 32rem; padding: 0 1.6rem }
    .g-blog { grid-template-columns: 28.8rem; gap: 3.2rem; width: 28.8rem }
    .g-dashboard { grid-template-columns: 32rem; grid-template-rows: auto 1fr; width: 32rem }
    .g-nav, .g-main, .g-side { padding: 1.6rem }
    .g-side { display: none }
    .g-dashboard.is-open .g-main { display: none }
    .g-dashboard.is-open .g-side { display: block }

    body { font-size: 1.4rem }
    .header { flex-wrap: wrap; gap: 1.6rem; padding: 2.4rem 0 1.6rem }
    .brand { margin-right: auto }
    .nav { order: 3; width: 28.8rem; gap: .8rem 1.6rem }
    .nav a, .languages a { font-size: 1.4rem }
    .languages { gap: 1.2rem }
    .hero { padding: 4.8rem 0 }
    .eyebrow { font-size: 1.2rem; margin-bottom: 1.6rem }
    .hero h1 { font-size: 3.6rem; margin-bottom: 2.4rem }
    .lead { font-size: 1.6rem }
    .actions { margin-top: 3.2rem }
    .button { min-height: 3.6rem; padding: 0 1.6rem; font-size: 1.4rem }
    .page-head { padding: 4.8rem 0 2.4rem }
    .page-head h1, .article h1 { font-size: 2.8rem }
    .prose p { font-size: 1.4rem }
    .stats { grid-template-columns: 28.8rem; gap: 2.4rem; padding: 3.2rem 0 }
    .stat-value { font-size: 3.6rem }
    .section { padding: 4.8rem 0 }
    .section-head { margin-bottom: 3.2rem }
    .section-head h2 { font-size: 2.2rem }
    .section-head-row { flex-direction: column; gap: .8rem }
    .cards, .people, .service-list { grid-template-columns: 28.8rem; gap: 1.6rem }
    .card, .service { padding: 1.6rem }
    .card h2, .card h3 { font-size: 1.7rem }
    .service h2 { font-size: 2rem }
    .article { padding: 3.2rem 0 4.8rem }
    .back { margin-bottom: 3.2rem }
    .article .lead, .article-image { margin-bottom: 3.2rem }
    .cta { padding: 2.4rem; margin-bottom: 4.8rem }
    .cta h2 { font-size: 2.2rem }
    .contact { grid-template-columns: 28.8rem; gap: 3.2rem; padding-bottom: 4.8rem }
    .field input:not([type="checkbox"]):not([type="file"]), .field select { min-height: 3.6rem }
    .pagination a { min-width: 3.6rem; min-height: 3.6rem }
    .footer { grid-template-columns: 28.8rem; gap: 2.4rem; padding: 4.8rem 0 3.2rem; font-size: 1.3rem }

    .admin .g-nav { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .4rem .8rem }
    .admin-brand { width: 28.8rem; margin-bottom: .8rem; font-size: 1.7rem }
    .admin-nav-title { display: none }
    .admin-nav a { padding: .4rem .8rem }
    .admin-user { display: flex; flex-wrap: wrap; gap: .8rem 1.6rem; width: 28.8rem; margin-top: .8rem; padding-top: .8rem; border-top: 1px solid rgba(255, 255, 255, .2) }
    .admin-user p { width: 28.8rem }
    .admin-head h1, .editor-head h2, .event h2 { font-size: 2.2rem }
    .editor-head { flex-wrap: wrap; gap: 1.6rem }
    .editor-row { grid-template-columns: 28.8rem; gap: 1.6rem }
    .locale-group { padding: 1.6rem }
    .editor-image { width: 28.8rem }
    .event-meta { grid-template-columns: 28.8rem; gap: .4rem }
    .event-meta dd { margin-bottom: .8rem }
    .admin-auth .auth-card { width: 28.8rem; margin: 3.2rem auto; padding: 2.4rem }
}
