/* Palette mirrors the dark theme in front/app/globals.css */
@font-face {
  font-family: "Space Grotesk";
  src: url("/assets/fonts/space-grotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --background: 30 20% 8%;
  --foreground: 35 30% 92%;
  --card: 30 18% 12%;
  --sidebar: 30 18% 10%;
  --primary: 36 60% 55%;
  --primary-foreground: 30 20% 8%;
  --secondary: 30 16% 18%;
  --muted-foreground: 30 15% 58%;
  --border: 30 14% 18%;
  --success: 142 71% 45%;
  --radius: 0.75rem;
  --gradient: linear-gradient(135deg, hsl(var(--primary)), hsl(var(--primary) / 0.7));
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}

body {
  margin: 0;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
}

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

h1,
h2,
h3 {
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

.container {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.muted {
  color: hsl(var(--muted-foreground));
}

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

.icon {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-radius: var(--radius);
}

.skip:focus {
  left: 0.5rem;
}

:focus-visible {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 3px;
  border-radius: 0.375rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid transparent;
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.btn-primary {
  background: var(--gradient);
  color: hsl(var(--primary-foreground));
  box-shadow: 0 0 20px hsl(var(--primary) / 0.3);
}

.btn-primary:hover {
  box-shadow: 0 0 30px hsl(var(--primary) / 0.5);
  transform: translateY(-1px);
}

.btn-ghost {
  border-color: hsl(var(--border));
}

.btn-ghost:hover {
  background: hsl(var(--secondary));
}

.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.875rem;
  border-radius: 0.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
  font-size: 0.8rem;
  font-weight: 500;
}

.badge .icon {
  width: 0.9rem;
  height: 0.9rem;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: hsl(var(--background) / 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid hsl(var(--border));
}

.nav-inner {
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.brand img {
  width: 2rem;
  height: auto;
}

.brand-sm {
  font-size: 1rem;
}

.brand-sm img {
  width: 1.5rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.9rem;
}

.nav-links a:not(.btn) {
  color: hsl(var(--muted-foreground));
  transition: color 0.2s ease;
}

.nav-links a:not(.btn):hover {
  color: hsl(var(--foreground));
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  padding: 5rem 0 5.5rem;
}

.hero-glow {
  position: absolute;
  inset: -20% -10% auto auto;
  width: 40rem;
  height: 40rem;
  background: radial-gradient(circle, hsl(var(--primary) / 0.16), transparent 65%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 3.5rem;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.4rem, 5.2vw, 3.75rem);
  font-weight: 700;
  margin: 1.5rem 0 1.25rem;
}

.lead {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: hsl(var(--muted-foreground));
  max-width: 36rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.hero-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: hsl(var(--success));
  box-shadow: 0 0 0 0 hsl(var(--success) / 0.6);
  animation: ping 2s ease-out infinite;
}

/* Hero mock (overlay alert + goal + schedule) */
.hero-visual {
  display: grid;
  gap: 1rem;
}

.mock-alert,
.mock-goal,
.mock-schedule {
  background: linear-gradient(180deg, hsl(var(--card)), hsl(var(--sidebar)));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) + 4px);
  padding: 1.25rem;
}

.mock-alert {
  border-color: hsl(var(--primary) / 0.4);
  box-shadow: 0 0 40px hsl(var(--primary) / 0.15);
  animation: pulse-glow 3s ease-in-out infinite;
}

.mock-alert-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  line-height: 1.35;
}

.mock-alert-head small {
  display: block;
  color: hsl(var(--muted-foreground));
}

.mock-avatar {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--gradient);
  color: hsl(var(--primary-foreground));
  font-weight: 700;
  flex-shrink: 0;
}

.mock-alert p {
  margin-top: 0.85rem;
  font-size: 1.05rem;
}

.mock-goal-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.progress {
  height: 0.6rem;
  border-radius: 999px;
  background: hsl(var(--secondary));
  overflow: hidden;
}

.progress span {
  display: block;
  width: 74%;
  height: 100%;
  border-radius: inherit;
  background: var(--gradient);
}

.mock-schedule {
  display: grid;
  gap: 0.15rem;
  font-size: 0.9rem;
}

/* Sections */
.section {
  padding: 5.5rem 0;
  border-top: 1px solid hsl(var(--border));
}

.section-alt {
  background: hsl(var(--sidebar));
}

.section h2 {
  font-size: clamp(1.75rem, 3.4vw, 2.4rem);
  text-align: center;
}

.section-lead {
  text-align: center;
  color: hsl(var(--muted-foreground));
  max-width: 38rem;
  margin: 1rem auto 0;
}

.features {
  list-style: none;
  padding: 0;
  margin: 3rem 0 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.card {
  padding: 1.5rem;
  border-radius: var(--radius);
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}

.card:hover {
  border-color: hsl(var(--primary) / 0.35);
  transform: translateY(-2px);
}

.card-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius);
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
  margin-bottom: 1rem;
}

.card-icon .icon {
  width: 1.5rem;
  height: 1.5rem;
}

.card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.card p,
.steps p {
  font-size: 0.925rem;
  color: hsl(var(--muted-foreground));
}

.steps {
  list-style: none;
  padding: 0;
  margin: 3rem 0 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  text-align: center;
}

.step-num {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--gradient);
  color: hsl(var(--primary-foreground));
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  box-shadow: 0 0 20px hsl(var(--primary) / 0.3);
}

.steps h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.cta {
  max-width: 44rem;
  margin: 0 auto;
  text-align: center;
  padding: 3rem 1.5rem;
  border-radius: calc(var(--radius) + 8px);
  border: 1px solid hsl(var(--primary) / 0.3);
  background:
    radial-gradient(ellipse at top, hsl(var(--primary) / 0.14), transparent 70%),
    hsl(var(--card));
}

.cta h2 {
  margin: 1rem 0 0.75rem;
}

.cta p {
  color: hsl(var(--muted-foreground));
  max-width: 32rem;
  margin: 0 auto 2rem;
}

/* Footer */
.footer {
  border-top: 1px solid hsl(var(--border));
  padding: 2rem 0;
  font-size: 0.875rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.link:hover {
  color: hsl(var(--foreground));
}

/* Motion */
.fade-up {
  animation: fade-up 0.6s ease-out both;
}

.fade-up-delay {
  animation-delay: 0.15s;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 0 20px hsl(var(--primary) / 0.12);
  }
  50% {
    box-shadow: 0 0 40px hsl(var(--primary) / 0.28);
  }
}

@keyframes ping {
  70% {
    box-shadow: 0 0 0 8px hsl(var(--success) / 0);
  }
  100% {
    box-shadow: 0 0 0 0 hsl(var(--success) / 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* Responsive */
@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .hero-copy {
    text-align: center;
  }
  .lead {
    margin: 0 auto;
  }
  .hero-actions,
  .hero-note {
    justify-content: center;
  }
  .hero-visual {
    max-width: 30rem;
    width: 100%;
    margin: 0 auto;
  }
  .features {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .nav-links a:not(.btn) {
    display: none;
  }
  .hero {
    padding: 3rem 0 4rem;
  }
  .hero-actions .btn {
    width: 100%;
  }
  .section {
    padding: 4rem 0;
  }
  .features,
  .steps {
    grid-template-columns: 1fr;
  }
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}
