/* Outfit – lokal gehostet */
@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 200;
    font-display: swap;
    src: url('../fonts/Outfit-200.ttf') format('truetype');
}
@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/Outfit-400.ttf') format('truetype');
}
@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/Outfit-600.ttf') format('truetype');
}

/* ── Variables ───────────────────────────────────────────
   :root      = Middle (19:00–07:00)
   theme-light = Light  (07:00–19:00)
───────────────────────────────────────────────────────── */
:root {
    --bg:             #0b1520;
    --text-primary:   #c2d4e2;
    --text-secondary: #6a8fa8;
    --ticker-color:   #5a9abf;
    --ring-active:    #4db5ff;
}

body.theme-light {
    --bg:             #dce8f2;
    --text-primary:   #0a1a28;
    --text-secondary: #0d2a42;
    --ticker-color:   #0d2a42;
    --ring-active:    #1a82cc;
    --grad-1:         #dce8f2;
    --grad-2:         #e0d8e8;
    --grad-3:         #d5e8e0;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg);
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    overflow: hidden;
    transition: background-color 0.5s ease;
    user-select: none;
}

/* ── Light-mode animated gradient ─────────────────────── */
body.theme-light {
    background: linear-gradient(-45deg, var(--grad-1), var(--grad-2), var(--grad-3), var(--grad-2), var(--grad-1));
    background-size: 500% 500%;
    animation: gradient-shift 15s ease infinite;
}
@keyframes gradient-shift {
    0%   { background-position:   0%   0%; }
    25%  { background-position: 100%   0%; }
    50%  { background-position: 100% 100%; }
    75%  { background-position:   0% 100%; }
    100% { background-position:   0%   0%; }
}

.hidden { display: none !important; }

/* ── Artwork background ────────────────────────────────── */
.artwork-bg {
    position: fixed; inset: 0; z-index: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(10px) brightness(0.35);
    transform: scale(1.1);
    opacity: 0;
    transition: opacity 1.2s ease;
    pointer-events: none;
}
.artwork-bg.visible { opacity: 1; }
body.theme-light .artwork-bg { filter: blur(10px) brightness(0.55); }

/* ── Clock screen ───────────────────────────────────────── */
.clock-screen {
    position: fixed; inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: clamp(1.8rem, 5vmin, 3rem);
    cursor: pointer;
    z-index: 1;
}

/* ── Main content block ─────────────────────────────────── */
.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(0.8rem, 2.8vmin, 1.6rem);
    transition: transform 0.6s ease;
}

/* ── Time ───────────────────────────────────────────────── */
/* Uhrzeit: +15% größer */
.time {
    font-size: clamp(3.8rem, 16.5vmin, 7.1rem);
    font-weight: 600; line-height: 1;
    color: var(--text-primary); letter-spacing: 0.02em;
    text-shadow: 0 0 40px rgba(77,181,255,0.12);
    transition: color 0.5s ease;
}

/* Smooth pulsing colon */
.colon {
    display: inline-block;
    animation: colon-pulse 2s ease-in-out infinite;
    transition: color 0.5s ease;
}
@keyframes colon-pulse {
    0%,  100% { opacity: 1; }
    50%        { opacity: 0.15; }
}

/* ── Date ───────────────────────────────────────────────── */
/* Datum: doppelte Größe */
.date {
    font-size: clamp(1.44rem, 4.64vmin, 2.0rem);
    font-weight: 300; letter-spacing: 0.06em; line-height: 1.4;
    color: var(--text-secondary);
    transition: color 0.5s ease;
}

/* ── Weather ────────────────────────────────────────────── */
/* Wetter: doppelte Größe */
.weather {
    display: flex; align-items: center; justify-content: center;
    gap: 0.3em;
    font-size: clamp(1.89rem, 7.2vmin, 2.97rem);
    font-weight: 300; letter-spacing: 0.05em;
    color: var(--text-secondary);
    opacity: 0; transition: opacity 0.6s ease, color 0.5s ease;
}
.weather.visible { opacity: 1; }
.weather svg {
    width: 1.35em; height: 1.35em; flex-shrink: 0;
    fill: none; stroke: var(--text-secondary);
    stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
    transition: stroke 0.5s ease;
    transform-origin: center;
}

/* ── Weather icon animations ───────────────────────────── */
.weather svg.weather-sunny      { animation: weather-spin 12s linear infinite; }
.weather svg.weather-clear-night { animation: weather-glow 4s ease-in-out infinite; }
.weather svg.weather-partlycloudy { animation: weather-drift 6s ease-in-out infinite; }
.weather svg.weather-cloudy     { animation: weather-drift 8s ease-in-out infinite; }
.weather svg.weather-fog        { animation: weather-glow 5s ease-in-out infinite; }
.weather svg.weather-rainy,
.weather svg.weather-pouring    { animation: weather-bounce 2s ease-in-out infinite; }
.weather svg.weather-snowy,
.weather svg.weather-snowy-rainy { animation: weather-float 3s ease-in-out infinite; }
.weather svg.weather-lightning,
.weather svg.weather-lightning-rainy { animation: weather-flash 3s ease-in-out infinite; }
.weather svg.weather-windy,
.weather svg.weather-windy-variant { animation: weather-drift 3s ease-in-out infinite; }
.weather svg.weather-hail       { animation: weather-bounce 1.5s ease-in-out infinite; }

@keyframes weather-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes weather-glow {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.6; }
}
@keyframes weather-drift {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(0.15em); }
}
@keyframes weather-bounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(0.1em); }
}
@keyframes weather-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-0.1em) rotate(3deg); }
}
@keyframes weather-flash {
    0%, 100% { opacity: 1; }
    70%      { opacity: 1; }
    75%      { opacity: 0.3; }
    80%      { opacity: 1; }
    85%      { opacity: 0.4; }
    90%      { opacity: 1; }
}

/* ── Astro (Sonne & Mond) ──────────────────────────────── */
.astro {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4em;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.6s ease, max-height 0.6s ease;
}
.astro.visible { opacity: 1; max-height: 12rem; }

.sun-times {
    display: flex;
    align-items: center;
    gap: 0.6em;
    font-size: clamp(1.44rem, 4.64vmin, 2.0rem);
    font-weight: 300;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}
.sun-icon {
    width: 1.4em; height: 1.4em; flex-shrink: 0;
    fill: none; stroke: var(--text-secondary);
    stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
    transition: stroke 0.5s ease;
}
.sun-item {
    display: flex;
    align-items: center;
    gap: 0.15em;
}
.sun-arrow {
    font-size: 0.65em;
    line-height: 1;
}
.sun-arrow.up   { color: var(--ring-active); }
.sun-arrow.down { color: var(--text-secondary); opacity: 0.6; }

.moon-info {
    display: flex;
    align-items: center;
    gap: 0.35em;
    font-size: clamp(1.44rem, 4.64vmin, 2.0rem);
    font-weight: 300;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}
.moon-info svg {
    width: 1.3em; height: 1.3em; flex-shrink: 0;
    transition: fill 0.5s ease;
}

/* ── Ticker ─────────────────────────────────────────────── */
.ticker-wrap {
    width: min(85vw, 480px);
    overflow: hidden;
    opacity: 0;
    max-height: 0;
    transition: opacity 0.6s ease, max-height 0.6s ease;
}
.ticker-wrap.visible {
    opacity: 1;
    max-height: 4rem;
}

.ticker-track {
    display: flex;
    white-space: nowrap;
}

@keyframes ticker-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(var(--ticker-shift)); }
}

.ticker-text,
.ticker-clone {
    flex-shrink: 0;
    font-size: clamp(1.0rem, 3.4vmin, 1.4rem);
    font-weight: 400; letter-spacing: 0.04em;
    color: var(--ticker-color);
    padding-right: 4em;
    transition: color 0.5s ease;
}

/* ── Theme badge ────────────────────────────────────────── */
.theme-badge {
    position: fixed; bottom: 1.2rem; right: 1.4rem;
    font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--text-secondary); opacity: 0; pointer-events: none; z-index: 10;
    transition: opacity 0.4s ease, color 0.5s ease;
}
.theme-badge.show { opacity: 1; }
