/* ==========================================================================
   Beach Trip Countdown — PNW Coastal Sunset Theme
   Pure modern CSS, mobile-first, zero framework dependencies
   ========================================================================== */

:root {
  /* PNW Sunset Palette (HSL) */
  --sky-zenith: hsl(212 52% 9%);
  --sky-upper: hsl(210 48% 15%);
  --sky-mid: hsl(207 37% 24%);
  --sky-haze: hsl(11 32% 41%);
  --sky-sunset: hsl(18 58% 55%);
  --sky-horizon: hsl(31 76% 73%);

  /* Frosted Sea-Glass Surface Tokens */
  --glass-bg: hsla(210 52% 10% / 0.48);
  --glass-bg-hover: hsla(210 50% 13% / 0.56);
  --glass-border-top: hsla(32 80% 88% / 0.24);
  --glass-border: hsla(210 40% 80% / 0.14);
  --glass-divider: hsla(32 60% 90% / 0.08);
  --glass-shadow:
    0 20px 44px -14px hsla(212 65% 4% / 0.65),
    0 4px 12px -2px hsla(212 60% 6% / 0.4),
    inset 0 1px 0 hsla(34 90% 92% / 0.22);

  /* Typography & Ink */
  --ink-primary: hsl(34 38% 95%);
  --ink-secondary: hsl(28 24% 80%);
  --ink-muted: hsl(210 18% 66%);
  --accent-warm: hsl(29 82% 74%);

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-numeral: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --radius-card: 20px;
}

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

html,
body {
  min-height: 100%;
  background-color: var(--sky-zenith);
  color: var(--ink-primary);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-x: hidden;
}

/* ==========================================================================
   Atmospheric PNW Coastal Sunset Scene
   ========================================================================== */

.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    var(--sky-zenith) 0%,
    var(--sky-upper) 26%,
    var(--sky-mid) 50%,
    var(--sky-haze) 66%,
    var(--sky-sunset) 76%,
    var(--sky-horizon) 84%,
    hsl(210 46% 12%) 86%,
    hsl(212 56% 7%) 100%
  );
}

.sun-glow {
  position: absolute;
  left: 50%;
  bottom: 24vh;
  width: min(110vw, 1100px);
  height: min(65vh, 560px);
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse at 50% 72%,
    hsla(33 92% 78% / 0.38) 0%,
    hsla(19 72% 58% / 0.2) 38%,
    hsla(19 60% 42% / 0) 72%
  );
}

/* Subtle photographic grain eliminates sky gradient banding */
.grain {
  position: absolute;
  inset: 0;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.coastline {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: clamp(300px, 50vh, 520px);
  display: block;
}

.wave-back {
  animation: drift-slow 18s ease-in-out infinite alternate;
}

.wave-mid {
  animation: drift-mid 13s ease-in-out infinite alternate;
}

.wave-front {
  animation: drift-front 10s ease-in-out infinite alternate;
}

.shimmer {
  animation: shimmer-pulse 7s ease-in-out infinite alternate;
}

@keyframes drift-slow {
  from { transform: translateX(-18px); }
  to { transform: translateX(18px); }
}

@keyframes drift-mid {
  from { transform: translateX(24px); }
  to { transform: translateX(-24px); }
}

@keyframes drift-front {
  from { transform: translateX(-30px); }
  to { transform: translateX(30px); }
}

@keyframes shimmer-pulse {
  from { opacity: 0.78; }
  to { opacity: 1; }
}

/* ==========================================================================
   Hero Layout & Typography
   ========================================================================== */

.hero {
  position: relative;
  z-index: 1;
  flex: 1 0 auto;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(2.5rem, 8vh, 5.5rem) clamp(1rem, 4vw, 2rem) clamp(2rem, 6vh, 3.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero-header {
  margin-bottom: clamp(1.75rem, 4.5vh, 3rem);
}

.eyebrow {
  font-size: clamp(0.7rem, 1.5vw, 0.8rem);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-warm);
  margin-bottom: 0.75rem;
  text-shadow: 0 2px 12px hsla(212 60% 5% / 0.65);
}

.title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.25rem, 6.2vw, 4.1rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
  text-shadow: 0 6px 28px hsla(212 65% 4% / 0.55);
}

.subtitle {
  margin-top: 0.85rem;
  font-size: clamp(0.95rem, 2.2vw, 1.125rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--ink-secondary);
  text-shadow: 0 2px 14px hsla(212 65% 4% / 0.65);
}

/* ==========================================================================
   Frosted Glass Countdown Cards
   ========================================================================== */

.countdown {
  width: 100%;
  max-width: 740px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.75rem, 2.2vw, 1.35rem);
}

.countdown[hidden] {
  display: none;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(1.15rem, 3vw, 1.9rem) clamp(0.5rem, 1.5vw, 1rem) clamp(1rem, 2.5vw, 1.5rem);
  border-radius: var(--radius-card);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-top-color: var(--glass-border-top);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1), background-color 240ms ease;
}

/* Subtle horizontal split hairline echoing the classic flip clock */
.card::after {
  content: '';
  position: absolute;
  left: 12%;
  right: 12%;
  top: 46%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--glass-divider) 25%,
    var(--glass-divider) 75%,
    transparent 100%
  );
  pointer-events: none;
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-3px);
    background: var(--glass-bg-hover);
  }
}

.value-wrap {
  position: relative;
  overflow: hidden;
  line-height: 1.05;
  padding: 0.1em 0;
}

.value {
  display: inline-block;
  font-family: var(--font-numeral);
  font-weight: 600;
  font-size: clamp(2.35rem, 6.8vw, 4.4rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
  text-shadow: 0 4px 20px hsla(212 65% 4% / 0.45);
}

.value.is-ticking {
  animation: digit-tick 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes digit-tick {
  0% {
    opacity: 0.45;
    transform: translateY(-10%);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.label {
  margin-top: clamp(0.45rem, 1.2vw, 0.75rem);
  font-size: clamp(0.68rem, 1.4vw, 0.78rem);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

/* ==========================================================================
   Celebratory Beach Weekend State
   ========================================================================== */

.weekend-banner {
  width: 100%;
  max-width: 580px;
  padding: clamp(1.75rem, 4vw, 2.75rem) clamp(1.25rem, 4vw, 2.5rem);
  border-radius: var(--radius-card);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-top-color: var(--glass-border-top);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
}

.weekend-banner[hidden] {
  display: none;
}

.weekend-heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.75rem, 4.5vw, 2.6rem);
  color: var(--accent-warm);
  margin-bottom: 0.75rem;
}

.weekend-copy {
  font-size: clamp(1rem, 2.3vw, 1.15rem);
  line-height: 1.55;
  color: var(--ink-primary);
}

.weekend-subcopy {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--ink-secondary);
}

/* ==========================================================================
   NoScript Fallback
   ========================================================================== */

.noscript-note {
  margin-top: 1.5rem;
  padding: 0.85rem 1.25rem;
  border-radius: 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--ink-primary);
  font-size: 0.92rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 1.1rem clamp(1rem, 4vw, 2rem) calc(1.1rem + env(safe-area-inset-bottom, 0px));
  background: hsla(212 60% 5% / 0.55);
  border-top: 1px solid hsla(210 35% 75% / 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-align: center;
  font-size: clamp(0.74rem, 1.6vw, 0.84rem);
  line-height: 1.55;
  color: var(--ink-muted);
}

.site-footer .rival-line {
  margin-top: 0.2rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-secondary);
}

/* ==========================================================================
   Responsive Breakpoints & Accessibility
   ========================================================================== */

@media (max-width: 540px) {
  .countdown {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 360px;
  }

  .card {
    border-radius: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wave-back,
  .wave-mid,
  .wave-front,
  .shimmer,
  .value.is-ticking {
    animation: none !important;
  }

  .card {
    transition: none;
  }
}
