/* ═══════════════════════════════════════════
   FocusRaft Landing Page — styles.css
   Design Spec v1.0 | Dark Theme
   ═══════════════════════════════════════════ */

/* ─── Design Tokens ─── */
:root {
  /* Colors — Primary */
  --bg: #0B0B12;
  --surface: #13131D;
  --surface-raised: #1A1A28;

  /* Colors — Brand */
  --primary: #D97757;
  --primary-hover: #E58B6D;
  --primary-pressed: #C4674A;
  --secondary: #6C7A96;
  --secondary-hover: #7D8BA7;
  --accent: #3DBDA7;

  /* Colors — Text */
  --text-heading: #F0F0F5;
  --text-body: #C8C8D4;
  --text-muted: #8888A0;
  --text-disabled: #555566;

  /* Colors — Semantic */
  --border-default: #1E1E2E;
  --border-hover: #2A2A3E;
  --border-focus: #D97757;
  --error: #E5534B;

  /* Spacing (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-32: 128px;

  /* Typography */
  --font-display: "Instrument Sans", "Inter", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  /* Layout */
  --max-width: 1120px;
  --max-width-narrow: 680px;
  --max-width-heading: 600px;

  /* Animation */
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ─── Reset & Base ─── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-body);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg {
  display: block;
  max-width: 100%;
}

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

ul, ol {
  list-style: none;
}

/* ─── 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;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

.container--narrow {
  max-width: var(--max-width-narrow);
}

/* ─── Skip Link ─── */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  padding: var(--space-2) var(--space-4);
  background: var(--primary);
  color: var(--bg);
  font-weight: 600;
  font-size: 14px;
  border-radius: 0 0 8px 8px;
  z-index: 1000;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0;
}

/* ─── Buttons ─── */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--bg);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  padding: 14px 28px;
  min-width: 160px;
  height: 48px;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(217, 119, 87, 0.25);
}

.btn-primary:active {
  background: var(--primary-pressed);
  transform: translateY(0);
  box-shadow: none;
}

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

.btn-primary:disabled {
  background: var(--text-disabled);
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: transparent;
  color: var(--text-body);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  border: 1px solid var(--border-hover);
  height: 40px;
}

.btn-secondary:hover {
  background: var(--surface-raised);
  color: var(--text-heading);
  border-color: var(--primary);
}

.btn-secondary:active {
  background: var(--surface);
}

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

/* ─── Navigation ─── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  display: flex;
  align-items: center;
  z-index: 100;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.nav.is-scrolled {
  background-color: rgba(11, 11, 18, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-default);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.nav__logo {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.01em;
}

/* ─── Hero Section ─── */
.hero {
  padding-top: calc(64px + var(--space-16));
  padding-bottom: var(--space-12);
  text-align: center;
}

.hero__content {
  max-width: var(--max-width-narrow);
  margin: 0 auto;
}

.hero__title {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-heading);
  margin-bottom: var(--space-5);
}

.hero__subtitle {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-body);
  margin-bottom: var(--space-8);
}

.hero__cta {
  margin-bottom: var(--space-4);
}

.hero__badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.hero__badges span {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.hero__dot {
  color: var(--text-disabled);
}

/* ─── Scroll Animation ─── */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(12px);
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
}

.hero .animate-on-scroll.is-visible {
  transition-duration: 600ms;
}

/* Stagger delays for hero elements */
.hero__title.animate-on-scroll.is-visible {
  transition-delay: 0ms;
}
.hero__subtitle.animate-on-scroll.is-visible {
  transition-delay: 100ms;
}
.hero__cta.animate-on-scroll.is-visible {
  transition-delay: 200ms;
}
.hero__badges.animate-on-scroll.is-visible {
  transition-delay: 300ms;
}

/* Feature card stagger */
.feature-card:nth-child(1).animate-on-scroll.is-visible { transition-delay: 0ms; }
.feature-card:nth-child(2).animate-on-scroll.is-visible { transition-delay: 80ms; }
.feature-card:nth-child(3).animate-on-scroll.is-visible { transition-delay: 160ms; }
.feature-card:nth-child(4).animate-on-scroll.is-visible { transition-delay: 240ms; }

/* Screenshot scale animation */
.screenshot__container.animate-on-scroll {
  transform: scale(0.97);
}
.screenshot__container.animate-on-scroll.is-visible {
  transform: scale(1);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
}

/* ─── Problem / Solution Section ─── */
.problem-solution {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

.problem-solution__grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  position: relative;
}

.problem-solution__divider {
  width: 100%;
  height: 1px;
  background: var(--border-default);
}

.problem-solution__col {
  flex: 1;
}

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

.eyebrow--problem {
  color: var(--primary);
}

.eyebrow--solution {
  color: var(--accent);
}

.problem-solution__heading {
  font-family: var(--font-body);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text-heading);
  margin-bottom: var(--space-3);
}

.problem-solution__body {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-body);
}

/* ─── Shared Section Heading ─── */
.section-heading {
  font-family: var(--font-body);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text-heading);
  text-align: center;
  margin-bottom: var(--space-8);
}

/* ─── Feature Cards Section ─── */
.features {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

.features__heading {
  max-width: var(--max-width-heading);
  margin-left: auto;
  margin-right: auto;
}

.features__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  padding: var(--space-5);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.feature-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.feature-card__icon {
  width: 32px;
  height: 32px;
  color: var(--primary);
  margin-bottom: var(--space-4);
}

.feature-card__title {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-heading);
  margin-bottom: var(--space-2);
}

.feature-card__desc {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-body);
}

/* ─── Screenshot Section ─── */
.screenshot {
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
}

.screenshot__heading {
  /* extends .section-heading */
}

.screenshot__container {
  max-width: 960px;
  margin: 0 auto;
  border-radius: 12px;
  border: 1px solid var(--border-default);
  overflow: hidden;
  box-shadow: 0 0 80px rgba(217, 119, 87, 0.08);
}

.screenshot__chrome {
  height: 32px;
  background: var(--surface-raised);
  display: flex;
  align-items: center;
  padding-left: var(--space-3);
  gap: 6px;
}

.screenshot__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-disabled);
}

.screenshot__content {
  background: var(--surface);
  aspect-ratio: 16 / 9;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.screenshot__wireframe {
  width: 100%;
  height: 100%;
}

.screenshot__overlay {
  position: absolute;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.875rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ─── Waitlist CTA Section ─── */
.waitlist {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

.waitlist__card {
  max-width: 520px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border-default);
  border-radius: 16px;
  padding: var(--space-12) var(--space-6);
  text-align: center;
}

.waitlist__heading {
  /* extends .section-heading; overrides below */
  margin-bottom: var(--space-3);
}

.waitlist__subtitle {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: var(--space-8);
}

.waitlist__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.waitlist__input-wrapper {
  position: relative;
  width: 100%;
}

.waitlist__input {
  width: 100%;
  height: 48px;
  background: var(--surface-raised);
  border: 1px solid var(--border-hover);
  border-radius: 8px;
  padding: 0 var(--space-4);
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text-heading);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.waitlist__input::placeholder {
  color: var(--text-disabled);
}

.waitlist__input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.15);
}

.waitlist__input.has-error {
  border-color: var(--error);
}

.waitlist__error {
  display: none;
  font-size: 0.8125rem;
  color: var(--error);
  text-align: left;
  margin-top: var(--space-1);
}

.waitlist__error.is-visible {
  display: block;
}

.waitlist__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--accent);
  background: rgba(61, 189, 167, 0.1);
  padding: 4px 12px;
  border-radius: 100px;
}

/* Waitlist Success State */
.waitlist__success {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.waitlist__success.is-visible {
  display: flex;
  animation: fadeInUp 300ms ease-out forwards;
}

.waitlist__success-icon {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.waitlist__success-text {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--accent);
}

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

/* ─── Footer ─── */
.footer {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
  border-top: 1px solid var(--border-default);
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
}

.footer__link {
  color: var(--text-body);
  transition: color 0.15s ease;
}

.footer__link:hover {
  text-decoration: underline;
}

/* ═══════════════════════════════════════════
   Responsive Breakpoints (Mobile-First)
   ═══════════════════════════════════════════ */

/* ─── 480px: Mobile Large ─── */
@media (min-width: 480px) {
  .waitlist__form {
    flex-direction: row;
    gap: var(--space-2);
  }

  .waitlist__input {
    border-radius: 8px;
  }
}

/* ─── 768px: Tablet ─── */
@media (min-width: 768px) {
  body {
    font-size: 16px;
  }

  .container {
    padding-left: var(--space-8);
    padding-right: var(--space-8);
  }

  /* Hero */
  .hero {
    padding-top: calc(64px + var(--space-20));
    padding-bottom: var(--space-16);
  }

  .hero__title {
    font-size: 2.75rem;
    line-height: 1.1;
  }

  /* Problem / Solution */
  .problem-solution {
    padding-top: var(--space-20);
    padding-bottom: var(--space-20);
  }

  .problem-solution__grid {
    flex-direction: row;
    gap: var(--space-10);
    align-items: flex-start;
  }

  .problem-solution__divider {
    width: 1px;
    height: auto;
    align-self: stretch;
  }

  /* Features */
  .features {
    padding-top: var(--space-20);
    padding-bottom: var(--space-20);
  }

  .features__heading {
    font-size: 2.25rem;
  }

  .features__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
  }

  .feature-card {
    padding: var(--space-6);
  }

  /* Screenshot */
  .screenshot {
    padding-top: var(--space-20);
    padding-bottom: var(--space-20);
  }

  .screenshot__heading {
    font-size: 2.25rem;
  }

  /* Waitlist */
  .waitlist {
    padding-top: var(--space-20);
    padding-bottom: var(--space-20);
  }

  .waitlist__card {
    padding: var(--space-12);
  }

  .waitlist__heading {
    font-size: 2.25rem;
  }

  /* Footer */
  .footer {
    padding-top: var(--space-10);
    padding-bottom: var(--space-10);
  }

  .footer__inner {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* ─── 1024px: Desktop ─── */
@media (min-width: 1024px) {
  .container {
    padding-left: 0;
    padding-right: 0;
  }

  /* Hero */
  .hero {
    padding-top: calc(64px + var(--space-32));
    padding-bottom: var(--space-24);
  }

  .hero__title {
    font-size: 3.5rem;
    line-height: 1.1;
  }

  .hero__subtitle {
    font-size: 1.125rem;
  }

  /* Problem / Solution */
  .problem-solution {
    padding-top: var(--space-24);
    padding-bottom: var(--space-24);
  }

  .problem-solution__heading {
    font-size: 2.25rem;
  }

  /* Features */
  .features {
    padding-top: var(--space-24);
    padding-bottom: var(--space-24);
  }

  .features__grid {
    gap: var(--space-6);
  }

  /* Screenshot */
  .screenshot {
    padding-top: var(--space-24);
    padding-bottom: var(--space-24);
  }

  /* Waitlist */
  .waitlist {
    padding-top: var(--space-24);
    padding-bottom: var(--space-24);
  }

  /* Footer */
  .footer {
    padding-top: var(--space-12);
    padding-bottom: var(--space-12);
  }
}

/* ─── Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }

  .animate-on-scroll.is-visible {
    transition-duration: 0ms !important;
    transition-delay: 0ms !important;
  }

  .feature-card {
    transition-duration: 0ms;
  }

  .btn-primary,
  .btn-secondary {
    transition-duration: 0ms;
  }

  .nav {
    transition-duration: 0ms;
  }

  .waitlist__success.is-visible {
    animation: none;
  }

  html {
    scroll-behavior: auto;
  }
}
