/* ==========================================================================
   PDF Impose — "Midnight Precision" design system
   Near-black canvas, hairline borders, single indigo-violet accent.
   ========================================================================== */

:root {
  --bg: #0b0c0e;
  --bg-raised: #101114;
  --bg-inset: #08090a;
  --border: #26282c;
  --border-soft: #1b1c1f;
  --text: #e6e7e9;
  --text-dim: #8a8f98;
  --text-faint: #5b5f68;
  --accent: #5e6ad2;
  --accent-bright: #7b85e8;
  --accent-glow: rgba(94, 106, 210, 0.35);
  --good: #4fb26a;
  --warn: #d2a35e;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --grid: 8px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --max-w: 1120px;
  --shadow-glow: 0 0 0 1px var(--border), 0 8px 30px -12px rgba(94, 106, 210, 0.25);
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  top: -48px;
  left: 12px;
  z-index: 100;
  background: var(--accent);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 12px;
  text-decoration: none;
}

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 900px 480px at 50% -120px, rgba(94,106,210,0.14), transparent 65%);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Eyebrow / labels ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin: 0 0 12px;
}
.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px 2px var(--accent-glow);
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 12, 14, 0.86);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; color: var(--text); }
.brand svg { width: 22px; height: 22px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links a:not(.btn) {
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
}
.nav-links a:not(.btn):hover { color: var(--text); text-decoration: none; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.nav-toggle:hover { border-color: var(--accent); }
.nav-toggle:active { background: var(--bg-raised); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, 0 8px 24px -8px var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent-bright);
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(255,255,255,0.12) inset, 0 10px 30px -6px var(--accent-glow);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--accent); text-decoration: none; color: var(--text); }
.btn-lg { padding: 13px 24px; font-size: 15px; }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero {
  padding: 88px 0 64px;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -220px;
  right: -140px;
  width: 720px;
  height: 560px;
  background: radial-gradient(closest-side, rgba(94, 106, 210, 0.16), rgba(94, 106, 210, 0.05) 55%, transparent 75%);
  pointer-events: none;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr);
  gap: 56px;
  align-items: center;
  position: relative;
}
.hero-inner { max-width: 760px; }
.hero-visual {
  margin: 0;
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.45));
}
@keyframes hero-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
/* Orchestrated load reveal - staggered fade-up, motion-safe only */
@media (prefers-reduced-motion: no-preference) {
  .hero-inner .eyebrow,
  .hero-inner h1,
  .hero-inner .subhead,
  .hero-inner .hero-actions,
  .hero-inner .trust-line,
  .hero-visual {
    animation: hero-rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  .hero-inner .eyebrow { animation-delay: 0ms; }
  .hero-inner h1 { animation-delay: 70ms; }
  .hero-inner .subhead { animation-delay: 140ms; }
  .hero-inner .hero-actions { animation-delay: 210ms; }
  .hero-inner .trust-line { animation-delay: 280ms; }
  .hero-visual { animation-delay: 260ms; }
}
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-visual { max-width: 440px; }
}
h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.2rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  font-weight: 650;
}
.hero .subhead {
  font-size: 18px;
  color: var(--text-dim);
  max-width: 620px;
  margin: 0 0 28px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.trust-line {
  font-size: 13px;
  color: var(--text-faint);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.trust-line .dot { color: var(--border); }

/* ---------- Sections ---------- */
section { padding: 72px 0; border-bottom: 1px solid var(--border); }
section:last-of-type { border-bottom: none; }
h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  font-weight: 600;
}
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head p { color: var(--text-dim); font-size: 15.5px; margin: 0; }

/* ---------- How it works ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.step {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 22px;
  background: var(--bg-raised);
}
.step .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(94,106,210,0.14);
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 16px;
}
.step svg { width: 32px; height: 32px; margin-bottom: 14px; color: var(--accent-bright); }
.step h3 { font-size: 16px; margin: 0 0 8px; font-weight: 600; }
.step p { color: var(--text-dim); font-size: 14px; margin: 0; }

/* ---------- Feature grid ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.feature:hover { border-color: #3a3d44; box-shadow: var(--shadow-glow); }
.feature h3 { font-size: 15px; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.feature h3::before {
  content: "";
  width: 6px; height: 6px; border-radius: 1px;
  background: var(--accent);
  transform: rotate(45deg);
  flex-shrink: 0;
}
.feature p { color: var(--text-dim); font-size: 14px; margin: 0; }

/* ---------- Calculator ---------- */
.calculator {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
  padding: 32px;
}
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 720px) { .calc-grid { grid-template-columns: 1fr; } }
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}
select, input[type="number"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-sans);
}
select:focus, input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.calc-result {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  background: var(--bg);
  min-height: 160px;
}
.calc-result .scheme-name {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent-bright);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.calc-result h4 { margin: 0 0 10px; font-size: 20px; }
.calc-result p { color: var(--text-dim); font-size: 14px; margin: 0 0 16px; }
.kbd {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 2px 6px;
  color: var(--text-dim);
}

/* ---------- FAQ ---------- */
.faq-list { max-width: 780px; }
details {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  padding: 4px 20px;
  background: var(--bg-raised);
}
details[open] { border-color: #3a3d44; }
summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 0;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  font-size: 20px;
  color: var(--accent-bright);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
details[open] summary::after { transform: rotate(45deg); }
details p { color: var(--text-dim); font-size: 14.5px; margin: 0 0 18px; }

/* ---------- Blog cards ---------- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.blog-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.blog-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.blog-card .tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin-bottom: 12px;
}
.blog-card h3 { font-size: 17px; margin: 0 0 10px; color: var(--text); line-height: 1.4; }
.blog-card p { font-size: 13.5px; color: var(--text-dim); margin: 0; flex-grow: 1; }
.blog-card .read-more { margin-top: 16px; font-size: 13px; font-weight: 600; color: var(--accent-bright); }

/* ---------- Footer ---------- */
.site-footer {
  padding: 56px 0 40px;
  background: var(--bg-raised);
  border-top: 1px solid var(--border);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 40px;
}
.footer-col h4 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 16px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: var(--text-dim); font-size: 13.5px; }
.footer-col a:hover { color: var(--text); }
.footer-brand p { color: var(--text-dim); font-size: 13.5px; max-width: 280px; }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12.5px;
  color: var(--text-faint);
}
.footer-bottom a { color: var(--text-faint); }
.footer-bottom a:hover { color: var(--text-dim); }

/* ---------- Article page ---------- */
.article-header { padding: 56px 0 32px; border-bottom: 1px solid var(--border); }
.breadcrumb { font-size: 13px; color: var(--text-faint); margin-bottom: 18px; }
.breadcrumb a { color: var(--text-faint); }
.breadcrumb a:hover { color: var(--text-dim); }
.byline { font-size: 13.5px; color: var(--text-faint); margin: 18px 0 0; }
article.post { padding: 48px 0 20px; }
.post-body { max-width: 760px; }
.answer-block {
  border: 1px solid var(--accent);
  border-left-width: 3px;
  border-radius: var(--radius-md);
  background: rgba(94,106,210,0.07);
  padding: 20px 24px;
  margin: 0 0 36px;
  font-size: 16px;
  color: var(--text);
}
.answer-block strong { color: var(--accent-bright); }
.post-body h2 { margin-top: 44px; font-size: 1.5rem; }
.post-body h3 { margin-top: 28px; font-size: 1.15rem; }
.post-body p { color: #cbccd1; font-size: 15.5px; margin: 0 0 16px; }
.post-body ul, .post-body ol { color: #cbccd1; font-size: 15.5px; padding-left: 22px; }
.post-body li { margin-bottom: 8px; }
.post-body figure { margin: 32px 0; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; background: var(--bg-raised); }
.post-body figcaption { font-size: 13px; color: var(--text-dim); margin-top: 14px; text-align: center; }

/* ---------- Table wrapper (prevents horizontal page overflow) ---------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 24px 0;
  border-radius: var(--radius-md);
}
.table-wrap table { margin: 0; }

.post-body table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}
.post-body th, .post-body td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
}
.post-body th {
  background: var(--bg-raised);
  color: var(--text-dim);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}
.post-body td { color: #cbccd1; }
.post-body td.num, .post-body th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
.post-body tbody tr:hover { background: rgba(94, 106, 210, 0.05); }
.post-body a { color: var(--accent-bright); text-decoration: underline; text-decoration-color: rgba(94,106,210,0.4); }
.post-cta {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  background: var(--bg-raised);
  text-align: center;
  margin: 44px 0;
}
.post-cta h3 { margin: 0 0 10px; font-size: 20px; }
.post-cta p { color: var(--text-dim); margin: 0 0 20px; font-size: 14.5px; }
.glossary dt { font-weight: 700; color: var(--text); margin-top: 14px; }
.glossary dd { color: var(--text-dim); margin: 4px 0 0; font-size: 14.5px; }

/* ---------- Directory (network page) ---------- */
.dir-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.dir-card {
  --chip: var(--accent);
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  color: inherit;
  text-decoration: none;
  background: var(--bg-raised);
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.dir-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--chip);
}
.dir-card:hover {
  border-color: var(--chip);
  transform: translateY(-3px);
  box-shadow: 0 14px 32px -18px var(--chip);
  text-decoration: none;
  color: inherit;
}
.dir-card:active { transform: translateY(-1px); }
.dir-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.dir-chip {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--chip);
  box-shadow: 0 0 8px 1px color-mix(in srgb, var(--chip) 55%, transparent);
  flex-shrink: 0;
}
.dir-cat {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
}
.dir-card .domain { font-family: var(--font-mono); font-size: 15px; font-weight: 600; color: var(--text); margin: 0 0 8px; }
.dir-card p { color: var(--text-dim); font-size: 13.5px; margin: 0; flex-grow: 1; }
.dir-visit { margin-top: 16px; font-size: 13px; font-weight: 600; color: var(--chip); }

/* ---------- Utility ---------- */
.center { text-align: center; }
.mt-0 { margin-top: 0; }

/* ---------- 404 ---------- */
.error-page { padding: 120px 0; text-align: center; }
.error-code {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent-bright);
  letter-spacing: 0.1em;
  margin-bottom: 20px;
}
.error-actions { display: flex; gap: 14px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .steps, .feature-grid, .blog-grid, .dir-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .nav-links { position: fixed; top: 64px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); flex-direction: column; align-items: flex-start; padding: 20px 24px; gap: 18px; transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity 0.15s ease, transform 0.15s ease; }
  .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-toggle { display: inline-flex; }
  .steps, .feature-grid, .blog-grid, .footer-grid, .dir-grid { grid-template-columns: 1fr; }
  .hero { padding: 56px 0 44px; }
  section { padding: 52px 0; }
}
