/*
 * Prototype: the home page as a clock. Loaded after site.css, so it uses the same tokens (nothing new here).
 * Wide screens only; phones and short windows get the normal site (see .fallback).
 */

.clock-page {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background: radial-gradient(ellipse 70% 80% at 50% 48%, var(--surface) 0%, var(--background) 55%, var(--sidebar) 100%) fixed;
}
.clock-page main { flex: 1; display: grid; align-items: center; padding-block: 16px; }
.menu-lite { display: flex; align-items: center; gap: 8px; }
.menu-lite a:not(.btn) { padding: 10px 12px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-weight: 500; font-size: 15px; }
.menu-lite a:not(.btn):hover { background: var(--primary-50); }
.menu-lite .view-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--primary-600); }

/* phones and short windows: the normal site */
.fallback { display: none; text-align: center; justify-items: center; gap: 20px; padding-block: 56px; }
.noscript { text-align: center; }

@media (max-width: 719px), (max-height: 519px) {
    .fallback { display: grid; }
    .stage-wrap { display: none !important; }
}

/* layout: on a tablet (and a narrow window) everything is stacked and close together; on a wide screen the texts go to the sides */
.stage-wrap {
    --size: clamp(420px, min(100vw - 32px, 100svh - 380px), 800px);
    width: min(1280px, 100% - 32px);
    margin-inline: auto;
    display: grid;
    justify-items: center;
    gap: 20px;
}
.stage-side { display: grid; gap: 14px; justify-items: center; text-align: center; max-width: 520px; }
.stage-intro h1 { font-size: clamp(28px, 3.6vw, 40px); }
.stage-intro .ticks { display: none; margin: 8px 0 0; }
.stage-intro .lead { margin-top: 0; font-size: 18px; line-height: 28px; }
.stage-intro { order: 0; }
.clock { order: 1; }
.stage-aside { order: 2; min-height: 0; }
@media (max-width: 1179px) { .stage-intro .lead, .stage-intro .overline { display: none; } }

@media (min-width: 1180px) {
    .stage-wrap {
        --side: clamp(240px, 21vw, 380px);
        --gap: clamp(40px, 5vw, 120px);
        --size: clamp(440px, min(100svh - 170px, 100vw - 2 * var(--side) - 2 * var(--gap) - 64px), 880px);
        width: min(1760px, 100% - 64px);
        grid-template-columns: var(--side) var(--size) var(--side);
        justify-content: space-between;
        align-items: center;
        gap: 0;
    }
    .stage-side { max-width: none; text-align: left; justify-items: start; gap: 18px; }
    .stage-intro h1 { font-size: clamp(34px, 3vw, 52px); }
    .stage-intro .lead { font-size: 19px; }
    .stage-intro .ticks { display: grid; margin-top: 12px; }
    .stage-aside { justify-items: stretch; }
    .stage-aside .btn { justify-self: start; }
}

/* what the part says */
.caption { display: grid; gap: 6px; min-height: 120px; align-content: start; width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 18px 20px; }
.caption-count { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--primary-600); }
.caption-dots { display: inline-flex; gap: 6px; }
.caption-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--primary-200); transition: background-color 180ms ease-out, transform 180ms ease-out; }
.caption-dots span.on { background: var(--primary-600); transform: scale(1.4); }
.caption-title { font-size: 22px; line-height: 28px; font-weight: 600; color: var(--text-strong); }
.caption-text { font-size: 16px; color: var(--text-muted); }
.hint { font-size: 14px; line-height: 20px; color: var(--text-muted); max-width: 340px; }
.hint-touch { display: none; }
@media (hover: none) {
    .hint-fine { display: none; }
    .hint-touch { display: inline; }
}

/* one dialog per hour, born at its hour */
.hour-dialog {
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    color: var(--text);
    width: min(980px, calc(100% - 32px));
    max-height: min(90svh, 900px);
    box-shadow: 0 24px 80px rgb(10 45 105 / 0.3);
    overflow: hidden;
}
.hour-dialog.w-narrow { width: min(760px, calc(100% - 32px)); }
.hour-dialog.w-xl { width: min(1180px, calc(100% - 32px)); max-height: min(94svh, 1000px); }
.hour-dialog[open] { display: block; animation: hour-pop 300ms cubic-bezier(0.2, 0.8, 0.2, 1); transform-origin: var(--ox, 50%) var(--oy, 50%); }
.hour-dialog::backdrop { background: rgb(10 45 105 / 0.38); backdrop-filter: blur(3px); }
.hour-dialog[open]::backdrop { animation: hour-fade 250ms ease-out; }
@keyframes hour-pop { from { opacity: 0; transform: scale(0.5); } to { opacity: 1; transform: none; } }
@keyframes hour-fade { from { opacity: 0; } to { opacity: 1; } }

.dlg { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: min(90svh, 900px); }
.w-xl .dlg { max-height: min(94svh, 1000px); }
.dlg-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; padding: 24px 24px 16px; border-bottom: 1px solid var(--border); }
.dlg-head h2 { font-size: clamp(22px, 3vw, 28px); }
.dlg-close { flex-shrink: 0; min-width: 44px; min-height: 44px; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface); color: var(--text-strong); border-radius: var(--radius-md); cursor: pointer; }
.dlg-close:hover { background: var(--primary-50); }
.dlg-body { padding: 24px; display: grid; gap: 20px; overflow-y: auto; align-content: start; }
.dlg-foot { padding: 14px 24px; border-top: 1px solid var(--border); background: var(--background); font-weight: 600; }
.dlg-foot a { display: inline-flex; align-items: center; min-height: 44px; }
.dlg-body .lead { margin-top: 0; font-size: 18px; line-height: 28px; }
.dlg .card { background: var(--background); box-shadow: none; }
.dlg-section + .dlg-section { margin-top: 12px; padding-top: 28px; border-top: 1px solid var(--border); }
.dlg-section > .section-head { margin-bottom: 20px; }
.dlg-section .section-head h3 { font-size: 24px; line-height: 32px; }
.dlg-section .lead { margin-top: 0; }
.dlg-section .doors-section { padding: 0; }
.dlg-section .band, .dlg-section .section { padding: 0; }
.dlg .tablist { gap: 8px; margin-bottom: 16px; }
.dlg .panel-intro { font-size: 16px; line-height: 24px; margin-bottom: 16px; }
.dlg .screen { min-height: 380px; }
.dlg .phone-screen { min-height: 440px; }

/* slim footer */
.mini-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-block: 12px; font-size: 14px; color: var(--text-muted); border-top: 1px solid var(--border); }
.mini-foot nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.mini-foot a { color: var(--text-muted); display: inline-flex; align-items: center; min-height: 44px; }
.mini-foot a:hover { color: var(--primary-600); }
@media (max-width: 719px), (max-height: 519px) { .mini-foot { display: none; } }

@media (prefers-reduced-motion: reduce) {
    .caption-dots span { transition: none; }
    .hour-dialog[open], .hour-dialog[open]::backdrop { animation: none; }
}
