:root {
    color-scheme: light;
    --green-950: #123523;
    --green-900: #14532d;
    --green-800: #166534;
    --green-700: #15803d;
    --green-100: #dcfce7;
    --green-50: #f0fdf4;
    --ink: #172033;
    --muted: #64748b;
    --line: #e2e8e3;
    --surface: #ffffff;
    --page: #f7faf7;
    --shadow: 0 16px 42px #12281912;
    font-family: "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background: var(--page);
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    margin: 0;
    line-height: 1.6;
}

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

a {
    color: var(--green-800);
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid #65a30d;
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 20;
    padding: 10px 14px;
    transform: translateY(-160%);
    border-radius: 8px;
    background: white;
    color: var(--green-900);
    font-weight: 700;
}

.skip-link:focus {
    transform: translateY(0);
}

.topline {
    background: var(--green-950);
    color: #e5f5e9;
    font-size: 13px;
}

.topline-inner,
.nav-inner,
.container,
.footer-inner {
    width: min(1160px, calc(100% - 40px));
    margin: 0 auto;
}

.topline-inner {
    display: flex;
    justify-content: flex-end;
    gap: 22px;
    padding: 8px 0;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid #e8eee8;
    background: #fffffffa;
    backdrop-filter: blur(12px);
}

.nav-inner {
    display: flex;
    min-height: 82px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: flex;
    min-width: 0;
    align-items: center;
    color: var(--ink);
    text-decoration: none;
}

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

.primary-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.primary-nav a {
    padding: 10px 11px;
    border-radius: 8px;
    color: #334155;
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
    background: var(--green-50);
    color: var(--green-800);
}

.primary-nav .nav-apply {
    margin-left: 6px;
    padding: 11px 15px;
    background: var(--green-800);
    color: white;
}

.primary-nav .nav-apply:hover {
    background: var(--green-900);
    color: white;
}

.primary-nav .nav-apply[aria-current="page"] {
    background: var(--green-900);
    color: white;
}

.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: white;
    color: var(--green-900);
    cursor: pointer;
    font-size: 21px;
}

.hero {
    position: relative;
    min-height: 550px;
    display: grid;
    align-items: center;
    overflow: hidden;
    background: var(--green-950);
    color: white;
}

.hero::before {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, #102d20f2 0%, #102d20c9 46%, #102d2061 100%),
        url("kisii-polytechnic-campus.jpg") center 48% / cover;
    content: "";
}

.hero-content {
    position: relative;
    z-index: 1;
    width: min(1160px, calc(100% - 40px));
    margin: 0 auto;
    padding: 76px 0 86px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 18px;
    color: #c8f3d2;
    font-size: 12px;
    font-weight: 750;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.eyebrow::before {
    width: 26px;
    height: 2px;
    background: #86efac;
    content: "";
}

.hero h1 {
    max-width: 720px;
    margin: 0;
    font-size: clamp(38px, 6vw, 66px);
    line-height: 1.04;
    letter-spacing: -.045em;
}

.hero p {
    max-width: 620px;
    margin: 22px 0 0;
    color: #e3eee6;
    font-size: clamp(16px, 2vw, 19px);
}

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

.button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 11px 17px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--green-800);
    color: white;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background .18s ease, transform .18s ease;
}

.button:hover {
    transform: translateY(-1px);
    background: var(--green-900);
}

.button-light {
    border-color: #ffffff9c;
    background: #ffffff12;
    color: white;
}

.button-light:hover {
    background: #ffffff24;
}

.button-outline {
    border-color: #b7d5bd;
    background: white;
    color: var(--green-900);
}

.button-outline:hover {
    background: var(--green-50);
}

.quick-links {
    position: relative;
    z-index: 2;
    width: min(1040px, calc(100% - 40px));
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: -38px auto 0;
    border: 1px solid #e7eee8;
    border-radius: 14px;
    background: white;
    box-shadow: var(--shadow);
}

.quick-link {
    display: flex;
    min-height: 104px;
    align-items: center;
    gap: 16px;
    padding: 22px 24px;
    color: var(--ink);
    text-decoration: none;
}

.quick-link + .quick-link {
    border-left: 1px solid var(--line);
}

.quick-link:hover strong {
    color: var(--green-800);
}

.quick-icon {
    display: grid;
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 12px;
    background: var(--green-50);
    color: var(--green-800);
    font-size: 22px;
}

.quick-link strong,
.quick-link span {
    display: block;
}

.quick-link strong {
    font-size: 15px;
}

.quick-link span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.section {
    padding: 76px 0;
}

.section-soft {
    background: #eef5ef;
}

.section-heading {
    max-width: 690px;
    margin-bottom: 30px;
}

.section-heading .eyebrow {
    margin-bottom: 10px;
    color: var(--green-800);
}

.section-heading h2,
.page-hero h1 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(29px, 4vw, 42px);
    line-height: 1.15;
    letter-spacing: -.035em;
}

.section-heading p {
    margin: 13px 0 0;
    color: var(--muted);
}

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

.department-card {
    min-height: 158px;
    padding: 23px;
    border: 1px solid #e3ebe4;
    border-radius: 12px;
    background: white;
    box-shadow: 0 8px 24px #102a1b08;
}

.department-card .number {
    color: var(--green-700);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .1em;
}

.department-card h3 {
    margin: 12px 0 0;
    font-size: 17px;
    line-height: 1.35;
}

.department-card h3 a {
    color: inherit;
    text-decoration: none;
}

.department-card h3 a:hover {
    color: var(--green-800);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.department-card p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 54px;
}

.split-image {
    width: 100%;
    min-height: 340px;
    max-height: 440px;
    object-fit: cover;
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.split-copy h2 {
    margin: 0;
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.15;
    letter-spacing: -.035em;
}

.split-copy p {
    margin: 16px 0;
    color: var(--muted);
}

.page-hero {
    padding: 74px 0 68px;
    background: linear-gradient(135deg, #f0fdf4, #e5f1e7);
}

.page-hero .container {
    max-width: 850px;
}

.page-hero .eyebrow {
    margin-bottom: 12px;
    color: var(--green-800);
}

.page-hero p {
    max-width: 700px;
    margin: 16px 0 0;
    color: #526276;
    font-size: 17px;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(250px, .75fr);
    gap: 28px;
    align-items: start;
}

.content-card,
.info-card {
    padding: 25px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
}

.content-card h2,
.content-card h3,
.info-card h2,
.info-card h3 {
    margin-top: 0;
    line-height: 1.3;
}

.content-card p,
.info-card p,
.content-card li {
    color: #526276;
}

.content-card li + li {
    margin-top: 10px;
}

.department-list {
    display: grid;
    gap: 14px;
}

.level-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 20px;
    margin-bottom: 24px;
    padding: 18px 20px;
    border: 1px solid #dce9de;
    border-radius: 11px;
    background: var(--green-50);
}

.level-panel p {
    margin: 0;
    color: #435449;
    font-size: 14px;
    font-weight: 700;
}

.level-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.level-list span {
    padding: 5px 10px;
    border: 1px solid #cce3d0;
    border-radius: 999px;
    background: white;
    color: var(--green-900);
    font-size: 12px;
    font-weight: 700;
}

.department-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 19px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: white;
}

.department-row .quick-icon {
    width: 40px;
    height: 40px;
    font-size: 17px;
}

.department-row h2 {
    margin: 2px 0 5px;
    font-size: 17px;
}

.department-row h2 a,
.admin-departments h3 a {
    color: inherit;
    text-decoration: none;
}

.department-row h2 a:hover,
.admin-departments h3 a:hover {
    color: var(--green-800);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.admin-departments {
    display: grid;
    gap: 14px;
    margin-top: 40px;
}

.admin-departments > h2 {
    margin: 0;
    font-size: 22px;
}

.admin-departments h3 {
    margin: 2px 0 5px;
    font-size: 17px;
}

.department-row p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.notice-card {
    padding: 19px 21px;
    border: 1px solid #f0d99c;
    border-radius: 11px;
    background: #fffbeb;
    color: #684f16;
}

.notice-spaced {
    margin-bottom: 24px;
}

.notice-spaced-top {
    margin-top: 22px;
}

.contact-card .contact-value {
    margin-top: 12px;
}

.footer-demo-link {
    color: inherit;
}

.notice-card p {
    margin: 0;
}

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

.contact-card {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
}

.contact-card h2 {
    margin: 12px 0 5px;
    font-size: 17px;
}

.contact-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.contact-card a {
    font-weight: 700;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.site-footer {
    padding: 46px 0 18px;
    background: var(--green-950);
    color: #e5f5e9;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: 38px;
    padding-bottom: 32px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    text-decoration: none;
    font-weight: 750;
}

.footer-brand img {
    width: 48px;
    height: 54px;
    object-fit: contain;
    border-radius: 4px;
    background: white;
}

.footer-intro {
    max-width: 380px;
    color: #c5d8ca;
    font-size: 14px;
}

.footer-column h2 {
    margin: 2px 0 12px;
    color: white;
    font-size: 14px;
}

.footer-column a {
    display: block;
    width: fit-content;
    margin: 8px 0;
    color: #d3e4d7;
    font-size: 13px;
    text-decoration: none;
}

.footer-column > span {
    display: block;
    margin: 8px 0;
    color: #d3e4d7;
    font-size: 13px;
}

.footer-column a:hover {
    color: white;
    text-decoration: underline;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding-top: 16px;
    border-top: 1px solid #ffffff2b;
    color: #c5d8ca;
    font-size: 12px;
}

@media (max-width: 900px) {
    .nav-inner {
        min-height: 72px;
    }

    .menu-toggle {
        display: inline-grid;
        flex: 0 0 auto;
        place-items: center;
    }

    .primary-nav {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        display: none;
        align-items: stretch;
        padding: 10px 20px 18px;
        border-bottom: 1px solid var(--line);
        background: white;
        box-shadow: 0 16px 24px #102a1b10;
    }

    .primary-nav.is-open {
        display: grid;
    }

    .primary-nav a {
        padding: 12px;
    }

    .primary-nav .nav-apply {
        margin: 5px 0 0;
        text-align: center;
    }

    .department-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {
    .topline-inner,
    .nav-inner,
    .container,
    .footer-inner {
        width: min(100% - 32px, 1160px);
    }

    .topline-inner {
        justify-content: center;
        gap: 14px;
        font-size: 11px;
    }

    .brand img {
        width: 180px;
        height: 53px;
    }

    .hero {
        min-height: 500px;
    }

    .hero::before {
        background:
            linear-gradient(90deg, #102d20e8, #102d2090),
            url("kisii-polytechnic-campus.jpg") center / cover;
    }

    .hero-content {
        width: calc(100% - 32px);
        padding: 68px 0 82px;
    }

    .quick-links {
        width: calc(100% - 32px);
        grid-template-columns: 1fr;
        margin-top: -28px;
    }

    .quick-link {
        min-height: 82px;
        padding: 16px 18px;
    }

    .quick-link + .quick-link {
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .section {
        padding: 56px 0;
    }

    .department-grid,
    .split,
    .content-grid,
    .contact-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .split {
        gap: 26px;
    }

    .split-image {
        min-height: 240px;
    }

    .page-hero {
        padding: 56px 0;
    }

    .footer-grid {
        gap: 22px;
    }

    .footer-bottom {
        flex-direction: column;
    }
}

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

    *,
    *::before,
    *::after {
        transition-duration: .01ms !important;
    }
}
