/* wp2html.com, Blueprint. Tokens and rationale live in ../../DESIGN.md */

@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Martian Mono";
  src: url("/assets/fonts/martian-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-style: normal;
  font-display: swap;
}

:root {
  --vellum: #eaede8;
  --sheet: #f8f9f6;
  --ink: #102033;
  --muted: #4a5668;
  --line: #2c55c9;
  --signal: #ff5a1f;
  --kept: #17784a;
  --risk: #b93a0b;
  --rule: rgba(16, 32, 51, 0.18);
  --panel-text: #eaede8;
  --panel-path: #9db4f0;
  --panel-kept: #7fd6a6;
  --panel-muted: #8a96a8;

  --display: "Archivo", "Arial Narrow", sans-serif;
  --body: "Archivo", system-ui, sans-serif;
  --code: "Martian Mono", ui-monospace, Menlo, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  --measure: 66ch;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--vellum);
  color: var(--ink);
  font-family: var(--body);
  font-stretch: 100%;
  font-size: 1.125rem;
  line-height: 1.55;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--line); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--line); outline-offset: 2px; border-radius: 2px; }
::selection { background: var(--signal); color: var(--ink); }

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--vellum); padding: 8px 14px; z-index: 50; }
.skip:focus { left: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Type */
h1, h2, h3 { font-family: var(--display); margin: 0; color: var(--ink); }
h1 {
  font-stretch: 62%;
  font-weight: 820;
  font-size: clamp(3.25rem, 10.5vw, 8.75rem);
  line-height: 0.88;
  letter-spacing: -0.012em;
}
h2 {
  font-stretch: 62%;
  font-weight: 800;
  font-size: clamp(2.5rem, 6.4vw, 5rem);
  line-height: 0.92;
  letter-spacing: -0.008em;
  max-width: 18ch;
}
h3 {
  font-stretch: 88%;
  font-weight: 700;
  font-size: 1.375rem;
  line-height: 1.2;
}
p { margin: 0 0 1em; max-width: var(--measure); }
.lede { font-size: clamp(1.18rem, 1.8vw, 1.375rem); line-height: 1.5; max-width: 34em; }
.muted { color: var(--muted); }
.small { font-size: 0.9375rem; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--vellum) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.wordmark {
  font-family: var(--display); font-stretch: 70%; font-weight: 800; font-size: 1.75rem;
  color: var(--ink); text-decoration: none; letter-spacing: -0.01em; line-height: 1;
  display: inline-flex; align-items: baseline;
}
.wordmark .wp { position: relative; }
.wordmark .wp::after {
  content: ""; position: absolute; left: -2px; right: -2px; top: 52%;
  height: 3px; background: var(--signal); transform: rotate(-8deg);
}
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.site-nav a { color: var(--ink); text-decoration: none; font-size: 0.98rem; font-weight: 500; }
.site-nav a:hover { text-decoration: underline; }
.site-nav .lang { font-weight: 600; }
@media (max-width: 860px) { .site-nav .opt { display: none; } }

/* Buttons and fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px;
  font: inherit; font-weight: 700; font-stretch: 92%;
  color: var(--ink); background: var(--signal);
  border: 2px solid var(--ink); border-radius: 4px;
  text-decoration: none; cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.btn-small { min-height: 40px; padding: 0 16px; font-size: 0.95rem; box-shadow: 2px 2px 0 var(--ink); }
.btn-plain { background: var(--sheet); }

.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--sheet); border: 2px solid var(--ink); border-radius: 4px;
  padding: 12px 14px; min-height: 52px;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #6b7686; }
.field input[aria-invalid="true"] { border-color: var(--risk); box-shadow: 0 0 0 2px rgba(185, 58, 11, 0.2); }

/* Hero */
.hero { padding-block: clamp(40px, 7vw, 96px) clamp(48px, 7vw, 104px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.hero h1 { margin-bottom: 28px; }
.hero .lede { margin-bottom: 32px; }
@media (max-width: 960px) { .hero .wrap { grid-template-columns: 1fr; } }

.check-form { max-width: 560px; }
.check-form .row { display: flex; gap: 10px; }
.check-form .row input { flex: 1; min-width: 0; font-size: 1.125rem; }
.check-form .note { margin-top: 12px; font-size: 0.9375rem; color: var(--muted); }
.check-form .error { color: var(--risk); font-weight: 600; margin: 10px 0 0; }
@media (max-width: 520px) { .check-form .row { flex-direction: column; } .check-form .btn { width: 100%; } }

/* Teardown panel: the signature */
.panel {
  background: var(--ink); color: var(--panel-text);
  border-radius: 6px; padding: clamp(20px, 2.6vw, 30px);
  box-shadow: 8px 8px 0 rgba(16, 32, 51, 0.16);
  min-height: 420px;
}
.panel h2, .panel h3 { color: var(--panel-text); }
.panel-title { font-family: var(--display); font-stretch: 88%; font-weight: 650; font-size: 1.0625rem; color: var(--panel-text); margin: 0 0 14px; }
.panel ul { list-style: none; margin: 0; padding: 0; }
.panel li { font-family: var(--code); font-stretch: 87.5%; font-size: 0.875rem; line-height: 1.35; padding: 7px 0; border-bottom: 1px solid rgba(234, 237, 232, 0.1); }
.teardown .gone li { color: var(--panel-path); position: relative; width: fit-content; max-width: 100%; border-bottom: 0; padding: 5px 0; }
.teardown .gone li::after {
  content: ""; position: absolute; left: -3px; right: -3px; top: 50%;
  height: 2px; background: var(--signal);
  transform-origin: left center; transform: scaleX(1);
}
.teardown .after { margin-top: 26px; padding-top: 20px; border-top: 1px dashed rgba(234, 237, 232, 0.28); }
.teardown .after li { color: var(--panel-kept); border-bottom: 0; padding: 4px 0 4px 24px; position: relative; }
.teardown .after li::before { content: ""; position: absolute; left: 2px; top: 0.62em; width: 11px; height: 6px; border-left: 2px solid var(--panel-kept); border-bottom: 2px solid var(--panel-kept); transform: rotate(-45deg); }
.teardown .caption { margin: 18px 0 0; font-size: 0.9375rem; color: var(--panel-muted); }

/* One orchestrated page-load moment */
/* Plays once the panel is on screen (site.js adds .play), so phones see it too. */
@media (prefers-reduced-motion: no-preference) {
  .js .teardown .gone li::after { transform: scaleX(0); }
  .js .teardown .after { opacity: 0; transform: translateY(6px); }
  .js .teardown.play .gone li::after { animation: strike 360ms cubic-bezier(.6,0,.2,1) forwards; animation-delay: calc(350ms + var(--i, 0) * 210ms); }
  .js .teardown.play .gone li { animation: dim 360ms ease forwards; animation-delay: calc(410ms + var(--i, 0) * 210ms); }
  .js .teardown.play .after { animation: settle 500ms ease forwards; animation-delay: 1.95s; }
}
.teardown .gone li:nth-child(2) { --i: 1; }
.teardown .gone li:nth-child(3) { --i: 2; }
.teardown .gone li:nth-child(4) { --i: 3; }
.teardown .gone li:nth-child(5) { --i: 4; }
.teardown .gone li:nth-child(6) { --i: 5; }
.teardown .gone li:nth-child(7) { --i: 6; }
.teardown .gone li:nth-child(8) { --i: 7; }
@keyframes strike { to { transform: scaleX(1); } }
@keyframes dim { to { color: var(--panel-muted); } }
@keyframes settle { to { opacity: 1; transform: none; } }

/* Check results (same panel) */
.result h2 { font-family: var(--display); font-stretch: 80%; font-weight: 750; font-size: 1.5rem; line-height: 1.15; margin-bottom: 6px; color: var(--panel-text); max-width: none; word-break: break-word; }
.result .verdict { color: var(--panel-text); margin: 0 0 16px; font-size: 1rem; }
.result dl { margin: 0; }
.result .r { display: grid; grid-template-columns: 8em 1fr; gap: 4px 14px; padding: 10px 0; border-top: 1px solid rgba(234, 237, 232, 0.12); }
.result dt { color: var(--panel-muted); font-size: 0.9375rem; }
.result dd { margin: 0; font-size: 1rem; color: var(--panel-text); word-break: break-word; }
.result dd code { font-family: var(--code); font-stretch: 87.5%; font-size: 0.875rem; }
.result dd .why { display: block; font-size: 0.9375rem; margin-top: 4px; color: var(--panel-muted); }
.result dd.bad { color: #ffb08f; }
.result dd.ok { color: var(--panel-kept); }
.result .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.panel .btn { border-color: var(--panel-text); box-shadow: 3px 3px 0 rgba(234, 237, 232, 0.3); text-align: center; }
.panel .btn:hover { box-shadow: 4px 4px 0 rgba(234, 237, 232, 0.4); }
.result .btn-plain { color: var(--ink); }
.result .loading { font-family: var(--code); font-size: 0.875rem; color: var(--panel-path); }
@media (max-width: 520px) { .result .r { grid-template-columns: 1fr; } }

/* Sections */
.section { padding-block: clamp(56px, 8vw, 112px); border-top: 1px solid var(--rule); }
.section-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(20px, 4vw, 64px); align-items: end; margin-bottom: clamp(32px, 4vw, 56px); }
.section-head p { margin: 0; }
@media (max-width: 860px) { .section-head { grid-template-columns: 1fr; } }

/* PHP2Shell band */
.alert { background: var(--sheet); border-top: 1px solid var(--rule); }
.alert .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(20px, 4vw, 64px); padding-block: clamp(48px, 6vw, 88px); }
.alert .date { font-family: var(--display); font-stretch: 62%; font-weight: 800; font-size: clamp(2.75rem, 6vw, 4.75rem); line-height: 0.9; }
.alert .date span { display: block; color: var(--muted); font-stretch: 75%; font-weight: 600; font-size: 0.42em; margin-top: 12px; line-height: 1.2; }
.alert .wrap > div > p:last-child { margin-bottom: 0; }
@media (max-width: 860px) { .alert .wrap { grid-template-columns: 1fr; } }

/* Comparison table */
.compare { width: 100%; border-collapse: collapse; background: var(--sheet); border: 2px solid var(--ink); }
.compare th, .compare td { text-align: left; vertical-align: top; padding: 16px 18px; border-bottom: 1px solid var(--rule); }
.compare thead th { font-family: var(--display); font-stretch: 80%; font-weight: 750; font-size: 1.125rem; border-bottom: 2px solid var(--ink); }
.compare tbody th { font-weight: 600; width: 24%; }
.compare td.before { color: var(--muted); }
.compare tbody tr:last-child > * { border-bottom: 0; }
@media (max-width: 720px) {
  .compare thead { display: none; }
  .compare, .compare tbody, .compare tr, .compare th, .compare td { display: block; width: 100%; }
  .compare tr { padding: 14px 16px; border-bottom: 1px solid var(--rule); }
  .compare tr:last-child { border-bottom: 0; }
  .compare th, .compare td { padding: 4px 0; border: 0; }
  .compare tbody th { width: auto; font-size: 1.0625rem; }
  .compare td::before { content: attr(data-label) ": "; font-weight: 600; color: var(--ink); }
}

/* Process: a real sequence, so it's numbered */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 5.5rem minmax(0, 18rem) minmax(0, 1fr); gap: 8px clamp(16px, 3vw, 40px); padding: 24px 0; border-top: 1px solid var(--rule); align-items: baseline; }
.steps li::before { content: counter(step); font-family: var(--display); font-stretch: 62%; font-weight: 800; font-size: 3.5rem; line-height: 0.8; color: var(--ink); }
.steps h3 { font-size: 1.5rem; }
.steps p { margin: 0; }
@media (max-width: 760px) { .steps li { grid-template-columns: 3.5rem 1fr; } .steps li p { grid-column: 2; } .steps li::before { font-size: 2.75rem; } }

/* Kept, fixed, removed */
.ledger { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 2px solid var(--ink); background: var(--sheet); }
.ledger > div { padding: clamp(20px, 2.4vw, 32px); }
.ledger > div + div { border-left: 1px solid var(--rule); }
.ledger h3 { font-stretch: 62%; font-weight: 800; font-size: 2.25rem; line-height: 1; margin-bottom: 18px; }
.ledger ul { list-style: none; margin: 0; padding: 0; }
.ledger li { padding: 9px 0 9px 30px; position: relative; border-top: 1px solid var(--rule); }
.ledger .kept li::before { content: ""; position: absolute; left: 4px; top: 1.05em; width: 12px; height: 7px; border-left: 2.5px solid var(--kept); border-bottom: 2.5px solid var(--kept); transform: rotate(-45deg); }
.ledger .fixed li::before { content: ""; position: absolute; left: 3px; top: 0.98em; width: 14px; height: 14px; background:
  linear-gradient(var(--line), var(--line)) center / 14px 2.5px no-repeat,
  linear-gradient(var(--line), var(--line)) center / 2.5px 14px no-repeat; }
.ledger .removed li { color: var(--muted); }
.ledger .removed li span { text-decoration: line-through; text-decoration-color: var(--signal); text-decoration-thickness: 2px; }
.ledger .removed li::before { content: ""; position: absolute; left: 3px; top: 1.32em; width: 15px; height: 2.5px; background: var(--signal); }
@media (max-width: 860px) { .ledger { grid-template-columns: 1fr; } .ledger > div + div { border-left: 0; border-top: 1px solid var(--rule); } }

/* Two-up prose blocks */
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 4vw, 56px); }
.split > div { border-top: 2px solid var(--ink); padding-top: 18px; }
.split h3 { margin-bottom: 10px; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }
.plain-list { margin: 0; padding-left: 1.2em; max-width: var(--measure); }
.plain-list li { margin-bottom: 10px; }
.plain-list li::marker { color: var(--muted); }
.notfit li::marker { content: "– "; }

/* FAQ */
.faq { max-width: 860px; }
.faq details { border-top: 1px solid var(--rule); }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { list-style: none; cursor: pointer; padding: 20px 44px 20px 0; position: relative; font-weight: 650; font-size: 1.1875rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 8px; top: 50%; width: 14px; height: 14px; margin-top: -7px; background:
  linear-gradient(var(--ink), var(--ink)) center / 14px 2px no-repeat,
  linear-gradient(var(--ink), var(--ink)) center / 2px 14px no-repeat; transition: transform 160ms ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding-bottom: 8px; }

/* Quote form */
.quote .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 72px); }
.quote-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; background: var(--sheet); border: 2px solid var(--ink); padding: clamp(20px, 3vw, 36px); border-radius: 6px; }
.quote-form .full { grid-column: 1 / -1; }
.quote-form .hp { position: absolute; left: -9999px; }
.quote-form .status { margin: 0; font-weight: 600; }
.quote-form .status.ok { color: var(--kept); }
.quote-form .status.err { color: var(--risk); }
@media (max-width: 860px) { .quote .wrap { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .quote-form { grid-template-columns: 1fr; } }

/* Article pages */
.article { padding-block: clamp(40px, 6vw, 88px); }
.article h1 { font-size: clamp(2.75rem, 7.5vw, 6rem); max-width: 14ch; margin-bottom: 20px; }
.article .meta { color: var(--muted); font-size: 0.9375rem; margin-bottom: 28px; }
.article h2 { font-size: clamp(2rem, 4.4vw, 3.25rem); margin: 56px 0 18px; }
.article ul, .article ol { max-width: var(--measure); padding-left: 1.3em; }
.article li { margin-bottom: 10px; }
.article .cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 8px; }
.article .sources li { font-size: 0.9375rem; }

/* Footer with a drawing title block */
.site-footer { border-top: 2px solid var(--ink); padding-block: 40px 48px; font-size: 0.9375rem; }
.site-footer .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: start; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 14px 0 18px; }
.site-footer nav a { color: var(--ink); }
.site-footer .legal { color: var(--muted); max-width: 70ch; margin: 0; }
.titleblock { border: 2px solid var(--ink); display: grid; grid-template-columns: auto auto; min-width: 280px; background: var(--sheet); }
.titleblock div { padding: 8px 12px; border-bottom: 1px solid var(--rule); }
.titleblock div:nth-child(odd) { color: var(--muted); border-right: 1px solid var(--rule); }
.titleblock div:nth-last-child(-n+2) { border-bottom: 0; }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr; } .titleblock { min-width: 0; } }

/* Simple pages */
.simple { padding-block: clamp(56px, 9vw, 128px); min-height: 50vh; }
.simple h1 { font-size: clamp(3rem, 9vw, 6.5rem); margin-bottom: 24px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .faq summary::after { transition: none; }
}
