/* =========================================================
   Bean There — Landing Page Styles
   Mobile-first, system-driven, CLS-free, accessible.
   ========================================================= */

/* ---- Design tokens ---- */
:root {
  /* Color */
  --espresso: #3b2a1a;
  --espresso-90: #32231600;
  --cream: #f7f1e8;
  --cream-2: #efe5d6;
  --foam: #fffdf9;
  --caramel: #e8a87c;
  --caramel-deep: #c8824f;
  --ink: #2a2018;
  --ink-soft: #6b5d4f;
  --line: #e2d6c4;
  --error: #b3261e;
  --success: #2e6b3e;

  /* Type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;

  /* Radius */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 24px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-1: 0 1px 2px rgba(59, 42, 26, 0.06);
  --shadow-2: 0 6px 24px -8px rgba(59, 42, 26, 0.18);
  --shadow-3: 0 18px 50px -20px rgba(59, 42, 26, 0.35);

  /* Layout */
  --container: 1140px;
  --gutter: 1.25rem;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur: 0.28s;

  /* Header height for scroll offset */
  --header-h: 64px;
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--caramel-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; padding: 0; }
button { font: inherit; cursor: pointer; }
:focus-visible {
  outline: 3px solid var(--caramel-deep);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- Layout helpers ---- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
section[id], footer[id] { scroll-margin-top: calc(var(--header-h) + 1rem); }

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  background: var(--espresso);
  color: var(--foam);
  padding: var(--space-3) var(--space-4);
  border-radius: 0 0 var(--r-sm) 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 241, 232, 0.85);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
  height: var(--header-h);
  display: flex;
  align-items: center;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--espresso);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-flex; flex: 0 0 auto; }
.site-nav {
  display: none;
  gap: var(--space-5);
  align-items: center;
}
.site-nav a {
  color: var(--ink);
  font-weight: 500;
  font-size: 0.95rem;
}
.site-nav a:hover { color: var(--caramel-deep); text-decoration: none; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.8rem 1.4rem;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 0.975rem;
  line-height: 1;
  border: 2px solid transparent;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  text-decoration: none;
  min-height: 48px;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--espresso);
  color: var(--foam);
  box-shadow: var(--shadow-2);
}
.btn-primary:hover { background: #2c1f12; box-shadow: var(--shadow-3); }
.btn-ghost {
  background: transparent;
  color: var(--espresso);
  border-color: var(--espresso);
}
.btn-ghost:hover { background: var(--espresso); color: var(--foam); }

/* ---- Eyebrow / section heads ---- */
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--caramel-deep);
  margin-bottom: var(--space-3);
}
.eyebrow-light { color: var(--caramel); }
.section-head {
  max-width: 640px;
  margin: 0 auto var(--space-7);
  text-align: center;
}
.section-head h2,
.section-head .section-sub { margin-top: var(--space-2); }
.section-head .section-sub { color: var(--ink-soft); font-size: 1.05rem; }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  padding: var(--space-7) 0 var(--space-8);
  background:
    radial-gradient(120% 100% at 80% 0%, rgba(232, 168, 124, 0.22), transparent 60%),
    var(--cream);
}
.hero-grid {
  display: grid;
  gap: var(--space-6);
  align-items: center;
}
.hero-copy h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 7vw, 4.25rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: var(--espresso);
}
.hero-sub {
  margin-top: var(--space-4);
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 38ch;
}
.hero-actions {
  margin-top: var(--space-5);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.hero-meta {
  margin-top: var(--space-6);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  max-width: 460px;
}
.hero-meta li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hero-meta strong {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--espresso);
  line-height: 1;
}
.hero-meta span {
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* hero image — aspect-ratio prevents CLS before load */
.hero-media-frame {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--cream-2);
  box-shadow: var(--shadow-3);
  aspect-ratio: 4 / 3;
}
.hero-media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(59, 42, 26, 0.06);
  pointer-events: none;
}
#hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 0.5s var(--ease), transform 0.6s var(--ease);
}
#hero-image.is-loaded { opacity: 1; transform: scale(1); }
#hero-image.is-error {
  /* graceful fallback if the image 404s — show a warm gradient */
  opacity: 1;
  background: linear-gradient(135deg, var(--caramel), var(--espresso));
}

/* =========================================================
   FEATURES
   ========================================================= */
.features {
  padding: var(--space-9) 0;
  background: var(--foam);
}
.feature-grid {
  display: grid;
  gap: var(--space-5);
}
.feature {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--space-5);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--r-sm);
  background: var(--espresso);
  color: var(--caramel);
  margin-bottom: var(--space-4);
}
.feature-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--espresso);
  margin-bottom: var(--space-2);
}
.feature-body { color: var(--ink-soft); font-size: 0.98rem; }

/* =========================================================
   HOW IT WORKS
   ========================================================= */
.how {
  padding: var(--space-9) 0;
  background: var(--cream);
}
.steps {
  display: grid;
  gap: var(--space-5);
  counter-reset: step;
}
.step {
  position: relative;
  background: var(--foam);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--space-5);
  padding-left: calc(var(--space-5) + 1.5rem);
}
.step-num {
  position: absolute;
  left: var(--space-5);
  top: var(--space-5);
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--caramel);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}
.step::before {
  content: "";
  position: absolute;
  left: calc(var(--space-5) - 0.5rem);
  top: var(--space-5);
  bottom: var(--space-5);
  width: 2px;
  background: var(--caramel);
  opacity: 0.35;
  border-radius: 2px;
}
.step-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--espresso);
  margin-bottom: var(--space-2);
}
.step-body { color: var(--ink-soft); font-size: 0.98rem; }

/* =========================================================
   SIGN-UP
   ========================================================= */
.signup {
  padding: var(--space-9) 0;
  background:
    radial-gradient(90% 120% at 50% 0%, rgba(232, 168, 124, 0.18), transparent 55%),
    var(--espresso);
  color: var(--foam);
}
.signup-inner {
  max-width: 680px;
  text-align: center;
}
.signup-inner h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 5vw, 2.85rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin-top: var(--space-2);
}
.signup-sub {
  margin-top: var(--space-3);
  color: rgba(255, 253, 249, 0.82);
  font-size: 1.05rem;
}
.signup-form {
  margin-top: var(--space-6);
  text-align: left;
}
.field { display: block; }
.field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: rgba(255, 253, 249, 0.9);
}
.field-control {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.field-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.85rem 1rem;
  border-radius: var(--r-pill);
  border: 2px solid transparent;
  background: var(--foam);
  color: var(--ink);
  font-size: 1rem;
  min-height: 48px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.field-input::placeholder { color: #9b8b78; }
.field-input:focus {
  outline: none;
  border-color: var(--caramel);
  box-shadow: 0 0 0 4px rgba(232, 168, 124, 0.25);
}
.field-input[aria-invalid="true"] {
  border-color: var(--caramel);
  box-shadow: 0 0 0 4px rgba(200, 130, 79, 0.3);
}
.field-help {
  margin-top: var(--space-2);
  font-size: 0.82rem;
  color: rgba(255, 253, 249, 0.65);
}
.btn-submit { white-space: nowrap; }
.form-status {
  margin-top: var(--space-3);
  font-size: 0.9rem;
  font-weight: 500;
  min-height: 1.2em;
}
.form-status.is-success { color: var(--caramel); }
.form-status.is-error { color: #ffb4a8; }
.signup-fineprint {
  margin-top: var(--space-5);
  font-size: 0.78rem;
  color: rgba(255, 253, 249, 0.5);
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  background: var(--espresso);
  color: rgba(255, 253, 249, 0.7);
  padding: var(--space-7) 0;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  align-items: center;
  text-align: center;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--foam);
  font-weight: 700;
}
.footer-tag { font-size: 0.92rem; }
.footer-nav {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  justify-content: center;
}
.footer-nav a { color: rgba(255, 253, 249, 0.8); font-size: 0.9rem; }
.footer-nav a:hover { color: var(--caramel); text-decoration: none; }
.footer-copy { font-size: 0.8rem; color: rgba(255, 253, 249, 0.5); }

/* =========================================================
   Responsive breakpoints
   ========================================================= */
@media (min-width: 600px) {
  .field-control { flex-direction: row; align-items: stretch; }
  .btn-submit { flex: 0 0 auto; }
}

@media (min-width: 720px) {
  .site-nav { display: flex; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { flex-direction: row; flex-wrap: wrap; justify-content: space-between; text-align: left; }
}

@media (min-width: 960px) {
  :root { --header-h: 72px; }
  .hero { padding: var(--space-8) 0 var(--space-9); }
  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: var(--space-8);
  }
  .hero-copy { order: 1; }
  .hero-media { order: 2; }
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
}

/* =========================================================
   Motion preferences
   ========================================================= */
@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;
  }
  #hero-image { transform: none; }
}
