/* ============================================================
   MyDev Codes — components (the standard page system)
   Ported from the property's shipped base rules (/style.css),
   with the consolidation changes recorded for Site 10:
   - the template-placeholder tokens resolve to real values
     via tokens.css aliases (--brand-strong, --focus);
   - body text renders in Inter (the file the pages already
     load), headings and the brand in Space Grotesk (D5);
   - the blue re-skin layer (/brand-refresh.css) is retired:
     its component behaviour (hero rhythm, card hover lift)
     is re-expressed here in the property palette; its colour
     overrides are dropped.
   Pairs with /css/tokens.css + /css/site.css. Article-only
   rules live in site.css under body.article scope.
   ============================================================ */

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

[hidden] { display: none !important; }

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

button, input, select, textarea { font: inherit; }

/* ---- Base ---- */
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-900);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-600); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-700); }

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

h1, h2, h3 { font-family: var(--font-display); line-height: var(--leading-snug); }
h1, h2 { text-wrap: balance; letter-spacing: var(--tracking-display); }
h1 { font-weight: 700; }
h2 { font-weight: 700; }
h3 { font-weight: 600; }
p { text-wrap: pretty; }

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 20;
  background: var(--ink-900); color: #fff;
  padding: 10px 14px; border-radius: 999px;
}
.skip:focus { top: 12px; color: #fff; }

/* ---- Layout ---- */
main { display: block; }
.wrap {
  width: min(var(--wrap), calc(100% - 40px));
  margin-inline: auto;
}
main article { margin-top: 28px; }

/* ---- Standard page components ---- */
.hero { padding-block: clamp(3rem, 8vw, 6rem) clamp(2rem, 5vw, 4rem); }
.eyebrow {
  margin: 0 0 14px;
  color: var(--brand-600);
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
h1 { font-size: clamp(2.2rem, 6vw, 4.2rem); line-height: 1.02; margin: 0 0 18px; max-width: 12ch; }
h2 { font-size: clamp(1.45rem, 3vw, 2.15rem); margin: 42px 0 12px; }
h3 { font-size: 1.05rem; margin: 24px 0 7px; }
p, li { max-width: 72ch; }
.lead { color: var(--muted); font-size: var(--text-lead); max-width: 62ch; }

.button, button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 11px 18px;
  border: 1px solid var(--brand-600); border-radius: 999px;
  background: var(--brand-600); color: #fff;
  font-weight: 750; text-decoration: none; cursor: pointer;
  transition: transform var(--dur-1) ease, background var(--dur-1) ease, border-color var(--dur-1) ease;
}
.button:hover, button:hover { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.button.secondary, button.secondary { background: transparent; color: var(--brand-700); }
.button.secondary:hover, button.secondary:hover { background: var(--brand-50); color: var(--brand-700); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin: 26px 0; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l);
  padding: 20px;
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.prose { max-width: var(--container-narrow); }
.tool {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l);
  padding: clamp(20px, 4vw, 34px); box-shadow: var(--shadow-2);
}
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
label { display: grid; gap: 7px; font-weight: 700; }
input, select, textarea {
  width: 100%; border: 1px solid #aeb9ae; border-radius: 12px;
  background: #fff; color: var(--ink-900);
  padding: 11px 12px; min-height: 46px;
}
output {
  display: block; white-space: pre-wrap;
  margin-top: 18px; padding: 16px;
  border: 1px dashed var(--brand-600); border-radius: var(--radius-m);
  background: var(--brand-50);
  font-family: var(--font-mono);
  font-size: 0.95rem;
}
.note { color: var(--muted); font-size: var(--text-small); }
.breadcrumbs { color: var(--muted); font-size: var(--text-small); }
.sources { font-size: var(--text-small); color: var(--muted); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 24px 0; }
.facts div { border-top: 3px solid var(--brand-600); padding-top: 10px; }
details { border-top: 1px solid var(--line); padding: 14px 0; }
summary { cursor: pointer; font-weight: 800; }
.check-item { display: flex; gap: 10px; align-items: flex-start; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 18px; }
legend { font-weight: 800; padding: 0 6px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.print-note { display: none; }
.to-top { font-size: var(--text-small); }
.mono { font-family: var(--font-mono); }

/* ---- Chrome (standard header / footer) ---- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-in { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-block: 14px; }
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--ink-900); text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800; letter-spacing: -.02em; font-size: 1.1rem;
}
.brand:hover { color: var(--ink-900); text-decoration: underline; text-underline-offset: 4px; }
.brand .brand-glyph { flex: none; }
.site-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.site-nav a { color: var(--ink-900); text-decoration: none; font-weight: 650; padding: 8px 10px; border-radius: 999px; }
.site-nav a[aria-current="page"] { background: var(--brand-50); color: var(--brand-700); }
.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  border: 1px solid var(--line); border-radius: var(--radius-m);
  background: var(--surface); color: var(--ink-900);
}
.nav-toggle:hover { background: var(--brand-50); color: var(--ink-900); }
.nav-toggle svg { width: 22px; height: 22px; }
.site-footer { border-top: 1px solid var(--line); margin-top: 64px; padding-block: 30px 42px; color: var(--muted); }
.site-footer p { max-width: none; }
.site-footer a { color: var(--ink-900); }

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none; position: absolute; left: 20px; right: 20px; top: calc(100% + 8px);
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l);
    box-shadow: var(--shadow-2); padding: 10px;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px; }
  .header-in { position: relative; }
}

/* ---- Utilities ---- */
.reveal { opacity: 1; transform: none; }
.js .reveal {
  opacity: 0; transform: translateY(14px);
  transition: opacity var(--dur-3) ease, transform var(--dur-3) ease;
}
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* A9-C5 (estate audit 2026-11-11): the footer nav had no rule at all —
   its links rendered as 20px inline targets, and the adjacent
   Contact/Privacy pair failed WCAG 2.5.8 even under the spacing
   exception. Give the nav a flex row and 24px-minimum targets. */
.footer-nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.footer-nav a { display: inline-flex; align-items: center; min-height: 28px; padding-block: 2px; }
