/* nomadchef marketing site.
   The palette mirrors the Flutter app's semantic theme tokens
   (../frontend/lib/core/theme/app_theme_colors.dart): :root holds the
   light-mode values — the default — and the .dark class on <html> swaps in
   the dark-mode values, so the page re-skins itself exactly like the app.
   The switch in the nav toggles the class and persists the choice in
   localStorage (see index.html). Components only reference the tokens
   below — never raw colors. */

:root {
  color-scheme: light;

  /* surfaces: surfaceAlt scaffold, card, cardBorder, inputFill, borderInput */
  --surface-alt: #f0f4f0;
  --card: #ffffff;
  --card-border: #d5e8d8;
  --input-fill: #e8f0ea;
  --border-input: rgba(22, 58, 39, 0.15);
  --divider: #d1d5dc;

  /* text: ink, muted, faint, accentText, placeholder */
  --ink: #1a3320;
  --muted: #4a5565;
  --faint: #5f6b7a;
  --accent-text: #3e7752;
  --placeholder: #8a958f;

  /* brand actions: forest CTA + onForest label. The focus accent is the one
     green the app keeps identical in both themes (#4A8C62). */
  --forest: #2d5535;
  --forest-hover: #4a8c62;
  --on-forest: #ffffff;
  --accent: #4a8c62;

  /* wordmark ink: the light/dark logo asset colors (#163A27 / #8FCBA6) */
  --logo-ink: #163a27;

  /* feedback: success / danger */
  --success: #007227;
  --danger: #d91d3e;

  --shadow: rgba(0, 0, 0, 0.1);
}

/* dark mode is opt-in: the nav switch adds .dark to <html> */
:root.dark {
  color-scheme: dark;

  --surface-alt: #10241b;
  --card: #1a3829;
  --card-border: #2d5535;
  --input-fill: #26332b;
  --border-input: #2e3b33;
  --divider: #3a434b;

  --ink: #e4ede5;
  --muted: rgba(240, 244, 240, 0.62);
  --faint: rgba(240, 244, 240, 0.4);
  --accent-text: #93d4ac;
  --placeholder: #79857e;

  --forest: #8fcba6;
  --forest-hover: #9fd7b2;
  --on-forest: #12291b;

  --logo-ink: #8fcba6;

  --success: #58d68d;
  --danger: #ff6b7a;

  --shadow: rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--surface-alt);
  transition: background-color 0.2s ease, color 0.2s ease;
}

::selection {
  background: var(--forest);
  color: var(--on-forest);
}

.nav {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--logo-ink);
  text-decoration: none;
}

.brand-wordmark {
  display: block;
  height: 28px; /* .nav height = 2 x 20px padding + 28px = 68px, see .hero */
  width: auto;
}

/* theme switch (top right): pill track with a sliding brand-forest knob.
   The knob covers the current mode's glyph; the visible glyph hints at the
   mode you get when you flip it. */
.theme-toggle {
  display: inline-flex;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
}

.theme-toggle-track {
  position: relative;
  display: block;
  width: 56px;
  height: 28px;
  border-radius: 999px;
  background: var(--input-fill);
  border: 1px solid var(--border-input);
}

.theme-toggle-sun,
.theme-toggle-moon {
  position: absolute;
  top: 50%;
  width: 13px;
  height: 13px;
  transform: translateY(-50%);
  color: var(--muted);
}

.theme-toggle-sun {
  left: 6px;
}

.theme-toggle-moon {
  right: 6px;
}

.theme-toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--forest);
  box-shadow: 0 1px 2px var(--shadow);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

:root.dark .theme-toggle-knob {
  transform: translateX(28px);
}

.hero {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  min-height: calc(100svh - 68px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-text);
  margin: 0 0 24px;
}

.pill::before {
  content: "";
  width: 24px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(36px, 6.5vw, 56px);
  font-weight: 800;
  line-height: 1.2;
}

h1 em {
  font-style: normal;
  color: var(--accent-text);
}

.subtitle {
  margin: 0 0 40px;
  font-size: 18px;
  color: var(--muted);
}

.loop-card {
  max-width: 460px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 2px 8px var(--shadow);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.loop-title {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 800;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.newsletter-form-input {
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  width: 100%;
  max-width: 340px;
  background: var(--input-fill);
  border: 1px solid var(--border-input);
  border-radius: 14px;
  padding: 13px 16px;
  margin: 0 0 10px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.newsletter-form-input::placeholder {
  color: var(--placeholder);
}

.newsletter-form-input:focus {
  border-color: var(--forest);
}

.newsletter-form-button,
.newsletter-loading-button {
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--on-forest);
  background: var(--forest);
  width: 100%;
  max-width: 340px;
  border: none;
  border-radius: 999px;
  padding: 13px 20px;
  box-shadow: 0 1px 2px var(--shadow);
  cursor: pointer;
  transition: background 0.15s ease;
}

.newsletter-form-button:hover {
  background: var(--forest-hover);
}

.newsletter-loading-button {
  display: none;
}

.newsletter-success,
.newsletter-error {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.newsletter-success-message {
  margin: 0;
  font-size: 15px;
  color: var(--success);
}

.newsletter-error-message {
  margin: 0;
  font-size: 15px;
  color: var(--danger);
}

.newsletter-back-button {
  display: none;
  margin: 10px auto 0;
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 14px;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
}

.newsletter-back-button:hover {
  text-decoration: underline;
}

.features {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 72px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 28px 24px;
  text-align: left;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.feature-card h2 {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 800;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
}

footer {
  border-top: 1px solid var(--divider);
  padding: 28px 24px 40px;
  text-align: center;
}

footer p {
  margin: 0;
  font-size: 14px;
  color: var(--faint);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  body,
  .loop-card,
  .feature-card,
  .newsletter-form-input,
  .theme-toggle-knob {
    transition: none;
  }
}
