/* ==========================================================================
   style.css — Base layer + component system
   Depends on variables.css. Load order: variables -> style -> responsive.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Reset & base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--sp-4));
}

body {
  margin: 0;
  background-color: var(--bg-base);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--dur-base) var(--ease-out),
    color var(--dur-base) var(--ease-out);
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--sp-3);
  color: var(--text-strong);
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
}

h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5, h6 { font-size: var(--fs-md); }

p { margin: 0 0 var(--sp-4); }
p:last-child { margin-bottom: 0; }

a {
  color: var(--accent);
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: 0.18em;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--accent-hover); }

img, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

ul, ol { margin: 0 0 var(--sp-4); padding-left: var(--sp-5); }

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

hr {
  height: 1px;
  margin: var(--sp-7) 0;
  border: 0;
  background: var(--border-subtle);
}

::selection {
  background: var(--accent-soft);
  color: var(--text-strong);
}

/* --------------------------------------------------------------------------
   2. Accessibility utilities
   -------------------------------------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

.skip-link {
  position: absolute;
  top: var(--sp-2);
  left: var(--sp-2);
  z-index: var(--z-toast);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-sm);
  background: var(--accent);
  color: var(--text-onaccent);
  font-weight: var(--fw-semibold);
  transform: translateY(-200%);
  transition: transform var(--dur-base) var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */
.shell {
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.shell--narrow { max-width: var(--shell-narrow); }

.section { padding-block: var(--sp-9); }
.section--tight { padding-block: var(--sp-7); }
.section--sunken {
  background: var(--bg-sunken);
  border-block: 1px solid var(--border-subtle);
}
/* Accent-tinted section for high-emphasis bands (e.g. "why choose"). */
.section-head {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--sp-7);
}
.section-head__text { max-width: 62ch; }
.section-head h2 { margin-bottom: var(--sp-3); font-size: var(--fs-2xl); }
.section-head p { color: var(--text-muted); margin: 0; font-size: var(--fs-lg); }

.eyebrow {
  display: block;
  margin-bottom: var(--sp-2);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.grid { display: grid; gap: var(--sp-4); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--auto {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.stack > * + * { margin-top: var(--sp-4); }
.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
}

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text-strong);
  --btn-border: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding: var(--sp-2) var(--sp-5);
  border: 1px solid var(--btn-border);
  border-radius: var(--r-md);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: inherit;
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}
.btn:active { transform: translateY(1px); }
.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  --btn-bg: var(--accent);
  --btn-fg: var(--text-onaccent);
  --btn-border: var(--accent);
  box-shadow: var(--shadow-accent);
}
.btn--primary:hover:not([disabled]) {
  --btn-bg: var(--accent-hover);
  --btn-border: var(--accent-hover);
  color: var(--text-onaccent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn--secondary {
  --btn-bg: var(--bg-surface);
  --btn-fg: var(--text-strong);
  --btn-border: var(--border-strong);
}
.btn--secondary:hover:not([disabled]) {
  --btn-bg: var(--bg-sunken);
  color: var(--text-strong);
}

.btn--ghost { --btn-fg: var(--text-body); }
.btn--ghost:hover:not([disabled]) {
  --btn-bg: var(--bg-sunken);
  color: var(--text-strong);
}

.btn--danger {
  --btn-bg: var(--danger-bg);
  --btn-fg: var(--danger-fg);
  --btn-border: transparent;
}

.btn--sm { min-height: 34px; padding: var(--sp-1) var(--sp-3); font-size: var(--fs-sm); }
.btn--lg { min-height: 50px; padding: var(--sp-3) var(--sp-6); font-size: var(--fs-md); }
.btn--block { width: 100%; }

.btn__icon { width: 18px; height: 18px; flex: none; }

/* --------------------------------------------------------------------------
   5. Form controls
   -------------------------------------------------------------------------- */
.field { display: block; margin-bottom: var(--sp-4); }
.field__label {
  display: block;
  margin-bottom: var(--sp-2);
  color: var(--text-strong);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}
.field__hint {
  display: block;
  margin-top: var(--sp-2);
  color: var(--text-muted);
  font-size: var(--fs-xs);
}
.field__error {
  display: block;
  margin-top: var(--sp-2);
  color: var(--danger-fg);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--bg-surface);
  color: var(--text-strong);
  font-family: inherit;
  font-size: var(--fs-base);
  transition: border-color var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}
.input::placeholder,
.textarea::placeholder { color: var(--text-muted); }

.input:hover,
.select:hover,
.textarea:hover { border-color: var(--slate-400); }

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input[aria-invalid="true"] { border-color: var(--danger-fg); }
.textarea { min-height: 120px; resize: vertical; }

.select {
  appearance: none;
  padding-right: var(--sp-7);
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   6. Cards
   -------------------------------------------------------------------------- */
.card {
  display: flex;
  flex-direction: column;
  padding: var(--sp-5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out);
}
.card--interactive { cursor: pointer; text-decoration: none; box-shadow: var(--shadow-xs); transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out); }
.card--interactive:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.card__title {
  margin-bottom: var(--sp-2);
  font-size: var(--fs-lg);
  color: var(--text-strong);
}
.card__body { margin: 0; color: var(--text-muted); font-size: var(--fs-base); }
.card__footer {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border-subtle);
}

/* Category card ---------------------------------------------------------- */
.category-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-6);
  padding-top: calc(var(--sp-6) + 4px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  transition: border-color var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out);
}
/* Coloured top accent bar gives each category a distinct product identity. */
.category-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--cat-fg, var(--accent));
  opacity: 0.9;
  transform: scaleX(0.4);
  transform-origin: left;
  transition: transform var(--dur-base) var(--ease-out);
}
.category-card:hover {
  border-color: var(--cat-fg, var(--accent));
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  color: inherit;
}
.category-card:hover::before { transform: scaleX(1); }
.category-card__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  background: var(--cat-bg, var(--accent-soft));
  color: var(--cat-fg, var(--accent));
  font-size: var(--fs-xl);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cat-fg, var(--accent)) 14%, transparent);
  transition: transform var(--dur-base) var(--ease-out);
}
.category-card:hover .category-card__icon { transform: scale(1.08) rotate(-3deg); }
.category-card__name {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
}
.category-card__desc {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-sm);
}
.category-card__count {
  margin-top: auto;
  padding-top: var(--sp-2);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

/* Tool card -------------------------------------------------------------- */
.tool-card {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  padding: var(--sp-5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
  color: inherit;
  text-decoration: none;
  transition: border-color var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out);
}
.tool-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
  color: inherit;
}
.tool-card__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: var(--r-sm);
  background: var(--bg-sunken);
  font-size: var(--fs-md);
}
.tool-card__name {
  display: block;
  margin-bottom: var(--sp-1);
  color: var(--text-strong);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
}
.tool-card__desc {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  line-height: var(--lh-snug);
}

/* --------------------------------------------------------------------------
   7. Badge / tag
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 2px var(--sp-2);
  border-radius: var(--r-pill);
  background: var(--bg-sunken);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  white-space: nowrap;
}
.badge--accent { background: var(--accent-soft); color: var(--accent); }

/* --------------------------------------------------------------------------
   8. Result panel
   -------------------------------------------------------------------------- */
.result-panel {
  padding: var(--sp-5);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  background: var(--bg-surface);
}
.result-panel__label {
  margin-bottom: var(--sp-2);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}
.result-panel__value {
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  overflow-wrap: anywhere;
}
.result-panel__note {
  margin: var(--sp-3) 0 0;
  color: var(--text-muted);
  font-size: var(--fs-sm);
}
.result-panel--empty {
  border-left-color: var(--border-strong);
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   9. Breadcrumbs
   -------------------------------------------------------------------------- */
.breadcrumb { padding-block: var(--sp-4); font-size: var(--fs-sm); }
.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}
.breadcrumb__item { display: flex; align-items: center; gap: var(--sp-2); }
.breadcrumb__item::after {
  content: "/";
  color: var(--text-muted);
  opacity: 0.6;
}
.breadcrumb__item:last-child::after { content: none; }
.breadcrumb__item[aria-current="page"] { color: var(--text-muted); }

/* --------------------------------------------------------------------------
   10. FAQ accordion
   -------------------------------------------------------------------------- */
.faq { display: grid; gap: var(--sp-3); }
.faq__item {
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  background: var(--bg-surface);
  overflow: hidden;
}
.faq__question {
  width: 100%;
  display: flex;
  gap: var(--sp-4);
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4);
  border: 0;
  background: none;
  color: var(--text-strong);
  font-family: inherit;
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  text-align: left;
  cursor: pointer;
}
.faq__question:hover { background: var(--bg-sunken); }
.faq__marker {
  position: relative;
  width: 16px;
  height: 16px;
  flex: none;
  transition: transform var(--dur-base) var(--ease-out);
}
.faq__marker::before,
.faq__marker::after {
  content: "";
  position: absolute;
  inset: 50% 0 auto 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: translateY(-50%);
}
.faq__marker::after { transform: translateY(-50%) rotate(90deg); }
.faq__question[aria-expanded="true"] .faq__marker { transform: rotate(45deg); }

.faq__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur-base) var(--ease-out);
}
.faq__panel[data-open="true"] { grid-template-rows: 1fr; }
.faq__panel > div { overflow: hidden; }
.faq__answer {
  margin: 0;
  padding: 0 var(--sp-4) var(--sp-4);
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   11. Advertisement slots — reserved to prevent CLS
   -------------------------------------------------------------------------- */
.ad-slot {
  display: grid;
  place-items: center;
  width: 100%;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  background: var(--bg-sunken);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  overflow: hidden;
}
.ad-slot--top { min-height: var(--ad-top-h); margin-block: var(--sp-5); }
.ad-slot--bottom { min-height: var(--ad-bottom-h); margin-block: var(--sp-5); }
.ad-slot--inline { min-height: 250px; margin-block: var(--sp-5); }

/* --------------------------------------------------------------------------
   12. Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg-surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
}
@supports not (backdrop-filter: blur(12px)) {
  .site-header { background: var(--bg-surface); }
}

.site-header__inner {
  display: flex;
  gap: var(--sp-4);
  align-items: center;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  gap: var(--sp-2);
  align-items: center;
  flex: none;
  color: var(--text-strong);
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-tight);
  text-decoration: none;
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: var(--text-onaccent);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
}

.site-nav { margin-left: var(--sp-3); }
.site-nav__list {
  display: flex;
  gap: var(--sp-1);
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav__link {
  display: inline-block;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  color: var(--text-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  text-decoration: none;
}
.site-nav__link:hover {
  background: var(--bg-sunken);
  color: var(--text-strong);
}
.site-nav__link[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
}

.header-actions {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  margin-left: auto;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  background: var(--bg-surface);
  color: var(--text-body);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}
.icon-btn:hover {
  background: var(--bg-sunken);
  border-color: var(--border-strong);
  color: var(--text-strong);
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 18px; height: 18px; }

/* Theme toggle icon swap */
.theme-toggle svg { transition: transform var(--dur-base) var(--ease-out); }
@media (prefers-reduced-motion: no-preference) {
  .theme-toggle:hover svg { transform: rotate(-18deg); }
}
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.nav-toggle { display: none; }

/* Mobile drawer ---------------------------------------------------------- */
.mobile-nav {
  display: none;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}
.mobile-nav[data-open="true"] { display: block; }
.mobile-nav__list {
  margin: 0;
  padding: var(--sp-3) 0;
  list-style: none;
}
.mobile-nav__link {
  display: block;
  padding: var(--sp-3) var(--gutter);
  color: var(--text-body);
  font-weight: var(--fw-medium);
  text-decoration: none;
}
.mobile-nav__link:hover {
  background: var(--bg-sunken);
  color: var(--text-strong);
}

/* --------------------------------------------------------------------------
   13. Search
   -------------------------------------------------------------------------- */
.search {
  position: relative;
  flex: 1 1 auto;
  max-width: 420px;
}
.search--hero { max-width: 620px; margin-inline: auto; }

.search__field { position: relative; display: flex; align-items: center; }
.search__icon {
  position: absolute;
  left: var(--sp-3);
  width: 17px;
  height: 17px;
  color: var(--text-muted);
  pointer-events: none;
}
.search__input { padding-left: calc(var(--sp-3) * 2 + 17px); }
.search--hero .search__input {
  min-height: 58px;
  border-radius: var(--r-lg);
  font-size: var(--fs-md);
  box-shadow: var(--shadow-md);
}
.search--hero .search__input:focus {
  box-shadow: var(--shadow-md), 0 0 0 4px var(--accent-soft);
}
.search__clear {
  position: absolute;
  right: var(--sp-2);
  display: none;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--bg-sunken);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  line-height: 1;
  cursor: pointer;
}
.search[data-has-query="true"] .search__clear { display: grid; }

.search__results {
  position: absolute;
  top: calc(100% + var(--sp-2));
  left: 0;
  right: 0;
  z-index: var(--z-dropdown);
  max-height: 62vh;
  padding: var(--sp-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  background: var(--bg-raised);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.search__results[hidden] { display: none; }

.search__group + .search__group { margin-top: var(--sp-2); }
.search__group-label {
  padding: var(--sp-2) var(--sp-3) var(--sp-1);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}
.search__list { margin: 0; padding: 0; list-style: none; }

.search__option {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  color: var(--text-body);
  text-decoration: none;
  cursor: pointer;
}
.search__option:hover,
.search__option[data-active="true"] {
  background: var(--accent-soft);
  color: var(--text-strong);
}
.search__option-icon { flex: none; font-size: var(--fs-md); }
.search__option-text { min-width: 0; }
.search__option-name {
  display: block;
  color: var(--text-strong);
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
}
.search__option-desc {
  display: block;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search__option mark {
  padding: 0 1px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  color: inherit;
  font-weight: var(--fw-semibold);
}
.search__empty {
  padding: var(--sp-5) var(--sp-3);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  text-align: center;
}

/* --------------------------------------------------------------------------
   14. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding-block: var(--sp-10) var(--sp-9);
  border-bottom: 1px solid var(--border-subtle);
  background:
    radial-gradient(55% 60% at 90% 0%, rgba(14, 165, 183, 0.12) 0%, transparent 60%),
    radial-gradient(45% 50% at 5% 10%, rgba(11, 110, 95, 0.08) 0%, transparent 55%),
    linear-gradient(180deg, #f6fbfa 0%, #ffffff 65%);
  text-align: center;
  overflow: hidden;
}
.hero__inner { position: relative; z-index: var(--z-base); }
/* Hero eyebrow rendered as a soft pill badge for a premium first impression. */
.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
  padding: 6px var(--sp-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-pill);
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
  font-size: var(--fs-xs);
}
.hero .eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.hero__title {
  max-width: 18ch;
  margin-inline: auto;
  margin-bottom: var(--sp-4);
  font-size: var(--fs-4xl);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
}
.hero__lede {
  max-width: 56ch;
  margin-inline: auto;
  margin-bottom: var(--sp-6);
  color: var(--text-muted);
  font-size: var(--fs-lg);
}
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-5);
  justify-content: center;
  margin-top: var(--sp-5);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}
.hero__meta-item { display: inline-flex; align-items: center; gap: var(--sp-2); }
.hero__meta-item::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* --------------------------------------------------------------------------
   15. Blog preview
   -------------------------------------------------------------------------- */
.post-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  background: var(--bg-surface);
  color: inherit;
  text-decoration: none;
  transition: border-color var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out);
}
.post-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  color: inherit;
}
.post-card__meta {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}
.post-card__title {
  margin: 0;
  font-size: var(--fs-lg);
  color: var(--text-strong);
}
.post-card__excerpt { margin: 0; color: var(--text-muted); font-size: var(--fs-sm); }

/* --------------------------------------------------------------------------
   16. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: var(--sp-10);
  padding-block: var(--sp-9) var(--sp-6);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-sunken);
}
.site-footer__grid {
  display: grid;
  gap: var(--sp-6);
  grid-template-columns: 1.4fr repeat(4, 1fr);
  margin-bottom: var(--sp-7);
}
.site-footer__about { max-width: 34ch; }
.site-footer__tagline {
  margin: var(--sp-3) 0 0;
  color: var(--text-muted);
  font-size: var(--fs-sm);
}
.site-footer__support {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-pill);
  background: var(--bg-surface);
  color: var(--text-body);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-decoration: none;
  transition: border-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
.site-footer__support:hover { border-color: var(--accent); color: var(--accent); }
.site-footer__support-icon { color: var(--accent); }
.footer-col__title {
  margin-bottom: var(--sp-3);
  color: var(--text-strong);
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}
.footer-col__list { margin: 0; padding: 0; list-style: none; }
.footer-col__list a {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  text-decoration: none;
  display: inline-block;
  padding-block: 4px;
}
.footer-col__list a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.site-footer__bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
  justify-content: space-between;
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}
.site-footer__bar a {
  display: inline-block;
  padding-block: 4px;
}

/* --------------------------------------------------------------------------
   17. 404
   -------------------------------------------------------------------------- */
.error-page {
  display: grid;
  place-items: center;
  min-height: 62vh;
  padding-block: var(--sp-9);
  text-align: center;
}
.error-page__code {
  margin-bottom: var(--sp-3);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--fs-4xl);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-tight);
}

/* ==========================================================================
   PHASE 2 — Homepage composition
   Sections added for the full landing experience. Everything below reuses
   the tokens and primitives above; no new colours or spacing values.
   ========================================================================== */

/* --------------------------------------------------------------------------
   18. Hero — two-column with geometric graphic
   -------------------------------------------------------------------------- */
.hero--split { text-align: left; }

.hero__grid {
  display: grid;
  gap: var(--sp-7);
  align-items: center;
  grid-template-columns: 1fr;
}

.hero__copy { max-width: 56ch; }
.hero--split .hero__title,
.hero--split .hero__lede { margin-inline: 0; }
.hero--split .hero__title { max-width: 20ch; }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
.hero--split .hero__meta { justify-content: flex-start; }

/* Category-colour helpers still used by the hero preview mini-tiles.
   (Old showcase/panel/tiles CSS removed in Phase 12 cleanup — those selectors
   no longer appear in any markup.) */
.hero__tile--developer { --cat-fg: var(--cat-developer-fg); --cat-bg: var(--cat-developer-bg); }
.hero__tile--lifestyle { --cat-fg: var(--cat-lifestyle-fg); --cat-bg: var(--cat-lifestyle-bg); }
.hero__tile--finance { --cat-fg: var(--cat-finance-fg); --cat-bg: var(--cat-finance-bg); }

/* Gentle staggered entrance for the hero copy — reduced-motion safe, and it
   only animates opacity/transform so it never shifts layout or blocks paint. */
@media (prefers-reduced-motion: no-preference) {
  .hero__copy > * { animation: hero-rise var(--dur-slow) var(--ease-out) both; }
  .hero__copy > *:nth-child(1) { animation-delay: 0.02s; }
  .hero__copy > *:nth-child(2) { animation-delay: 0.08s; }
  .hero__copy > *:nth-child(3) { animation-delay: 0.14s; }
  .hero__copy > *:nth-child(4) { animation-delay: 0.20s; }
  .hero__copy > *:nth-child(5) { animation-delay: 0.26s; }
}
@keyframes hero-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   19. Statistics band
   -------------------------------------------------------------------------- */
.stats {
  border-block: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}
.stats__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-5);
  padding-block: var(--sp-6);
  margin: 0;
}
.stat { text-align: center; }
.stat__value {
  display: block;
  color: var(--text-strong);
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
}
.stat__label {
  display: block;
  margin-top: var(--sp-1);
  color: var(--text-body);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}
.stat__note {
  display: block;
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

/* --------------------------------------------------------------------------
   20. Category card — accent-aware variant
   -------------------------------------------------------------------------- */
.category-card {
  /* Fallback so a card without a category modifier still renders correctly. */
  --cat-fg: var(--accent);
  --cat-bg: var(--accent-soft);
}
.category-card--measurements { --cat-fg: var(--cat-measurements-fg); --cat-bg: var(--cat-measurements-bg); }
.category-card--developer    { --cat-fg: var(--cat-developer-fg);    --cat-bg: var(--cat-developer-bg); }
.category-card--text         { --cat-fg: var(--cat-text-fg);         --cat-bg: var(--cat-text-bg); }
.category-card--lifestyle    { --cat-fg: var(--cat-lifestyle-fg);    --cat-bg: var(--cat-lifestyle-bg); }
.category-card--engineering  { --cat-fg: var(--cat-engineering-fg);  --cat-bg: var(--cat-engineering-bg); }
.category-card--data-finance { --cat-fg: var(--cat-finance-fg);      --cat-bg: var(--cat-finance-bg); }

.category-card__icon {
  background: var(--cat-bg);
  color: var(--cat-fg);
}
.category-card:hover { border-color: var(--cat-fg); }
.category-card__count { color: var(--cat-fg); }

.category-card__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  align-self: flex-start;
  margin-top: var(--sp-3);
  padding: 6px var(--sp-3);
  border-radius: var(--r-pill);
  background: var(--cat-bg, var(--accent-soft));
  color: var(--cat-fg, var(--accent));
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
.category-card:hover .category-card__cta {
  background: var(--cat-fg, var(--accent));
  color: var(--white);
}
.category-card__cta::after {
  content: "→";
  transition: transform var(--dur-base) var(--ease-out);
}
.category-card:hover .category-card__cta::after { transform: translateX(3px); }

/* --------------------------------------------------------------------------
   21. Tool card — category badge
   -------------------------------------------------------------------------- */
.tool-card { --cat-fg: var(--accent); --cat-bg: var(--accent-soft); }
.tool-card--measurements { --cat-fg: var(--cat-measurements-fg); --cat-bg: var(--cat-measurements-bg); }
.tool-card--developer    { --cat-fg: var(--cat-developer-fg);    --cat-bg: var(--cat-developer-bg); }
.tool-card--text         { --cat-fg: var(--cat-text-fg);         --cat-bg: var(--cat-text-bg); }
.tool-card--lifestyle    { --cat-fg: var(--cat-lifestyle-fg);    --cat-bg: var(--cat-lifestyle-bg); }
.tool-card--engineering  { --cat-fg: var(--cat-engineering-fg);  --cat-bg: var(--cat-engineering-bg); }
.tool-card--data-finance { --cat-fg: var(--cat-finance-fg);      --cat-bg: var(--cat-finance-bg); }

.tool-card__icon { background: var(--cat-bg); color: var(--cat-fg); }
.tool-card:hover { border-color: var(--cat-fg); }

.tool-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
  margin-top: var(--sp-3);
}
.badge--category {
  background: var(--cat-bg);
  color: var(--cat-fg);
  font-weight: var(--fw-semibold);
}

/* --------------------------------------------------------------------------
   22. Trust / "Why choose" cards
   -------------------------------------------------------------------------- */
.trust-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out);
}
.trust-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.trust-card__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent);
}
.trust-card__icon svg { width: 20px; height: 20px; }
.trust-card__title {
  margin: 0;
  font-size: var(--fs-md);
  font-family: var(--font-body);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
}
.trust-card__body { margin: 0; color: var(--text-muted); font-size: var(--fs-sm); }

/* --------------------------------------------------------------------------
   22b. How it works — numbered step cards
   -------------------------------------------------------------------------- */
.how-step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-5);
  padding-top: var(--sp-6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.how-step:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.how-step__num {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--text-onaccent);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}
.how-step__title {
  margin: 0;
  font-size: var(--fs-md);
  font-family: var(--font-body);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
}
.how-step__body { margin: 0; color: var(--text-muted); font-size: var(--fs-sm); }

/* --------------------------------------------------------------------------
   22c. Who it's for — audience chips
   -------------------------------------------------------------------------- */
.audience {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.audience:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.audience__who {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
}
.audience__how { color: var(--text-muted); font-size: var(--fs-sm); }

/* Static FAQ (category landing pages): a plain, always-open definition list
   that reuses the .faq__item card shell. */
.faq__q {
  margin: 0;
  padding: var(--sp-4) var(--sp-5) 0;
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
}
.faq__a {
  margin: 0;
  padding: var(--sp-2) var(--sp-5) var(--sp-4);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

/* --------------------------------------------------------------------------
   23. Mid-content advertisement
   -------------------------------------------------------------------------- */
.ad-slot--mid { min-height: var(--ad-mid-h); margin-block: var(--sp-5); }

/* --------------------------------------------------------------------------
   24. Section footer link row
   -------------------------------------------------------------------------- */
.section-more {
  display: flex;
  justify-content: center;
  margin-top: var(--sp-6);
}

/* ==========================================================================
   PHASE 3 — Tool framework
   Workspace controls, result surface, states and tool content sections.
   All built from existing tokens; no new colours or spacing values.
   ========================================================================== */

/* --------------------------------------------------------------------------
   25. Tool page scaffolding
   -------------------------------------------------------------------------- */
.tool-intro {
  max-width: 62ch;
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-lg);
}

.tool-content > .tool-section + .tool-section {
  margin-top: var(--sp-8);
  padding-top: var(--sp-8);
  border-top: 1px solid var(--border-subtle);
}
.tool-section h2 { margin-bottom: var(--sp-4); }
.tool-section__note {
  margin-top: var(--sp-4);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

/* --------------------------------------------------------------------------
   26. Workspace
   -------------------------------------------------------------------------- */
.workspace {
  display: grid;
  gap: var(--sp-5);
  grid-template-columns: 1fr;
  align-items: start;
}
.workspace__controls {
  padding: var(--sp-5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  background: var(--bg-surface);
}
.workspace__controls > .field:last-child { margin-bottom: 0; }
.workspace__result { position: relative; }

/* --------------------------------------------------------------------------
   27. Field extras
   -------------------------------------------------------------------------- */
.field--inline { display: flex; flex-direction: column; gap: var(--sp-2); }
.field__req { color: var(--danger-fg); }

.fieldset {
  min-width: 0;      /* fieldsets default to min-content and break grids */
  margin: 0 0 var(--sp-4);
  padding: 0;
  border: 0;
}
.fieldset > .field__label { padding: 0; }

/* Input with a trailing unit label */
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-right: 3.5rem; }
.input-group__unit {
  position: absolute;
  right: var(--sp-3);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  pointer-events: none;
}

/* Radio and checkbox groups */
.choice-group { display: grid; gap: var(--sp-2); }
.choice { display: flex; gap: var(--sp-2); align-items: center; }
.choice__input {
  width: 18px;
  height: 18px;
  flex: none;
  accent-color: var(--accent);
  cursor: pointer;
}
.choice__label { cursor: pointer; font-size: var(--fs-base); }

/* Toggle switch */
.toggle {
  display: inline-flex;
  gap: var(--sp-3);
  align-items: center;
  cursor: pointer;
}
.toggle__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.toggle__track {
  position: relative;
  display: block;
  width: 42px;
  height: 24px;
  flex: none;
  border-radius: var(--r-pill);
  background: var(--border-strong);
  transition: background-color var(--dur-base) var(--ease-out);
}
.toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
  transition: transform var(--dur-base) var(--ease-out);
}
.toggle__input:checked + .toggle__track { background: var(--accent); }
.toggle__input:checked + .toggle__track .toggle__thumb { transform: translateX(18px); }
.toggle__input:focus-visible + .toggle__track {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.toggle__label { font-size: var(--fs-base); }

/* File input */
.file { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.file__button { cursor: pointer; }
.file__name {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  overflow-wrap: anywhere;
}
/* The input is visually hidden but must still show focus via its label. */
.file__input:focus-visible + .file__button {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   28. Result panel additions
   -------------------------------------------------------------------------- */
.result-panel__empty {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-base);
}
.result-panel--error {
  border-left-color: var(--danger-fg);
  background: var(--danger-bg);
}
.result-panel--error .result-panel__empty { color: var(--danger-fg); }
.result-panel--loading { opacity: 0.75; }

.result-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border-subtle);
}

.result-secondary { margin: var(--sp-4) 0 0; }
.result-secondary__row {
  display: flex;
  gap: var(--sp-4);
  justify-content: space-between;
  padding: var(--sp-2) 0;
  border-top: 1px solid var(--border-subtle);
}
.result-secondary__label { margin: 0; color: var(--text-muted); font-size: var(--fs-sm); }
.result-secondary__value {
  margin: 0;
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-align: right;
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   29. States
   -------------------------------------------------------------------------- */
.state {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  align-items: center;
  padding: var(--sp-7) var(--sp-5);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  text-align: center;
}
.state__title { margin: 0; color: var(--text-strong); font-weight: var(--fw-semibold); }
.state__text { margin: 0; color: var(--text-muted); font-size: var(--fs-sm); }
.state--error {
  border-style: solid;
  border-color: var(--danger-fg);
  background: var(--danger-bg);
}
.state--error .state__text { color: var(--danger-fg); }

.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
}
@media (prefers-reduced-motion: no-preference) {
  .spinner { animation: spin 720ms linear infinite; }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   30. Tool content sections
   -------------------------------------------------------------------------- */
.steps { margin: 0; padding-left: var(--sp-5); }
.steps__item { margin-bottom: var(--sp-3); }
.steps__item::marker { color: var(--accent); font-weight: var(--fw-semibold); }

.formula {
  padding: var(--sp-4);
  margin-bottom: var(--sp-4);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  background: var(--bg-sunken);
  overflow-x: auto;
}
.formula__code {
  color: var(--text-strong);
  font-size: var(--fs-md);
  white-space: pre;
}

.term-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-2) var(--sp-4);
  margin: 0;
}
.term-list__symbol {
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: var(--fw-semibold);
}
.term-list__meaning { margin: 0; color: var(--text-muted); font-size: var(--fs-sm); }

.examples { display: grid; gap: var(--sp-4); }
.example {
  padding: var(--sp-4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  background: var(--bg-surface);
}
.example__title {
  margin-bottom: var(--sp-3);
  font-family: var(--font-body);
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
}
.example__rows {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-2) var(--sp-4);
  margin: 0;
}
.example__rows dt {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}
.example__rows dd { margin: 0; font-size: var(--fs-sm); }
.example__result {
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-weight: var(--fw-semibold);
}
.example__working {
  margin: var(--sp-3) 0 0;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

/* ==========================================================================
   Category 3 — Text, Writing & Productivity (Phase 6)
   Components introduced by the notepad, counter, case converter, diff, lorem
   and hash tools. All colours come from the shared token set so light and dark
   themes and the AA-contrast guarantees are inherited rather than re-specified.
   ========================================================================== */

/* A result region a tool fills with its own richer markup (via renderResult),
   as opposed to the single-value ResultPanel. Shares the panel's shell. */
.result-panel--filled {
  display: block;
  padding: var(--sp-5);
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
}
.result-subhead {
  margin: var(--sp-5) 0 var(--sp-3);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

/* ---- Statistics grid (word counter, shared shape) ---------------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}
.stat-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-4);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
}
.stat-card__value {
  font-family: var(--font-mono);
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
  line-height: var(--lh-tight);
  word-break: break-word;
}
.stat-card__label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* ---- Keyword frequency table ------------------------------------------ */
.keyword-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
.keyword-table th,
.keyword-table td {
  padding: var(--sp-2) var(--sp-3);
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}
.keyword-table th {
  color: var(--text-muted);
  font-weight: var(--fw-semibold);
}
.keyword-table td:nth-child(2),
.keyword-table th:nth-child(2),
.keyword-table td:nth-child(3),
.keyword-table th:nth-child(3) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---- Case converter list ---------------------------------------------- */
.case-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}
.case-row {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
}
.case-row__label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
}
.case-row__value {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--text-strong);
  word-break: break-word;
  white-space: pre-wrap;
}

/* ---- Lorem output ------------------------------------------------------ */
.lorem-output {
  margin: var(--sp-3) 0 0;
  padding: var(--sp-4);
  max-height: 420px;
  overflow: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  line-height: var(--lh-loose);
  white-space: pre-wrap;
  color: var(--text-body);
}

/* ---- Diff view --------------------------------------------------------- */
.diff-summary {
  margin: 0 0 var(--sp-3);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-body);
}
.diff-summary--same { color: var(--signal-500); }
.diff-view {
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  overflow: auto;
  max-height: 480px;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
}
.diff-row {
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  align-items: baseline;
}
.diff-row__gutter {
  padding: 0 var(--sp-2);
  text-align: center;
  color: var(--text-muted);
  user-select: none;
}
.diff-row__text {
  padding: 1px var(--sp-2) 1px 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.diff-row--add { background: var(--signal-100); }
.diff-row--add .diff-row__gutter { color: var(--signal-500); }
.diff-row--remove { background: var(--rose-100); }
.diff-row--remove .diff-row__gutter { color: var(--rose-500); }
.diff-row--equal { background: transparent; }

/* ---- Hash list --------------------------------------------------------- */
.hash-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}
.hash-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
}
.hash-row__meta { display: flex; align-items: center; gap: var(--sp-2); }
.hash-row__name {
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
  color: var(--text-strong);
}
.hash-row__value {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-body);
  word-break: break-all;
}
.badge--warn {
  background: var(--warn-bg);
  color: var(--warn-fg);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  padding: 0 var(--sp-2);
  border-radius: var(--r-pill);
}

/* ---- Small input/select variants used by tool chrome ------------------ */
.input--sm,
.select--sm {
  padding: var(--sp-1) var(--sp-2);
  font-size: var(--fs-sm);
  height: auto;
}
.choice--inline {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
}
.field--slider {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.field--slider input[type="range"] { width: 100%; }

/* ==========================================================================
   Notepad (flagship)
   ========================================================================== */
.notepad {
  --np-font-size: 16px;
  --np-line-height: 1.6;
  --np-width: 760px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.notepad__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  padding: var(--sp-2);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
}
.notepad__find {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3);
  background: var(--bg-sunken);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
}
.notepad__find-count {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.notepad__settings {
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-surface);
}
.notepad__settings summary {
  cursor: pointer;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-body);
}
.notepad__settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-3);
  align-items: end;
}
.notepad__surface {
  display: flex;
  justify-content: center;
}
.notepad__area {
  width: 100%;
  max-width: var(--np-width);
  min-height: 420px;
  padding: var(--sp-5);
  resize: vertical;
  background: var(--paper, var(--bg-raised));
  color: var(--text-strong);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: var(--np-font-size);
  line-height: var(--np-line-height);
  box-shadow: var(--shadow-sm);
}
.notepad__surface--mono .notepad__area { font-family: var(--font-mono); }
.notepad__area:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.notepad__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-3);
  align-items: center;
}
.notepad__stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
}
.notepad-stat {
  display: inline-flex;
  align-items: baseline;
  gap: var(--sp-1);
  font-size: var(--fs-sm);
}
.notepad-stat__value {
  font-family: var(--font-mono);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
}
.notepad-stat__label { color: var(--text-muted); font-size: var(--fs-xs); }
.notepad__status {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.notepad--fullscreen {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  padding: var(--sp-5);
  background: var(--bg-base);
  overflow: auto;
}
.notepad--fullscreen .notepad__area { min-height: 70vh; }

/* ============================================================== *
 * Phase 7 — Kitchen, Lifestyle & Everyday tool result components *
 * ============================================================== */

/* Headline result: a large primary value with optional unit and note. */
.result-headline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}
.result-headline__value {
  font-size: var(--fs-3xl);
  font-weight: 700;
  line-height: 1.1;
  color: var(--signal-600);
  letter-spacing: -0.01em;
}
.result-headline__unit {
  font-size: var(--fs-lg);
  font-weight: 500;
  color: var(--text-muted);
}
.result-headline__note {
  flex-basis: 100%;
  margin: var(--sp-1) 0 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* Key/value equivalents table. */
.equiv-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--sp-3) 0;
  font-size: var(--fs-sm);
}
.equiv-table caption {
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  padding-bottom: var(--sp-2);
}
.equiv-table th,
.equiv-table td {
  padding: var(--sp-2) var(--sp-3);
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}
.equiv-table th {
  font-weight: 500;
  color: var(--text-muted);
  width: 45%;
}
.equiv-table td {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.equiv-table tr:last-child th,
.equiv-table tr:last-child td { border-bottom: none; }

/* Multi-column reference table with horizontal scroll on small screens. */
.table-scroll {
  overflow-x: auto;
  margin: var(--sp-3) 0;
  -webkit-overflow-scrolling: touch;
}
.ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  min-width: 320px;
}
.ref-table th,
.ref-table td {
  padding: var(--sp-2) var(--sp-3);
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.ref-table thead th {
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-strong);
  position: sticky;
  top: 0;
  background: var(--bg-raised);
}
.ref-table td { font-variant-numeric: tabular-nums; }
.ref-table__row--current {
  background: var(--signal-100);
  font-weight: 600;
}
.ref-table__row--current td { color: var(--signal-600); }

/* Small caveat / approximation line. */
.result-caveat {
  margin: var(--sp-3) 0 0;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  line-height: 1.5;
}

/* Scaled recipe output. */
.scaled-factor {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--signal-600);
  margin: 0 0 var(--sp-3);
}
.scaled-list {
  list-style: none;
  margin: 0 0 var(--sp-3);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.scaled-list__item {
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-base);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}
.scaled-list__item--asis {
  color: var(--text-muted);
  font-style: italic;
}

/* ==========================================================================
   Online Notepad — rich-text editor (menu bar + icon toolbar layout)
   ========================================================================== */
.notepad--rte {
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  --np-font-size: 16px;
  --np-font-family: var(--font-body);
}


/* Menu bar */
.np-menubar {
  display: flex;
  align-items: stretch;
  gap: 2px;
  padding: 2px var(--sp-2);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}
.np-menu { position: relative; }
.np-menu__label {
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--text-body);
  background: none;
  border: none;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.np-menu__label:hover, .np-menu.is-open .np-menu__label { background: var(--bg-sunken); color: var(--text-strong); }
.np-menu__list {
  position: absolute;
  top: 100%; left: 0;
  min-width: 190px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-2);
  z-index: 50;
  display: none;
}
.np-menu.is-open .np-menu__list { display: block; }
.np-menu__item {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--text-body);
  background: none;
  border: none;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.np-menu__item:hover { background: var(--accent-soft); color: var(--text-strong); }
.np-menu__divider { height: 1px; background: var(--border-subtle); margin: var(--sp-2) 0; }

/* Icon toolbar */
.np-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border-subtle);
}
.np-tool {
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: none;
  color: var(--text-body);
  cursor: pointer;
  transition: background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}
.np-tool:hover { background: var(--bg-surface); border-color: var(--border-strong); color: var(--text-strong); }
.np-tool:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.np-tool.is-active { background: var(--accent-soft); color: var(--accent); }
.np-tool__sep { width: 1px; height: 22px; background: var(--border-subtle); margin: 0 var(--sp-2); }
.np-select {
  font: inherit;
  font-size: var(--fs-sm);
  height: 34px;
  padding: 0 var(--sp-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--bg-surface);
  color: var(--text-strong);
  cursor: pointer;
}

/* Find/replace bar */
.np-find {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--border-subtle);
}
.np-find__input {
  font: inherit;
  font-size: var(--fs-sm);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--bg-base);
  color: var(--text-strong);
}
.np-find__input:focus { outline: 2px solid var(--focus-ring); border-color: var(--accent); }
.np-find__btn {
  font: inherit; font-size: var(--fs-sm); font-weight: 500;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--bg-surface);
  color: var(--text-body);
  cursor: pointer;
}
.np-find__btn:hover { border-color: var(--accent); color: var(--accent); }
.np-find__btn--ghost { border-color: transparent; }
.np-find__count { font-size: var(--fs-sm); color: var(--text-muted); }

/* Editable page surface (rich text) */
.rte__surface {
  min-height: 460px;
  max-height: 70vh;
  overflow-y: auto;
  padding: var(--sp-6) var(--sp-7);
  background: var(--bg-base);
  color: var(--text-strong);
  font-family: var(--np-font-family, var(--font-body));
  font-size: var(--np-font-size, 16px);
  line-height: 1.7;
  outline: none;
}
.rte__surface:focus { box-shadow: inset 0 0 0 2px var(--accent-soft); }
.rte__surface:empty::before {
  content: 'Start writing…';
  color: var(--text-muted);
  pointer-events: none;
}
.rte__surface h1, .rte__surface h2 { color: var(--text-strong); margin: 0.6em 0 0.3em; }
.rte__surface ul, .rte__surface ol { padding-left: 1.5em; margin: 0.4em 0; }
.rte__surface hr { border: none; border-top: 1px solid var(--border-subtle); margin: 1em 0; }

/* Fullscreen */
.notepad--fullscreen, .notepad--pseudo-fullscreen {
  position: fixed; inset: 0; z-index: 900;
  border-radius: 0;
  max-height: none;
}
.notepad--fullscreen .rte__surface, .notepad--pseudo-fullscreen .rte__surface {
  max-height: none;
  height: calc(100vh - 220px);
}

/* ==========================================================================
   Cookie consent banner
   ========================================================================== */
.cookie-consent {
  position: fixed;
  left: var(--sp-4);
  right: var(--sp-4);
  bottom: var(--sp-4);
  z-index: 1000;
  max-width: 640px;
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}
.cookie-consent__text {
  flex: 1 1 260px;
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--text-body);
}
.cookie-consent__text a { color: var(--accent); text-decoration: underline; }
.cookie-consent__actions { display: flex; gap: var(--sp-2); flex-shrink: 0; }
.cookie-consent__btn {
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  cursor: pointer;
  transition: background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
}
.cookie-consent__btn--accept { background: var(--accent); border-color: var(--accent); color: #fff; }
.cookie-consent__btn--accept:hover { filter: brightness(1.05); }
.cookie-consent__btn--reject { background: transparent; color: var(--text-body); }
.cookie-consent__btn--reject:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 480px) {
  .cookie-consent { flex-direction: column; align-items: stretch; }
  .cookie-consent__actions { justify-content: stretch; }
  .cookie-consent__btn { flex: 1; }
}

/* ==========================================================================
   Contact form
   ========================================================================== */
/* Prominent clickable email card on the Contact page. */
.contact-email-card {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin: var(--sp-5) 0;
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  background:
    radial-gradient(120% 180% at 0% 0%, var(--accent-soft) 0%, transparent 60%),
    var(--bg-surface);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: border-color var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out);
}
.contact-email-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.contact-email-card__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--fs-xl);
}
.contact-email-card__text { display: flex; flex-direction: column; gap: 2px; }
.contact-email-card__label {
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}
.contact-email-card__addr {
  color: var(--text-strong);
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
}
.contact-email-card__cta {
  margin-left: auto;
  color: var(--accent);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
}
@media (max-width: 30rem) {
  .contact-email-card { flex-wrap: wrap; }
  .contact-email-card__cta { margin-left: 0; width: 100%; }
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  max-width: 640px;
  margin-top: var(--sp-5);
  padding: var(--sp-6);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
}
.contact-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}
@media (max-width: 560px) { .contact-form__row { grid-template-columns: 1fr; } }
.contact-form__field { display: flex; flex-direction: column; gap: var(--sp-2); }
.contact-form__label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-strong); }
.contact-form input,
.contact-form select,
.contact-form textarea {
  font: inherit;
  padding: var(--sp-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--bg-base);
  color: var(--text-strong);
  width: 100%;
}
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--focus-ring);
  border-color: var(--accent);
}
.contact-form textarea { resize: vertical; min-height: 120px; }
.contact-form__field[data-invalid="true"] input,
.contact-form__field[data-invalid="true"] select,
.contact-form__field[data-invalid="true"] textarea {
  border-color: var(--danger, #c0392b);
  background: color-mix(in srgb, var(--danger, #c0392b) 5%, var(--bg-base));
}
.contact-form__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-form__submit { align-self: flex-start; }
.contact-form__status {
  margin: 0;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
}
.contact-form__status[data-kind="success"] {
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-base));
  color: var(--text-strong);
  border: 1px solid var(--accent);
}
.contact-form__status[data-kind="error"] {
  background: color-mix(in srgb, var(--danger, #c0392b) 8%, var(--bg-base));
  color: var(--danger, #c0392b);
  border: 1px solid var(--danger, #c0392b);
}

/* ==========================================================================
   HTML Sitemap page
   ========================================================================== */
.sitemap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-6);
  margin-bottom: var(--sp-7);
}
.sitemap-group h2 {
  font-size: var(--fs-lg);
  margin: 0 0 var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border-subtle);
}
.sitemap-group h2 a { color: var(--text-strong); text-decoration: none; }
.sitemap-group h2 a:hover { color: var(--accent); }
.sitemap-group__count {
  font-size: var(--fs-sm);
  font-weight: 400;
  color: var(--text-muted);
}
.sitemap-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.sitemap-list a { color: var(--text-body); text-decoration: none; }
.sitemap-list a:hover { color: var(--accent); text-decoration: underline; }
.sitemap-list--columns {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-2) var(--sp-5);
}
.sitemap-group--wide { margin-top: var(--sp-6); padding-top: var(--sp-5); border-top: 1px solid var(--border-subtle); }

/* ==========================================================================
   PHASE 12 — Premium SaaS redesign layer
   Presentation-only. No changes to data regions, routing, or SEO.
   ========================================================================== */

/* Pill eyebrow ----------------------------------------------------------- */
.eyebrow--pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
  padding: 7px var(--sp-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-pill);
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
}
.eyebrow--pill::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* Hero headline accent + search ------------------------------------------ */
.hero__title-accent {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero__search { margin: var(--sp-6) 0 0; max-width: 540px; }
.hero__search-field {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  height: 62px;
  padding: 0 8px 0 20px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-md);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.hero__search-field:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-md), 0 0 0 4px var(--accent-soft);
}
.hero__search-icon { width: 21px; height: 21px; color: var(--accent); flex: none; }
.hero__search-input {
  flex: 1; min-width: 0;
  border: 0; outline: none; background: transparent;
  font-family: inherit; font-size: var(--fs-base); color: var(--text-strong);
}
.hero__search-field .btn { height: 48px; flex: none; }
.hero__chips {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2);
  margin: var(--sp-3) 0 0;
}
.hero__chips-label { font-size: var(--fs-sm); color: var(--text-muted); }
.hero__chip {
  padding: 6px var(--sp-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-pill);
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
  font-size: var(--fs-sm); font-weight: var(--fw-medium);
  color: var(--text-body); text-decoration: none;
  transition: all var(--dur-fast) var(--ease-out);
}
.hero__chip:hover {
  border-color: var(--accent); color: var(--accent);
  background: var(--accent-soft); transform: translateY(-1px);
}

/* Hero working-tool preview ---------------------------------------------- */
.hero__preview { position: relative; }
.hero__win {
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  background: var(--bg-surface);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}
.hero__win-bar {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-sunken);
}
.hero__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.hero__dot:nth-child(1){ background:#f0a04b; } .hero__dot:nth-child(2){ background:#e0c341; } .hero__dot:nth-child(3){ background:#56b877; }
.hero__win-tab {
  margin-left: var(--sp-2);
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 11px;
  border: 1px solid var(--border-subtle); border-radius: var(--r-pill);
  background: var(--bg-surface);
  font-size: 12.5px; font-weight: var(--fw-semibold); color: var(--text-body);
}
.hero__win-tab-dot { width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.hero__win-body { padding: 22px; }
.hero__pv-tool { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: 18px; }
.hero__pv-ic {
  display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 12px; background: var(--accent-soft); color: var(--accent);
}
.hero__pv-ic svg { width: 22px; height: 22px; }
.hero__pv-title { display: block; font-family: var(--font-display); font-size: 16px; font-weight: var(--fw-bold); color: var(--text-strong); }
.hero__pv-sub { display: block; font-size: 12.5px; color: var(--text-muted); }
.hero__pv-io { display: grid; grid-template-columns: 1fr auto 1fr; gap: var(--sp-3); align-items: center; margin-bottom: 16px; }
.hero__pv-field { padding: 11px 13px; border: 1px solid var(--border-subtle); border-radius: var(--r-md); background: var(--bg-sunken); }
.hero__pv-field--out { background: var(--accent-soft); border-color: var(--accent); }
.hero__pv-l { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: var(--fw-semibold); color: var(--text-muted); }
.hero__pv-v { display: block; font-family: var(--font-mono); font-size: 20px; font-weight: var(--fw-bold); color: var(--text-strong); }
.hero__pv-field--out .hero__pv-v { color: var(--accent); }
.hero__pv-swap { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.hero__pv-swap svg { width: 17px; height: 17px; }
.hero__pv-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.hero__pv-chip { padding: 5px 11px; border-radius: var(--r-pill); background: var(--bg-sunken); font-size: 12px; font-weight: var(--fw-semibold); color: var(--text-muted); }
.hero__pv-chip--on { background: var(--accent); color: var(--text-onaccent); }
.hero__win-cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); padding: 0 22px 22px; }
.hero__pv-cat { display: flex; flex-direction: column; gap: 3px; padding: 11px; border: 1px solid var(--border-subtle); border-radius: var(--r-sm); background: var(--bg-surface); }
.hero__pv-cat-ic { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; font-size: 12px; font-weight: var(--fw-bold); margin-bottom: 3px; }
.hero__pv-cat-n { font-size: 12px; font-weight: var(--fw-semibold); color: var(--text-strong); }
.hero__pv-cat-m { font-size: 10.5px; color: var(--text-muted); }

/* category colour helpers reused by preview tiles */
.hero__tile--developer { background: var(--cat-developer-bg); color: var(--cat-developer-fg); }
.hero__tile--finance { background: var(--cat-finance-bg); color: var(--cat-finance-fg); }
.hero__tile--lifestyle { background: var(--cat-lifestyle-bg); color: var(--cat-lifestyle-fg); }

/* Scroll reveal ---------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Mega-menu -------------------------------------------------------------- */
.site-header { position: sticky; }
.site-nav__item.has-mega { position: static; }
.site-nav__chevron { width: 13px; height: 13px; margin-left: 4px; vertical-align: -1px; transition: transform var(--dur-base) var(--ease-out); }
.has-mega:hover .site-nav__chevron,
.has-mega:focus-within .site-nav__chevron { transform: rotate(180deg); }
.site-nav__link { display: inline-flex; align-items: center; }
.mega {
  position: absolute;
  left: 0; right: 0;
  top: 100%;
  z-index: calc(var(--z-header) - 1);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), visibility var(--dur-base);
}
.has-mega:hover .mega,
.has-mega:focus-within .mega { opacity: 1; visibility: visible; transform: none; }
.mega__inner { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: var(--sp-5) var(--sp-4); }
.mega__item { display: flex; gap: var(--sp-3); padding: var(--sp-3); border-radius: var(--r-md); text-decoration: none; transition: background-color var(--dur-fast) var(--ease-out); }
.mega__item:hover { background: var(--bg-sunken); }
.mega__ic { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; flex: none; font-size: 16px; font-weight: var(--fw-bold); }
.mega__ic--measurements { background: var(--cat-measurements-bg); color: var(--cat-measurements-fg); }
.mega__ic--developer { background: var(--cat-developer-bg); color: var(--cat-developer-fg); }
.mega__ic--text { background: var(--cat-text-bg); color: var(--cat-text-fg); }
.mega__ic--lifestyle { background: var(--cat-lifestyle-bg); color: var(--cat-lifestyle-fg); }
.mega__ic--engineering { background: var(--cat-engineering-bg); color: var(--cat-engineering-fg); }
.mega__ic--finance { background: var(--cat-finance-bg); color: var(--cat-finance-fg); }
.mega__t { display: block; font-size: var(--fs-base); font-weight: var(--fw-semibold); color: var(--text-strong); }
.mega__d { display: block; font-size: var(--fs-sm); color: var(--text-muted); }
.mega__foot { display: flex; justify-content: space-between; align-items: center; padding: var(--sp-4); border-top: 1px solid var(--border-subtle); font-size: var(--fs-sm); color: var(--text-muted); }
.mega__foot a { color: var(--accent); font-weight: var(--fw-semibold); text-decoration: none; }
@media (max-width: 60rem) {
  .site-nav__item.has-mega .mega { display: none; }
  .site-nav__chevron { display: none; }
}

/* Trust strip (dark stat band) ------------------------------------------- */
.trust-strip {
  background: var(--ink-900);
  color: #fff;
  padding-block: var(--sp-6);
}
.trust-strip__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-5);
}
.trust-strip .stat { flex: 1; min-width: 120px; }
.trust-strip .stat__value,
.trust-strip .stat strong,
.trust-strip .stat b {
  font-family: var(--font-display);
  font-size: 31px;
  font-weight: var(--fw-black, 900);
  background: linear-gradient(135deg, var(--spark-300), var(--signal-100));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.trust-strip .stat__label,
.trust-strip .stat span { color: #9fb3c8; }

/* Featured collections --------------------------------------------------- */
.collections {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}
.collection {
  display: flex;
  flex-direction: column;
  padding: var(--sp-5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
  text-decoration: none;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.collection:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--ccol, var(--accent));
}
.collection__ic {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--cbg, var(--accent-soft));
  color: var(--ccol, var(--accent));
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  margin-bottom: var(--sp-4);
}
.collection__k { font-size: 11px; font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: .06em; color: var(--ccol, var(--accent)); }
.collection__t { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: var(--fw-bold); color: var(--text-strong); margin: 4px 0 5px; }
.collection__d { font-size: var(--fs-sm); color: var(--text-muted); }
.collection--measurements { --ccol: var(--cat-measurements-fg); --cbg: var(--cat-measurements-bg); }
.collection--developer { --ccol: var(--cat-developer-fg); --cbg: var(--cat-developer-bg); }
.collection--text { --ccol: var(--cat-text-fg); --cbg: var(--cat-text-bg); }
.collection--lifestyle { --ccol: var(--cat-lifestyle-fg); --cbg: var(--cat-lifestyle-bg); }
.collection--engineering { --ccol: var(--cat-engineering-fg); --cbg: var(--cat-engineering-bg); }
.collection--finance { --ccol: var(--cat-finance-fg); --cbg: var(--cat-finance-bg); }

/* Dark band section (Why) ------------------------------------------------ */
.section--darkband {
  background: radial-gradient(120% 120% at 50% 0%, var(--ink-800) 0%, var(--ink-900) 70%);
  color: #fff;
  border-block: 1px solid rgba(255,255,255,0.08);
}
.section--darkband .section-head h2 { color: #fff; }
.section--darkband .section-head p { color: #9fb3c8; }
.section--darkband .eyebrow { color: var(--spark-300); }
.section--darkband .trust-card {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.09);
}
.section--darkband .trust-card:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.16); }
.section--darkband .trust-card__title { color: #fff; }
.section--darkband .trust-card__body { color: #9fb3c8; }
.section--darkband .trust-card__icon { background: rgba(103,224,238,0.14); color: var(--spark-300); }

/* CTA banner ------------------------------------------------------------- */
.cta-banner {
  position: relative;
  overflow: hidden;
  text-align: center;
  max-width: 1040px;
  margin-inline: auto;
  padding: var(--sp-8) var(--sp-6);
  border-radius: var(--r-xl);
  background: radial-gradient(120% 140% at 50% 0%, var(--ink-800), var(--ink-900));
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.cta-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(50% 60% at 50% 0%, rgba(14,165,183,0.25), transparent 70%);
}
.cta-banner > * { position: relative; }
.cta-banner__title { color: #fff; font-size: var(--fs-3xl); font-weight: var(--fw-black, 900); margin-bottom: var(--sp-3); }
.cta-banner__text { color: #9fb3c8; font-size: var(--fs-lg); margin-bottom: var(--sp-5); }
.cta-banner__btn { background: #fff; color: var(--ink-900); box-shadow: 0 10px 30px rgba(0,0,0,0.3); border: 0; }
.cta-banner__btn:hover { background: #fff; color: var(--ink-900); transform: translateY(-2px); box-shadow: 0 16px 40px rgba(0,0,0,0.4); }

@media (max-width: 60rem) {
  .collections { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 40rem) {
  .collections { grid-template-columns: 1fr; }
  .trust-strip__grid { gap: var(--sp-4); }
  .trust-strip .stat { min-width: 40%; }
}

/* Hero title — match approved v3 (heavier weight, balanced sizing) --------- */
.hero--split .hero__title {
  max-width: 15ch;
  font-size: 56px;
  font-weight: var(--fw-black, 900);
  letter-spacing: -0.035em;
  line-height: 1.06;
}
.hero__win { border-radius: var(--r-xl); }
/* preview inner window slightly larger radius to match v3 */

/* Section headings — match v3 heavier display weight ---------------------- */
.section-head h2,
.sec__head h2 { font-weight: var(--fw-black, 900); font-size: 42px; letter-spacing: -0.03em; }
.section-head .eyebrow { font-size: 13px; }
.cta-banner__title { font-weight: var(--fw-black, 900); }

/* Card radii — match approved v3 exactly --------------------------------- */
.category-card { border-radius: var(--r-xl); }   /* 26px, softer product cards */
.tool-card { border-radius: var(--r-md); }        /* 12px, tighter tool tiles */

/* Category card details — match v3 -------------------------------------- */
.category-card__icon { width: 60px; height: 60px; border-radius: 16px; }
.category-card__cta { padding: 9px 18px; }
.mega { box-shadow: 0 8px 20px rgba(13,27,42,0.08), 0 28px 60px rgba(13,27,42,0.16); }

/* Header "Explore tools" gradient CTA — match v3 ------------------------- */
.nav__cta {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--r-sm);
  background: var(--grad-brand);
  color: #fff;
  font-size: 14px;
  font-weight: var(--fw-semibold);
  text-decoration: none;
  box-shadow: var(--shadow-accent);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.nav__cta:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); color: #fff; }
@media (max-width: 60rem) { .nav__cta { display: none; } }

/* Category card icon + CTA — match v3 bold solid-colour style ------------ */
.category-card__icon {
  background: var(--cat-fg, var(--accent));
  color: #fff;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--cat-fg, var(--accent)) 34%, transparent);
}
.category-card__cta {
  background: var(--cat-fg, var(--accent));
  color: #fff;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--cat-fg, var(--accent)) 28%, transparent);
}
.category-card:hover .category-card__cta {
  background: var(--cat-fg, var(--accent));
  color: #fff;
  filter: brightness(1.08);
}
.category-card__count { color: var(--cat-fg, var(--accent)); font-family: var(--font-mono); font-weight: var(--fw-semibold); }

/* Hero preview floating badges (used by the working-tool preview) --------- */
.hero__badge {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 11px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-pill);
  background: var(--bg-surface);
  box-shadow: var(--shadow-md);
  color: var(--text-strong);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
}
.hero__badge--a { top: -16px; right: 24px; }
.hero__badge--b { bottom: -18px; left: -12px; }
@media (prefers-reduced-motion: no-preference) {
  .hero__badge--a { animation: hero-float 5s ease-in-out infinite; }
  .hero__badge--b { animation: hero-float 6s ease-in-out infinite 0.6s; }
}
@keyframes hero-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
