/* ==========================================================================
   GLOBAL — Bauhaus design tokens, base elements, shared components.
   Every value in the design system lives here as a custom property.
   See .claude/design-system.md
   ========================================================================== */

/* --- Tokens --------------------------------------------------------------- */

:root {
  /* Palette — Bauhaus primaries + stark black/white. Nothing else. */
  --bg: #f0f0f0;
  --fg: #121212;
  --red: #d02020;
  --blue: #1040c0;
  --yellow: #f0c020;
  --white: #ffffff;
  --muted: #e0e0e0;
  --wash: #fff9c4; /* accordion expanded content */
  --border: #121212;

  /* Border widths — 2px mobile, 4px desktop. Major divisions always 4px. */
  --bw: 2px;
  --bw-strong: 4px;

  /* Hard offset shadows only. Never blurred. */
  --shadow-sm: 3px 3px 0 0 var(--fg);
  --shadow-md: 4px 4px 0 0 var(--fg);
  --shadow-lg: 6px 6px 0 0 var(--fg);

  /* Spacing scale — 4 / 8 / 12 / 16 / 24 */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s6: 24px;

  /* Layout */
  --container: 80rem; /* max-w-7xl */
  --pad-x: var(--s4);
  --pad-y: 48px;

  /* Motion — mechanical, snappy. */
  --dur: 200ms;
  --ease: ease-out;

  --font: "Outfit", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (min-width: 640px) {
  :root {
    --pad-x: var(--s6);
    --pad-y: 64px;
    --shadow-md: 6px 6px 0 0 var(--fg);
    --shadow-lg: 8px 8px 0 0 var(--fg);
  }
}

@media (min-width: 1024px) {
  :root {
    --bw: 4px;
    --pad-x: 32px;
    --pad-y: 96px;
  }
}

/* --- Reset & base --------------------------------------------------------- */

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-weight: 500; /* body is medium for readability */
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 640px) {
  body {
    font-size: 1.125rem;
  }
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

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

/* Headlines: black weight, uppercase, tight tracking, tight leading. */
h1,
h2,
h3 {
  margin: 0;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.035em;
  line-height: 0.9;
}

h1 {
  font-size: clamp(2.25rem, 9vw, 6rem);
}

h2 {
  font-size: clamp(1.875rem, 6vw, 3.5rem);
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
}

p {
  margin: 0 0 var(--s4);
}

p:last-child {
  margin-bottom: 0;
}

/* Visible focus everywhere — 2px offset ring. */
:focus-visible {
  outline: var(--bw-strong) solid var(--blue);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--yellow);
  color: var(--fg);
  border: var(--bw-strong) solid var(--border);
  padding: var(--s3) var(--s4);
  font-weight: 700;
  text-transform: uppercase;
}

.skip-link:focus {
  left: var(--s4);
  top: var(--s4);
}

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

/* --- Layout primitives ---------------------------------------------------- */

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

/* Every section is bounded by a thick rule — strong horizontal rhythm. */
.section {
  padding-block: var(--pad-y);
  border-bottom: var(--bw-strong) solid var(--border);
}

.section-label {
  display: inline-block;
  margin-bottom: var(--s3);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.section-head {
  max-width: 46rem;
  margin-bottom: 40px;
}

.section-head p {
  margin-top: var(--s4);
  margin-bottom: 0;
}

/* --- Buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: var(--s3) var(--s6);
  border: var(--bw) solid var(--border);
  border-radius: 0;
  box-shadow: var(--shadow-md);
  background: var(--white);
  color: var(--fg);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}

/* The physical press: shift into the shadow, then remove it. */
.btn:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.btn:hover {
  color: inherit;
}

.btn--red {
  background: var(--red);
  color: var(--white);
}

.btn--blue {
  background: var(--blue);
  color: var(--white);
}

.btn--yellow {
  background: var(--yellow);
  color: var(--fg);
}

.btn--red:hover,
.btn--blue:hover,
.btn--yellow:hover,
.btn--outline:hover {
  filter: brightness(0.92);
}

.btn--outline {
  background: var(--white);
  color: var(--fg);
}

.btn--pill {
  border-radius: 9999px;
}

.btn--lg {
  padding: var(--s4) 40px;
  font-size: 1.125rem;
}

/* --- Cards ---------------------------------------------------------------- */

.card {
  position: relative;
  padding: var(--s6);
  background: var(--white);
  border: var(--bw-strong) solid var(--border);
  box-shadow: var(--shadow-lg);
  transition: transform var(--dur) var(--ease);
}

.card:hover {
  transform: translateY(-4px);
}

/* Corner decoration — a small primary-colored shape, cycled per card. */
.card::after {
  content: "";
  position: absolute;
  top: var(--s3);
  right: var(--s3);
  width: 16px;
  height: 16px;
  background: var(--red);
}

.card--circle::after {
  border-radius: 9999px;
  background: var(--blue);
}

.card--triangle::after {
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  background: var(--yellow);
}

.card h3 {
  margin-bottom: var(--s3);
  padding-right: var(--s6);
}

.card p {
  font-size: 1rem;
}

/* --- Geometric shape helpers --------------------------------------------- */

.shape {
  display: block;
}

.shape--circle {
  border-radius: 9999px;
}

.shape--triangle {
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.shape--rotated {
  transform: rotate(45deg);
}

/* --- Ad slots ------------------------------------------------------------- */
/* Reserved height so AdSense never shifts layout (CLS). Never place inside
   the calculator's interaction area. */

/* ---------------------------------------------------------------------------
   AD SLOTS — CURRENTLY HIDDEN
   ---------------------------------------------------------------------------
   The placeholders are hidden until AdSense approval so the site does not show
   empty grey boxes to a reviewer. The markup stays in index.html so the planned
   placement is not lost.

   TO ENABLE: delete the `.section--ad { display: none; }` rule directly below.

   WARNING: remove that rule BEFORE pasting real AdSense code into these slots.
   Live ad units inside a display:none container will not render and breach
   AdSense policy on hidden ads.
   ------------------------------------------------------------------------- */

.section--ad {
  display: none;
}

/* Ads get their own band, but not a full section's worth of air. */
.section--ad {
  padding-block: 40px;
}

.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  margin-inline: auto;
  max-width: 970px;
  border: var(--bw) dashed var(--border);
  background: var(--muted);
  color: var(--fg);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

@media (min-width: 1024px) {
  .ad-slot {
    min-height: 250px;
  }
}
