/* ==========================================================================
   Square Roots — main stylesheet
   Tokens first, then base, layout, components, and print.
   Palette draws on the sample image: brick, bark, and leaf.
   ========================================================================== */

:root {
  /* Color */
  --color-bg: #faf7f2;
  --color-surface: #ffffff;
  --color-text: #2b2420;
  --color-muted: #6b5f56;
  --color-border: #e6ddd2;
  --color-brick: #a4492f;
  --color-brick-dark: #7f3621;
  --color-bark: #5c4a3d;
  --color-leaf: #3f6b3a;
  --color-leaf-soft: #e8efe4;

  /* Type */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;
  --text-sm: 0.875rem;
  --text-base: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  --text-2xl: clamp(2rem, 1.4rem + 3vw, 3.25rem);

  /* Space and shape */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --space-6: 4rem;
  --radius: 10px;
  --max-width: 68rem;
  --measure: 40rem;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
}

h1,
h2,
h3 {
  font-family: var(--font-serif);
  line-height: 1.15;
  color: var(--color-bark);
  margin: 0 0 var(--space-3);
}

h1 { font-size: var(--text-2xl); letter-spacing: -0.01em; }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }

p { margin: 0 0 var(--space-3); }

a {
  color: var(--color-brick);
  text-underline-offset: 0.15em;
}

a:hover { color: var(--color-brick-dark); }

:focus-visible {
  outline: 3px solid var(--color-leaf);
  outline-offset: 2px;
}

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

.skip-link {
  position: absolute;
  left: -999px;
}

.skip-link:focus {
  left: var(--space-3);
  top: var(--space-3);
  background: var(--color-surface);
  padding: var(--space-2) var(--space-3);
  z-index: 10;
}

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

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

@media (min-width: 48rem) {
  .container { padding: 0 var(--space-4); }
}

.section { padding: var(--space-6) 0; }
.section--tint { background: var(--color-leaf-soft); }

.prose { max-width: var(--measure); }

/* --------------------------------------------------------------------------
   Header and footer
   -------------------------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 4rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-bark);
  text-decoration: none;
}

.brand img { width: 2rem; height: 2rem; }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--color-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 600;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--color-brick); }

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-5) 0;
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3);
}

/* --------------------------------------------------------------------------
   Components
   -------------------------------------------------------------------------- */

.hero { padding: var(--space-6) 0 var(--space-5); }

.eyebrow {
  display: inline-block;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-leaf);
  margin-bottom: var(--space-2);
}

.lede {
  font-size: var(--text-lg);
  color: var(--color-muted);
  max-width: var(--measure);
}

.notice {
  display: inline-block;
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-left: 4px solid var(--color-leaf);
  background: var(--color-leaf-soft);
  color: var(--color-bark);
  font-size: var(--text-sm);
  font-weight: 600;
}

.doors {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
  margin-top: var(--space-5);
}

@media (min-width: 48rem) {
  .doors { grid-template-columns: repeat(3, 1fr); }
}

.door {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.door:hover {
  border-color: var(--color-brick);
  transform: translateY(-2px);
  color: var(--color-text);
}

.door__quote {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  color: var(--color-bark);
}

.door__cta {
  margin-top: auto;
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--color-brick);
}

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

@media (min-width: 48rem) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}

.card {
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

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

.badge {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  background: var(--color-leaf-soft);
  color: var(--color-leaf);
  font-size: var(--text-sm);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.button {
  display: inline-block;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius);
  background: var(--color-brick);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.button:hover { background: var(--color-brick-dark); color: #fff; }

/* Only shown when printing */
.print-only { display: none; }

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

/* --------------------------------------------------------------------------
   Print: every content page prints as a branded one-pager.
   -------------------------------------------------------------------------- */

@media print {
  @page { size: letter; margin: 0.5in; }

  :root { --text-base: 10pt; --text-lg: 12pt; --text-xl: 15pt; --text-2xl: 20pt; }

  body { background: #fff; color: #000; line-height: 1.35; }

  .site-nav,
  .site-footer,
  .skip-link,
  .no-print { display: none !important; }

  .print-only { display: block; }

  .site-header { border-bottom: 2px solid var(--color-bark); }
  .site-header .container { min-height: 0; padding-bottom: 0.1in; }

  .section,
  .hero { padding: 0.15in 0; }

  .card,
  .door { break-inside: avoid; border-color: #bbb; }

  a { color: #000; text-decoration: none; }

  .print-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    font-size: 8pt;
    color: #444;
    border-top: 1px solid #bbb;
    padding-top: 0.05in;
  }
}
