/* Diagnostic tool pages (/engines/*). Scoped to .eng-page.
   Thesis: an instrument on a bench. A dark readout card (the form) sits on
   paper beside plain-spoken copy; the guide below is ruled like a data sheet. */

.eng-page {
  --eng-paper: #f5f0e4;
  --eng-paper-2: #ebe4d2;
  --eng-ink: #1b1c20;
  --eng-muted: #5a5850;
  --eng-rule: #d0c8b4;
  --eng-slate: #1c2229;
  --eng-slate-2: #252d36;
  --eng-slate-line: #3b4651;
  --eng-slate-text: #e9ebec;
  --eng-slate-muted: #b3bcc3;
  --eng-brass: #bd964c;
  --eng-green: #1f6a52;
  --eng-ease: cubic-bezier(0.16, 1, 0.3, 1);
  min-height: 100vh;
  color: var(--eng-ink);
  background: var(--eng-paper);
  font-family: "DM Sans Variable", "DM Sans", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-x: clip;
}
.eng-page *,
.eng-page *::before,
.eng-page *::after { box-sizing: border-box; }
.eng-page ::selection { color: #fff; background: var(--eng-slate); }
.eng-page a { text-underline-offset: 0.25em; }
.eng-page a:focus-visible,
.eng-page summary:focus-visible,
.eng-page button:focus-visible,
.eng-page input:focus-visible,
.eng-page select:focus-visible { outline: 2px solid var(--eng-green); outline-offset: 3px; }
.eng-page [id] { scroll-margin-top: 112px; }
:where(.eng-page) :is(h1, h2, h3, p, ol, ul, dl, dd, form) { margin: 0; }
.eng-page h1,
.eng-page h2 { font-family: "Cormorant Garamond Variable", Georgia, serif; font-weight: 500; text-wrap: balance; }
.eng-wrap { width: min(100%, 1280px); margin-inline: auto; padding-inline: clamp(20px, 5vw, 64px); }

/* Hero */
.eng-hero { padding: 112px 0 clamp(48px, 6vw, 80px); border-bottom: 1px solid var(--eng-rule); }
.eng-hero .eng-wrap { padding-inline: 0; width: min(100%, 1280px); }
.eng-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr); gap: clamp(32px, 5vw, 80px); align-items: start; padding-inline: clamp(20px, 5vw, 64px); }
.eng-h1 { font-size: clamp(2.2rem, 3.7vw, 3.4rem); line-height: 1.06; letter-spacing: -0.02em; max-width: 20ch; }
.eng-lede { margin-top: 20px; max-width: 58ch; font-size: 1.125rem; color: #38362f; }
.eng-checks { display: grid; margin-top: 26px; border-top: 2px solid var(--eng-ink); }
.eng-check { padding: 12px 0; border-bottom: 1px solid var(--eng-rule); }
.eng-check-row { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; align-items: start; }
.eng-check-icon { width: 18px; height: 18px; margin-top: 3px; color: var(--eng-green); }
.eng-check-text { font-size: 1rem; color: #38362f; line-height: 1.5; }

.eng-card { padding: clamp(20px, 3vw, 32px); border-radius: 12px; background: var(--eng-slate); color: var(--eng-slate-text); box-shadow: 0 24px 46px -24px rgba(12, 18, 24, 0.6); animation: eng-rise 0.9s var(--eng-ease) 0.15s both; }
.eng-card-head { display: flex; align-items: flex-start; gap: 12px; }
.eng-card-icon { flex: none; width: 22px; height: 22px; margin-top: 2px; color: #e8c98e; }
.eng-card-title { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #e8c98e; }
.eng-card-sub { margin-top: 4px; font-size: 0.9375rem; color: var(--eng-slate-muted); }
.eng-form { display: grid; gap: 18px; margin-top: 22px; }
.eng-field { display: grid; gap: 6px; position: relative; }
.eng-label { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--eng-slate-muted); }
.eng-input { width: 100%; padding: 13px 14px; border: 1px solid var(--eng-slate-line); border-radius: 8px; background: var(--eng-slate-2); color: #fff; font: inherit; font-size: 1rem; transition: border-color 0.2s; }
.eng-input::placeholder { color: #8d98a2; }
.eng-input:hover { border-color: #5a6876; }
.eng-input:focus { border-color: #e8c98e; outline: none; }
.eng-input:focus-visible { outline: 2px solid #e8c98e; outline-offset: 2px; }
.eng-input-icon { padding-left: 40px; }
.eng-field-icon { position: absolute; left: 13px; bottom: 15px; width: 17px; height: 17px; color: #8d98a2; pointer-events: none; }
.eng-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.eng-error { padding: 12px 14px; border-radius: 8px; background: rgba(217, 83, 61, 0.14); border: 1px solid rgba(217, 83, 61, 0.5); color: #ffd3c9; font-size: 0.9375rem; }
.eng-submit { display: grid; grid-template-columns: 1fr; gap: 10px; }
.eng-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 22px; border: 0; border-radius: 10px; background: #e8c98e; color: var(--eng-ink); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; transition: background 0.2s var(--eng-ease), opacity 0.2s; }
.eng-btn:hover { background: #fff; }
.eng-submit .eng-btn { width: 100%; }
.eng-btn:disabled { opacity: 0.7; cursor: progress; }
.eng-btn svg { width: 18px; height: 18px; }
.eng-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 16px; border: 1px solid var(--eng-slate-line); border-radius: 10px; background: transparent; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.eng-ghost:hover { background: var(--eng-slate-2); }
.eng-ghost svg { width: 16px; height: 16px; }
.eng-spin { width: 16px; height: 16px; animation: eng-spin 0.9s linear infinite; }
@keyframes eng-spin { to { transform: rotate(360deg); } }
@keyframes eng-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* Guide */
.eng-sec { padding: clamp(48px, 7vw, 92px) 0; border-bottom: 1px solid var(--eng-rule); }
.eng-sec h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); line-height: 1.07; letter-spacing: -0.015em; }
.eng-split { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(28px, 6vw, 96px); align-items: start; }
.eng-split > div > p, .eng-sec h2 + p { margin-top: 16px; color: var(--eng-muted); max-width: 60ch; }
.eng-split > div > p + p { margin-top: 12px; }
.eng-ruled { list-style: none; padding: 0; counter-reset: q; border-top: 2px solid var(--eng-ink); }
.eng-ruled li { counter-increment: q; position: relative; padding: 16px 0 16px 2.6rem; border-bottom: 1px solid var(--eng-rule); }
.eng-ruled li::before { content: counter(q); position: absolute; left: 0; top: 16px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--eng-ink); color: #fff; font-size: 0.875rem; font-weight: 700; }
.eng-report { background: var(--eng-paper-2); }
.eng-doc { padding: clamp(20px, 3vw, 32px); border: 1px solid #bdb59f; border-radius: 4px; background: #fcfaf5; box-shadow: 0 18px 34px -22px rgba(30, 24, 14, 0.4); }
.eng-doc-kicker { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--eng-muted); }
.eng-doc-title { margin: 6px 0 12px !important; padding-bottom: 12px; border-bottom: 2px solid var(--eng-ink); font-family: "Cormorant Garamond Variable", Georgia, serif; font-size: 1.9rem; line-height: 1.05; }
.eng-doc-part { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--eng-rule); font-size: 0.9375rem; line-height: 1.45; }
.eng-doc-part:last-child { border-bottom: 0; }
.eng-doc-part i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--eng-slate); color: #fff; font-style: normal; font-size: 0.8125rem; font-weight: 700; }
.eng-audience { font-weight: 600; color: var(--eng-ink) !important; margin-bottom: 14px; max-width: 60ch; }
.eng-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 28px; border-top: 2px solid var(--eng-ink); }
.eng-three > div { padding: 18px clamp(14px, 2.4vw, 32px) 8px 0; }
.eng-three > div + div { padding-left: clamp(14px, 2.4vw, 32px); border-left: 1px solid var(--eng-rule); }
.eng-three dt { font-family: "Cormorant Garamond Variable", Georgia, serif; font-size: 1.7rem; line-height: 1.1; }
.eng-three dd { margin-top: 6px; color: var(--eng-muted); }

.eng-faq { background: var(--eng-paper-2); }
.eng-faq details { border-bottom: 1px solid #bdb59f; }
.eng-faq details:first-child { border-top: 1px solid #bdb59f; }
.eng-faq summary { list-style: none; display: flex; justify-content: space-between; gap: 20px; padding: 20px 0; font-weight: 600; cursor: pointer; }
.eng-faq summary::-webkit-details-marker { display: none; }
.eng-faq summary::after { content: "+"; flex: none; font-size: 1.5rem; line-height: 1; color: var(--eng-green); transition: transform 0.25s var(--eng-ease); }
.eng-faq details[open] summary::after { transform: rotate(45deg); }
.eng-faq details p { padding: 0 0 22px; max-width: 64ch; color: #38362f; margin: 0 !important; }

.eng-rail { margin-top: 24px; }
.eng-rail ul { list-style: none; padding: 0; border-top: 2px solid var(--eng-ink); }
.eng-rail li { border-bottom: 1px solid var(--eng-rule); }
.eng-rail a { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) 22px; gap: clamp(14px, 3vw, 40px); align-items: center; padding: 16px 0; color: inherit; text-decoration: none; transition: padding 0.3s var(--eng-ease), background 0.3s var(--eng-ease); }
.eng-rail a:hover { padding-inline: 12px; background: var(--eng-paper-2); }
.eng-rail-name { font-family: "Cormorant Garamond Variable", Georgia, serif; font-size: 1.55rem; line-height: 1.1; }
.eng-rail-name small { display: block; margin-top: 2px; font-family: "DM Sans Variable", Arial, sans-serif; font-size: 0.8125rem; color: var(--eng-muted); letter-spacing: 0.02em; }
.eng-rail-desc { color: var(--eng-muted); font-size: 0.9375rem; }
.eng-rail svg { width: 18px; height: 18px; color: var(--eng-green); transition: transform 0.3s var(--eng-ease); }
.eng-rail a:hover svg { transform: translateX(4px); }
.eng-rail-head { margin-bottom: 10px; }

.eng-close { background: var(--eng-ink); color: #f1ede2; border-bottom: 0; }
.eng-close-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: clamp(24px, 5vw, 80px); align-items: center; }
.eng-close p, .eng-close h2 + p { margin-top: 14px !important; max-width: 56ch; color: #d6d0c1 !important; }
.eng-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.eng-quiet { color: #f1ede2; font-weight: 600; text-decoration: underline; text-decoration-color: var(--eng-brass); text-decoration-thickness: 2px; }
.eng-crumbs { display: flex; flex-wrap: wrap; gap: 6px 10px; padding-block: 22px 34px; font-size: 0.9rem; color: var(--eng-muted); }
.eng-crumbs a { color: var(--eng-green); }

@media (max-width: 1000px) {
  .eng-hero-grid, .eng-split, .eng-close-grid { grid-template-columns: 1fr; }
  .eng-three { grid-template-columns: 1fr; }
  .eng-three > div, .eng-three > div + div { padding-left: 0; border-left: 0; border-bottom: 1px solid var(--eng-rule); padding-bottom: 16px; }
}
@media (max-width: 720px) {
  .eng-hero { padding-top: 96px; }
  .eng-h1 { font-size: 2.05rem; }
  .eng-lede { margin-top: 14px; font-size: 1rem; line-height: 1.55; }
  .eng-checks { display: none; }
  .eng-two { grid-template-columns: 1fr; }
  .eng-rail a { grid-template-columns: minmax(0, 1fr) 20px; }
  .eng-rail-desc { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .eng-card { animation: none; }
  .eng-spin { animation-duration: 3s; }
  .eng-page * { transition-duration: 0.01ms !important; }
}

/* The shared editorial surface under the report paints a dark strip meant for a dark nav. */
.eng-page div.absolute.inset-x-0.top-0.h-40 { display: none; }
