/* Premium Aesthetic Clock Styles */
:root {
    /* Strict HSL Palette - No Color Noise */
    --hue-accent: 210;
    /* Blue-ish */

    --bg-light-l: 96%;
    --bg-dark-l: 8%;

    --fg-light-l: 15%;
    --fg-dark-l: 90%;

    /* Light Theme Defaults */
    --color-bg: hsl(var(--hue-accent), 10%, var(--bg-light-l));
    --color-fg: hsl(var(--hue-accent), 10%, var(--fg-light-l));
    --color-fg-muted: hsl(var(--hue-accent), 5%, 50%);
    --color-accent: hsl(var(--hue-accent), 60%, 55%);

    --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
}

body.dark {
    --color-bg: hsl(var(--hue-accent), 10%, var(--bg-dark-l));
    --color-fg: hsl(var(--hue-accent), 10%, var(--fg-dark-l));
    --color-fg-muted: hsl(var(--hue-accent), 5%, 40%);
    --color-accent: hsl(var(--hue-accent), 60%, 65%);

    --shadow-soft: 0 20px 50px -10px rgba(0, 0, 0, 0.3);
    --glass-bg: rgba(10, 10, 12, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html,
body {
    height: 100%;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-fg);
    transition: background-color 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), color 0.6s ease;
}

/* Ambient Background Gradient */
body::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 10% 10%, hsla(var(--hue-accent), 60%, 55%, 0.04), transparent 40%),
        radial-gradient(circle at 90% 90%, hsla(var(--hue-accent), 60%, 55%, 0.03), transparent 40%);
    pointer-events: none;
    z-index: 0;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
}

/* Kiosk Utility */
body.no-cursor {
    cursor: none;
}

/* === Typography & Time === */
#clock-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    z-index: 1;
    user-select: none;
    position: relative;
}

.time-wrapper {
    display: flex;
    align-items: baseline;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    /* Subtle fade in on load */
    animation: fade-in-up 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.time-digit {
    font-size: min(25vw, 35vh);
    font-weight: 600;
    letter-spacing: -0.05em;
    position: relative;
    font-variant-numeric: tabular-nums;
}

.time-colon {
    font-size: min(22vw, 30vh);
    margin: 0 0.05em;
    opacity: 0.4;
    font-weight: 300;
    animation: breath 3s ease-in-out infinite;
}

.time-meta {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    margin-left: max(1vw, 1vh);
    padding-bottom: min(3vw, 4vh);
}

.time-seconds {
    font-size: min(6vw, 8vh);
    font-weight: 500;
    opacity: 0.8;
}

.time-ampm {
    font-size: min(3vw, 4vh);
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.5;
    margin-top: 5px;
}

/* Date Info */
.date-container {
    margin-top: 2vh;
    text-align: center;
    opacity: 0;
    animation: fade-in-up 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s forwards;
}

.day-badge {
    display: inline-block;
    padding: 0.3em 1em;
    background: var(--color-fg);
    color: var(--color-bg);
    border-radius: 100px;
    font-size: min(2.5vw, 2vh);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 0.5em;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.date-text {
    font-size: min(3.5vw, 3vh);
    color: var(--color-fg-muted);
    font-weight: 400;
    letter-spacing: 0.02em;
}

/* === Glass Menu === */
#menu-btn {
    position: fixed;
    top: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    z-index: 100;
    transition: background 0.2s;
}

#menu-btn:hover {
    background: rgba(125, 125, 125, 0.1);
}

#menu-btn svg {
    width: 24px;
    height: 24px;
    fill: var(--color-fg);
    opacity: 0.7;
}

#menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 99;
}

#menu-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    bottom: 20px;
    width: min(340px, 90vw);
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 32px;
    box-shadow: var(--shadow-soft);

    display: flex;
    flex-direction: column;
    gap: 32px;

    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: 101;
}

body.menu-open #menu-panel {
    transform: translateX(0);
}

body.menu-open #menu-backdrop {
    opacity: 1;
    pointer-events: auto;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.group-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-fg-muted);
    font-weight: 700;
    margin-bottom: 4px;
}

.control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    font-weight: 500;
}

/* Custom Switch */
.switch {
    width: 48px;
    height: 28px;
    background: rgba(125, 125, 125, 0.2);
    border-radius: 99px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}

.switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.switch.active {
    background: var(--color-accent);
}

.switch.active::after {
    transform: translateX(20px);
}

/* === AdSense === */
.ad-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    display: flex;
    justify-content: center;
    transition: opacity 0.3s;
}

.ad-slot {
    width: 728px;
    height: 90px;
    max-width: 90vw;
    background: rgba(125, 125, 125, 0.05);
    /* Placeholder */
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--color-fg-muted);
}

/* Hide Ads in Menu Mode on mobile for space */
body.menu-open .ad-container {
    opacity: 0;
    pointer-events: none;
}

/* === Animations === */
@keyframes fade-in-up {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes breath {

    0%,
    100% {
        opacity: 0.4;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

/* === Responsive === */
@media (orientation: portrait) {
    .time-wrapper {
        flex-direction: column;
        align-items: center;
    }

    .time-colon {
        display: none;
    }

    .time-meta {
        margin: 1vh 0 0 0;
        align-items: center;
        padding-bottom: 0;
    }

    .time-seconds {
        font-size: 5vh;
    }

    .ad-slot {
        width: 320px;
        height: 50px;
    }
}

/* === New Content Pages (Privacy, Contact) === */
body.content-page {
    display: block;
    overflow-y: auto;
    padding: 0;
}

.content-container {
    max-width: 800px;
    margin: 60px auto;
    padding: 40px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
}

.back-link {
    display: inline-block;
    margin-bottom: 24px;
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.back-link:hover {
    text-decoration: underline;
}

.content-container h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.content-container h2 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.content-container p {
    line-height: 1.7;
    margin-bottom: 1.2rem;
    color: var(--color-fg-muted);
}

.content-container ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    color: var(--color-fg-muted);
}

.content-container li {
    margin-bottom: 0.5rem;
}

.content-container a {
    color: var(--color-accent);
    text-decoration: none;
}

.content-container a:hover {
    text-decoration: underline;
}

.blog-post {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
}

.contact-box {
    margin-top: 2rem;
    padding: 2rem;
    background: rgba(125, 125, 125, 0.05);
    border-radius: 12px;
}

/* === Homepage Content Sections === */
.homepage-content {
    width: 100%;
    max-width: 1000px;
    padding: 80px 20px;
    margin-top: -50px;
    /* Slight overlap for depth */
    z-index: 10;
}

.section-intro {
    text-align: center;
    margin-bottom: 60px;
}

.section-intro h2 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -0.03em;
}

.section-intro p {
    font-size: 1.25rem;
    color: var(--color-fg-muted);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Interactive Blog Cards */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.blog-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 20px;
    padding: 40px;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease;
    cursor: default;
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-soft);
}

.blog-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--color-accent);
}

.blog-card p {
    line-height: 1.7;
    color: var(--color-fg-muted);
    font-size: 1rem;
}

.blog-card .read-more {
    display: inline-block;
    margin-top: 20px;
    font-weight: 600;
    color: var(--color-accent);
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
}

/* Feature Highlights */
.features-container {
    padding: 100px 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.feature-item {
    text-align: center;
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 20px;
    display: inline-block;
}

.feature-item h4 {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

/* Scroll Indicator */
.scroll-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0.6;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-10px);
    }

    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* === Footer Adjustment === */
#site-footer {
    position: relative;
    padding: 60px 0 120px;
    bottom: auto;
    width: 100%;
    text-align: center;
    font-size: 0.8rem;
    z-index: 40;
}

#site-footer a {
    color: var(--color-fg-muted);
    text-decoration: none;
    margin: 0 10px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

#site-footer a:hover {
    opacity: 1;
}

body.menu-open #site-footer {
    opacity: 0;
    pointer-events: none;
}

/* === Fullscreen Logic === */
/* Hide Ads when in Fullscreen Mode */
body:fullscreen .ad-container,
body:-webkit-full-screen .ad-container,
body:-moz-full-screen .ad-container,
body:-ms-fullscreen .ad-container {
    display: none !important;
}

/* Responsive Content */
@media (max-width: 768px) {
    #site-footer {
        bottom: 80px;
    }

    .content-container {
        margin: 0;
        min-height: 100vh;
        border-radius: 0;
        border: none;
    }
}

/* === FIX: Fullscreen Logic (Browser Agent Finding) === */
/* The previous rule targeted body:fullscreen, but JS triggers root fullscreen. */
/* This broader rule ensures ads are hidden regardless of the fullscreen element. */
:fullscreen .ad-container,
:-webkit-full-screen .ad-container,
:-moz-full-screen .ad-container,
:-ms-fullscreen .ad-container {
    display: none !important;
}