/* =================================================================
   davidnilsen.com — personal-site layer over the PKG palette.
   tokens-shared.css, tokens-pkg.css, global.css, fonts.css and
   components.css are copies of pkg_systems_com's; this file holds
   only what the two personal pages add, plus the print rules the
   dossier PDF is rendered with (build/pdf.ts).
   ================================================================= */

html { font-size: 100%; scroll-padding-top: 1.5rem; }
body { overflow-wrap: break-word; }

.dn-skip { position: absolute; left: 1rem; top: -6rem; z-index: 20; padding: 0.8rem 1rem; background: var(--accent); color: var(--bg-base); }
.dn-skip:focus { top: 1rem; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }

/* Navigation — a bracketed name in place of the PKG logo */
.site-nav { gap: 2rem; flex-wrap: wrap; }
.dn-wordmark { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--text-primary); font: 600 1.125rem/1 var(--font-body); letter-spacing: -0.01em; }
.dn-wordmark:hover { color: var(--text-primary); text-decoration: none; }
.dn-wordmark span { color: var(--accent); font: 700 1rem/1 var(--font-mono); }
.site-nav .nav-links { flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.site-nav .nav-links a { display: inline-flex; align-items: center; min-height: 2.75rem; font-size: 0.9375rem; }
.site-nav .nav-links a[aria-current="page"] { color: var(--accent); }

.site-footer .footer-links { flex-wrap: wrap; gap: 1rem 1.5rem; }
.site-footer .dn-identity { max-width: 40rem; margin: 1rem auto 0; font-family: var(--font-body); font-size: 0.8125rem; line-height: 1.6; color: var(--text-tertiary); }

/* Shared type */
.dn-kicker { color: var(--accent); font: 500 0.8125rem/1.5 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 1.25rem; }
.dn-text-link { color: var(--accent); text-decoration: underline; text-underline-offset: 0.25rem; }
.btn { white-space: normal; text-align: center; min-height: 3rem; }

/* Home — hero */
.dn-hero { padding-top: 5.5rem; padding-bottom: 4.5rem; }
.dn-hero > * { max-width: 56rem; }
.dn-hero h1 { font-size: clamp(2.75rem, 6vw, 4.5rem); line-height: 1.04; letter-spacing: -0.045em; }
.dn-aka { font: 500 1rem var(--font-mono); color: var(--text-tertiary); margin: 0.75rem 0 2rem; }
.dn-lede { font-size: 1.375rem; line-height: 1.55; margin-bottom: 1.25rem; }
.dn-hero-note { font-size: 1.0625rem; color: var(--text-secondary); max-width: 44rem; }
.dn-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 1.25rem 1.75rem; margin-top: 2.25rem; }

/* Home — sections */
.dn-section { padding-top: 4.5rem; padding-bottom: 4.5rem; }
.dn-soft { background: var(--bg-surface); border-block: 1px solid var(--border-subtle); }
.dn-section h2 { font-size: clamp(1.875rem, 3.4vw, 2.5rem); line-height: 1.15; letter-spacing: -0.035em; margin-bottom: 1.25rem; }
.dn-section p { color: var(--text-secondary); font-size: 1.0625rem; line-height: 1.65; }
.dn-section p + p { margin-top: 1rem; }
.dn-section .dn-kicker { color: var(--accent); font-size: 0.8125rem; }
.dn-section p strong { color: var(--text-primary); }
.dn-intro { max-width: 46rem; }

.dn-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: 1.5rem; margin: 2.25rem 0; }
.dn-pair article { padding: 1.75rem; border: 1px solid #355b55; border-radius: 0.75rem; background: #10201f; }
.dn-pair h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }
.dn-pair article > span { display: block; color: var(--accent); font: 0.8125rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.75rem; }

.dn-claim { border-left: 3px solid var(--accent); padding-left: 1.25rem; max-width: 46rem; }

.dn-dossier-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem 2.5rem; align-items: center; margin-top: 2.5rem; padding: 2rem; border: 1px solid #355b55; border-radius: 0.75rem; background: #142725; }
.dn-dossier-card h3 { font-size: 1.5rem; line-height: 1.3; margin-bottom: 0.5rem; }
.dn-dossier-card p { color: #c0d5d0; }
.dn-dossier-card .dn-actions { margin-top: 0; }

.dn-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 3rem; }
.dn-columns h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }

.dn-links { list-style: none; max-width: 46rem; }
.dn-links li { display: grid; grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr); gap: 0.25rem 1.5rem; padding: 1rem 0; border-bottom: 1px solid var(--border-default); }
.dn-links li a { font-weight: var(--weight-semibold); }
.dn-links li span { color: var(--text-secondary); }

.dn-contact { max-width: 46rem; }
.dn-contact .dn-email { display: inline-block; margin-top: 1.25rem; font: 500 1.25rem var(--font-mono); }

/* Dossier */
.dn-doc-header { padding-bottom: var(--space-4); border-bottom: 1px solid var(--border-default); }
.dn-doc-header .dn-subtitle { font-size: 1.25rem; line-height: 1.5; color: var(--text-secondary); }
.dn-doc-header .dn-actions { margin-top: 1.5rem; }
.dn-doc-header .btn, .dn-doc-header .btn:hover { color: var(--text-primary); text-decoration: none; }
.article .dn-claim p { color: var(--text-primary); }
.article .dn-pair { margin: var(--space-6) 0; }
.article .dn-pair h3 { margin-top: 0; }
.article .dn-pair article p { margin: 0; }
.article .dn-source { font-size: var(--text-sm); color: var(--text-tertiary); }
.article .dn-closing { font-size: var(--text-sm); color: var(--text-tertiary); border-top: 1px solid var(--border-default); padding-top: var(--space-5); }
.article ol.dn-references { padding-left: 1.25rem; }
.article ol.dn-references li { font-size: 0.9375rem; color: var(--text-secondary); }
.dn-print-only { display: none; }

@media (max-width: 650px) {
  .site-nav { align-items: flex-start; flex-direction: column; padding: 1.25rem; gap: 0.75rem; }
  .site-nav .nav-links { gap: 0.25rem 1.25rem; }
  .container { padding-left: 1.25rem; padding-right: 1.25rem; }
  .dn-hero { padding-top: 3rem; padding-bottom: 3rem; }
  .dn-lede { font-size: 1.2rem; }
  .dn-section { padding-top: 3rem; padding-bottom: 3rem; }
  .dn-dossier-card { grid-template-columns: minmax(0, 1fr); padding: 1.5rem; }
  .dn-actions { align-items: flex-start; flex-direction: column; }
  .dn-links li { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* Print — the dossier PDF. Light paper, no site chrome. */
@page { size: Letter; margin: 0.8in 0.85in; }
@media print {
  :root {
    --bg-base: #ffffff;
    --bg-surface: #ffffff;
    --bg-elevated: #f3f5f7;
    --text-primary: #12151c;
    --text-secondary: #333a48;
    --text-tertiary: #5a6275;
    --accent: #137a6b;
    --border-subtle: #d9dde4;
    --border-default: #c9ced8;
  }
  body { background: #fff; font-size: 10.5pt; }
  .site-nav, .site-footer, .article-toc, .dn-skip, .dn-no-print { display: none !important; }
  .dn-print-only { display: block; }
  .article-layout, .article-layout.no-toc { display: block; max-width: none; padding: 0; }
  .article { line-height: 1.55; }
  .article p, .article li, .article ol.dn-references li { font-size: 10.5pt; }
  .article h1 { font-size: 26pt; }
  .article h2 { font-size: 15pt; margin-top: 18pt; break-after: avoid; }
  .article h3 { font-size: 12pt; break-after: avoid; }
  /* The paradigm table never splits: it moves to the next page whole, and
     its heading and intro sentence travel with it. Compact rows keep the
     gap that leaves behind small. */
  .article table { display: table; font-size: 10pt; break-inside: avoid; }
  .article h2:has(+ p + table), .article h2 + p:has(+ table) { break-after: avoid; }
  .article table th, .article table td { padding: 4pt 8pt; border-bottom: 1px solid #c9ced8; color: #12151c; }
  .article a { color: #137a6b; text-decoration: none; }
  .article .dn-pair { display: block; }
  .article .dn-pair article { background: #fff; border: 1px solid #c9ced8; padding: 10pt 12pt; margin-bottom: 8pt; break-inside: avoid; }
  .article .dn-pair h3 { color: #12151c; }
  .dn-claim { border-left-color: #137a6b; }
  .dn-doc-header { border-bottom-color: #c9ced8; }
}
