/* ============================================================
   Komjey landing page — standalone styles (no framework)
   Theme tokens mirror the app (ui/src/assets/tailwind.css):
   olive/green primary, Inter font, oklch color space.
   ============================================================ */

:root {
  --background: oklch(1 0 0);
  --foreground: oklch(0.153 0.006 107.1);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.153 0.006 107.1);
  --primary: oklch(0.527 0.154 150.069);
  --primary-strong: oklch(0.448 0.119 151.328);
  --primary-foreground: oklch(0.982 0.018 155.826);
  --muted: oklch(0.966 0.005 106.5);
  --muted-foreground: oklch(0.58 0.031 107.3);
  --border: oklch(0.93 0.007 106.5);
  --ring: oklch(0.737 0.021 106.9);
  --secondary: oklch(0.967 0.001 286.375);

  --radius: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.06);
  --shadow-md: 0 10px 30px -12px oklch(0.153 0.006 107.1 / 0.18);
  --shadow-lg: 0 24px 60px -20px oklch(0.153 0.006 107.1 / 0.28);

  --container: 1140px;
}

[data-theme='dark'] {
  --background: oklch(0.153 0.006 107.1);
  --foreground: oklch(0.988 0.003 106.5);
  --card: oklch(0.228 0.013 107.4);
  --card-foreground: oklch(0.988 0.003 106.5);
  --primary: oklch(0.627 0.194 149.214);
  --primary-strong: oklch(0.723 0.219 149.579);
  --primary-foreground: oklch(0.153 0.006 107.1);
  --muted: oklch(0.286 0.016 107.4);
  --muted-foreground: oklch(0.737 0.021 106.9);
  --border: oklch(1 0 0 / 0.1);
  --ring: oklch(0.58 0.031 107.3);
  --secondary: oklch(0.274 0.006 286.033);

  --shadow-md: 0 10px 30px -12px oklch(0 0 0 / 0.6);
  --shadow-lg: 0 24px 60px -20px oklch(0 0 0 / 0.7);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

p {
  margin: 0;
}

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

img,
svg {
  display: block;
}

ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.925rem;
  padding: 0.6rem 1.05rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--btn-bg);
  color: var(--btn-fg);
  cursor: pointer;
  white-space: nowrap;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease,
    opacity 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}

.btn--lg {
  font-size: 1rem;
  padding: 0.8rem 1.4rem;
}

.btn--primary {
  --btn-bg: var(--primary);
  --btn-fg: var(--primary-foreground);
  box-shadow: 0 8px 20px -10px var(--primary);
}
.btn--primary:hover {
  --btn-bg: var(--primary-strong);
  box-shadow: 0 12px 26px -10px var(--primary);
}

.btn--secondary {
  --btn-bg: var(--card);
  --btn-fg: var(--foreground);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.btn--secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn--ghost {
  --btn-fg: var(--foreground);
}
.btn--ghost:hover {
  background: var(--muted);
}

/* On the dark CTA panel */
.btn--invert {
  background: var(--background);
  color: var(--foreground);
}
.btn--invert:hover {
  opacity: 0.92;
}
.btn--ghost-light {
  color: #fff;
  border-color: oklch(1 0 0 / 0.35);
}
.btn--ghost-light:hover {
  background: oklch(1 0 0 / 0.12);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}
.icon-btn:hover {
  background: var(--muted);
}
.icon-btn .icon-moon {
  display: none;
}
[data-theme='dark'] .icon-btn .icon-sun {
  display: none;
}
[data-theme='dark'] .icon-btn .icon-moon {
  display: block;
}

/* ---------- Eyebrow / gradient text ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted-foreground);
  background: var(--muted);
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}
.eyebrow--center {
  margin-inline: auto;
}
.eyebrow__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 4px oklch(0.527 0.154 150.069 / 0.18);
}

.text-gradient {
  background: linear-gradient(120deg, var(--primary), var(--primary-strong));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: oklch(1 0 0 / 0.72);
  border-bottom: 1px solid transparent;
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
[data-theme='dark'] .nav {
  background: oklch(0.153 0.006 107.1 / 0.72);
}
.nav.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
}
.brand__mark {
  display: block;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.6rem;
}
.brand__name {
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted-foreground);
}
.nav__links a {
  position: relative;
  transition: color 0.18s ease;
}
.nav__links a:hover {
  color: var(--foreground);
}
.nav__links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--primary);
  transition: width 0.2s ease;
}
.nav__links a:hover::after {
  width: 100%;
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(4rem, 10vw, 8rem) 0 clamp(3rem, 7vw, 6rem);
  text-align: center;
}
.hero__aurora {
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 70%;
  z-index: 0;
  background:
    radial-gradient(40% 50% at 25% 20%, oklch(0.723 0.219 149.579 / 0.22), transparent 70%),
    radial-gradient(45% 55% at 80% 10%, oklch(0.527 0.154 150.069 / 0.18), transparent 70%),
    radial-gradient(40% 60% at 60% 60%, oklch(0.448 0.119 151.328 / 0.14), transparent 70%);
  filter: blur(10px);
  animation: aurora 16s ease-in-out infinite alternate;
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
}
.hero__title {
  font-size: clamp(2.2rem, 5.5vw, 4rem);
  font-weight: 800;
  max-width: 18ch;
}
.hero__subtitle {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--muted-foreground);
  max-width: 60ch;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 0.4rem;
}
.hero__note {
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

/* hero entrance */
.hero__item {
  opacity: 0;
  animation: fade-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--d) * 0.12s + 0.05s);
}

/* ---------- Stats ---------- */
.stats {
  padding: 1.5rem 0;
}
.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-md);
}
.stat {
  text-align: center;
  padding: 0.25rem 0.5rem;
}
.stat__value {
  display: block;
  font-size: clamp(1.3rem, 2.5vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--primary);
}
.stat__label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted-foreground);
  margin-top: 0.2rem;
}

/* ---------- Sections ---------- */
.section {
  padding: clamp(3.5rem, 8vw, 6rem) 0;
}
.section--muted {
  background: var(--muted);
}
.section__head {
  text-align: center;
  max-width: 46rem;
  margin: 0 auto 3rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.section__title {
  font-size: clamp(1.7rem, 3.5vw, 2.6rem);
  font-weight: 800;
}
.section__lead {
  font-size: 1.05rem;
  color: var(--muted-foreground);
}

/* ---------- Features grid ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.feature {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease;
}
.feature:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: oklch(0.527 0.154 150.069 / 0.4);
}
.feature__icon {
  display: inline-grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 0.8rem;
  background: oklch(0.527 0.154 150.069 / 0.12);
  color: var(--primary);
  margin-bottom: 1rem;
}
.feature__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.feature__text {
  font-size: 0.93rem;
  color: var(--muted-foreground);
}

/* ---------- Steps ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  counter-reset: step;
}
.step {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-sm);
}
.step__num {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--primary-foreground);
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  margin-bottom: 1rem;
}
.step__title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.step__text {
  font-size: 0.93rem;
  color: var(--muted-foreground);
}

/* ---------- CTA ---------- */
.cta {
  position: relative;
  overflow: hidden;
  text-align: center;
  border-radius: var(--radius-xl);
  padding: clamp(2.5rem, 6vw, 4.5rem) 1.5rem;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-strong), var(--primary));
  box-shadow: var(--shadow-lg);
}
.cta__glow {
  position: absolute;
  inset: auto -10% -60% -10%;
  height: 120%;
  background: radial-gradient(50% 60% at 50% 100%, oklch(1 0 0 / 0.25), transparent 70%);
  pointer-events: none;
}
.cta__title {
  position: relative;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 800;
}
.cta__text {
  position: relative;
  margin-top: 0.75rem;
  font-size: 1.05rem;
  opacity: 0.92;
}
.cta__actions {
  position: relative;
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0 2rem;
  background: var(--background);
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: space-between;
  align-items: flex-start;
}
.footer__tagline {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: var(--muted-foreground);
  max-width: 28ch;
}
.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: 0.92rem;
  color: var(--muted-foreground);
}
.footer__links a:hover {
  color: var(--foreground);
}
.footer__bottom {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

/* ---------- Legal pages (terms / privacy) ---------- */
.legal {
  max-width: 46rem;
  margin-inline: auto;
  color: var(--foreground);
}
.legal__title {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 800;
}
.legal__updated {
  margin-top: 0.6rem;
  margin-bottom: 2rem;
  font-size: 0.9rem;
  color: var(--muted-foreground);
}
.legal h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 2.25rem;
  margin-bottom: 0.6rem;
}
.legal p {
  margin-bottom: 1rem;
  color: var(--muted-foreground);
}
.legal ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  list-style: disc;
  color: var(--muted-foreground);
}
.legal li {
  margin-bottom: 0.4rem;
}
.legal strong {
  color: var(--foreground);
}
.legal a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal a:hover {
  color: var(--primary-strong);
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
/* Stagger children of revealed grids */
.features.is-visible .feature,
.steps.is-visible .step {
  animation: fade-up 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.features.is-visible .feature {
  animation-delay: calc(var(--i, 0) * 0.07s);
}
.steps.is-visible .step {
  animation-delay: calc(var(--i, 0) * 0.1s);
}

/* ---------- Keyframes ---------- */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes aurora {
  from {
    transform: translate3d(-2%, 0, 0) scale(1);
  }
  to {
    transform: translate3d(3%, 2%, 0) scale(1.08);
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .features,
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
  .nav__links {
    display: none;
  }
}

@media (max-width: 620px) {
  .features,
  .steps,
  .stats__grid {
    grid-template-columns: 1fr;
  }
  .nav__login {
    display: none;
  }
  .hero__cta .btn,
  .cta__actions .btn {
    flex: 1 1 auto;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal,
  .hero__item {
    opacity: 1 !important;
    transform: none !important;
  }
}
