/* EnoughForIt — design system per mockup: Poppins headings, Inter body,
   indigo primary, warm off-white ground, playful-but-practical. */

:root {
  --indigo: #4f46e5;
  --indigo-dark: #3d34c9;
  --indigo-soft: #eef2ff;
  --emerald: #10b981;
  --emerald-deep: #0b8a61; /* large-text AA on white */
  --emerald-soft: #e7f8f1;
  --amber: #f59e0b;
  --amber-soft: #fdf3df;
  --orange: #f97316;
  --orange-soft: #ffefe3;
  --navy: #151e3c;
  --ink: #1e2749;
  --slate: #64748b;
  --line: #e7e5e0;
  --bg: #fffbf7;
  --card: #ffffff;
  --danger: #dc2626;
  --ad-border: #c4b5fd;
  --ad-text: #8b5cf6;
  --ad-bg: #faf8ff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(21, 30, 60, 0.05), 0 6px 18px -8px rgba(21, 30, 60, 0.12);
  --font-head: 'Poppins', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; color: var(--navy); margin: 0 0 0.5em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--indigo); }
img { max-width: 100%; height: auto; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.icon { width: 1.35em; height: 1.35em; vertical-align: -0.28em; }

.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--navy); color: #fff;
  padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 100;
}
.skip-link:focus { left: 0; }

/* ------------------------------------------------------------- header --- */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.logo-mark { color: var(--indigo); display: inline-flex; }
.logo-mark .icon { width: 1.5em; height: 1.5em; }
.logo-word { font-family: var(--font-head); font-weight: 800; font-size: 1.25rem; color: var(--navy); letter-spacing: -0.02em; }
.logo-word b { color: var(--indigo); font-weight: 800; }
.logo-word i { color: var(--emerald); font-style: normal; }
.logo-word em { color: var(--slate); font-style: normal; font-weight: 600; font-size: 0.8em; }
.site-nav { display: flex; align-items: center; gap: 26px; }
.site-nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.site-nav a:hover, .site-nav a.active { color: var(--indigo); }
.nav-search { display: inline-flex; color: var(--slate); }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2.5px; background: var(--navy); margin: 4.5px 0; border-radius: 2px; transition: 0.2s; }

/* ---------------------------------------------------------------- hero --- */
.hero { padding: 56px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 40px; align-items: center; }
.hero h1 { margin-bottom: 12px; }
.hero h1 .accent { color: var(--indigo); }
.hero-copy { font-size: 1.15rem; color: var(--slate); max-width: 34em; }
.hero-copy .squiggle {
  color: var(--ink); font-weight: 600;
  background: linear-gradient(0deg, var(--amber-soft) 35%, transparent 35%);
}
.hero-img { text-align: center; }
.hero-img img { max-width: min(100%, 380px); border-radius: 20px; }
.finder { display: flex; gap: 10px; margin: 22px 0 14px; max-width: 560px; }
.finder select {
  flex: 1; min-width: 0; height: 54px; padding: 0 16px; font: 600 1rem var(--font-body);
  color: var(--ink); background: var(--card); border: 2px solid var(--line);
  border-radius: var(--radius-sm); cursor: pointer;
}
.finder select:focus { outline: 3px solid var(--indigo-soft); border-color: var(--indigo); }
.popular-searches { font-size: 0.9rem; color: var(--slate); }
.popular-searches a { margin-right: 10px; }

/* ------------------------------------------------------------- buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 1rem var(--font-body); border-radius: var(--radius-sm);
  padding: 0 22px; height: 54px; cursor: pointer; text-decoration: none;
  border: 2px solid transparent; transition: 0.15s;
}
.btn-primary { background: var(--indigo); color: #fff; }
.btn-primary:hover { background: var(--indigo-dark); }
.btn-secondary { background: var(--card); color: var(--navy); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--indigo); color: var(--indigo); }
.btn-sm { height: 44px; font-size: 0.92rem; padding: 0 16px; }
.btn-block { width: 100%; }

/* --------------------------------------------------------------- tiles --- */
.section { padding: 36px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head .view-all { font-weight: 600; font-size: 0.95rem; white-space: nowrap; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 22px 12px 18px; text-decoration: none; text-align: center;
  transition: 0.15s; box-shadow: var(--shadow);
}
.tile:hover { transform: translateY(-3px); border-color: var(--indigo); }
.tile-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 14px;
}
.tile-icon .icon { width: 26px; height: 26px; }
.tile-icon.sm { width: 38px; height: 38px; border-radius: 10px; flex: none; }
.tile-icon.sm .icon { width: 20px; height: 20px; }
.cat-home { background: var(--indigo-soft); color: var(--indigo); }
.cat-yard { background: var(--emerald-soft); color: var(--emerald); }
.cat-building { background: var(--orange-soft); color: var(--orange); }
.tile-name { font: 700 1rem var(--font-head); color: var(--navy); }
.tile-tag { font-size: 0.8rem; color: var(--slate); }

/* ---------------------------------------------------------- categories --- */
.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.category-card {
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 26px; text-decoration: none; box-shadow: var(--shadow); transition: 0.15s;
  display: flex; flex-direction: column; gap: 8px;
}
.category-card:hover { transform: translateY(-3px); border-color: var(--indigo); }
.category-card h3 { margin: 0; }
.category-card.cat-h h3 { color: var(--indigo); }
.category-card.cat-y h3 { color: var(--emerald); }
.category-card.cat-b h3 { color: var(--orange); }
.category-card p { margin: 0; color: var(--slate); font-size: 0.95rem; }
.category-card .go {
  margin-top: 8px; width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; color: #fff;
}
.cat-h .go { background: var(--indigo); }
.cat-y .go { background: var(--emerald); }
.cat-b .go { background: var(--orange); }

/* --------------------------------------------------------- how it works --- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step { text-align: center; padding: 18px; }
.step-icon {
  width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 1.5px solid var(--line); box-shadow: var(--shadow);
}
.step-icon .icon { width: 32px; height: 32px; }
.step:nth-child(1) .step-icon { color: var(--indigo); }
.step:nth-child(2) .step-icon { color: var(--emerald); }
.step:nth-child(3) .step-icon { color: var(--orange); }
.step h3 { margin-bottom: 4px; }
.step p { color: var(--slate); font-size: 0.95rem; margin: 0; }

/* ---------------------------------------------------------------- trust --- */
.trust { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
.trust h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.trust ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.trust li { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.trust li .icon { color: var(--emerald); flex: none; }

/* ------------------------------------------------------------- ad slots --- */
/* Reserved zones: clearly labeled, visually distinct from app content,
   space reserved up front to avoid layout shift (business case §14). */
.ad-slot {
  border: 2px dashed var(--ad-border); border-radius: var(--radius-sm);
  background: var(--ad-bg); color: var(--ad-text);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; min-height: 100px; margin: 28px auto; max-width: 990px;
  font: 600 0.85rem var(--font-body); letter-spacing: 0.12em; text-transform: uppercase;
}
.ad-slot .ad-size { font-size: 0.75rem; letter-spacing: 0.05em; opacity: 0.75; text-transform: none; }
.ad-slot.ad-rect { min-height: 260px; max-width: 400px; }

/* ------------------------------------------------------------ calc page --- */
.breadcrumb { padding: 18px 0 0; font-size: 0.88rem; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; color: var(--slate); }
.breadcrumb a { color: var(--slate); text-decoration: none; }
.breadcrumb a:hover { color: var(--indigo); }
.breadcrumb [aria-current] { color: var(--navy); font-weight: 600; }

.calc-hero { padding: 18px 0 8px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.calc-hero .intro { color: var(--slate); font-size: 1.05rem; max-width: 38em; margin: 0; }
.calc-hero .tile-icon { width: 64px; height: 64px; flex: none; }
.calc-hero .tile-icon .icon { width: 32px; height: 32px; }

.calc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; padding-bottom: 40px; }
.calc-main { min-width: 0; }
.calc-rail { position: sticky; top: 84px; display: grid; gap: 16px; }

.calc-card {
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px; margin-top: 14px;
}
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: 0.92rem; }
.field .hint { font-size: 0.8rem; color: var(--slate); }
.input-wrap { display: flex; gap: 8px; }
.field input[type='text'], .field input[type='number'], .field select {
  width: 100%; min-width: 0; height: 48px; padding: 0 12px;
  font: 500 1rem var(--font-body); color: var(--ink);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fff;
}
.field input:focus, .field select:focus { outline: 3px solid var(--indigo-soft); border-color: var(--indigo); }
.field select.unit-select { flex: none; width: 84px; }
.field.invalid input, .field.invalid select { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 0.82rem; font-weight: 500; display: none; }
.field.invalid .field-error { display: block; }
.form-error {
  display: none; background: #fdf0ef; border: 1.5px solid #f3c4c0; color: var(--danger);
  border-radius: var(--radius-sm); padding: 10px 14px; margin-top: 14px; font-weight: 500;
}
.form-error.show { display: block; }

.advanced { grid-column: 1 / -1; border-top: 1px dashed var(--line); padding-top: 4px; margin-top: 4px; }
.advanced summary { cursor: pointer; font-weight: 600; color: var(--indigo); font-size: 0.92rem; padding: 8px 0; }
.advanced .field-grid { padding-top: 10px; }

.waste-row { display: flex; align-items: center; gap: 10px; }
.field .waste-row input { width: 96px; flex: none; }
.waste-row .pct { font-weight: 600; color: var(--slate); }

.calc-cta { margin-top: 22px; }
.privacy-note { text-align: center; color: var(--slate); font-size: 0.85rem; margin: 14px 0 0; }
.privacy-note .icon { color: var(--emerald); }

/* --------------------------------------------------------------- result --- */
.result { display: none; margin-top: 24px; }
.result.show { display: block; animation: pop 0.25s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }
.result-banner {
  background: var(--emerald-soft); border: 1.5px solid #bce9d8; color: #0b7c5c;
  border-radius: var(--radius-sm); padding: 10px 16px; font-weight: 600; margin-bottom: 18px;
  display: flex; align-items: center; gap: 8px;
}
.result-title { text-align: center; margin: 20px 0 16px; }
.result-title .icon { color: var(--amber); }
.result-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.result-card {
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 18px 14px; text-align: center;
}
.result-card .rc-label { font-size: 0.8rem; font-weight: 600; color: var(--slate); text-transform: uppercase; letter-spacing: 0.05em; }
.result-card .rc-value { font: 800 2.6rem/1.1 var(--font-head); color: var(--navy); margin: 6px 0 2px; }
.result-card .rc-unit { font-weight: 600; color: var(--ink); }
.result-card .rc-note { font-size: 0.78rem; color: var(--slate); margin-top: 6px; }
.result-card.buy { border: 2px solid var(--indigo); box-shadow: var(--shadow); }
.result-card.buy .rc-value { color: var(--emerald-deep); font-size: 3.1rem; }
.result-actions { display: flex; gap: 12px; justify-content: center; margin: 20px 0; flex-wrap: wrap; }
.meaning {
  background: var(--amber-soft); border: 1.5px solid #f3e0b8; border-radius: var(--radius-sm);
  padding: 16px 18px; margin: 8px 0 16px;
}
.meaning h3 { font-size: 0.95rem; margin-bottom: 4px; }
.meaning p { margin: 0; font-size: 0.95rem; }
.assumptions { font-size: 0.88rem; color: var(--slate); margin: 0 0 8px; padding-left: 20px; }
.assumptions li { margin-bottom: 4px; }
.show-math summary { cursor: pointer; font-weight: 600; color: var(--indigo); padding: 8px 0; }
.show-math ol { background: var(--indigo-soft); border-radius: var(--radius-sm); padding: 16px 16px 16px 36px; margin: 8px 0 0; }
.show-math li { margin-bottom: 6px; font-size: 0.92rem; }

/* -------------------------------------------------------------- content --- */
.content-accordions { display: grid; gap: 10px; margin-top: 8px; }
.accordion {
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
}
.accordion summary {
  cursor: pointer; font-weight: 600; padding: 14px 18px; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: '+'; font-weight: 700; color: var(--indigo); font-size: 1.2rem; }
.accordion[open] summary::after { content: '–'; }
.accordion .acc-body { padding: 0 18px 16px; }
.accordion .acc-body :last-child { margin-bottom: 0; }
.accordion ul { padding-left: 20px; margin: 0; }
.accordion li { margin-bottom: 6px; }

.info-card {
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); margin-top: 18px;
}
.info-card h3 { display: flex; gap: 8px; align-items: center; }
.info-card p { margin: 0; color: var(--slate); font-size: 0.95rem; }

.related-panel {
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.related-panel h3 { margin-bottom: 10px; }
.related-card {
  display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--navy); font-weight: 600; font-size: 0.92rem;
}
.related-card:hover { background: var(--indigo-soft); }
.related-card > .icon:last-child { margin-left: auto; color: var(--slate); width: 1.05em; }

.faq-item h3 { font-size: 1rem; margin-bottom: 4px; }
.faq-item p { color: var(--slate); font-size: 0.95rem; }

/* --------------------------------------------------------------- footer --- */
.site-footer { background: var(--navy); color: #cdd3e6; margin-top: 40px; }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 28px; padding: 44px 20px 24px;
}
.footer-brand p { margin: 10px 0 0; font-size: 0.92rem; }
.logo-light .logo-word, .logo-light .logo-word em { color: #fff; }
.logo-light .logo-word b { color: #a5b4fc; }
.logo-light .logo-word i { color: #6ee7b7; }
.site-footer h3 { color: #fff; font-size: 0.95rem; margin-bottom: 10px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.site-footer a { color: #cdd3e6; text-decoration: none; font-size: 0.9rem; }
.site-footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.12); padding: 16px 20px; font-size: 0.85rem; }
.footer-bottom p { margin: 0; }

/* --------------------------------------------------------- static pages --- */
.page-prose { max-width: 760px; padding: 32px 0 40px; }
.page-prose h1 { margin-bottom: 0.4em; }
.page-prose h2 { margin-top: 1.6em; }
.page-prose ul { padding-left: 22px; }

.error-hero { text-align: center; padding: 80px 0; }
.error-hero .big { font: 800 6rem/1 var(--font-head); color: var(--indigo); margin-bottom: 8px; }

/* ------------------------------------------------------------ responsive --- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-img { order: -1; }
  .hero-img img { max-width: 260px; }
  .calc-layout { grid-template-columns: 1fr; }
  .calc-rail { position: static; }
  .category-grid, .steps { grid-template-columns: 1fr; }
  .trust { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .site-nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    background: var(--card); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; padding: 12px 20px; gap: 4px;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 10px 0; }
  .nav-search { display: none; }
  .nav-toggle { display: block; }
  .hero { padding-top: 28px; }
  .finder { flex-direction: column; }
  .field-grid { grid-template-columns: 1fr; }
  .result-cards { grid-template-columns: 1fr; }
  .result-card.buy { order: -1; }
  .calc-card { padding: 18px; }
  .tile-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Contact form */
.contact-form { display: flex; flex-direction: column; gap: 14px; max-width: 560px; margin: 18px 0 26px; }
.contact-form label { font-weight: 600; color: var(--ink); font-size: 15px; }
.contact-form input[type='text'], .contact-form input[type='email'], .contact-form textarea {
  width: 100%; margin-top: 6px; padding: 12px 14px; font: inherit; font-size: 16px;
  border: 2px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
.contact-form input:focus, .contact-form textarea:focus { outline: 3px solid var(--indigo-soft); border-color: var(--indigo); }
.contact-form button { align-self: flex-start; }
.contact-sent { background: var(--mint-soft, #e7f8ef); border: 2px solid var(--mint, #22c55e); border-radius: 12px; padding: 14px 18px; margin: 18px 0; }
