:root {
    --bg: #274139;
    --bg-2: #14271f;
    --card: #152820;
    --card-2: #20382d;
    --card-bg: rgba(20, 40, 31, .82);
    --text: #f4f6f1;
    --muted: #c0cbc3;
    --accent: #a7f3d0;
    --accent-2: #ffd28a;
    --chip: #2a4437;
    --ring: 0 0 0 2px rgba(167, 243, 208, .2), 0 8px 20px rgba(0, 0, 0, .28);
    --shadow: 0 12px 28px rgba(0, 0, 0, .24);
}

/* Shared responsive polish for every BEUPYQ page using the portal theme. */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    min-width: 320px;
    line-height: 1.55;
}

button,
input,
select,
textarea {
    font: inherit;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid var(--accent-2, #ffd28a);
    outline-offset: 3px;
}

img,
svg,
video,
canvas,
iframe {
    max-width: 100%;
}

table {
    max-width: 100%;
}

@media (max-width: 640px) {
    .app,
    .content,
    main {
        max-width: 100%;
    }

    .content {
        padding-right: max(14px, env(safe-area-inset-right));
        padding-left: max(14px, env(safe-area-inset-left));
    }

    .topbar {
        padding-right: max(10px, env(safe-area-inset-right));
        padding-left: max(10px, env(safe-area-inset-left));
    }

    .sidebar {
        right: max(8px, env(safe-area-inset-right));
        width: min(300px, calc(100vw - 16px));
        max-height: calc(100dvh - 80px);
        overflow-y: auto;
    }

    pre,
    .table-wrap,
    .table-responsive {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    :where(button, .btn, .button, .sidebar-nav a) {
        min-height: 44px;
    }
}

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

html,
body {
    background-color: #101a2c;
    background-image:
        radial-gradient(ellipse at 82% 0%, rgba(36, 127, 134, .22), transparent 35rem),
        radial-gradient(ellipse at 0% 50%, rgba(89, 95, 151, .14), transparent 35rem);
    background-attachment: fixed;
}

a,
button,
.tile,
.info-card,
.card,
.list-row,
.semester-item {
    transition-property: color, background-color, border-color, box-shadow, transform, opacity;
    transition-duration: .2s;
    transition-timing-function: ease;
}

.tile:hover,
.info-card:hover,
.card:hover,
.list-row:hover,
.semester-item:hover {
    border-color: rgba(167, 243, 208, .38);
}

.app > main,
.content {
    animation: portal-enter .4s ease-out both;
}

@keyframes portal-enter {
    from { opacity: 0; transform: translateY(8px) }
    to { opacity: 1; transform: translateY(0) }
}

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