/* =========================================================
  BASE STYLES — Semantic tokens only
  Goal: predictable typography + spacing with no selector fights.
========================================================= */

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-family-body);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  font-weight: var(--font-weight-body);
  color: var(--color-text-primary);
  background: var(--color-page-background);
}

/* Layout primitives */
.container {
  max-width: var(--layout-container-max-width);
  margin-inline: auto;
  padding-inline: var(--layout-container-inline-padding);
}

.section {
  padding-block: var(--spacing-section-vertical);
}


/* ---------------------------------------------------------
  Typography
--------------------------------------------------------- */

h1, h2, h3 {
  margin: 0;
  color: var(--color-text-heading);
  line-height: var(--line-height-heading);
  font-weight: var(--font-weight-heading);
}

h1 { font-size: var(--font-size-heading-1); }
h2 { font-size: var(--font-size-heading-2); margin-bottom: var(--space-16); }
h3 { font-size: var(--font-size-heading-3); margin-bottom: var(--space-12); }

p {
  margin: 0;
  color: var(--color-text-primary);
}

a {
  color: var(--color-link-default);
  text-underline-offset: 0.18em;
}

a:hover { color: var(--color-link-hover); }

/* ---------------------------------------------------------
  Consistent vertical rhythm
  - Use .stack on wrappers (div/form/etc.)
  - Lists can also use .stack, but we override item spacing below.
--------------------------------------------------------- */

.stack > * + * {
  margin-top: var(--spacing-stack-normal);
}

/* Paragraph groups (like the Why/Belief/Solution sections) should read normally */
.content.stack > * + * {
  margin-top: var(--space-16);
}

/* Lists should feel like a single grouped unit (not disjoint blocks) */
ul.stack, ol.stack {
  margin: 0;
  padding-left: var(--space-20);
}

ul.stack > li + li {
  margin-top: var(--space-8);
}

ol.stack > li + li {
  margin-top: var(--space-20);
}

/* ---------------------------------------------------------
  BUTTON NORMALIZATION — drop-in for base.css
  Goal: make <a class="button"> and <button class="button">
  look/feel identical (padding, line-height, border, font)
--------------------------------------------------------- */

/* Remove browser defaults that cause inconsistency */
button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  background: none;
  border: 0;
  margin: 0;
  padding: 0;
  line-height: 0;
}

/* Ensure anchor "buttons" don't get link styling
   IMPORTANT: do NOT force width here (layout should control width) */
a.button {
  color: inherit;
  text-decoration: none;
}

/* Single source of truth: every button uses .button */
.button,
button.button,
input.button[type="button"],
input.button[type="submit"],
input.button[type="reset"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);

  padding: var(--space-12) var(--space-20);
  border-radius: var(--radius-pill);
  border: var(--border-width-thin) solid transparent;

  font-weight: var(--font-weight-semibold);
  line-height: 1;
  white-space: nowrap;

  cursor: pointer;

  transition:
    transform var(--motion-duration-medium) var(--motion-easing-standard),
    background var(--motion-duration-medium) var(--motion-easing-standard),
    color var(--motion-duration-medium) var(--motion-easing-standard),
    border-color var(--motion-duration-medium) var(--motion-easing-standard);
}

/* Press state (consistent across <a> + <button>) */
.button:active {
  transform: translateY(1px);
}

/* Focus ring (keyboard friendly) */
.button:focus {
  outline: none;
}
.button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Disabled (only applies to actual form controls) */
button.button:disabled,
input.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Variants (keep your existing token-driven colors) */
.button-primary {
  background: var(--color-button-primary-background);
  color: var(--color-button-primary-text);
}
.button-primary:hover {
  background: var(--color-button-primary-background-hover);
  color: var(--color-button-primary-text);
}

.button-secondary {
  background: var(--color-button-secondary-background);
  color: var(--color-button-secondary-text);
  border-color: var(--color-button-secondary-border);
}
.button-secondary:hover {
  background: var(--color-button-secondary-background-hover);
}

/* ---------------------------------------------------------
  ACTIONS (button layout utility)
  Mobile-first:
    - stacked buttons
    - full width
  Desktop:
    - row
    - auto width (side-by-side)
--------------------------------------------------------- */

.actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

.actions > .button {
  width: 100%;
}

/* If you want the row sooner/later, change 768px */
@media (min-width: 768px) {
  .actions {
    flex-direction: row;
    align-items: center;
  }

  .actions > .button {
    width: auto;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .button,
  button.button,
  input.button[type="button"],
  input.button[type="submit"],
  input.button[type="reset"] {
    transition: none;
  }
}

/* ---------------------------------------------------------
  Forms (site-wide defaults)
--------------------------------------------------------- */

label {
  display: block;
  font-weight: var(--font-weight-medium);
  color: var(--color-text-heading);
}

input,
textarea {
  width: 100%;
  font: inherit;
  color: var(--color-input-text);
  background: var(--color-input-background);
  border: var(--border-width-thin) solid var(--color-input-border);
  border-radius: var(--radius-input);
  padding: var(--space-12) var(--space-16);
}

input:focus,
textarea:focus {
  outline: none;
  box-shadow: var(--focus-ring);
}

textarea { resize: vertical; }

/* ---------------------------------------------------------
  Smooth scroll offset for sticky header
  (JS updates --scroll-offset with real header height)
--------------------------------------------------------- */

:root {
  --scroll-offset: 80px;
}

main section[id] {
  scroll-margin-top: calc(var(--scroll-offset) + var(--space-16));
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button { transition: none; }
}
