/* =====================================================
   1. CSS VARIABLES / ROOT CONFIG
===================================================== */
:root {
  --color-bg: #06070d;
  --color-glass: rgba(255, 255, 255, 0.06);
  --color-glass-border: rgba(255, 255, 255, 0.12);
  --color-text-primary: #f3f5fc;
  --color-text-muted: #8b91ac;

  --color-accent: #8b5cf6;
  --color-accent-2: #3b82f6;
  --color-accent-3: #ec4899;
  --gradient-accent: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 60%, #ec4899 100%);

  --shadow-soft: 0 20px 60px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 90px rgba(139, 92, 246, 0.25);

  --radius-lg: 32px;
  --radius-md: 18px;

  --transition-fast: 0.2s ease;
  --transition-med: 0.5s cubic-bezier(0.22, 1, 0.36, 1);

  --font-main: 'Poppins', sans-serif;
}

/* =====================================================
   2. RESET
===================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  font-family: var(--font-main);
  background: var(--color-bg);
  color: var(--color-text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font-family: inherit;
  border: none;
  outline: none;
  cursor: pointer;
  background: none;
}

/* =====================================================
   3. ANIMATED AURORA BACKGROUND
===================================================== */
.aurora-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  will-change: transform;
}

.blob-1 {
  width: 480px;
  height: 480px;
  top: -120px;
  left: -100px;
  background: var(--color-accent);
  animation: floatBlob1 16s ease-in-out infinite;
}

.blob-2 {
  width: 420px;
  height: 420px;
  bottom: -140px;
  right: -100px;
  background: var(--color-accent-2);
  animation: floatBlob2 18s ease-in-out infinite;
}

.blob-3 {
  width: 360px;
  height: 360px;
  top: 40%;
  left: 50%;
  background: var(--color-accent-3);
  animation: floatBlob3 20s ease-in-out infinite;
}

@keyframes floatBlob1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 80px) scale(1.15); }
}

@keyframes floatBlob2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-70px, -50px) scale(1.1); }
}

@keyframes floatBlob3 {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-40%, -60%) scale(1.2); }
}

/* =====================================================
   4. HEADER (logo only, no navigation)
===================================================== */
.site-header {
  position: relative;
  z-index: 10;
  width: 100%;
  padding: 1.6rem 0;
  animation: fadeDown 0.7s var(--transition-med);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.logo-accent {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* =====================================================
   5. MAIN / CLOCK CARD
===================================================== */
.main-content {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

.clock-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  padding: 3rem 2.2rem 2.6rem;
  text-align: center;
  background: var(--color-glass);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--shadow-soft), var(--shadow-glow);
  animation: cardEntrance 0.9s var(--transition-med) both;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.clock-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-soft), 0 0 110px rgba(139, 92, 246, 0.35);
}

.clock-greeting {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 1.6rem;
}

/* =====================================================
   6. CIRCULAR PROGRESS RING
===================================================== */
.ring-wrapper {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 0 auto;
}

.progress-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 6;
}

.ring-fill {
  fill: none;
  stroke: url(#none);
  stroke: var(--color-accent-2);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 615.75; /* 2 * PI * 98 */
  stroke-dashoffset: 615.75;
  transition: stroke-dashoffset 0.3s linear;
  filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.7));
}

.ring-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.clock-display {
  font-size: clamp(1.9rem, 7vw, 2.5rem);
  font-weight: 700;
  letter-spacing: 1px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.1em;
  background: linear-gradient(135deg, #ffffff 0%, #c6b8f7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}

.clock-display .colon {
  animation: blink 1s steps(1) infinite;
  color: var(--color-accent-2);
  -webkit-text-fill-color: var(--color-accent-2);
}

.clock-display .ampm {
  font-size: 0.38em;
  font-weight: 600;
  margin-left: 0.25em;
  color: var(--color-accent-3);
  -webkit-text-fill-color: var(--color-accent-3);
  align-self: center;
}

.seconds-display {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  font-variant-numeric: tabular-nums;
}

.seconds-display #seconds {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.seconds-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--color-text-muted);
}

/* =====================================================
   7. DATE DISPLAY
===================================================== */
.date-display {
  margin-top: 1.8rem;
  font-size: 0.98rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 400;
}

.date-display .dot {
  color: var(--color-accent-2);
}

#weekday {
  color: var(--color-text-primary);
  font-weight: 500;
}

/* =====================================================
   8. FORMAT TOGGLE (12h / 24h)
===================================================== */
.format-toggle {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}

.format-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.toggle-switch {
  position: relative;
  width: 52px;
  height: 28px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--color-glass-border);
  border-radius: 999px;
  transition: background var(--transition-fast);
}

.toggle-switch:focus-visible {
  outline: 2px solid var(--color-accent-2);
  outline-offset: 3px;
}

.toggle-switch[aria-checked="true"] {
  background: var(--gradient-accent);
}

.toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform var(--transition-med);
}

.toggle-switch[aria-checked="true"] .toggle-knob {
  transform: translateX(24px);
}

/* =====================================================
   9. FOOTER
===================================================== */
.site-footer {
  position: relative;
  z-index: 10;
  background: rgba(6, 7, 13, 0.6);
  border-top: 1px solid var(--color-glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 2.5rem 1.5rem 1.5rem;
  animation: fadeIn 0.9s var(--transition-med) both;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-logo {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.footer-tagline {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
}

.footer-contact p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 0.4rem;
}

.footer-contact a {
  color: var(--color-accent-2);
  transition: color var(--transition-fast);
}

.footer-contact a:hover {
  color: var(--color-text-primary);
}

.challenge-tag {
  color: var(--color-accent-3) !important;
}

.footer-bottom {
  margin-top: 1.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--color-glass-border);
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* =====================================================
   10. ANIMATIONS
===================================================== */
@keyframes cardEntrance {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes blink {
  50% { opacity: 0.25; }
}

/* =====================================================
   11. RESPONSIVE
===================================================== */

/* Tablet */
@media (max-width: 768px) {
  .clock-card {
    padding: 2.6rem 1.8rem 2.2rem;
  }

  .ring-wrapper {
    width: 210px;
    height: 210px;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .clock-card {
    padding: 2.2rem 1.4rem 2rem;
    border-radius: var(--radius-md);
  }

  .ring-wrapper {
    width: 190px;
    height: 190px;
  }

  .date-display {
    flex-wrap: wrap;
    font-size: 0.88rem;
  }

  .blob-1, .blob-2, .blob-3 {
    filter: blur(60px);
  }
}