/* =========================================================================
   PCB Toolkit, Directory, hub, calculator & index pages
   Builds on styles.css + guides.css. Reuses .art-hero, .prose, .cmp-table,
   .faq, .tldr, .method-grid where possible; adds only the new pieces.
   ========================================================================= */

/* ---------- generic page hero (lighter than article hero) ---------- */
.page-hero {
  padding: 56px 0 0;
}
.crumbs {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  font-size: 13px; color: var(--muted);
  margin-bottom: 26px;
}
.crumbs a { color: var(--accent-ink); }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { width: 4px; height: 4px; background: var(--line-strong); border-radius: 50%; }
.crumbs .mono { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

.page-hero__title {
  font-size: clamp(44px, 5.4vw, 76px);
  margin: 0 0 22px;
  max-width: 20ch;
}
.page-hero__dek {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 22;
  font-size: 22px;
  line-height: 1.45;
  color: var(--ink-2);
  max-width: 62ch;
  margin: 0;
  text-wrap: pretty;
}
.page-hero__stats {
  display: flex; flex-wrap: wrap; gap: 36px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.page-hero__stats div { font-size: 13px; color: var(--muted); }
.page-hero__stats strong {
  display: block;
  font-family: var(--font-display);
  font-variation-settings: "opsz" 26;
  font-weight: 500;
  color: var(--ink);
  font-size: 26px;
  line-height: 1.1;
  margin-bottom: 4px;
}

/* hub hero with side photo */
.hub-hero__grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 56px;
  align-items: center;
}
.hub-hero__photo {
  position: relative;
  border-radius: var(--r-xl);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--bg-deep);
  box-shadow: 0 30px 70px -24px rgba(36,24,12,0.28);
}
.hub-hero__photo img { width: 100%; height: 100%; object-fit: cover; }
.hub-hero__photo .cap {
  position: absolute; left: 18px; bottom: 18px;
  background: rgba(27,22,18,0.78); color: var(--bg);
  padding: 9px 13px; border-radius: 999px; font-size: 12px;
  backdrop-filter: blur(8px);
}
@media (max-width: 900px) {
  .hub-hero__grid { grid-template-columns: 1fr; gap: 32px; }
  .hub-hero__photo { aspect-ratio: 16/10; order: -1; }
}

/* generic section spacing for static pages */
.block { padding: 64px 0; }
.block--tight { padding: 44px 0; }
.block--deep { background: var(--bg-deep); }
.block-head {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: end;
  margin-bottom: 44px;
}
.block-head h2 {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 40;
  font-weight: 500;
  font-size: clamp(32px, 3.4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 12px 0 0;
  text-wrap: balance;
}
.block-head__aside {
  font-size: 15.5px; color: var(--muted); max-width: 420px; padding-bottom: 4px;
  line-height: 1.55;
}

/* ---------- TOOL LIST (lean directory) ---------- */
.tool-list {
  display: grid;
  gap: 16px;
  margin: 0;
}
.tool-card {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 24px;
  align-items: start;
  padding: 26px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: border-color 160ms ease, box-shadow 200ms ease, transform 200ms ease;
}
.tool-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 18px 40px -24px rgba(36,24,12,0.22);
  transform: translateY(-1px);
}
.tool-card__rank {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 36;
  font-size: 34px;
  font-weight: 500;
  color: var(--line-strong);
  line-height: 1;
  letter-spacing: -0.02em;
}
.tool-card__main { min-width: 0; }
.tool-card__top {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 8px;
}
.tool-card__name {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 28;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.05;
}
.tool-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--bg);
  white-space: nowrap;
}
.tool-badge.runner { background: var(--accent); }
.tool-badge.budget { background: #3F6B5B; }
.tool-badge.niche  { background: #2C5F75; }
.tool-badge.scale  { background: #5C4A2A; }
.tool-card__desc {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 12px;
  max-width: 62ch;
}
.tool-card__fit {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  font-size: 13px;
  color: var(--ink-2);
}
.tool-card__fit span { display: inline-flex; gap: 7px; align-items: baseline; }
.tool-card__fit .k {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--muted-2);
}
.tool-card__aside {
  text-align: right;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
  white-space: nowrap;
}
.tool-card__price {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
}
.tool-card__price small { display: block; color: var(--muted-2); font-size: 11px; margin-top: 2px; }
.tool-card__links { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.tool-card__links a {
  font-size: 13px;
  color: var(--accent-ink);
  border-bottom: 1px solid var(--accent-soft);
  display: inline-flex; align-items: center; gap: 5px;
}
.tool-card__links a:hover { border-bottom-color: var(--accent); }
.tool-card__links a.muted-link { color: var(--muted); border-bottom-color: var(--line); }

/* pricing snapshot disclaimer */
.price-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 26px;
  padding: 14px 18px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}
.price-note strong { color: var(--ink-2); font-weight: 600; }
.price-note::before {
  content: "≈";
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--accent-ink);
  line-height: 1.3;
}

/* ---------- CARD GRID (index pages + hub link cards) ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.link-card {
  display: flex;
  flex-direction: column;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  min-height: 180px;
  transition: border-color 160ms ease, box-shadow 200ms ease, transform 200ms ease;
}
.link-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 18px 40px -24px rgba(36,24,12,0.2);
  transform: translateY(-2px);
}
.link-card__kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 14px;
  display: flex; justify-content: space-between; align-items: center;
}
.link-card__title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 28;
  font-size: 25px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.08;
  color: var(--ink);
  margin: 0 0 8px;
  text-wrap: balance;
}
.link-card__desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}
.link-card__foot {
  margin-top: auto;
  padding-top: 18px;
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted-2);
  letter-spacing: 0.03em;
}
.link-card__arrow {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: grid; place-items: center; color: var(--ink-2);
  transition: transform 200ms ease, background 160ms ease;
  flex-shrink: 0;
}
.link-card:hover .link-card__arrow { transform: translate(2px,-2px); background: var(--bg-deep); }

/* photo-topped link card (business hubs index) */
.link-card--photo { padding: 0; overflow: hidden; }
.link-card--photo .photo {
  aspect-ratio: 16/10; background: var(--bg-deep); overflow: hidden; position: relative;
}
.link-card--photo .photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 500ms cubic-bezier(.2,.7,.2,1); }
.link-card--photo:hover .photo img { transform: scale(1.04); }
.link-card--photo .pad { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }

/* ---------- PARTNER NOTE (PawPoint, tasteful) ---------- */
.partner-note {
  margin: 8px 0;
  padding: 22px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent-soft);
  border-radius: var(--r-md);
  display: flex; align-items: center; gap: 20px;
  flex-wrap: wrap;
}
.partner-note__body { flex: 1; min-width: 240px; }
.partner-note__eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--muted-2); margin-bottom: 6px;
}
.partner-note__body p {
  margin: 0; font-size: 14.5px; color: var(--ink-2); line-height: 1.5; max-width: 64ch;
}
.partner-note a.partner-cta {
  font-size: 13.5px;
  color: var(--accent-ink);
  border-bottom: 1px solid var(--accent-soft);
  white-space: nowrap;
}
.partner-note a.partner-cta:hover { border-bottom-color: var(--accent); }

/* ---------- HUB: operating loop / stack rows ---------- */
.loop {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.loop > div { background: var(--surface); padding: 24px; }
.loop .step {
  font-family: var(--font-mono); font-size: 11px; color: var(--accent-ink);
  letter-spacing: 0.05em; margin-bottom: 10px;
}
.loop h4 {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 24;
  font-size: 21px; font-weight: 500; letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.loop p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.5; }

/* hub stack: software category recommendations */
.stack-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.stack-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center;
  padding: 22px 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  transition: border-color 160ms ease, transform 160ms ease;
}
.stack-item:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.stack-item__icon {
  width: 42px; height: 42px; border-radius: 10px; background: var(--bg-deep);
  display: grid; place-items: center; color: var(--ink);
}
.stack-item__t {
  font-family: var(--font-display); font-variation-settings: "opsz" 22;
  font-size: 19px; font-weight: 500; letter-spacing: -0.01em; color: var(--ink); margin-bottom: 2px;
}
.stack-item__t + p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.stack-item__pick {
  font-family: var(--font-mono); font-size: 11px; color: var(--accent-ink); text-align: right; white-space: nowrap;
}
.stack-item__pick small { display: block; color: var(--muted-2); margin-top: 2px; }

/* feature CTA band (guide cross-link inside hub) */
.feature-band {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 0;
  background: var(--ink);
  color: var(--bg);
  border-radius: var(--r-xl);
  overflow: hidden;
}
.feature-band__body { padding: 48px 52px; }
.feature-band__body .kicker { color: rgba(244,239,230,0.6); }
.feature-band__body h3 {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 40;
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 500; letter-spacing: -0.01em; line-height: 1.05;
  margin: 14px 0 14px; color: var(--bg); text-wrap: balance;
}
.feature-band__body p { margin: 0 0 26px; color: rgba(244,239,230,0.8); font-size: 16px; line-height: 1.55; max-width: 46ch; }
.feature-band__body .btn--primary { background: var(--accent); color: #fff; }
.feature-band__body .btn--primary:hover { background: var(--accent-ink); }
.band-list {
  list-style: none; margin: 0 0 28px; padding: 0;
  display: flex; flex-direction: column; gap: 9px;
  max-width: 44ch;
}
.band-list li {
  position: relative; padding-left: 26px;
  color: rgba(244,239,230,0.88); font-size: 15px; line-height: 1.45;
}
.band-list li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: var(--accent); font-weight: 600;
}
.feature-band__photo { position: relative; background: var(--bg-deep); min-height: 280px; }
.feature-band__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- CALCULATOR ---------- */
.calc-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  margin: 8px 0 0;
}
.calc-inputs {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 30px 32px;
}
.calc-inputs h3, .calc-output h3 {
  font-family: var(--font-sans);
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted-2); margin: 0 0 22px;
}
.field { margin-bottom: 24px; }
.field:last-child { margin-bottom: 0; }
.field__label {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  margin-bottom: 10px;
}
.field__label .name { font-size: 15px; color: var(--ink); font-weight: 500; }
.field__label .val {
  font-family: var(--font-mono); font-size: 14px; color: var(--accent-ink);
  background: var(--accent-soft); padding: 3px 9px; border-radius: 5px;
}
.field__hint { font-size: 12.5px; color: var(--muted-2); margin-top: 8px; line-height: 1.4; }

input[type="range"].rng {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 999px;
  background: var(--bg-deep);
  outline: none; cursor: pointer;
}
input[type="range"].rng::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink); border: 3px solid var(--surface);
  box-shadow: 0 2px 6px rgba(36,24,12,0.3);
  cursor: pointer;
}
input[type="range"].rng::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink); border: 3px solid var(--surface);
  box-shadow: 0 2px 6px rgba(36,24,12,0.3); cursor: pointer;
}

.num-input {
  display: flex; align-items: center; gap: 0;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--bg); overflow: hidden; max-width: 220px;
}
.num-input .prefix { padding: 0 0 0 12px; color: var(--muted); font-family: var(--font-mono); font-size: 14px; }
.num-input input {
  flex: 1; border: 0; background: transparent; padding: 11px 12px;
  font-family: var(--font-mono); font-size: 15px; color: var(--ink); width: 100%;
  outline: none; -moz-appearance: textfield;
}
.num-input input::-webkit-outer-spin-button,
.num-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.num-input .suffix { padding: 0 12px 0 0; color: var(--muted); font-family: var(--font-mono); font-size: 13px; }

.seg {
  display: inline-flex; background: var(--bg-deep); border-radius: 999px; padding: 3px;
  gap: 2px; flex-wrap: wrap;
}
.seg button {
  border: 0; background: transparent; color: var(--ink-2);
  font-size: 13.5px; font-weight: 500; padding: 7px 14px; border-radius: 999px;
  transition: background 140ms ease, color 140ms ease;
}
.seg button.on { background: var(--ink); color: var(--bg); }

/* output panel */
.calc-output {
  position: sticky; top: 90px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 30px 32px;
}
.calc-headline { margin-bottom: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--line-strong); }
.calc-headline .lbl {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 10px;
}
.calc-headline .big {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 60;
  font-weight: 400;
  font-size: clamp(48px, 6vw, 68px);
  line-height: 0.98; letter-spacing: -0.02em; color: var(--ink);
}
.calc-headline .big .unit { font-size: 24px; color: var(--muted); letter-spacing: 0; }
.calc-headline .sub { margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.calc-headline .sub strong { color: var(--accent-ink); }

.calc-bd { display: flex; flex-direction: column; gap: 0; }
.calc-bd__row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
.calc-bd__row:last-child { border-bottom: 0; }
.calc-bd__row .l { color: var(--muted); }
.calc-bd__row .v { font-family: var(--font-mono); font-size: 14px; color: var(--ink); }
.calc-bd__row.total { margin-top: 6px; padding-top: 16px; border-top: 2px solid var(--ink); border-bottom: 0; }
.calc-bd__row.total .l { color: var(--ink); font-weight: 600; font-family: var(--font-sans); }
.calc-bd__row.total .v { color: var(--accent-ink); font-size: 16px; }
.calc-bd__row.pos .v { color: #244A3D; }
.calc-bd__row.neg .v { color: var(--accent-ink); }

/* mini bar viz in output */
.calc-viz { display: flex; align-items: flex-end; gap: 5px; height: 64px; margin: 4px 0 20px; }
.calc-viz .b { flex: 1; background: var(--line-strong); border-radius: 3px 3px 0 0; min-height: 4px; transition: height 220ms ease; }
.calc-viz .b.on { background: var(--accent); }

.calc-note {
  margin-top: 22px; font-size: 12.5px; color: var(--muted); line-height: 1.5;
  padding-top: 18px; border-top: 1px solid var(--line);
}
.calc-note a { color: var(--accent-ink); border-bottom: 1px solid var(--accent-soft); }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .calc-shell { grid-template-columns: 1fr; }
  .calc-output { position: static; }
  .card-grid, .card-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .loop { grid-template-columns: repeat(2, 1fr); }
  .stack-grid { grid-template-columns: 1fr; }
  .feature-band { grid-template-columns: 1fr; }
  .feature-band__photo { min-height: 200px; order: -1; }
  .block-head { grid-template-columns: 1fr; gap: 16px; align-items: start; }
  .tool-card { grid-template-columns: 40px 1fr; }
  .tool-card__aside { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; text-align: left; padding-top: 14px; border-top: 1px solid var(--line); }
  .tool-card__links { align-items: flex-start; flex-direction: row; gap: 16px; }
}
@media (max-width: 640px) {
  .card-grid, .card-grid.cols-2, .card-grid.cols-4 { grid-template-columns: 1fr; }
  .loop { grid-template-columns: 1fr; }
  .page-hero__title { font-size: 38px; }
  .tool-card { grid-template-columns: 1fr; }
  .tool-card__rank { display: none; }
}
