/* ---------- Tokens (derived from the app's SwiftUI design) ---------- */
:root {
  --bg: #f3f1e8;
  --bg-end: #e6ecdc;
  --surface: #ffffff;
  --surface-raised: #f6f5ef;
  --ink1: #1d2318;
  --ink2: #535b4c;
  --ink3: #7f8777;
  --brand: #4e8a3e;
  --brand-tint: #3c7330;
  --on-brand: #ffffff;
  --hairline: rgba(29, 35, 24, 0.10);
  --danger: #b83c28;
  --success: #357a40;

  --space-xs: 4px;
  --space-s: 8px;
  --space-m: 12px;
  --space-l: 16px;
  --space-xl: 20px;
  --space-xxl: 24px;
  --space-section: 32px;

  --radius-badge: 8px;
  --radius-thumb: 12px;
  --radius-field: 14px;
  --radius-card: 20px;
  --radius-cta: 26px;

  --shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  --shadow-soft: 0 2px 10px rgba(0, 0, 0, 0.05);

  --container: 960px;
  --container-narrow: 720px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151a13;
    --bg-end: #0d110c;
    --surface: #1e241b;
    --surface-raised: #283024;
    --ink1: #eef1e8;
    --ink2: #aab2a1;
    --ink3: #858d7c;
    --brand: #6fae5a;
    --brand-tint: #8fca79;
    --on-brand: #0f1a0b;
    --hairline: rgba(255, 255, 255, 0.09);
    --danger: #ff8a73;
    --success: #7fcf8a;
    --shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    --shadow-soft: 0 2px 10px rgba(0, 0, 0, 0.25);
  }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink1);
  background: linear-gradient(to bottom, var(--bg), var(--bg-end));
  background-attachment: fixed;
  overflow-x: hidden;
}

h1, h2, h3, p {
  margin: 0;
}

a {
  color: var(--brand-tint);
}

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: var(--radius-badge);
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-xxl);
}

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

.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
}

/* ---------- Header ---------- */
.site-header {
  padding: var(--space-l) 0;
  border-bottom: 1px solid var(--hairline);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-l);
  flex-wrap: wrap;
}

.brand {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink1);
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  padding: var(--space-xs);
  background: var(--surface);
  border-radius: var(--radius-cta);
  box-shadow: var(--shadow-soft);
}

.nav-link {
  padding: var(--space-s) var(--space-l);
  border-radius: var(--radius-cta);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink2);
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
  color: var(--ink1);
  background: var(--surface-raised);
}

.nav-link.is-active {
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 600;
}

.nav-link:focus-visible {
  border-radius: var(--radius-cta);
}

/* ---------- Main ---------- */
.site-main {
  flex: 1 0 auto;
  padding: 56px 0 64px;
}

/* ---------- Home ---------- */
.hero {
  max-width: 680px;
}

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-tint);
  margin-bottom: var(--space-m);
}

.hero-title {
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-text {
  margin-top: var(--space-xl);
  font-size: 18px;
  color: var(--ink2);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-m);
  margin-top: var(--space-section);
}

.features {
  margin-top: 64px;
}

.section-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink2);
  margin-bottom: var(--space-l);
}

.feature-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-m);
}

.feature {
  padding: var(--space-xxl) var(--space-xl);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-thumb);
  background: var(--surface-raised);
  color: var(--brand-tint);
  margin-bottom: var(--space-l);
}

.feature-title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
}

.feature-text {
  margin-top: var(--space-s);
  font-size: 15px;
  color: var(--ink2);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: var(--space-m) var(--space-xl);
  border: 0;
  border-radius: var(--radius-cta);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease, filter 0.2s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn:focus-visible {
  border-radius: var(--radius-cta);
}

.btn-primary {
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink1);
  box-shadow: var(--shadow-soft);
}

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

.btn-full {
  width: 100%;
}

/* ---------- Inner pages ---------- */
.page-title {
  font-size: clamp(30px, 4.5vw, 38px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.page-intro {
  margin-top: var(--space-m);
  font-size: 18px;
  color: var(--ink2);
}

/* ---------- Form ---------- */
.form-card {
  margin-top: var(--space-section);
  padding: var(--space-section) var(--space-xxl);
}

.field + .field {
  margin-top: var(--space-xl);
}

.field:last-of-type {
  margin-bottom: var(--space-xxl);
}

label {
  display: block;
  margin-bottom: var(--space-s);
  font-size: 15px;
  font-weight: 600;
}

input,
textarea {
  display: block;
  width: 100%;
  padding: var(--space-m) var(--space-l);
  font-family: inherit;
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink1);
  background: var(--surface-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-field);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea {
  resize: vertical;
  min-height: 150px;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 30%, transparent);
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--danger);
}

.field-error {
  margin-top: var(--space-s);
  font-size: 14px;
  color: var(--danger);
}

.form-success {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  margin-top: var(--space-xl);
  padding: var(--space-m) var(--space-l);
  border-radius: var(--radius-field);
  background: var(--surface-raised);
  color: var(--success);
  font-size: 15px;
  font-weight: 600;
}

.form-success[hidden],
.field-error[hidden] {
  display: none;
}

.form-success svg {
  flex-shrink: 0;
}

/* ---------- Privacy ---------- */
.policy {
  margin-top: var(--space-section);
  padding: var(--space-section) var(--space-xxl);
}

.policy-section + .policy-section {
  margin-top: var(--space-l);
  padding-top: var(--space-l);
  border-top: 1px solid var(--hairline);
}

.policy p {
  font-size: 16px;
  color: var(--ink2);
}

.policy-heading {
  display: block;
  margin-bottom: var(--space-xs);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink1);
}

/* ---------- Footer ---------- */
.site-footer {
  flex-shrink: 0;
  padding: var(--space-xxl) 0;
  border-top: 1px solid var(--hairline);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-l);
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer-name {
  font-size: 15px;
  font-weight: 600;
}

.footer-note {
  font-size: 13px;
  color: var(--ink2);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-l);
}

.footer-nav a {
  font-size: 14px;
  color: var(--ink2);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-nav a:hover {
  color: var(--brand-tint);
  text-decoration: underline;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .container {
    padding: 0 var(--space-l);
  }

  .header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-m);
  }

  .nav {
    justify-content: space-between;
  }

  .nav-link {
    flex: 1 1 auto;
    text-align: center;
    padding: var(--space-s) var(--space-m);
  }

  .site-main {
    padding: 36px 0 48px;
  }

  .hero-text,
  .page-intro {
    font-size: 17px;
  }

  .actions .btn {
    flex: 1 1 100%;
  }

  .features {
    margin-top: 48px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .form-card,
  .policy {
    padding: var(--space-xxl) var(--space-l);
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 360px) {
  .nav-link {
    font-size: 14px;
    padding: var(--space-s);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
