/* KARLIN · Graphite theme | isolated override — no edits to site.css */
:root { color-scheme: light; }
html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #22282d;
  --ink: #efeee9;
  --slate: #bac2c5;
  --navy: #b0c7d5;
  --line: #454f56;
  --karlin-dark-surface: #2a3137;
  --karlin-dark-edge: #53616b;
}
html[data-theme="dark"] body {
  background-color: #22282d;
  color: var(--ink);
  /* Thin diagonal brushing under graphite depth and a cool top-right glow. */
  background-image:
    radial-gradient(ellipse 90% 65% at 90% 3%, rgba(102, 126, 139, .22), transparent 62%),
    radial-gradient(ellipse 85% 75% at 2% 79%, rgba(13, 19, 25, .30), transparent 64%),
    repeating-linear-gradient(99deg, rgba(234, 239, 242, .015) 0, rgba(234, 239, 242, .015) 1px, transparent 1px, transparent 5px),
    linear-gradient(150deg, #21272c 0%, #292f35 51%, #20262b 100%);
}
html[data-theme="dark"] body::selection,
html[data-theme="dark"] ::selection { background: #557589; color: #fff; }
html[data-theme="dark"] h3,
html[data-theme="dark"] .identity,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] .work-list h3,
html[data-theme="dark"] .services h3,
html[data-theme="dark"] .steps h3,
html[data-theme="dark"] .article-card h2,
html[data-theme="dark"] .article-related-grid strong { color: var(--ink); }
html[data-theme="dark"] p,
html[data-theme="dark"] .article-content,
html[data-theme="dark"] .article-content p,
html[data-theme="dark"] .work-list p,
html[data-theme="dark"] .services p { color: var(--slate); }
html[data-theme="dark"] .header nav a:hover,
html[data-theme="dark"] .languages a[aria-current],
html[data-theme="dark"] .languages a:hover,
html[data-theme="dark"] .article-card:hover h2,
html[data-theme="dark"] .article-related-grid a:hover strong { color: #d7e5ee; }
html[data-theme="dark"] .languages { border-color: var(--line); }
html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .work-number,
html[data-theme="dark"] .work-tag,
html[data-theme="dark"] .service-top > span,
html[data-theme="dark"] .steps article > span,
html[data-theme="dark"] .small-study span,
html[data-theme="dark"] .article-topline,
html[data-theme="dark"] .article-card-meta { color: #a0adb5; }
html[data-theme="dark"] .eyebrow i { background: #72818b; }
html[data-theme="dark"] .approach {
  background: linear-gradient(117deg, rgba(62, 73, 82, .48), rgba(37, 46, 54, .70) 67%, rgba(46, 53, 58, .13));
}
html[data-theme="dark"] .contact {
  background: linear-gradient(116deg, rgba(52, 62, 70, .65), rgba(28, 36, 42, .65));
}
html[data-theme="dark"] .button,
html[data-theme="dark"] .articles-footer-cta .button {
  color: #f5f4ef;
  background: linear-gradient(112deg, #3c5668, #2d4557);
  border-color: #60788a;
  box-shadow: inset 0 1px rgba(255,255,255,.085), 0 6px 20px rgba(5,10,14,.11);
}
html[data-theme="dark"] .button:hover,
html[data-theme="dark"] .articles-footer-cta .button:hover { background: #45657a; }
/* Restore light pencil-on-charcoal detail without changing the original SVG. */
html[data-theme="dark"] .hero-art img,
html[data-theme="dark"] .contact img,
html[data-theme="dark"] .contact-grid aside img {
  filter: invert(.91) hue-rotate(180deg) saturate(.65) brightness(.91);
  opacity: .80;
}
html[data-theme="dark"] .service-top svg,
html[data-theme="dark"] .small-study svg,
html[data-theme="dark"] .articles-graphic svg {
  stroke: #9cabb5;
}
html[data-theme="dark"] .point { fill: #b7d2e4; }
html[data-theme="dark"] .articles-graphic { background: radial-gradient(ellipse at center, rgba(149,169,181,.10), transparent 68%); }
html[data-theme="dark"] .articles-footer-cta {
  background: linear-gradient(125deg, #313b43, #262e34 70%, #303a43);
  border-color: #55626a;
}
html[data-theme="dark"] .article-content h2 { color: var(--ink); }
html[data-theme="dark"] .article-content a,
html[data-theme="dark"] .article-topline a,
html[data-theme="dark"] .article-card-link,
html[data-theme="dark"] .prose a { color: #b6d8ee; }
html[data-theme="dark"] .article-content code { color: #e7ebec; background: #3a444b; }
html[data-theme="dark"] .contact-form label { color: var(--ink); }
html[data-theme="dark"] .contact-form input,
html[data-theme="dark"] .contact-form textarea { background: #2d373e; color: var(--ink); border-color: #7d8c96; }
html[data-theme="dark"] .contact-form [aria-invalid="true"] { border-color: #e49b8a; }
html[data-theme="dark"] .field-error { color: #e9ad9f; }
html[data-theme="dark"] .form-status { background: #2c4437; color: #d5ecdf; border-color: #8fc3a2; }
html[data-theme="dark"] .form-status.error { background: #4c3432; color: #f6d9d4; border-color: #e7aa9e; }
html[data-theme="dark"] .analytics-notice { background: #303941; border-color: #677782; color: #ecefee; }
html[data-theme="dark"] .analytics-notice button { color: #cbdce5; }
html[data-theme="dark"] a:focus-visible,
html[data-theme="dark"] button:focus-visible { outline-color: #e0cba5; }
/* Footer-only appearance preference. Invisible control bounds, visible 17px outline icon. */
footer .karlin-theme-toggle {
  appearance: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
  margin: 0 0 0 -5px;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #77848a;
  cursor: pointer;
  line-height: 1;
  vertical-align: middle;
  transition: color .16s ease;
}
footer .karlin-theme-toggle:hover { color: #344e5d; }
footer .karlin-theme-toggle:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: -3px;
  border-radius: 3px;
}
footer .karlin-theme-toggle svg {
  display: block;
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
footer .karlin-theme-toggle .karlin-sun { display: none; }
html[data-theme="dark"] footer .karlin-theme-toggle { color: #a3b1b9; }
html[data-theme="dark"] footer .karlin-theme-toggle:hover { color: #f1ece2; }
html[data-theme="dark"] footer .karlin-theme-toggle .karlin-moon { display: none; }
html[data-theme="dark"] footer .karlin-theme-toggle .karlin-sun { display: block; }
/* Keep copyright and its icon as one unit; wrap the unit, not its children. */
footer .karlin-footer-appearance {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
footer .karlin-footer-appearance > span { flex: 0 0 auto; line-height: 1.4; }
@media (max-width: 580px) {
  footer .footer-links { align-items: center; column-gap: 16px; row-gap: 8px; }
  footer .footer-links > a { padding: 0; }
  footer .karlin-footer-appearance > span { flex-basis: auto; }
  footer .karlin-theme-toggle { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  footer .karlin-theme-toggle { transition: none; }
}
