/* ABOUTME: Styles for the Countdown app marketing website.
   ABOUTME: Dark theme with animated countdown circle and editorial typography. */

@import url('https://fonts.googleapis.com/css2?family=Young+Serif&family=Karla:ital,wght@0,400;0,500;0,600;1,400&display=swap');

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

:root {
  --bg: #08090a;
  --bg-subtle: #0f1012;
  --border: rgba(255, 255, 255, 0.06);
  --text: #e8e4df;
  --text-secondary: #b5b0ab;
  --text-tertiary: #7a7570;
  --green: #34d399;
  --orange: #f59e0b;
  --red: #ef4444;
  --font-display: 'Young Serif', serif;
  --font-body: 'Karla', sans-serif;
  --max-width: 1080px;
  --nav-height: 64px;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme: dark;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Grain texture overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
  pointer-events: none;
  z-index: 9999;
}

a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--green);
}

/* ---- Navigation ---- */

nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  z-index: 100;
  background: rgba(8, 9, 10, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.nav-logo:hover {
  color: var(--text);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.nav-links a:hover {
  color: var(--text);
}

.github-link svg {
  width: 18px;
  height: 18px;
  fill: var(--text-secondary);
  transition: fill 0.2s;
  display: block;
}

.github-link:hover svg {
  fill: var(--text);
}

/* ---- Hero ---- */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  position: relative;
}


/* Hero image */
.hero-image {
  position: relative;
  margin-bottom: 56px;
  animation: fadeIn 1s ease-out 0.1s both;
}

.hero-image::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: var(--red);
  filter: blur(80px);
  opacity: 0.12;
  pointer-events: none;
}

.hero-image img {
  position: relative;
  width: 200px;
  filter: drop-shadow(0 12px 40px rgba(0, 0, 0, 0.5));
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 80px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 16px;
  animation: fadeUp 0.8s ease-out 0.3s both;
}

.hero-tagline {
  font-size: clamp(18px, 2.5vw, 22px);
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-weight: 400;
  animation: fadeUp 0.8s ease-out 0.5s both;
}

.hero-description {
  font-size: 16px;
  color: var(--text-tertiary);
  max-width: 420px;
  line-height: 1.7;
  margin-bottom: 40px;
  animation: fadeUp 0.8s ease-out 0.7s both;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--text);
  color: var(--bg);
  padding: 14px 32px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.2s, box-shadow 0.2s;
  animation: fadeUp 0.8s ease-out 0.9s both;
}

.hero-cta:hover {
  color: var(--bg);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(232, 228, 223, 0.15);
}

.hero-cta svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
}

.hero-cta:hover svg {
  transform: translateX(3px);
}

.hero-platform {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 16px;
  animation: fadeUp 0.8s ease-out 1.1s both;
}

/* ---- Features ---- */

.features {
  padding: 80px 24px 120px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
}

.feature {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.feature:nth-child(2) {
  transition-delay: 0.1s;
}

.feature:nth-child(3) {
  transition-delay: 0.2s;
}

.feature.visible {
  opacity: 1;
  transform: translateY(0);
}

.feature-number {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: 16px;
  display: block;
}

.feature-title {
  font-family: var(--font-display);
  font-size: 24px;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.feature-text {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ---- Footer ---- */

footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-left {
  font-size: 13px;
  color: var(--text-tertiary);
}

.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
}

.footer-links a {
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--text-secondary);
}

/* ---- Legal pages ---- */

.legal {
  max-width: 680px;
  margin: 0 auto;
  padding: 120px 24px 80px;
  animation: fadeIn 0.6s ease-out both;
}

.legal h1 {
  font-family: var(--font-display);
  font-size: 36px;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.legal .last-updated {
  font-size: 14px;
  color: var(--text-tertiary);
  margin-bottom: 48px;
}

.legal h2 {
  font-family: var(--font-display);
  font-size: 22px;
  margin-top: 40px;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.legal p {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 16px;
}

.legal ul,
.legal ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.legal li {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 8px;
}

.legal a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal a:hover {
  color: var(--text);
}

.legal strong {
  color: var(--text);
  font-weight: 600;
}

/* ---- Animations ---- */

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

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- Responsive ---- */

@media (max-width: 768px) {
  nav {
    padding: 0 20px;
  }

  .nav-links {
    gap: 20px;
  }

  .hero {
    padding: 100px 20px 60px;
  }

  .hero-image img {
    width: 160px;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  footer {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .nav-links .nav-text-link {
    display: none;
  }
}
