/* ===========================================================
   SmarterSquares — Shared Design System
   "Make the most of every inch"
   =========================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Brand palette — natural materials: green, wood, brick, concrete */
  --green:  #5F8A57;  /* calm leafy green      */
  --amber:  #C58A36;  /* warm wood / ochre     */
  --coral:  #B45C3F;  /* brick / terracotta    */
  --blue:   #84867C;  /* concrete grey         */

  /* Tints (derived from base colors so palette swaps cascade) */
  --blue-tint:  color-mix(in srgb, var(--blue) 16%, #fff);
  --green-tint: color-mix(in srgb, var(--green) 15%, #fff);
  --amber-tint: color-mix(in srgb, var(--amber) 17%, #fff);
  --coral-tint: color-mix(in srgb, var(--coral) 15%, #fff);

  /* Calm sage-tinted neutrals */
  --bg:        #F2F5EC;
  --surface:   #FCFDF9;
  --surface-2: #E6EDDB;
  --ink:       #1E2519;
  --ink-soft:  #3A4633;
  --muted:     #69745F;
  --line:      #DBE4CF;
  --line-soft: #E7EEDC;

  /* Type */
  --font-display: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
  --font-text: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  --font-mono: "Space Mono", ui-monospace, monospace;

  /* Shape */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius:    18px;
  --radius-lg: 28px;
  --radius-xl: 40px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(26,34,22,.06), 0 1px 3px rgba(26,34,22,.04);
  --shadow:    0 4px 14px rgba(26,34,22,.08), 0 2px 4px rgba(26,34,22,.05);
  --shadow-lg: 0 18px 50px rgba(26,34,22,.13), 0 6px 16px rgba(26,34,22,.07);

  /* Layout */
  --maxw: 1180px;
  --gut: clamp(20px, 5vw, 56px);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-text);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; padding: 0; }

/* ---------- Type scale ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.08; letter-spacing: -0.02em; color: var(--ink); }
.h-display { font-size: clamp(2.7rem, 6vw, 4.5rem); letter-spacing: -0.035em; line-height: 1.02; }
h1 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.55rem); letter-spacing: -0.015em; }
h4 { font-size: 1.12rem; letter-spacing: -0.01em; }
p { text-wrap: pretty; }
.lead { font-size: clamp(1.12rem, 1.6vw, 1.32rem); color: var(--ink-soft); line-height: 1.55; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut); }
.section { padding-block: clamp(56px, 9vw, 110px); }
.section-tight { padding-block: clamp(40px, 6vw, 72px); }
.center { text-align: center; }
.stack-sm > * + * { margin-top: .6rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55em;
  font-family: var(--font-text);
  font-weight: 700; font-size: 1.02rem;
  padding: .82em 1.4em;
  border-radius: 999px;
  transition: transform .14s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--ink); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: #000; box-shadow: var(--shadow); transform: translateY(-1px); }
.btn-coral { background: var(--coral); color: #fff; box-shadow: 0 6px 18px rgba(180,92,63,.28); }
.btn-coral:hover { filter: brightness(1.04); transform: translateY(-1px); }
.btn-green { background: #3F6136; color: #fff; box-shadow: 0 6px 18px rgba(63,97,54,.26); }
.btn-green:hover { background: #355230; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink); background: var(--surface); }
.btn-white { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.btn-white:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-sm { padding: .6em 1.05em; font-size: .92rem; }
.arrow { transition: transform .18s ease; }
.btn:hover .arrow, .link-arrow:hover .arrow { transform: translateX(3px); }

.link-arrow {
  display: inline-flex; align-items: center; gap: .4em;
  font-weight: 700; color: var(--ink);
  border-bottom: 2px solid transparent; padding-bottom: 1px;
  transition: border-color .18s ease, gap .18s ease;
}
.link-arrow:hover { border-color: currentColor; }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: .6rem; }
.logo-mark { width: 34px; height: 34px; flex: none; }
.logo-word { font-family: var(--font-display); font-weight: 800; font-size: 1.28rem; letter-spacing: -0.03em; color: var(--ink); }
.logo-word b { color: var(--coral); font-weight: 800; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(251,248,243,.82);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; height: 74px;
}
.nav-links { display: flex; align-items: center; gap: .35rem; }
.nav-links a {
  font-weight: 600; font-size: .98rem; color: var(--ink-soft);
  padding: .5rem .8rem; border-radius: 999px;
  transition: background .16s ease, color .16s ease;
}
.nav-links a:hover { background: var(--surface-2); color: var(--ink); }
.nav-links a.active { color: var(--ink); }
.nav-right { display: flex; align-items: center; gap: .7rem; }
.nav-toggle { display: none; width: 44px; height: 44px; border-radius: 12px; align-items: center; justify-content: center; }
.nav-toggle:hover { background: var(--surface-2); }
.nav-toggle svg { width: 22px; height: 22px; }

/* Mobile menu */
.mobile-menu {
  display: none;
  position: fixed; inset: 74px 0 0 0; z-index: 55;
  background: var(--bg);
  padding: 1.4rem var(--gut) 2rem;
  flex-direction: column; gap: .3rem;
  animation: fadeIn .18s ease;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-family: var(--font-display); font-weight: 700; font-size: 1.5rem;
  padding: .7rem 0; border-bottom: 1px solid var(--line-soft); color: var(--ink);
}
.mobile-menu .btn { margin-top: 1.2rem; justify-content: center; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Pills / badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: .4em;
  font-size: .82rem; font-weight: 700;
  padding: .34em .8em; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-soft);
}
.pill .dot { width: 8px; height: 8px; border-radius: 999px; flex: none; }
.tag-blue  { background: var(--blue-tint);  color: #55524A; }
.tag-green { background: var(--green-tint); color: #3F5A26; }
.tag-amber { background: var(--amber-tint); color: #875A1C; }
.tag-coral { background: var(--coral-tint); color: #8F3F27; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: transform .2s ease, box-shadow .25s ease, border-color .2s ease;
}
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }

/* ---------- Image placeholder ---------- */
.ph {
  position: relative; overflow: hidden;
  background:
    repeating-linear-gradient(135deg, rgba(33,28,22,.045) 0 12px, rgba(33,28,22,.02) 12px 24px),
    var(--surface-2);
  display: flex; align-items: center; justify-content: center;
}
.ph::after {
  content: attr(data-label);
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .04em;
  color: var(--muted); text-transform: uppercase;
  background: rgba(255,255,255,.7); padding: .3em .7em; border-radius: 999px;
}
.ph-blue  { background: repeating-linear-gradient(135deg, rgba(138,134,124,.16) 0 12px, rgba(138,134,124,.06) 12px 24px), var(--blue-tint); }
.ph-green { background: repeating-linear-gradient(135deg, rgba(110,142,74,.16) 0 12px, rgba(110,142,74,.05) 12px 24px), var(--green-tint); }
.ph-amber { background: repeating-linear-gradient(135deg, rgba(197,138,54,.16) 0 12px, rgba(197,138,54,.05) 12px 24px), var(--amber-tint); }
.ph-coral { background: repeating-linear-gradient(135deg, rgba(180,92,63,.15) 0 12px, rgba(180,92,63,.05) 12px 24px), var(--coral-tint); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #E2EAD7; padding-block: clamp(48px, 7vw, 80px) 2rem; }
.site-footer a { color: #C1CBB5; transition: color .15s ease; }
.site-footer a:hover { color: #fff; }
.site-footer .logo-word { color: #fff; }
.footer-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.4fr; gap: 2.5rem;
  padding-bottom: 2.5rem; border-bottom: 1px solid rgba(255,255,255,.12);
}
.footer-col h5 { font-family: var(--font-text); font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: #96A088; margin-bottom: 1rem; font-weight: 700; }
.footer-col ul { display: flex; flex-direction: column; gap: .6rem; font-size: .96rem; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; padding-top: 1.6rem; font-size: .88rem; color: #96A088; }
.footer-bottom .links { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.newsletter-mini { display: flex; gap: .5rem; margin-top: 1rem; }
.newsletter-mini input {
  flex: 1; min-width: 0; padding: .7em 1em; border-radius: 999px; border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06); color: #fff; font: inherit; font-size: .92rem;
}
.newsletter-mini input::placeholder { color: #96A088; }
.newsletter-mini input:focus { outline: 2px solid var(--coral); border-color: transparent; }

/* ---------- Breadcrumb ---------- */
.crumbs { display: flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--muted); flex-wrap: wrap; }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { opacity: .5; }

/* ---------- Forms / inputs ---------- */
.field { display: flex; flex-direction: column; gap: .4rem; }
.field label { font-weight: 700; font-size: .92rem; color: var(--ink-soft); }
.input, .select {
  width: 100%; padding: .8em 1em; font: inherit; font-size: 1rem;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  color: var(--ink); transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint); }

/* ---------- Utility ---------- */
.muted { color: var(--muted); }
.divider { height: 1px; background: var(--line); border: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  body { font-size: 17px; }
  .nav-links, .nav-right .btn { display: none; }
  .nav-toggle { display: flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .footer-col.brand { grid-column: 1 / -1; }
}
@media (max-width: 540px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 680px) {
  input:not([type=range]):not([type=checkbox]):not([type=radio]),
  select, textarea { min-height: 44px; font-size: 1rem !important; }
  button:not(.nav-toggle):not(.seg button) { min-height: 44px; }
}
