:root {
    --ink: #211b35;
    --muted: #706a7c;
    --purple: #2d2157;
    --purple-light: #514277;
    --gold: #f6c851;
    --cream: #fbf8f0;
    --paper: #ffffff;
    --line: #e5e0d6;
    --green: #246649;
    --green-soft: #e5f2e9;
    --shadow: 0 20px 55px rgba(33, 27, 53, 0.09);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--cream);
    font-family: "DM Sans", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input { font: inherit; }

button,
input[type="checkbox"],
input[type="date"] { cursor: pointer; }

.hero {
    min-height: 460px;
    color: #fff;
    overflow: hidden;
    position: relative;
    background:
        radial-gradient(circle at 83% 30%, rgba(246, 200, 81, 0.32) 0 7%, transparent 7.4%),
        radial-gradient(circle at 78% 47%, rgba(246, 200, 81, 0.12) 0 18%, transparent 18.5%),
        linear-gradient(135deg, #2d2157 0%, #3d2c69 58%, #46356d 100%);
}

.hero::after {
    content: "";
    position: absolute;
    right: -8vw;
    bottom: -220px;
    width: 560px;
    height: 560px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    box-shadow: 0 0 0 50px rgba(255, 255, 255, 0.035), 0 0 0 110px rgba(255, 255, 255, 0.02);
}

.topbar,
.hero-content,
main,
footer {
    width: min(1160px, calc(100% - 40px));
    margin-inline: auto;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 30px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    aspect-ratio: 1;
    border-radius: 14px;
    color: var(--purple);
    background: var(--gold);
    font-family: "Fraunces", Georgia, serif;
}

.campus-label {
    padding: 8px 13px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 86px 0 100px;
}

.eyebrow {
    margin: 0 0 14px;
    color: var(--gold);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.eyebrow.dark { color: var(--purple-light); }

h1,
h2,
h3,
p { margin-top: 0; }

h1,
h2 { font-family: "Fraunces", Georgia, serif; }

h1 {
    max-width: 760px;
    margin-bottom: 20px;
    font-size: clamp(3.2rem, 7vw, 5.7rem);
    line-height: 0.94;
    letter-spacing: -0.055em;
}

h1 em {
    color: var(--gold);
    font-weight: inherit;
}

.hero-copy {
    max-width: 540px;
    margin: 0;
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.05rem;
    line-height: 1.65;
}

main {
    position: relative;
    z-index: 2;
    margin-top: -48px;
}

.controls {
    display: grid;
    grid-template-columns: minmax(160px, 0.72fr) minmax(280px, 1.7fr) minmax(250px, 1fr);
    gap: 22px;
    align-items: end;
    padding: 23px 26px;
    background: var(--paper);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.controls label,
.controls legend,
.control-label {
    color: #4f485c;
    font-size: 0.77rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.control-label,
.search-control > label {
    display: block;
    margin-bottom: 8px;
}

.date-value,
input[type="search"] {
    display: flex;
    align-items: center;
    width: 100%;
    height: 46px;
    color: var(--ink);
    background: #f8f6f1;
    border: 1px solid #e8e3da;
    border-radius: 12px;
}

.date-value {
    padding: 0 11px 0 13px;
    outline: none;
    font-weight: 600;
    color-scheme: light;
}

.date-value::-webkit-calendar-picker-indicator {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.search-field { position: relative; }

.search-field span {
    position: absolute;
    top: 50%;
    left: 15px;
    color: var(--muted);
    font-size: 1.45rem;
    transform: translateY(-54%);
}

input[type="search"] {
    padding: 0 14px 0 43px;
    outline: none;
}

input:focus-visible,
button:focus-visible,
summary:focus-visible {
    outline: 3px solid rgba(246, 200, 81, 0.72);
    outline-offset: 2px;
}

.diet-control {
    display: flex;
    min-width: 0;
    height: 69px;
    margin: 0;
    padding: 23px 0 0;
    gap: 16px;
    border: 0;
}

.diet-control legend { position: absolute; }

.diet-control label {
    display: flex;
    align-items: center;
    gap: 7px;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--green);
}

.menu-shell { padding: 74px 0 30px; }

.menu-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--line);
}

h2 {
    margin: 0;
    font-size: clamp(2.15rem, 4vw, 3.3rem);
    line-height: 1;
    letter-spacing: -0.045em;
}

.item-count {
    margin: 0 0 3px;
    color: var(--muted);
    font-size: 0.92rem;
}

.filter-row {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 28px;
    padding: 22px 0 10px;
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.meal-filters { justify-content: flex-end; }

.filter-pill {
    padding: 9px 14px;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.filter-pill:hover {
    color: var(--purple);
    background: #f2eee5;
}

.filter-pill:disabled {
    color: #aaa3b1;
    background: transparent;
    cursor: not-allowed;
    opacity: 0.7;
}

.filter-pill.active {
    color: #fff;
    background: var(--purple);
    border-color: var(--purple);
}

.meal-filters .filter-pill:first-child:not(:disabled) {
    color: var(--green);
    background: var(--green-soft);
    border-color: #bcdac6;
}

.meal-filters .filter-pill:first-child.active {
    color: #fff;
    background: var(--green);
    border-color: var(--green);
}

.state-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    gap: 18px;
    color: var(--muted);
}

.state-panel[hidden] { display: none; }

.state-panel h3 {
    margin-bottom: 5px;
    color: var(--ink);
}

.state-panel p { margin: 0; }

.loader {
    width: 25px;
    height: 25px;
    border: 3px solid #ded8cc;
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.error-panel > span {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: #8b331f;
    background: #f8e6df;
    border-radius: 50%;
    font-weight: 800;
}

.menu-content { padding-top: 10px; }

.hall-section { padding-top: 54px; }

.hall-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.hall-heading::before {
    content: "";
    flex: 0 0 10px;
    width: 10px;
    height: 34px;
    background: var(--gold);
    border-radius: 999px;
}

.hall-heading h3 {
    margin: 0;
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.72rem;
    letter-spacing: -0.035em;
}

.hall-heading span {
    color: var(--muted);
    font-size: 0.84rem;
}

.meal-section + .meal-section { margin-top: 52px; }

.meal-title {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 19px;
    color: var(--purple);
    font-size: 1.07rem;
}

.meal-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

.serving-now {
    flex: 0 0 auto;
    padding: 5px 9px;
    color: var(--green);
    background: var(--green-soft);
    border-radius: 999px;
    font-size: 0.68rem;
    line-height: 1.2;
    letter-spacing: 0;
}

.station-section + .station-section { margin-top: 28px; }

.station-name {
    margin-bottom: 13px;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

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

.dish-card {
    display: flex;
    flex-direction: column;
    min-height: 200px;
    padding: 21px;
    background: var(--paper);
    border: 1px solid rgba(229, 224, 214, 0.88);
    border-radius: 17px;
    box-shadow: 0 6px 18px rgba(33, 27, 53, 0.035);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.dish-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(33, 27, 53, 0.08);
}

.dish-card h4 {
    margin: 0 0 8px;
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.25rem;
    line-height: 1.18;
    letter-spacing: -0.025em;
}

.dish-description {
    display: -webkit-box;
    overflow: hidden;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.48;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.dish-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
}

.tag {
    padding: 5px 8px;
    color: #5d5667;
    background: #f3f0e9;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
}

.tag.diet {
    color: var(--green);
    background: var(--green-soft);
}

.nutrition {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: 0.77rem;
}

.nutrition summary {
    color: var(--purple-light);
    cursor: pointer;
    font-weight: 700;
}

.nutrition-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 7px 12px;
    margin-top: 12px;
    color: var(--muted);
}

.nutrition-grid b {
    display: block;
    color: var(--ink);
}

footer {
    padding: 58px 0 48px;
    color: var(--muted);
    border-top: 1px solid var(--line);
    font-size: 0.82rem;
    text-align: center;
}

footer p { margin: 0; }

@media (max-width: 900px) {
    .controls { grid-template-columns: 1fr 1.5fr; }

    .diet-control {
        grid-column: 1 / -1;
        height: 35px;
        padding-top: 0;
    }

    .diet-control legend {
        position: static;
        margin-right: 2px;
    }

    .dish-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-row { display: block; }

    .meal-filters {
        justify-content: flex-start;
        margin-top: 10px;
    }
}

@media (max-width: 620px) {
    .topbar,
    .hero-content,
    main,
    footer { width: min(100% - 28px, 1160px); }

    .hero { min-height: 430px; }
    .hero-content { padding-top: 82px; }
    .campus-label { display: none; }

    .controls {
        grid-template-columns: 1fr;
        gap: 17px;
        padding: 20px;
    }

    .diet-control {
        grid-column: auto;
        flex-wrap: wrap;
        height: auto;
    }

    .menu-shell { padding-top: 58px; }
    .menu-header { display: block; }
    .item-count { margin-top: 12px; }

    .filter-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .filter-pills::-webkit-scrollbar { display: none; }
    .filter-pill { flex: 0 0 auto; }
    .hall-section { padding-top: 44px; }
    .hall-heading { align-items: flex-start; }

    .hall-heading span {
        display: block;
        margin-top: 4px;
    }

    .dish-grid { grid-template-columns: 1fr; }
    .dish-card { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
