:root {
    --ink: #202427;
    --muted: #68716f;
    --paper: #fbfaf7;
    --soft: #f1eee7;
    --line: #ded8cd;
    --gold: #b99555;
    --green: #2f6257;
    --danger: #a3483f;
    --white: #ffffff;
    --shadow: 0 14px 30px rgba(32, 36, 39, 0.07);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--paper);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    max-width: 100%;
}

.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(251, 250, 247, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.nav-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    gap: 20px;
}

.brand,
.admin-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    letter-spacing: 0;
}

.brand img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 6px;
    background: var(--ink);
    color: var(--gold);
    font-weight: 800;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--muted);
    font-size: 0.95rem;
}

.main-nav a:hover,
.text-link {
    color: var(--green);
}

.nav-register {
    padding: 8px 12px;
    border-radius: 6px;
    background: var(--green);
    color: var(--white) !important;
}

.nav-admin {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.nav-toggle,
.admin-menu {
    display: none;
}

.hero {
    position: relative;
    min-height: 620px;
    overflow: hidden;
    background: #293331;
    color: var(--white);
}

.hero-slide {
    position: absolute;
    inset: 0;
    display: grid;
    align-items: end;
    opacity: 0;
    transform: scale(1.02);
    pointer-events: none;
    transition: opacity 700ms ease, transform 900ms ease;
}

.hero-slide.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.hero-slide > img,
.page-hero.event-detail > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-slide > img {
    position: absolute;
    inset: 0;
}

.hero-content {
    position: relative;
    padding: 120px 0 96px;
    max-width: 1120px;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.46);
}

.hero h1,
.page-hero h1 {
    max-width: 840px;
    margin: 10px 0 14px;
    font-size: clamp(2rem, 4vw, 4rem);
    line-height: 1.08;
    letter-spacing: 0;
}

.hero p,
.page-hero p {
    max-width: 680px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 1.05rem;
}

.hero-dots {
    position: absolute;
    left: 50%;
    bottom: 26px;
    z-index: 3;
    display: flex;
    gap: 8px;
    transform: translateX(-50%);
}

.hero-dots button {
    width: 10px;
    min-width: 10px;
    height: 10px;
    min-height: 10px;
    padding: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.48);
}

.hero-dots button.active {
    width: 26px;
    background: var(--white);
}

.eyebrow {
    margin: 0;
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.btn,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 0;
    border-radius: 6px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.btn.primary,
button.btn.primary {
    background: var(--green);
    color: var(--white);
}

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

.btn.light {
    background: rgba(255, 255, 255, 0.14);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.28);
}

.btn.small {
    min-height: 36px;
    padding: 8px 12px;
    margin-top: 14px;
}

.section {
    padding: 76px 0;
}

.muted-band {
    background: var(--soft);
}

.split,
.two-col {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 48px;
}

.section h2,
.prose h2,
.form-panel h2,
.contact-list h2,
.admin-panel h2 {
    margin: 8px 0 16px;
    font-size: clamp(1.45rem, 2.2vw, 2.2rem);
    line-height: 1.15;
    letter-spacing: 0;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
    margin-bottom: 26px;
}

.card-grid {
    display: grid;
    gap: 22px;
}

.card-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card-grid.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card-grid.six {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
}

.member-card,
.event-card,
.form-panel,
.contact-list,
.admin-panel,
.stats-grid article,
.login-card,
.install-panel {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.member-card {
    padding: 16px;
}

.home-members .member-card {
    padding: 12px;
}

.member-photo {
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    background: var(--soft);
    overflow: hidden;
    margin-bottom: 14px;
}

.member-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-card h3,
.member-card h2,
.event-card h2,
.event-card h3 {
    margin: 0 0 4px;
    font-size: 1.08rem;
    line-height: 1.25;
}

.home-members .member-card h3 {
    font-size: 0.98rem;
}

.member-card p,
.event-card p,
.site-footer p,
.muted,
.empty-state {
    color: var(--muted);
}

.designation {
    color: var(--green) !important;
    font-weight: 700;
}

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

.gallery-tile {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 8px;
    background: var(--soft);
}

.gallery-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 220ms ease;
}

.gallery-tile:hover img {
    transform: scale(1.04);
}

.gallery-tile span {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 8px 10px;
    border-radius: 6px;
    color: var(--white);
    background: rgba(32, 36, 39, 0.72);
    font-size: 0.9rem;
}

.event-card {
    overflow: hidden;
}

.event-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.event-card div {
    padding: 18px;
}

.event-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

time {
    color: var(--gold);
    font-weight: 800;
    font-size: 0.88rem;
}

.page-hero {
    position: relative;
    padding: 92px 0;
    overflow: hidden;
    color: var(--white);
    background: linear-gradient(135deg, #23282a, #38514a);
}

.page-hero.compact {
    padding: 76px 0;
}

.page-hero.event-detail {
    min-height: 430px;
    display: grid;
    align-items: end;
}

.page-hero.event-detail > img {
    position: absolute;
    inset: 0;
    opacity: 0.44;
}

.page-hero .container {
    position: relative;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.filter-row a {
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--muted);
    background: var(--white);
}

.filter-row a.active {
    color: var(--white);
    background: var(--green);
    border-color: var(--green);
}

.prose {
    font-size: 1.03rem;
}

.form-panel,
.contact-list {
    padding: 24px;
}

.registration-layout {
    align-items: start;
}

form label {
    display: grid;
    gap: 7px;
    color: var(--ink);
    font-weight: 700;
}

form label span,
.focal-copy span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 500;
}

input,
textarea,
select {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--white);
    color: var(--ink);
    font: inherit;
}

textarea {
    resize: vertical;
}

.form-panel form,
.login-card {
    display: grid;
    gap: 14px;
}

.friendly-form {
    gap: 16px;
}

.friendly-form input,
.friendly-form textarea,
.friendly-form select {
    background: #fffefd;
}

.event-option {
    display: grid;
    gap: 4px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.event-option:first-of-type {
    padding-top: 0;
}

.event-option strong {
    line-height: 1.25;
}

.event-option span {
    color: var(--muted);
}

.event-option.active strong {
    color: var(--green);
}

.alert {
    padding: 12px 14px;
    border-radius: 6px;
    margin: 0 0 16px;
}

.alert.success {
    background: #e8f2ee;
    color: var(--green);
}

.alert.error {
    background: #f8e9e7;
    color: var(--danger);
}

.site-footer {
    padding: 44px 0 24px;
    background: var(--ink);
    color: var(--white);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr 0.8fr;
    gap: 30px;
}

.footer-grid p,
.footer-bottom {
    color: rgba(255, 255, 255, 0.68);
}

.footer-bottom {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.login-body,
.install-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(135deg, #202427, #38514a);
}

.login-card,
.install-panel {
    width: min(440px, 100%);
    padding: 30px;
}

.credential-box {
    padding: 14px;
    border-radius: 6px;
    background: var(--soft);
    margin: 16px 0;
}

.admin-body {
    min-height: 100vh;
    background: #f6f4ef;
}

.admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 250px;
    padding: 24px 18px;
    background: var(--ink);
    color: var(--white);
}

.admin-sidebar nav {
    display: grid;
    gap: 6px;
    margin-top: 24px;
}

.admin-sidebar a {
    padding: 10px 12px;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.76);
}

.admin-sidebar a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
}

.admin-main {
    margin-left: 250px;
    padding: 28px;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}

.admin-topbar h1 {
    margin: 2px 0 0;
    font-size: 1.8rem;
    letter-spacing: 0;
}

.admin-topbar span {
    color: var(--muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stats-grid article,
.admin-panel {
    padding: 20px;
}

.stats-grid span {
    color: var(--muted);
}

.stats-grid strong {
    display: block;
    margin-top: 6px;
    font-size: 2rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-grid .full {
    grid-column: 1 / -1;
}

.focal-control {
    display: grid;
    gap: 12px;
}

.focal-copy {
    display: grid;
    gap: 2px;
}

.focal-preview {
    position: relative;
    overflow: hidden;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: var(--soft);
    cursor: crosshair;
    touch-action: none;
}

.focal-wide {
    aspect-ratio: 16 / 9;
}

.focal-square {
    aspect-ratio: 1 / 1;
    max-width: 360px;
}

.focal-gallery {
    aspect-ratio: 4 / 3;
}

.focal-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
}

.focal-preview.has-image img {
    opacity: 1;
}

.focal-preview::before {
    content: "Preview appears after selecting an image";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
    color: var(--muted);
    text-align: center;
}

.focal-preview.has-image::before {
    content: "";
    display: none;
}

.focal-marker {
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid var(--white);
    border-radius: 999px;
    box-shadow: 0 0 0 2px var(--green);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.focal-preview:not(.has-image) .focal-marker {
    display: none;
}

.check {
    display: flex;
    align-items: center;
    gap: 10px;
}

.check input {
    width: auto;
    min-height: auto;
}

.inline-form {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
}

.table-panel {
    margin-top: 20px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 0.86rem;
    text-transform: uppercase;
}

.row-actions,
.status-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.row-actions button,
.status-form button {
    min-height: 34px;
    padding: 7px 10px;
    background: var(--soft);
    color: var(--ink);
}

.status-badge {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 800;
}

.badge-success {
    background: #e8f2ee;
    color: var(--green);
}

.badge-warning {
    background: #fff4d9;
    color: #856222;
}

.badge-danger {
    background: #f8e9e7;
    color: var(--danger);
}

.badge-muted {
    background: var(--soft);
    color: var(--muted);
}

@media (max-width: 900px) {
    .main-nav {
        display: none;
        position: absolute;
        left: 16px;
        right: 16px;
        top: 72px;
        padding: 16px;
        background: var(--white);
        border: 1px solid var(--line);
        border-radius: 8px;
        box-shadow: var(--shadow);
        flex-direction: column;
        align-items: flex-start;
    }

    .main-nav.open {
        display: flex;
    }

    .nav-toggle,
    .admin-menu {
        display: inline-flex;
        background: var(--soft);
        color: var(--ink);
    }

    .hero {
        min-height: 520px;
    }

    .hero-slide > img {
        object-fit: contain !important;
        object-position: center center !important;
        background: #293331;
    }

    .split,
    .two-col,
    .footer-grid,
    .card-grid.three,
    .card-grid.four,
    .card-grid.six,
    .gallery-grid,
    .stats-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 180ms ease;
        z-index: 30;
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
        padding: 20px;
    }
}

@media (max-width: 560px) {
    .container {
        width: min(100% - 24px, 1120px);
    }

    .brand span:last-child {
        max-width: 210px;
        font-size: 0.9rem;
        line-height: 1.25;
    }

    .section {
        padding: 54px 0;
    }

    .hero-content {
        padding: 92px 0 70px;
    }

    .section-head,
    .admin-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .inline-form {
        align-items: stretch;
    }

    .inline-form > * {
        width: 100%;
    }
}
