:root {
    /* Modern Color Palette */
    --emerald-950: #0a2d1a;
    --emerald-900: #0f5a35;
    --emerald-800: #147d4a;
    --emerald-700: #1a9d5d;
    --emerald-600: #10b981;
    --emerald-500: #34d399;
    --cyan: #06b6d4;
    --cyan-light: #22d3ee;
    --blue: #3b82f6;
    --blue-dark: #1e3a8a;
    --amber: #f59e0b;
    --rose: #f43f5e;
    
    /* Legacy names for compatibility */
    --forest-950: #0a2d1a;
    --forest-900: #0f5a35;
    --forest-800: #147d4a;
    --forest-700: #1a9d5d;
    --forest-600: #10b981;
    --leaf: #34d399;
    --cream: #f0fdf9;
    --cream-2: #ecfdf5;
    --gold: #f59e0b;
    --red: #f43f5e;
    --roof: #9d4f34;
    --white: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --line: rgba(15, 90, 53, .08);
    --shadow: 0 20px 50px rgba(15, 90, 53, .12);
    --radius: 12px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, Roboto, Arial, sans-serif;
    color: var(--text);
    background: var(--cream);
    letter-spacing: 0;
}

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

.portal-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background:
        linear-gradient(135deg, rgba(15, 90, 53, .98) 0%, rgba(26, 157, 93, .96) 50%, rgba(15, 90, 53, .94) 100%);
    backdrop-filter: blur(20px);
    color: var(--white);
    border-bottom: 1px solid rgba(52, 211, 153, .12);
    box-shadow: 0 8px 32px rgba(15, 90, 53, .15);
}

.portal-header-inner {
    width: min(1240px, calc(100% - 48px));
    min-height: 86px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-brand img {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: var(--white);
    padding: 5px;
    box-shadow: 0 12px 26px rgba(0, 0, 0, .18);
}

.portal-brand strong,
.portal-brand small {
    display: block;
}

.portal-brand strong {
    font-size: 16px;
}

.portal-brand small {
    margin-top: 3px;
    color: rgba(255, 255, 255, .78);
    font-weight: 700;
}

.portal-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    font-weight: 800;
}

.portal-nav a {
    color: rgba(255, 255, 255, .82);
    position: relative;
}

.portal-nav a:hover,
.portal-nav a:first-child {
    color: var(--white);
}

.portal-nav a:first-child::after,
.portal-nav a:hover::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -10px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, #34d399, #06b6d4);
}

.portal-login,
.portal-primary,
.portal-secondary {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    padding: 0 18px;
    font-weight: 900;
}

.portal-login {
    background: var(--white);
    color: var(--forest-900);
    box-shadow: 0 14px 32px rgba(0, 0, 0, .14);
}

.hero-section {
    min-height: 650px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, .92fr);
    align-items: center;
    gap: 36px;
    padding: 86px max(48px, calc((100vw - 1240px) / 2)) 86px;
    background:
        radial-gradient(circle at 85% 15%, rgba(34, 211, 153, .25), transparent 28%),
        radial-gradient(circle at 15% 85%, rgba(59, 130, 246, .12), transparent 32%),
        radial-gradient(circle at 95% 75%, rgba(6, 182, 212, .15), transparent 25%),
        linear-gradient(135deg, rgba(15, 90, 53, .98) 0%, rgba(10, 45, 26, .97) 40%, rgba(20, 58, 35, .98) 100%);
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 124px;
    background:
        linear-gradient(135deg, transparent 0 18%, rgba(157, 79, 52, .58) 18% 24%, transparent 24% 100%) 0 0 / 360px 100%,
        linear-gradient(0deg, rgba(231, 221, 197, .22) 0 34%, rgba(147, 201, 95, .20) 34% 100%);
    opacity: .75;
}

.hero-section::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 100%) 0 0 / 88px 100%,
        radial-gradient(circle at 12% 24%, rgba(255, 255, 255, .08), transparent 18%);
    pointer-events: none;
}

.hero-content,
.hero-visual {
    position: relative;
    z-index: 1;
}

.portal-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #d1fae5;
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.portal-eyebrow::before {
    content: "";
    width: 28px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, #34d399, #06b6d4);
}

.hero-content h1 {
    max-width: 720px;
    margin: 14px 0 16px;
    font-size: clamp(46px, 6.6vw, 86px);
    line-height: .98;
    letter-spacing: 0;
}

.hero-content p {
    max-width: 690px;
    margin: 0;
    color: rgba(255, 255, 255, .80);
    font-size: 20px;
    line-height: 1.7;
}

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

.portal-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
    color: var(--white);
    box-shadow: 0 12px 24px rgba(16, 185, 129, .3);
    transition: all 0.3s ease;
}

.portal-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(16, 185, 129, .4);
}

.portal-secondary {
    background: rgba(255, 255, 255, .12);
    color: var(--white);
    border: 1.5px solid rgba(52, 211, 153, .32);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.portal-secondary:hover {
    background: rgba(255, 255, 255, .18);
    border-color: rgba(52, 211, 153, .52);
}

.hero-visual {
    min-height: 430px;
    display: grid;
    place-items: center;
}

.archive-illustration {
    position: relative;
    width: min(480px, 90vw);
    height: 340px;
    filter: drop-shadow(0 24px 48px rgba(0, 0, 0, .22));
}

.folder-back,
.folder-front {
    position: absolute;
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.folder-back {
    inset: 40px 40px 70px 28px;
    background: linear-gradient(140deg, #f59e0b 0%, #fbbf24 50%, #f59e0b 100%);
    transform: rotate(-5deg);
    box-shadow: 0 20px 50px rgba(245, 158, 11, .25);
}

.folder-front {
    inset: 105px 12px 24px 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 34px;
    background: linear-gradient(145deg, #10b981 0%, #059669 50%, #047857 100%);
    border: 4px solid rgba(255, 255, 255, .35);
    box-shadow: 0 24px 60px rgba(16, 185, 129, .28);
}

.folder-front span {
    color: rgba(255, 255, 255, .74);
    font-weight: 900;
}

.folder-front strong {
    margin-top: 4px;
    color: var(--white);
    font-size: 56px;
    line-height: 1;
}

.document-stack {
    position: absolute;
    top: 30px;
    right: 54px;
    width: 230px;
    height: 170px;
}

.document-stack span {
    position: absolute;
    inset: calc(var(--i, 0) * 12px) calc(var(--i, 0) * 10px) auto auto;
    width: 190px;
    height: 130px;
    border-radius: 12px;
    background: var(--white);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .14);
}

.document-stack span:nth-child(1) {
    --i: 0;
}

.document-stack span:nth-child(2) {
    --i: 1;
    opacity: .86;
}

.document-stack span:nth-child(3) {
    --i: 2;
    opacity: .72;
}

.public-stat-strip {
    width: min(1240px, calc(100% - 48px));
    margin: -54px auto 0;
    position: relative;
    z-index: 4;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.public-stat-strip article {
    min-height: 120px;
    padding: 22px;
    border-radius: var(--radius);
    background: var(--white);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.public-stat-strip article::before {
    content: "";
    display: block;
    width: 36px;
    height: 4px;
    margin-bottom: 14px;
    border-radius: 999px;
    background: var(--gold);
}

.public-stat-strip span,
.service-card p,
.section-heading p,
.split-section p,
.contact-section p {
    color: var(--muted);
}

.public-stat-strip strong {
    display: block;
    margin-top: 8px;
    font-size: 34px;
    color: var(--forest-900);
}

.portal-section,
.contact-section {
    width: min(1240px, calc(100% - 48px));
    margin: 0 auto;
    padding: 86px 0 0;
}

.section-heading {
    max-width: 840px;
    margin: 0 auto 36px;
    text-align: center;
}

.section-heading.compact {
    margin-bottom: 22px;
}

.section-heading h2,
.split-section h2,
.contact-section h2 {
    margin: 10px 0 12px;
    color: var(--forest-950);
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.1;
}

.section-heading p,
.split-section p,
.contact-section p {
    margin: 0;
    font-size: 17px;
    line-height: 1.7;
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.service-card,
.stats-panel,
.document-links,
.contact-card,
.public-request-form,
.request-success {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow);
}

.service-card {
    min-height: 280px;
    padding: 24px;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.service-card:hover {
    transform: translateY(-4px);
    border-color: rgba(47, 125, 50, .24);
    box-shadow: 0 26px 74px rgba(16, 45, 20, .20);
}

.service-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #e9f8df, #d8edc5);
    color: var(--forest-800);
    font-weight: 900;
}

.service-card h3 {
    margin: 26px 0 12px;
    color: var(--forest-950);
    font-size: 22px;
}

.service-card p {
    margin: 0;
    line-height: 1.65;
}

.stats-section {
    width: 100%;
    max-width: none;
    margin-top: 86px;
    padding: 78px max(40px, calc((100vw - 1180px) / 2));
    background:
        linear-gradient(180deg, rgba(237, 244, 223, .96), rgba(247, 248, 238, .96)),
        var(--cream-2);
}

.stats-panel {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 24px;
}

.split-section {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(360px, 1fr);
    align-items: center;
    gap: 24px;
}

.document-links {
    display: grid;
    gap: 10px;
    padding: 18px;
}

.document-links a {
    min-height: 50px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    border-radius: var(--radius);
    background: #f4f8ec;
    color: var(--forest-950);
    font-weight: 900;
}

.request-section {
    padding-top: 86px;
}

.request-success {
    width: min(760px, 100%);
    margin: 0 auto 16px;
    padding: 16px 18px;
    color: var(--forest-700);
    font-weight: 800;
}

.public-request-form {
    width: min(880px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 22px;
}

.honeypot-field {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.public-request-form label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-weight: 800;
}

.public-request-form label.wide {
    grid-column: 1 / -1;
}

.public-request-form input,
.public-request-form select,
.public-request-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfdfe;
    color: var(--text);
    padding: 12px;
    outline: none;
    font: inherit;
}

.public-request-form button {
    border: 0;
    cursor: pointer;
}

.gallery-section {
    padding-bottom: 78px;
}

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

.gallery-item {
    min-height: 240px;
    display: flex;
    align-items: flex-end;
    padding: 24px;
    border-radius: var(--radius);
    color: var(--white);
    font-size: 24px;
    font-weight: 900;
    background:
        linear-gradient(180deg, rgba(16, 45, 20, .08), rgba(16, 45, 20, .88)),
        linear-gradient(135deg, var(--leaf), var(--roof));
}

.gallery-slideshow-container {
    position: relative;
    width: 100%;
    background: #f9fafb;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-slide {
    position: relative;
    width: 100%;
    height: 100%;
    display: none;
}

.gallery-slide.active {
    display: flex;
}

.gallery-slide-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-slide-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    padding: 24px;
    font-size: 20px;
    font-weight: 700;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 12px 16px;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    border-radius: 4px;
    transition: background 0.2s;
}

.gallery-nav:hover {
    background: rgba(0, 0, 0, 0.8);
}

.gallery-prev {
    left: 12px;
}

.gallery-next {
    right: 12px;
}

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

.gallery-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.2s;
}

.gallery-dot.active {
    background: rgba(255, 255, 255, 0.9);
}

.contact-section {
    max-width: none;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 32px;
    padding: 70px max(48px, calc((100vw - 1240px) / 2));
    background:
        radial-gradient(circle at 80% 12%, rgba(241, 198, 77, .16), transparent 24%),
        linear-gradient(135deg, var(--forest-900), var(--forest-950));
    color: var(--white);
}

.contact-section h2 {
    color: var(--white);
}

.contact-section p {
    color: rgba(255, 255, 255, .78);
}

.contact-card {
    display: grid;
    gap: 10px;
    padding: 20px;
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .18);
}

.contact-card a,
.contact-card strong {
    color: var(--white);
}

.portal-footer {
    min-height: 60px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 24px;
    padding: 18px;
    color: var(--muted);
    background: var(--white);
}

/* Tablet landscape (768px - 1024px) */
@media (max-width: 1023px) {
    .portal-header-inner {
        width: calc(100% - 40px);
        gap: 16px;
    }

    .portal-brand img {
        width: 50px;
        height: 50px;
    }

    .portal-brand strong {
        font-size: 15px;
    }

    .portal-nav {
        display: none;
    }

    .portal-login {
        display: none;
    }

    .hero-section {
        grid-template-columns: 1fr;
        padding: 40px 24px 60px;
        gap: 20px;
    }

    .hero-content {
        order: 2;
    }

    .hero-visual {
        order: 1;
        min-height: 300px;
        margin-bottom: 0;
    }

    .hero-content h1 {
        font-size: 36px;
    }

    .hero-content p {
        font-size: 15px;
    }

    .split-section,
    .contact-section {
        grid-template-columns: 1fr;
        padding: 40px 24px;
    }

    .service-grid,
    .public-stat-strip {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

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

    .stats-section {
        padding: 40px 24px;
    }
}

/* Mobile phone (< 768px) */
@media (max-width: 767px) {
    html {
        font-size: 13px;
    }

    .portal-header {
        min-height: auto;
    }

    .portal-header-inner {
        width: calc(100% - 24px);
        min-height: 64px;
        gap: 12px;
    }

    .portal-brand {
        gap: 8px;
        flex: 1;
        min-width: 0;
    }

    .portal-brand img {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
    }

    .portal-brand strong {
        font-size: 13px;
    }

    .portal-brand small {
        font-size: 10px;
    }

    .portal-nav {
        display: none;
    }

    .portal-login {
        display: none;
    }

    .hero-section {
        grid-template-columns: 1fr;
        padding: 28px 16px 52px;
        gap: 16px;
    }

    .hero-content {
        order: 2;
        text-align: center;
    }

    .hero-visual {
        order: 1;
        min-height: 240px;
        margin-bottom: 0;
    }

    .archive-illustration {
        height: 220px;
    }

    .hero-content h1 {
        font-size: 24px;
        line-height: 1.3;
    }

    .hero-content p {
        font-size: 13px;
        line-height: 1.5;
        margin-bottom: 16px;
    }

    .hero-cta {
        flex-direction: column;
        gap: 10px;
    }

    .hero-cta button,
    .hero-cta a {
        width: 100%;
        padding: 10px 14px;
        font-size: 13px;
        min-height: 40px;
    }

    .stats-section {
        padding: 28px 16px;
    }

    .public-stat-strip {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .public-stat-item {
        padding: 14px 12px;
        text-align: center;
    }

    .public-stat-item strong {
        font-size: 18px;
    }

    .public-stat-item span {
        font-size: 11px;
    }

    .services-section {
        padding: 28px 16px;
    }

    .service-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .service-card {
        padding: 14px;
    }

    .service-card h3 {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .service-card p {
        font-size: 12px;
    }

    .gallery-section {
        padding: 28px 16px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

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

    .gallery-nav {
        padding: 8px 12px;
        font-size: 14px;
    }

    .gallery-slide-caption {
        padding: 16px;
        font-size: 14px;
    }

    .gallery-dots {
        bottom: 12px;
        gap: 6px;
    }

    .gallery-dot {
        width: 10px;
        height: 10px;
    }

    .split-section {
        grid-template-columns: 1fr;
        padding: 28px 16px;
        gap: 16px;
    }

    .split-content,
    .split-visual {
        order: 2;
    }

    .split-content h2 {
        font-size: 18px;
    }

    .split-content p {
        font-size: 13px;
    }

    .contact-section {
        grid-template-columns: 1fr;
        padding: 28px 16px;
    }

    .contact-content h2 {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .contact-content p {
        font-size: 13px;
        margin-bottom: 16px;
    }

    .public-request-form {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .public-request-form input,
    .public-request-form textarea,
    .public-request-form select {
        width: 100%;
        padding: 8px 10px;
        min-height: 40px;
        font-size: 13px;
    }

    .public-request-form textarea {
        padding: 10px;
        min-height: 100px;
    }

    .public-request-form button {
        width: 100%;
        min-height: 40px;
        font-size: 13px;
    }

    .portal-footer {
        padding: 24px 16px;
    }

    .portal-footer-inner {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .portal-footer-inner p {
        font-size: 12px;
    }
}
