/* =========================
   DT Digital Timers — Base Theme
   ========================== */

:root {
  --bg: #050914;
  --fg: #f7f9ff;
  --muted: #9ba4c4;
  --accent: #00c8ff;
  --accent-soft: rgba(0, 200, 255, 0.16);
  --radius: 18px;

  --banner-height: 108px;
  --item-size: 88px;
  --edge-fade: 88px;
  --gap: 20px;
  --speed: 24s;

  --maxw: 1120px;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Global reset / base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: radial-gradient(circle at top, #0f1733 0, #050914 52%, #020309 100%);
  color: var(--fg);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

main {
  max-width: var(--maxw);
  margin: 24px auto;
  padding: 0 16px;
}

section {
  margin: 32px 0;
}

/* Utility buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--fg);
  font-size: 15px;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
}

.btn.primary {
  background: linear-gradient(135deg, #00d0ff, #35ffb5);
  border-color: transparent;
  color: #050914;
  box-shadow: 0 8px 24px rgba(0, 200, 255, 0.35);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.btn.small {
  padding: 6px 10px;
  font-size: 14px;
}

/* Layout grids / cards */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.card h3 {
  margin: 0 0 4px;
}

.card p {
  margin: 6px 0 12px;
  color: var(--muted);
}

.card img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  object-fit: cover;
  display: block;
}

.card .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* =========================
   HERO (CLS-stable + responsive)
   ========================== */

.hero {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #050914;
}

/* Reserve space with aspect-ratio; video OR static poster */
.hero > video,
.hero > .hero-media {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
}

/* Fallback poster background if we swap to an <img> */
.hero > .hero-media {
  background: #050914;
}

.hero .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(5, 9, 20, 0.85), rgba(5, 9, 20, 0.2));
  display: grid;
  place-items: center;
  text-align: center;
  padding: 28px;
}

.hero h1 {
  font-size: clamp(28px, 5vw, 48px);
  margin: 0;
}

.hero p {
  max-width: 780px;
  margin: 10px auto 16px;
  color: var(--muted);
}

.hero .cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* =========================
   FILTER BAR
   ========================== */

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filters input,
.filters select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px;
  color: var(--fg);
  min-width: 140px;
}

/* =========================
   MODAL
   ========================== */

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 50;
}

.modal[open] {
  display: flex;
}

.modal .sheet {
  width: min(920px, 96vw);
  max-height: 90vh;
  overflow: auto;
  background: #0b1226;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.5);
}

.modal header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal header h3 {
  margin: 0;
}

.modal .content {
  padding: 16px;
}

.modal .close {
  background: transparent;
  border: 0;
  color: var(--fg);
  font-size: 22px;
  cursor: pointer;
}

/* =========================
   TOAST
   ========================== */

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  background: #111a33;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 10px 12px;
  border-radius: 10px;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.2s ease;
  z-index: 60;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* =========================
   FOOTER + FAMILY STRIP
   ========================== */

.site-footer {
  padding: 24px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  max-width: var(--maxw);
  margin: 32px auto 0;
}

.site-footer .socials {
  margin-bottom: 10px;
}

.site-footer .family {
  position: relative;
  width: 100%;
  height: 120px;
  overflow: hidden;
}

.site-footer .family .track {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: marquee var(--speed) linear infinite;
}

.site-footer .family img {
  height: 100px;
  border-radius: 18px;
  flex: 0 0 auto;
  box-shadow: 0 6px 18px rgba(0, 200, 255, 0.2);
}

.site-footer .family:hover .track {
  animation-play-state: paused;
}

/* =========================
   HEADER BANNER
   ========================== */

.timer-banner {
  position: relative;
  width: 100%;
  height: var(--banner-height);
  background: var(--bg);
  overflow: hidden;
  display: grid;
  place-items: center;
  box-shadow:
    inset 0 -1px 0 rgba(255, 255, 255, 0.06),
    inset 0 1px 0 rgba(0, 0, 0, 0.4);
}

.timer-banner .fade-left,
.timer-banner .fade-right {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--edge-fade);
  pointer-events: none;
}

.timer-banner .fade-left {
  left: 0;
  background: linear-gradient(90deg, var(--bg), transparent);
}

.timer-banner .fade-right {
  right: 0;
  background: linear-gradient(270deg, var(--bg), transparent);
}

.scroll-track {
  display: flex;
  align-items: center;
  gap: var(--gap);
  will-change: transform;
  animation: marquee var(--speed) linear infinite;
}

.timer-item {
  width: var(--item-size);
  height: var(--item-size);
  flex: 0 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 200, 255, 0.25);
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top, #061327, #02060f);
}

.timer-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.timer-item:hover {
  transform: scale(1.12);
}

/* Marquee animation */

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* =========================
   BLOG
   ========================== */

.post-card img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.post-card h3 {
  margin: 0.5rem 0;
}

.post-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

/* =========================
   SHARE (floating)
   ========================== */

.share-fab {
  position: fixed;
  right: 16px;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 40;
}

.share-fab .btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  padding: 0;
}

/* =========================
   UTILITIES
   ========================== */

.lazy {
  filter: saturate(0.95) contrast(1.02);
}

/* Skeleton loaders */

.skel {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.12),
    rgba(255, 255, 255, 0.06)
  );
  background-size: 200% 100%;
  animation: sk 1.1s linear infinite;
  border-radius: 10px;
}

@keyframes sk {
  to {
    background-position: -200% 0;
  }
}

/* =========================
   RESPONSIVE
   ========================== */

@media (max-width: 768px) {
  :root {
    --banner-height: 92px;
    --item-size: 78px;
    --edge-fade: 72px;
  }

  .hero > video,
  .hero > .hero-media {
    aspect-ratio: 9 / 16;
    max-height: 68vh;
  }

  .hero .overlay {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  :root {
    --banner-height: 84px;
    --item-size: 68px;
    --gap: 16px;
    --edge-fade: 56px;
    --speed: 28s;
  }

  .hero > video,
  .hero > .hero-media {
    aspect-ratio: 9 / 16;
    max-height: 62vh;
  }
}

/* Respect reduced motion: pause marquee & footer strip */

@media (prefers-reduced-motion: reduce) {
  .scroll-track,
  .site-footer .family .track {
    animation-duration: 0.001s !important;
  }
}
/* Allow clicks to reach links under the hero overlay */
.hero .overlay {
  pointer-events: none;
}

/* But keep the center content clickable */
.hero .overlay > div {
  pointer-events: auto;
}
