/* ============================================================
   Bean There — Landing Page
   Design tokens per spec §2
   ============================================================ */

:root {
  /* Color tokens */
  --espresso-900: #2A1D14;
  --espresso-700: #3B2A20;
  --espresso-600: #5A4434;
  --cream-100:    #F7F1E8;
  --cream-50:     #FBF7F1;
  --amber-500:    #C8853F;
  --amber-600:     #A86A2C;
  --white:        #FFFFFF;
  --success-600:  #2E7D5B;
  --error-600:    #B23A3A;

  /* Typography */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Spacing */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 64px;
  --space-7: 80px;
  --space-8: 96px;

  --container-max: 1120px;
  --gutter: 24px;

  /* Radius */
  --radius-card: 16px;
  --radius-pill: 999px;
  --radius-image: 12px;

  /* Shadow */
  --shadow-card: 0 1px 3px rgba(42,29,20,.08), 0 8px 24px rgba(42,29,20,.06);
  --shadow-card-hover: 0 12px 32px rgba(42,29,20,.12);

  /* Motion */
  --transition: 160ms ease-out;
}

/* ============================================================
   Reset & base
   ============================================================ */

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

html { scroll-behavior: smooth; }
html:focus-within { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--espresso-600);
  background: var(--cream-100);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

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

button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }

h1, h2, h3, h4 { margin: 0; font-weight: inherit; }

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

/* Shared focus ring */
:where(a, button, input):focus-visible {
  outline: 2px solid var(--amber-500);
  outline-offset: 2px;
  border-radius: 4px;
}

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 200;
  padding: 12px 20px;
  background: var(--espresso-900);
  color: var(--white);
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 14px;
  transition: top var(--transition);
}
.skip-link:focus { top: 12px; }

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  min-height: 44px;
  transition: background-color var(--transition), transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--amber-500);
  color: var(--espresso-900);
}
.btn-primary:hover { background: var(--amber-600); transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0); opacity: .95; }
.btn-primary:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--amber-500);
}
.btn-primary:disabled {
  background: rgba(42,29,20,.30);
  color: rgba(247,241,232,.5);
  cursor: not-allowed;
  transform: none;
}

.btn-outline {
  background: transparent;
  color: var(--amber-600);
  border: 1.5px solid var(--amber-500);
  min-height: 44px;
}
.btn-outline:hover { background: rgba(200,133,63,.10); }
.btn-outline:focus-visible {
  outline: 2px solid var(--amber-500);
  outline-offset: 2px;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 17px;
  color: var(--espresso-700);
  padding: 12px 4px;
  min-height: 44px;
  border-bottom: 2px solid transparent;
  transition: border-color var(--transition), color var(--transition);
}
.ghost-link .arrow { transition: transform var(--transition); display: inline-block; }
.ghost-link:hover { color: var(--amber-600); border-bottom-color: var(--amber-500); }
.ghost-link:hover .arrow { transform: translateY(4px); }

/* ============================================================
   Header / Nav
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  background: rgba(247,241,232,.95);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(42,29,20,.10);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: var(--space-3);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--espresso-700);
  line-height: 1;
}
.wordmark .bean-glyph { color: var(--amber-600); }

.primary-nav { flex: 1; display: flex; justify-content: center; }
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.nav-links a {
  position: relative;
  font-size: 15px;
  font-weight: 500;
  color: var(--espresso-600);
  padding: 8px 2px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: color var(--transition);
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 4px;
  height: 2px;
  background: var(--amber-600);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}
.nav-links a:hover { color: var(--amber-600); }
.nav-links a:hover::after { transform: scaleX(1); }

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.link-sign-in {
  font-size: 15px;
  font-weight: 500;
  color: var(--espresso-600);
  padding: 8px 12px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: color var(--transition);
}
.link-sign-in:hover { color: var(--amber-600); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px 9px;
  border-radius: var(--radius-pill);
}
.nav-toggle-bar {
  display: block;
  height: 2.5px;
  width: 100%;
  background: var(--espresso-700);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ============================================================
   Hero
   ============================================================ */

.hero {
  position: relative;
  padding-block: var(--space-8);
  background: var(--cream-100);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -120px; right: -120px;
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(200,133,63,.08), transparent 70%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 55% 45%;
  gap: var(--space-5);
  align-items: center;
  position: relative;
}

.eyebrow-pill {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--amber-600);
  background: rgba(200,133,63,.12);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-3);
}

.hero-h1 {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--espresso-700);
  margin-bottom: var(--space-2);
  letter-spacing: -0.01em;
}

.hero-sub {
  font-size: 18px;
  line-height: 1.6;
  color: var(--espresso-600);
  max-width: 520px;
  margin-bottom: var(--space-4);
}

.hero-cta-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}

.trust-line {
  font-size: 14px;
  color: var(--espresso-600);
}

.hero-image-wrap {
  position: relative;
}
.hero-image {
  width: 100%;
  aspect-ratio: 9 / 10;
  object-fit: cover;
  border-radius: var(--radius-image);
  box-shadow: var(--shadow-card);
  background: linear-gradient(135deg, rgba(42,29,20,.06), rgba(200,133,63,.06));
}

/* ============================================================
   Features
   ============================================================ */

.features {
  padding-block: var(--space-8);
  background: var(--cream-100);
}

.section-h2 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--espresso-700);
  text-align: center;
  margin-bottom: var(--space-2);
}

.section-lead {
  text-align: center;
  color: var(--espresso-600);
  max-width: 480px;
  margin-inline: auto;
  margin-bottom: var(--space-5);
  font-size: 17px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.feature-card {
  background: var(--cream-50);
  border: 1px solid rgba(42,29,20,.08);
  border-radius: var(--radius-card);
  padding: 28px;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition), background-color var(--transition);
}
.feature-card:hover {
  background: var(--white);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}
.feature-card:focus-within {
  background: var(--white);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover), 0 0 0 2px var(--amber-500);
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(200,133,63,.14);
  color: var(--amber-600);
  margin-bottom: var(--space-3);
}

.card-title {
  font-family: var(--font-body);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--espresso-700);
  margin-bottom: var(--space-1);
}

.card-body {
  font-size: 16px;
  line-height: 1.6;
  color: var(--espresso-600);
  margin: 0;
}

/* ============================================================
   CTA Band
   ============================================================ */

.cta-band {
  background: var(--espresso-900);
  color: var(--white);
  padding-block: var(--space-7);
}
.cta-inner {
  max-width: 680px;
  margin-inline: auto;
  text-align: center;
}

.cta-eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--amber-500);
  margin-bottom: var(--space-2);
}

.cta-h2 {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--white);
  margin-bottom: var(--space-2);
}

.cta-sub {
  font-size: 17px;
  line-height: 1.6;
  color: rgba(247,241,232,.80);
  margin-bottom: var(--space-4);
}

.signup-form { margin-bottom: var(--space-2); }

.form-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.input-wrap { flex: 1; text-align: left; }

.email-input {
  width: 100%;
  min-width: 280px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--espresso-600);
  background: var(--white);
  border: 1.5px solid rgba(42,29,20,.15);
  border-radius: var(--radius-pill);
  padding: 14px 20px;
  min-height: 50px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.email-input::placeholder { color: rgba(90,68,52,.5); }
.email-input:focus {
  outline: none;
  border-color: var(--amber-500);
  box-shadow: 0 0 0 2px var(--amber-500);
}
.email-input.is-valid { border-color: var(--success-600); }
.email-input.is-invalid {
  border-color: var(--error-600);
  box-shadow: 0 0 0 2px rgba(178,58,58,.15);
}

.helper-text {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(247,241,232,.70);
  margin: 8px 0 0 4px;
}
.error-text {
  font-size: 13px;
  line-height: 1.5;
  color: #F2A8A8;
  margin: 8px 0 0 4px;
}

.form-submit { flex-shrink: 0; }

.microcopy {
  font-size: 13px;
  color: rgba(247,241,232,.60);
  margin-top: var(--space-2);
}

.form-status { margin-top: var(--space-3); }

/* Confirmation card */
.confirmation-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  background: rgba(200,133,63,.10);
  border: 1px solid rgba(200,133,63,.35);
  border-radius: var(--radius-card);
  padding: var(--space-4) var(--space-5);
  color: var(--white);
}
.confirmation-card .check {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--amber-500);
  color: var(--espresso-900);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.confirmation-card p { font-size: 17px; margin: 0; }
.confirmation-card strong { color: var(--amber-500); }

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
  background: var(--espresso-900);
  color: rgba(247,241,232,.70);
  padding: var(--space-5) 0 var(--space-4);
  border-top: 1px solid rgba(200,133,63,.18);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.4fr;
  gap: var(--space-4);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid rgba(247,241,232,.10);
}

.wordmark-light { color: var(--white); }
.wordmark-light .bean-glyph { color: var(--amber-500); }

.footer-blurb {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(247,241,232,.60);
  max-width: 280px;
  margin-top: var(--space-2);
}

.footer-col h4 {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--white);
  margin-bottom: var(--space-2);
}
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a {
  font-size: 14px;
  color: rgba(247,241,232,.70);
  padding: 4px 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: color var(--transition);
}
.footer-col a:hover { color: var(--amber-500); }

.footer-email {
  display: inline-block;
  font-size: 14px;
  color: var(--amber-500);
  margin-bottom: var(--space-2);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.social-row { display: flex; gap: var(--space-2); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-top: var(--space-4);
  font-size: 13px;
  color: rgba(247,241,232,.60);
}
.footer-bottom p { margin: 0; }
.footer-bottom-links { display: flex; gap: var(--space-3); }
.footer-bottom-links a { color: rgba(247,241,232,.70); transition: color var(--transition); }
.footer-bottom-links a:hover { color: var(--amber-500); }
.footer-tagline { color: rgba(247,241,232,.45); }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1119px) {
  .container { padding-inline: 24px; }
}

/* Desktop: 960px+ */
@media (max-width: 959px) {
  .hero { padding-block: var(--space-6); }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }
  .hero-image-wrap { order: -1; max-width: 520px; margin-inline: auto; width: 100%; }
  .hero-h1 { font-size: 42px; }

  .features { padding-block: var(--space-6); }
  .card-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    max-width: 480px;
    margin-inline: auto;
  }

  .cta-band { padding-block: 56px; }
  .cta-h2 { font-size: 30px; }
}

/* Tablet: 600px+ keeps single column features; hero stacked */

/* Mobile menu breakpoint: <880px */
@media (max-width: 879px) {
  .primary-nav {
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    background: var(--cream-100);
    border-bottom: 1px solid rgba(42,29,20,.10);
    box-shadow: 0 8px 24px rgba(42,29,20,.08);
    padding: var(--space-2) var(--gutter) var(--space-3);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--transition), opacity var(--transition);
  }
  .primary-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .nav-links li { border-bottom: 1px solid rgba(42,29,20,.06); }
  .nav-links a {
    padding: 14px 4px;
    width: 100%;
    justify-content: flex-start;
  }
  .nav-links a::after { left: 4px; }

  .nav-toggle { display: flex; }
  .link-sign-in { display: none; }
}

/* Small mobile */
@media (max-width: 599px) {
  body { font-size: 16px; }
  .hero-h1 { font-size: 36px; }
  .section-h2 { font-size: 26px; }
  .hero-sub { font-size: 16px; }

  .hero-cta-row { flex-direction: column; align-items: stretch; }
  .hero-cta-row .btn { width: 100%; }
  .ghost-link { width: 100%; justify-content: center; }

  .cta-h2 { font-size: 26px; }
  .form-row { flex-direction: column; }
  .email-input { min-width: 0; }
  .form-submit { width: 100%; }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }
  .footer-bottom-links { flex-wrap: wrap; }
}

/* ============================================================
   Reduced motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 120ms !important;
    animation-duration: 120ms !important;
    animation-iteration-count: 1 !important;
  }
  .btn-primary:hover,
  .feature-card:hover,
  .feature-card:focus-within,
  .ghost-link:hover .arrow {
    transform: none !important;
  }
  .hero::before { display: none; }
}

/* Spinner */
.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(42,29,20,.25);
  border-top-color: var(--espresso-900);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
}
