/* ===== Analog Clock Theme ===== */

/* Toolbar (rendered in the page header) */
.an-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    align-items: center;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(6px);
}

.an-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--muted, #6b7280);
    letter-spacing: 0.02em;
    user-select: none;
}

.an-switch {
    position: relative;
    width: 38px;
    height: 20px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.an-switch:focus-visible {
    outline: 2px solid rgba(245, 196, 87, 0.6);
    outline-offset: 2px;
}

.an-switch-thumb {
    position: absolute;
    top: 1px;
    left: 1px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #94a3b8;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.25s ease,
                box-shadow 0.25s ease;
}

.an-switch[aria-pressed="true"] {
    background: rgba(245, 196, 87, 0.18);
    border-color: rgba(245, 196, 87, 0.45);
    box-shadow: 0 0 12px rgba(245, 196, 87, 0.25);
}

.an-switch[aria-pressed="true"] .an-switch-thumb {
    transform: translateX(18px);
    background: #f5c457;
    box-shadow: 0 0 8px rgba(245, 196, 87, 0.7);
}

/* ===== Clock ===== */
.an-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.an-clock {
    --clock-size: clamp(260px, 60vmin, 520px);

    position: relative;
    width: var(--clock-size);
    height: var(--clock-size);
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 35%,
            #f3efe6 0%,
            #e8e1d2 40%,
            #c8bda8 75%,
            #a89b85 100%);
    box-shadow:
        0 30px 60px -20px rgba(0, 0, 0, 0.6),
        0 12px 24px -10px rgba(0, 0, 0, 0.4),
        inset 0 -8px 14px rgba(0, 0, 0, 0.18),
        inset 0 6px 10px rgba(255, 255, 255, 0.55),
        0 0 0 1px rgba(0, 0, 0, 0.25);
    color: #1f1c18;
}

.an-face {
    position: absolute;
    inset: 6%;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 40%,
            #fbf8f1 0%,
            #efe9da 70%,
            #ddd4bd 100%);
    box-shadow:
        inset 0 0 0 1px rgba(0, 0, 0, 0.08),
        inset 0 0 22px rgba(0, 0, 0, 0.08);
}

/* ===== Hour ticks (12 + 60 minute marks) ===== */
.an-marks {
    position: absolute;
    inset: 0;
    border-radius: 50%;
}

.an-marks::before,
.an-marks::after {
    content: '';
    position: absolute;
    inset: 0;
}

.an-marks .tick {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 2px;
    height: 50%;
    background: linear-gradient(to top, transparent 92%, rgba(0, 0, 0, 0.45) 92%, rgba(0, 0, 0, 0.45) 100%);
    transform-origin: top center;
    pointer-events: none;
}

.an-marks .tick.major {
    width: 3px;
    background: linear-gradient(to top, transparent 88%, rgba(0, 0, 0, 0.7) 88%, rgba(0, 0, 0, 0.7) 100%);
}

/* ===== Roman / Arabic numerals ===== */
.an-numbers {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.an-numbers .num {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-family: "Georgia", "Times New Roman", serif;
    font-weight: 600;
    font-size: calc(var(--clock-size) * 0.085);
    color: #1c1916;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.an-clock.no-numbers .an-numbers { display: none; }

/* ===== Hands ===== */
.an-hand {
    position: absolute;
    left: 50%;
    bottom: 50%;
    transform-origin: 50% 100%;
    border-radius: 8px;
    will-change: transform;
}

.an-hand-hour {
    width: 6px;
    height: 26%;
    margin-left: -3px;
    background: linear-gradient(to bottom, #1c1916 0%, #1c1916 80%, transparent 100%);
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

.an-hand-minute {
    width: 4px;
    height: 38%;
    margin-left: -2px;
    background: linear-gradient(to bottom, #2a2622 0%, #2a2622 85%, transparent 100%);
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.25);
}

.an-hand-second {
    width: 2px;
    height: 42%;
    margin-left: -1px;
    background: linear-gradient(to bottom, #c0392b 0%, #c0392b 92%, transparent 100%);
    box-shadow: 0 0 6px rgba(192, 57, 43, 0.5);
}

.an-hand-second::after {
    content: '';
    position: absolute;
    bottom: -120%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c0392b;
    transform: translate(-50%, 0);
    box-shadow: 0 0 6px rgba(192, 57, 43, 0.55);
}

/* Sweep mode = the JS sets the exact position every rAF frame, so no
   CSS transition is needed / wanted (it would only cause jitter). */
.an-clock.sweep .an-hand {
    transition: none;
}

/* Ticking mode = second hand jumps once per second */
.an-clock.tick-mode .an-hand-second {
    transition: transform 0.16s cubic-bezier(0.4, 0, 0.6, 1);
}

/* ===== Center pivot ===== */
.an-pivot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #4a4339 0%, #1c1916 60%, #0a0907 100%);
    transform: translate(-50%, -50%);
    box-shadow:
        0 0 0 3px rgba(0, 0, 0, 0.15),
        0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 5;
}

/* ===== Day/date small label on dial ===== */
.an-day,
.an-date {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-family: "Georgia", "Times New Roman", serif;
    color: #1f1c18;
    text-align: center;
    line-height: 1.1;
}

.an-day {
    top: 24%;
    font-size: calc(var(--clock-size) * 0.055);
    letter-spacing: 0.18em;
    font-weight: 700;
    text-transform: uppercase;
}

.an-date {
    top: 33%;
    font-size: calc(var(--clock-size) * 0.045);
    letter-spacing: 0.06em;
}

@media (max-width: 640px) {
    .an-toolbar { gap: 6px 12px; padding: 5px 10px; }
    .an-toggle-label { font-size: 11px; }
}