/* DIY Build Calc — styles. System fonts, no frameworks, no animations. */
:root {
  --ink: #1d2b3a;
  --ink-2: #44546a;
  --muted: #6a7686;
  --paper: #f6f4ef;
  --card: #ffffff;
  --line: #dcd7cc;
  --line-2: #ebe7de;
  --accent: #d9480f;
  --accent-ink: #b33a0b;
  --accent-soft: #fff1e8;
  --tape: #f5b700;
  --ok: #1e6b4a;
  --error: #b42318;
  --radius: 10px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}
img, svg { display: block; }
a { color: var(--accent-ink); text-underline-offset: 2px; }
a:hover { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); font-weight: 800; }
h2 { font-size: 1.4rem; font-weight: 750; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--tape); outline-offset: 2px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.wrap--narrow { max-width: 760px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 10; border-radius: 6px; }
.skip:focus { left: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); font-size: 0.95rem; }

/* ---------- header ---------- */
.site-header {
  background: var(--ink);
  color: #fff;
  position: relative;
}
.site-header::after { /* tape measure strip */
  content: '';
  display: block;
  height: 8px;
  background:
    repeating-linear-gradient(90deg, var(--ink) 0 1.5px, transparent 1.5px 12px) top / 100% 5px no-repeat,
    repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 60px) top / 100% 8px no-repeat,
    var(--tape);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }
.logo:hover { color: #fff; }
.logo b { color: var(--tape); font-weight: 800; }
.logo__mark { width: 32px; height: 32px; color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav__link, .menu > summary {
  color: #fff; text-decoration: none; padding: 10px 12px; border-radius: 8px; font-weight: 550; font-size: 0.98rem; cursor: pointer;
}
.site-nav__link:hover, .menu > summary:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.menu { position: relative; }
.menu > summary { list-style: none; display: flex; align-items: center; gap: 6px; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after { content: ''; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); }
.menu[open] > summary { background: rgba(255, 255, 255, 0.12); }
.menu__panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20;
  width: min(560px, calc(100vw - 32px));
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px;
  background: var(--card); color: var(--ink); border-radius: var(--radius); padding: 18px;
  box-shadow: 0 12px 32px rgba(17, 27, 38, 0.22);
}
.menu__heading { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 4px 0 4px; }
.menu__group ul { list-style: none; margin: 0 0 8px; padding: 0; }
.menu__group a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 7px; color: var(--ink); text-decoration: none; font-weight: 550; }
.menu__group a:hover { background: var(--accent-soft); color: var(--accent-ink); }
.menu__group .icon { width: 20px; height: 20px; color: var(--accent); flex: none; }

@media (max-width: 640px) {
  .site-header__inner { flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .site-nav { width: 100%; justify-content: space-between; margin: 0 -12px; width: calc(100% + 24px); }
  .menu { position: static; }
  .menu__panel { left: 16px; right: 16px; width: auto; grid-template-columns: 1fr; top: auto; margin-top: 8px; }
}

/* ---------- home ---------- */
.hero { padding: 56px 0 40px; border-bottom: 1px solid var(--line); }
.eyebrow { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-ink); margin-bottom: 12px; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); max-width: 14em; }
.hero h1 span { display: block; color: var(--accent); }
.hero__lede { font-size: 1.15rem; color: var(--ink-2); max-width: 40em; }
.hero__jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.hero__jump a { padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.hero__jump a:hover { border-color: var(--accent); color: var(--accent-ink); }

.home { padding-top: 16px; }
.cat { padding: 32px 0 8px; scroll-margin-top: 16px; }
.cat__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-bottom: 14px; }
.cat__head h2 { margin: 0; }
.cat__head p { margin: 0; color: var(--muted); }

.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.card {
  display: flex; flex-direction: column; gap: 6px; height: 100%;
  padding: 20px; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none;
}
.card:hover { border-color: var(--accent); color: var(--ink); box-shadow: 0 4px 0 var(--accent-soft); }
.card__icon { width: 34px; height: 34px; color: var(--accent); margin-bottom: 6px; }
.card__name { font-weight: 750; font-size: 1.1rem; }
.card__desc { color: var(--ink-2); font-size: 0.96rem; flex: 1; }
.card__go { color: var(--accent-ink); font-weight: 650; font-size: 0.92rem; margin-top: 6px; }
.cards--compact .card { padding: 16px; }
.cards--compact .card__icon { width: 26px; height: 26px; }

.why { margin: 48px 0 8px; padding: 32px; background: var(--ink); color: #e8edf3; border-radius: 14px; }
.why h2 { color: #fff; }
.why__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-top: 12px; }
.why h3 { color: var(--tape); }
.why p { margin: 0; color: #c9d3de; }
.guide { margin: 40px 0 56px; max-width: 760px; }

/* ---------- calculator page ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 0.9rem; color: var(--muted); padding: 18px 0 0; }
.crumbs a { color: var(--ink-2); }
.page-head { display: flex; gap: 18px; align-items: flex-start; padding: 18px 0 24px; }
.page-head__icon { width: 52px; height: 52px; flex: none; color: var(--accent); background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; padding: 9px; }
.page-head h1 { margin-bottom: 6px; }
.lede { font-size: 1.12rem; color: var(--ink-2); max-width: 42em; margin: 0; }
@media (max-width: 560px) { .page-head__icon { display: none; } }

.calc { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .calc { grid-template-columns: 1fr; } }
.panel { background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 24px; }
.panel__title { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 750; margin-bottom: 18px; }
.calc__results { position: sticky; top: 16px; border-color: var(--ink); }
@media (max-width: 860px) { .calc__results { position: static; } }

.field { margin-bottom: 18px; min-width: 0; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 16px; }
.field-group[hidden] { display: none; }
.field__label { display: block; font-weight: 650; margin-bottom: 6px; }
.req { color: var(--accent); }
.opt { color: var(--muted); font-weight: 400; font-size: 0.9rem; }
.field__hint { font-size: 0.88rem; color: var(--muted); margin: 6px 0 0; }
.field__error { font-size: 0.9rem; color: var(--error); font-weight: 600; margin: 6px 0 0; }
.ftin { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.unit-input { position: relative; display: flex; }
.unit-input > span {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 0.92rem; pointer-events: none;
}
input[type='text'], input[type='email'], select, textarea {
  width: 100%; font: inherit; font-size: 1.15rem; color: var(--ink);
  min-height: 52px; padding: 10px 14px; background: #fcfbf8;
  border: 1.5px solid #c9c2b4; border-radius: 8px;
}
.unit-input input { padding-right: 76px; font-variant-numeric: tabular-nums; }
.ftin .unit-input input { padding-right: 40px; }
select { appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; font-size: 1.05rem; }
textarea { min-height: 140px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(245, 183, 0, 0.55); background: #fff; }
input[aria-invalid='true'] { border-color: var(--error); background: #fff7f6; }
input:disabled { opacity: 0.6; }

.field--check label { display: flex; align-items: center; gap: 10px; font-weight: 550; cursor: pointer; min-height: 44px; }
.field--check input { width: 22px; height: 22px; accent-color: var(--accent); margin: 0; }
.form-note { font-size: 0.88rem; color: var(--muted); margin: 4px 0 16px; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 26px;
  font: inherit; font-weight: 700; font-size: 1.05rem; border-radius: 8px; cursor: pointer; text-decoration: none; border: 2px solid transparent;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-ink); color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); border-color: #c9c2b4; }
.btn--ghost:hover { border-color: var(--ink); }
.btn:disabled { opacity: 0.6; cursor: wait; }
@media (max-width: 480px) { .actions .btn { flex: 1; } }

.results dl { margin: 0; }
.result { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.result:last-child { border-bottom: 0; }
.result dt { color: var(--ink-2); font-size: 0.97rem; }
.result dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.result--primary { display: block; padding: 18px 18px 16px; margin-bottom: 6px; background: var(--accent-soft); border: 0; border-left: 5px solid var(--accent); border-radius: 8px; }
.result--primary dt { font-weight: 650; color: var(--accent-ink); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; }
.result--primary dd { text-align: left; font-size: clamp(1.7rem, 4vw, 2.2rem); line-height: 1.15; margin-top: 4px; color: var(--ink); }
.result-empty { margin: 0; padding: 22px; text-align: center; color: var(--muted); background: repeating-linear-gradient(135deg, #faf8f3 0 10px, #f4f1ea 10px 20px); border-radius: 8px; }
.results[data-state='error'] .result-empty { color: var(--error); background: #fff7f6; font-weight: 600; }

.steps { margin-top: 18px; border-top: 1px solid var(--line-2); padding-top: 12px; }
.steps summary { cursor: pointer; font-weight: 650; color: var(--ink-2); padding: 4px 0; }
.steps ol { margin: 10px 0 0; padding-left: 20px; font-family: var(--mono); font-size: 0.84rem; line-height: 1.55; color: var(--ink-2); }
.steps li { margin-bottom: 6px; overflow-wrap: anywhere; }

/* ---------- content ---------- */
.content { max-width: 760px; margin: 48px 0 0; }
.content section { margin-bottom: 36px; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.4em; }
.prose h2 { margin-top: 1.4em; }
.content section > h2:first-child { margin-top: 0; }
.example { background: var(--card); border: 1.5px solid var(--line); border-left: 5px solid var(--tape); border-radius: var(--radius); padding: 22px 24px 8px; }
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; font-weight: 650; padding: 12px 0; }
.faq details p { color: var(--ink-2); }
.related { margin: 8px 0 56px; }

.ad-slot { margin: 32px 0; padding: 8px 0; min-height: 100px; }
.ad-slot__label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 4px; text-align: center; }

/* ---------- static pages ---------- */
.page { padding: 40px 0 56px; }
.contact-form { background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 24px; margin: 24px 0 16px; }
.form-status { margin: 14px 0 0; font-weight: 600; color: var(--ok); }
.form-status:empty { display: none; }

/* ---------- footer ---------- */
.site-footer { background: #15202c; color: #b7c2cf; padding: 44px 0 28px; font-size: 0.95rem; }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr repeat(5, 1fr); gap: 28px; }
@media (max-width: 900px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } .site-footer__grid > :first-child { grid-column: 1 / -1; } }
.site-footer a { color: #e3e9ef; text-decoration: none; }
.site-footer a:hover { color: var(--tape); text-decoration: underline; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer__heading { font-weight: 700; color: #fff; margin-bottom: 10px; font-size: 0.9rem; }
.logo--footer { margin-bottom: 12px; }
.site-footer__note { border-top: 1px solid #2a3a4b; margin: 32px 0 0; padding-top: 18px; font-size: 0.86rem; color: #8d9aa8; }
