/* ============================================
   Simmersong Landing Page
   ============================================ */

/* --- Reset & Base --- */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-on-surface);
  background-color: var(--color-surface);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* --- Utilities --- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* --- Header --- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 1.5rem;
  background: color-mix(in oklch, var(--color-surface) 70%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid color-mix(in oklch, var(--color-on-surface) 6%, transparent);
}

.header-inner {
  max-width: 72rem;
  margin: 0 auto;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  color: var(--color-on-surface);
}

.logo img {
  width: 36px;
  height: 36px;
}

.logo-text {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

/* --- Hero --- */

.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 6rem 1.5rem 3rem;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, color-mix(in oklch, var(--color-primary) 6%, transparent), transparent),
    radial-gradient(ellipse 60% 50% at 80% 20%, color-mix(in oklch, var(--color-primary-container) 30%, transparent), transparent),
    var(--color-surface);
}

.hero-inner {
  max-width: 72rem;
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

/* --- Hero Content (Left) --- */

.hero-content {
  max-width: 32rem;
}

.hero-heading {
  font-size: clamp(2.75rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--color-on-surface);
}

.hero-sub {
  margin-top: 1.25rem;
  font-size: 1.1875rem;
  font-weight: 350;
  line-height: 1.55;
  color: var(--color-on-surface-variant);
  max-width: 28rem;
}

/* --- Shared Form & Button --- */

.signup-form {
  display: flex;
  gap: 0.625rem;
  align-items: stretch;
}

.signup-form input[type="email"] {
  flex: 1;
  min-width: 0;
  padding: 0.8125rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-on-surface);
  background: var(--color-surface-container-high);
  border: 1.5px solid color-mix(in oklch, var(--color-on-surface) 12%, transparent);
  border-radius: 0.75rem;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.signup-form input[type="email"]::placeholder {
  color: var(--color-on-surface-variant);
  opacity: 0.6;
}

.signup-form input[type="email"]:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-primary) 15%, transparent);
}

.signup-form input[type="email"]:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
  border-color: transparent;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8125rem 1.5rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-on-primary);
  background: color-mix(in oklch, var(--color-primary) 85%, black);
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

.btn-primary:hover {
  background: color-mix(in oklch, var(--color-primary) 75%, black);
  box-shadow: 0 4px 16px color-mix(in oklch, var(--color-primary) 25%, transparent);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.signup-success {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-on-surface);
  padding: 0.8125rem 0;
}

.signup-note {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-on-surface-variant);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.btn-primary:active {
  transform: scale(0.97);
}

.hero-signup {
  margin-top: 2rem;
}

/* --- Hero Visual (Right) --- */

.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.hero-screenshot-frame {
  position: relative;
  width: clamp(220px, 22vw, 320px);
  transform: rotate(2deg);
}

.hero-screenshot-frame::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 2.5rem;
  background: linear-gradient(
    145deg,
    color-mix(in oklch, var(--color-primary) 15%, transparent),
    color-mix(in oklch, var(--color-primary-container) 40%, transparent)
  );
  z-index: -1;
}

.hero-screenshot {
  width: 100%;
  height: auto;
  border-radius: 2rem;
  box-shadow:
    0 8px 32px color-mix(in oklch, var(--color-on-surface) 10%, transparent),
    0 2px 8px color-mix(in oklch, var(--color-on-surface) 5%, transparent);
}

/* --- Problem Section --- */

.problem {
  padding: 5rem 1.5rem 5.5rem;
  background: var(--color-surface-container-low);
}

.problem-inner {
  max-width: 38rem;
  margin: 0 auto;
}

.problem-heading {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 500;
  letter-spacing: 0;
  color: var(--color-on-surface-variant);
  margin-bottom: 2.5rem;
}

.problem-list {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.problem-item {
  padding-left: 1.5rem;
  border-left: 2.5px solid var(--color-primary);
}

.problem-text {
  font-size: 1.1875rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-on-surface);
}

.problem-kicker {
  margin-top: 3.5rem;
  font-size: clamp(1.25rem, 2.5vw, 1.625rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--color-on-surface);
}

/* --- How It Works --- */

.how-it-works {
  padding: 6rem 1.5rem 7rem;
  background: var(--color-surface);
}

.how-inner {
  max-width: 64rem;
  margin: 0 auto;
}

.how-heading {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-on-surface);
  margin-bottom: 4rem;
  text-align: center;
}

.how-steps {
  display: flex;
  flex-direction: column;
  gap: 5rem;
}

.how-step {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto;
  gap: 1.5rem 2rem;
  align-items: center;
}

.how-step-number {
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  font-weight: 800;
  color: var(--color-primary);
  opacity: 0.3;
  line-height: 1;
  grid-row: 1 / -1;
  align-self: start;
  padding-top: 0.25rem;
}

.how-step-content {
  max-width: 24rem;
}

.how-step-title {
  font-size: clamp(1.1875rem, 2vw, 1.375rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-on-surface);
  margin-bottom: 0.5rem;
}

.how-step-desc {
  font-size: 1.0625rem;
  font-weight: 350;
  line-height: 1.6;
  color: var(--color-on-surface-variant);
}

.how-step-visual {
  width: clamp(200px, 22vw, 280px);
}

.how-screenshot {
  width: 100%;
  height: auto;
  border-radius: 2rem;
  box-shadow:
    0 6px 24px color-mix(in oklch, var(--color-on-surface) 8%, transparent),
    0 2px 6px color-mix(in oklch, var(--color-on-surface) 4%, transparent);
}

/* Zigzag: reversed steps swap content and visual */
.how-step--reversed {
  direction: rtl;
}

.how-step--reversed > * {
  direction: ltr;
}

/* Alternating screenshot tilts */
.how-step:nth-child(1) .how-screenshot { transform: rotate(1.5deg); }
.how-step:nth-child(2) .how-screenshot { transform: rotate(-1.5deg); }
.how-step:nth-child(3) .how-screenshot { transform: rotate(1.5deg); }

@media (max-width: 48rem) {
  .how-step {
    grid-template-columns: auto 1fr;
    gap: 1rem 1.25rem;
  }

  .how-step-visual {
    grid-column: 2;
    width: clamp(160px, 45vw, 220px);
    margin-top: 0.75rem;
  }

  .how-step--reversed {
    direction: ltr;
  }

  .how-steps {
    gap: 3.5rem;
  }
}

/* --- Final CTA --- */

.final-cta {
  padding: 7rem 1.5rem;
  text-align: center;
  background:
    radial-gradient(ellipse 70% 50% at 50% 60%, color-mix(in oklch, var(--color-primary) 8%, transparent), transparent),
    var(--color-surface-container-low);
}

.final-cta-inner {
  max-width: 32rem;
  margin: 0 auto;
}

.final-cta-heading {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--color-on-surface);
}

.final-cta-sub {
  margin-top: 1rem;
  font-size: 1.0625rem;
  font-weight: 350;
  line-height: 1.5;
  color: var(--color-on-surface-variant);
}

.final-cta-signup {
  margin-top: 2rem;
  justify-content: center;
}

.final-cta-signup input[type="email"] {
  max-width: 18rem;
}

@media (max-width: 48rem) {
  .final-cta-signup {
    flex-direction: column;
    align-items: center;
  }

  .final-cta-signup input[type="email"] {
    max-width: none;
    width: 100%;
  }
}

/* --- Footer --- */

.site-footer {
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-on-surface-variant);
  background: var(--color-surface);
}

.footer-inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.site-footer a {
  color: var(--color-on-surface-variant);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.site-footer a:hover {
  color: var(--color-on-surface);
}

/* --- Prose (Privacy, Terms, etc.) --- */

.prose {
  max-width: 42rem;
  margin: 0 auto;
  padding: 7rem 1.5rem 4rem;
}

.prose h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--color-on-surface);
}

.prose-meta {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-on-surface-variant);
}

.prose h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-on-surface);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.prose h3 {
  font-size: clamp(1.0625rem, 1.5vw, 1.1875rem);
  font-weight: 600;
  color: var(--color-on-surface);
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.prose p {
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.65;
  color: var(--color-on-surface-variant);
}

.prose ul {
  margin-top: 0.75rem;
  padding-left: 1.25rem;
  list-style: disc;
}

.prose li {
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.65;
  color: var(--color-on-surface-variant);
  margin-top: 0.375rem;
}

.prose li strong {
  color: var(--color-on-surface);
}

.prose a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.prose a:hover {
  text-decoration-thickness: 2px;
}

.prose hr {
  border: none;
  border-top: 1px solid color-mix(in oklch, var(--color-on-surface) 10%, transparent);
  margin: 2.5rem 0;
}

.prose table {
  width: 100%;
  margin-top: 1rem;
  border-collapse: collapse;
  font-size: 0.875rem;
  line-height: 1.5;
}

.prose th {
  text-align: left;
  font-weight: 600;
  color: var(--color-on-surface);
  padding: 0.5rem 0.75rem;
  border-bottom: 1.5px solid color-mix(in oklch, var(--color-on-surface) 15%, transparent);
}

.prose td {
  padding: 0.5rem 0.75rem;
  color: var(--color-on-surface-variant);
  border-bottom: 1px solid color-mix(in oklch, var(--color-on-surface) 8%, transparent);
  vertical-align: top;
}

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

@media (prefers-reduced-motion: no-preference) {
  /* Hero entrance */
  .hero-heading,
  .hero-sub,
  .hero-signup,
  .hero-screenshot-frame {
    opacity: 0;
    transform: translateY(20px);
    animation: fade-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  .hero-heading     { animation-delay: 0.1s; }
  .hero-sub         { animation-delay: 0.22s; }
  .hero-signup      { animation-delay: 0.34s; }
  .hero-screenshot-frame {
    animation-delay: 0.46s;
    transform: translateY(20px) rotate(2deg);
  }

  @keyframes fade-up {
    to {
      opacity: 1;
      transform: translateY(0) rotate(var(--rotate, 0deg));
    }
  }

  .hero-screenshot-frame {
    --rotate: 2deg;
  }

  /* Scroll-triggered reveals (only hide if JS will handle them) */
  .js-reveal .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .js-reveal .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  .js-reveal .reveal-stagger > .reveal:nth-child(1) { transition-delay: 0s; }
  .js-reveal .reveal-stagger > .reveal:nth-child(2) { transition-delay: 0.12s; }
  .js-reveal .reveal-stagger > .reveal:nth-child(3) { transition-delay: 0.24s; }
}

/* --- Responsive --- */

@media (max-width: 48rem) {
  .hero {
    padding: 5rem 1.25rem 2.5rem;
    min-height: auto;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    text-align: center;
  }

  .hero-content {
    max-width: none;
  }

  .hero-sub {
    max-width: none;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-signup {
    flex-direction: column;
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-visual {
    order: -1;
  }

  .hero-screenshot-frame {
    width: clamp(180px, 50vw, 260px);
    transform: rotate(0deg);
    --rotate: 0deg;
  }
}
