/*
Art direction: scholarly ministry, restrained navy and warm gold.
Layout: centered content with an independently centered desktop nav.
Existing RTM mark is preserved without recoloring or distortion.
*/

:root {
    color-scheme: dark;

    --bg: #101722;
    --surface: #182230;
    --surface-2: #202d3d;
    --text: #f3f0e8;
    --muted: #bbc4ce;
    --accent: #dfbd73;
    --accent-hover: #efd39b;
    --on-accent: #18202a;
    --border: rgba(243, 240, 232, .15);

    --font-body: "Avenir Next", "Segoe UI", sans-serif;
    --font-display: "Iowan Old Style", "Palatino Linotype", serif;

    --text-xs: .8125rem;
    --text-sm: .9375rem;
    --text-base: 1rem;
    --text-lg: clamp(1.125rem, 1rem + .5vw, 1.375rem);
    --text-xl: clamp(1.5rem, 1.2rem + 1vw, 2rem);
    --text-title: clamp(2.25rem, 1.5rem + 2.5vw, 4rem);
    --text-hero: clamp(2.6rem, 1.7rem + 3vw, 4.75rem);

    --s1: .25rem;
    --s2: .5rem;
    --s3: .75rem;
    --s4: 1rem;
    --s5: 1.25rem;
    --s6: 1.5rem;
    --s8: 2rem;
    --s10: 2.5rem;
    --s12: 3rem;
    --s16: 4rem;
    --s20: 5rem;
    --s24: 6rem;

    --radius: .75rem;
    --width: 76rem;
    --transition: 180ms ease;
}

[data-theme="light"] {
    color-scheme: light;
    --bg: #f7f5ef;
    --surface: #eeeae0;
    --surface-2: #e4dfd2;
    --text: #172332;
    --muted: #4f5d6a;
    --accent: #775417;
    --accent-hover: #5f4010;
    --on-accent: #ffffff;
    --border: rgba(23, 35, 50, .17);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 8rem;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: var(--text-base)/1.65 var(--font-body);
    -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
    line-height: 1.15;
    text-wrap: balance;
}

h1 {
    font: 500 var(--text-title)/1.08 var(--font-display);
    letter-spacing: -.025em;
}

h2 {
    font-size: var(--text-xl);
}

h3 {
    font-size: var(--text-lg);
}

p {
    text-wrap: pretty;
}

p + p {
    margin-top: var(--s4);
}

a {
    color: inherit;
    text-underline-offset: .25em;
}

a, button {
    transition:
        color var(--transition),
        background-color var(--transition),
        border-color var(--transition);
}

button {
    font: inherit;
    cursor: pointer;
}

button, input {
    color: inherit;
}

a:focus-visible,
button:focus-visible,
main:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 4px;
}

main:focus-visible {
    outline: none;
}

a:active, button:active {
    opacity: .8;
}

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

.container {
    width: min(
        calc(100% - var(--s8)),
        var(--width)
    );
    margin-inline: auto;
}

.section {
    padding-block: clamp(var(--s12), 6vw, var(--s24));
}

.section-tight {
    padding-top: 0;
}

.section-surface {
    background: var(--surface);
}

.muted {
    color: var(--muted);
}

.small {
    font-size: var(--text-sm);
}

.eyebrow {
    color: var(--accent);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
    margin-bottom: var(--s4);
}

.lead {
    font-size: var(--text-lg);
    color: var(--muted);
    max-width: 58ch;
    margin-top: var(--s6);
}

.prose {
    max-width: 65ch;
}

.prose .text-link,
.prose .button {
    margin-top: var(--s6);
}

.section-title {
    font: 500 var(--text-title)/1.1 var(--font-display);
    letter-spacing: -.02em;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s4);
    margin-top: var(--s8);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s2);
    min-height: 48px;
    padding: var(--s3) var(--s6);
    border: 1px solid transparent;
    border-radius: .375rem;
    background: var(--accent);
    color: var(--on-accent);
    font-size: var(--text-sm);
    font-weight: 700;
    text-decoration: none;
    text-align: center;
}

.button:hover {
    background: var(--accent-hover);
}

.button-secondary {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

.button-secondary:hover {
    background: var(--surface-2);
    color: var(--text);
}

.button-small {
    padding: var(--s2) var(--s4);
    min-height: 44px;
}

.text-link {
    display: inline-block;
    font-weight: 600;
    padding-block: var(--s3);
}

.text-link:hover {
    color: var(--accent);
}

.skip-link {
    position: absolute;
    top: var(--s4);
    left: var(--s4);
    z-index: 100;
    transform: translateY(-200%);
    padding: var(--s3) var(--s4);
    color: var(--on-accent);
    background: var(--accent);
}

.skip-link:focus {
    transform: none;
}

.announcement {
    border-bottom: 1px solid var(--border);
    padding-block: var(--s2);
    font-size: var(--text-xs);
    color: var(--muted);
    text-align: center;
}

.announcement .container {
    text-align: center;
    text-wrap: balance;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    min-height: 94px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: var(--s6);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: var(--s3);
    width: fit-content;
    color: var(--text);
    text-decoration: none;
    min-width: 0;
}

.brand img {
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
    object-fit: contain;
}

.brand-name {
    font-size: var(--text-sm);
    font-weight: 700;
    line-height: 1.25;
}

.brand-name > span {
    display: block;
    font-size: var(--text-xs);
    color: var(--muted);
    font-weight: 500;
    margin-top: var(--s1);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.primary-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--s5);
}

.primary-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    font-size: var(--text-sm);
    text-decoration: none;
    white-space: nowrap;
}

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

.header-actions {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: var(--s3);
}

.theme-toggle,
.menu-toggle {
    min-height: 44px;
    min-width: 44px;
    border: 1px solid var(--border);
    border-radius: .375rem;
    padding: var(--s2) var(--s3);
    color: var(--text);
    background: transparent;
    font-size: var(--text-sm);
}

.theme-toggle:hover,
.menu-toggle:hover {
    background: var(--surface-2);
}

.menu-toggle {
    display: none;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, .85fr);
    gap: var(--s16);
    align-items: center;
}

.hero h1 {
    font-size: var(--text-hero);
}

.hero h1 em {
    color: var(--accent);
    font-weight: inherit;
}

.next-class {
    padding: var(--s8);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.hero-mark {
    width: 112px;
    height: 112px;
    object-fit: contain;
    margin-bottom: var(--s8);
}

.next-class h2 {
    margin-bottom: var(--s4);
}

.class-time {
    font-size: var(--text-lg);
    font-weight: 600;
}

.class-time span {
    display: block;
    color: var(--muted);
    font-size: var(--text-sm);
    font-weight: 400;
}

.next-class .button {
    margin-block: var(--s6);
}

.editorial-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: var(--s16);
    align-items: start;
}

.section-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: var(--s6);
    margin-bottom: var(--s8);
}

.page-intro h1 {
    max-width: 22ch;
}

.page-intro .small {
    margin-top: var(--s6);
    max-width: 70ch;
}

.video-card {
    min-width: 0;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.video-player {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--surface-2);
    overflow: hidden;
}

.video-launch {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: var(--surface-2);
    color: var(--text);
}

.video-launch img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-launch::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .16);
}

.play-label {
    position: absolute;
    z-index: 1;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: #101722;
    color: #f3f0e8;
    border: 1px solid rgba(255, 255, 255, .45);
    padding: var(--s3) var(--s5);
    border-radius: .375rem;
    font-size: var(--text-sm);
    white-space: nowrap;
}

.video-launch:hover .play-label {
    background: #263549;
}

.video-empty-art {
    display: grid;
    place-items: center;
    height: 100%;
    font-size: var(--text-xl);
}

.video-player iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-info {
    padding: var(--s6);
}

.video-info h2 {
    font-family: var(--font-body);
    font-size: var(--text-lg);
    line-height: 1.35;
}

.video-info .small {
    margin-top: var(--s3);
}

.video-featured {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    align-items: center;
}

.video-featured .video-info {
    padding: var(--s8);
}

.video-featured h2 {
    font-size: var(--text-xl);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s6);
    margin-top: var(--s8);
}

.channel-action {
    margin-top: var(--s10);
    text-align: center;
}

.empty-state {
    padding: var(--s12) var(--s8);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.empty-state p {
    max-width: 60ch;
    margin-block: var(--s4) var(--s6);
    color: var(--muted);
}

.agenda {
    display: grid;
    gap: var(--s4);
}

.agenda-day {
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: var(--s8);
    padding: var(--s8);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.agenda-day.is-today {
    background: var(--surface);
}

.agenda-day-heading h2 {
    font-size: var(--text-lg);
}

.badge {
    display: inline-block;
    padding: var(--s1) var(--s3);
    margin-top: var(--s3);
    color: var(--accent);
    background: var(--surface-2);
    font-size: var(--text-xs);
    border-radius: 999px;
}

.agenda-event {
    display: grid;
    grid-template-columns: 7rem minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--s6);
    padding-block: var(--s4);
}

.agenda-event + .agenda-event {
    border-top: 1px solid var(--border);
}

.agenda-event:first-child {
    padding-top: 0;
}

.agenda-event:last-child {
    padding-bottom: 0;
}

.agenda-event h3 {
    font-size: var(--text-base);
}

.agenda-event a {
    font-size: var(--text-sm);
    padding-block: var(--s3);
}

.agenda-time {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.connect-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s6);
}

.panel {
    padding: var(--s8);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.panel h2 + p {
    margin-top: var(--s4);
    color: var(--muted);
}

.panel > .small {
    margin-top: var(--s6);
}

.details {
    margin: var(--s8) 0 0;
}

.details > div {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--s2) var(--s4);
    padding-block: var(--s3);
    border-bottom: 1px solid var(--border);
}

.details dt {
    color: var(--muted);
}

.details dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 600;
}

.legal-content {
    max-width: 52rem;
}

.notice {
    padding: var(--s5);
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: .375rem;
    margin-block: var(--s6);
}

.legal-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s2) var(--s5);
    margin-top: var(--s6);
}

.legal-navigation a {
    padding-block: var(--s3);
}

.legal-section {
    padding-block: var(--s10);
    border-top: 1px solid var(--border);
    scroll-margin-top: 8rem;
}

.legal-section h2 {
    margin-bottom: var(--s5);
}

.legal-section h3 {
    margin-top: var(--s6);
    margin-bottom: var(--s3);
}

.legal-section p {
    color: var(--muted);
}

.site-footer {
    border-top: 1px solid var(--border);
    padding-top: var(--s12);
    margin-top: var(--s10);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: var(--s10);
}

.footer-description {
    max-width: 36ch;
    margin-top: var(--s5);
    font-size: var(--text-sm);
}

.footer-links {
    display: grid;
    align-content: start;
    gap: var(--s2);
}

.footer-links a {
    width: fit-content;
    font-size: var(--text-sm);
    padding-block: var(--s2);
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--s4);
    margin-top: var(--s10);
    border-top: 1px solid var(--border);
    padding-block: var(--s6);
    color: var(--muted);
    font-size: var(--text-xs);
}

.footer-bottom p + p {
    margin-top: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 1100px) {
    .header-inner {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0 var(--s4);
        min-height: 84px;
    }

    .header-actions {
        grid-column: 2;
        grid-row: 1;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .primary-nav {
        grid-column: 1 / -1;
        grid-row: 2;
        display: none;
        flex-direction: column;
        gap: var(--s2);
        padding-block: var(--s4) var(--s6);
        text-align: center;
    }

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

    .primary-nav a {
        width: 100%;
        justify-content: center;
    }

    .hero-grid,
    .editorial-grid {
        gap: var(--s10);
    }

    .agenda-day {
        grid-template-columns: 11rem minmax(0, 1fr);
    }

    .agenda-event {
        grid-template-columns: 6rem minmax(0, 1fr);
        gap: var(--s3) var(--s5);
    }

    .agenda-event a {
        grid-column: 2;
        width: fit-content;
    }
}

@media (max-width: 760px) {
    .hero-grid,
    .editorial-grid,
    .connect-grid,
    .video-featured {
        grid-template-columns: 1fr;
    }

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

    .hero-grid {
        gap: var(--s10);
    }

    .next-class {
        padding: var(--s6);
    }

    .hero-mark {
        width: 88px;
        height: 88px;
        margin-bottom: var(--s6);
    }

    .agenda-day {
        grid-template-columns: 1fr;
        gap: var(--s5);
        padding: var(--s6);
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--s8);
    }

    .footer-grid > :first-child {
        grid-column: 1 / -1;
    }

    .header-zoom {
        display: none;
    }
}

@media (max-width: 480px) {
    .container {
        width: calc(100% - var(--s8));
    }

    .brand img {
        width: 42px;
        height: 42px;
    }

    .brand-name {
        font-size: var(--text-xs);
        max-width: 9rem;
    }

    .brand-name > span {
        font-size: .75rem;
    }

    .header-actions {
        gap: var(--s2);
    }

    .theme-toggle,
    .menu-toggle {
        padding-inline: var(--s2);
        font-size: var(--text-xs);
    }

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

    .video-featured .video-info,
    .panel {
        padding: var(--s6);
    }

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

    .actions {
        align-items: stretch;
    }

    .actions .button {
        flex: 1 1 auto;
    }

    .empty-state {
        padding: var(--s8) var(--s6);
    }
}

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

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