/* Shared public theme and navigation. ISO 9241 interaction principles inform
   consistency and control; focus, reflow and touch sizes follow WAI guidance. */
html { color-scheme:only light; background-color:#f7f8fb; scroll-padding-top:100px; }
html[data-theme="dark"] { color-scheme:dark; --ink:#eaf2ff; --muted:#9db1c8; --paper:#08111d; --white:#0f1b2d; --line:rgba(157,181,212,.16); --line-strong:rgba(157,181,212,.24); --header-bg:rgba(8,17,29,.96); --header-ink:#edf4ff; --secondary-hover:rgba(255,255,255,.08); --tag-bg:rgba(108,192,255,.14); --tag-ink:#9ed7ff; --field-bg:#0d1829; --field-focus-bg:#122238; --field-border:rgba(157,181,212,.22); }
[hidden] { display:none !important; }
:where(a,button,input,select,textarea,summary):focus-visible { outline:3px solid var(--blue-500); outline-offset:4px; }
:where(button,.btn,.pub-save,.pub-tabs a) { min-height:44px; touch-action:manipulation; }
:where(.btn,.btn-primary,.btn-outline,.btn-primary-outline,.theme-toggle):hover { transform:none; }
.btn.primary:hover,.btn-primary:hover,.btn.secondary:hover,.btn.ghost:hover,.btn-primary-outline:hover,.btn-outline:hover,.theme-toggle:hover { transform:none; }
.site-header { z-index:200; }
.site-header .header-inner { gap:18px; min-height:76px; padding-block:12px; }
.site-header .logo { flex-shrink:0; min-height:44px; }
.site-header .site-nav { position:static; display:flex; align-items:center; gap:16px; opacity:1; transform:none; pointer-events:auto; min-width:0; padding:0; box-shadow:none; background:transparent; }
.site-header .site-nav a { display:inline-flex; align-items:center; min-height:44px; color:var(--header-ink); }
.site-header .site-nav a[aria-current="page"] { text-decoration:underline; text-underline-offset:7px; }
.site-header .site-nav .nav-mobile-cta { display:none; }
.site-header .header-actions { margin-left:auto; gap:10px; min-width:0; }
.site-header .theme-toggle { min-width:44px; min-height:44px; border-radius:12px; padding:10px 12px; white-space:nowrap; }
.theme-icon { width:20px; height:20px; flex-shrink:0; }
.theme-icon-sun { display:none; }
body[data-theme="dark"] .theme-icon-sun { display:block; }
body[data-theme="dark"] .theme-icon-moon { display:none; }
.site-header .nav-toggle { min-width:80px; min-height:44px; align-items:center; justify-content:center; gap:9px; border-radius:12px; padding:10px 12px; cursor:pointer; }
.nav-icon { display:inline-grid; gap:4px; width:17px; }
.nav-icon span { display:block; width:17px; height:2px; background:currentColor; }
/* Shared footer: explicit theme surfaces and separate, comfortable link groups. */
.site-footer { background:#edf2f9; color:#45566c; border-top:1px solid var(--line-strong); padding:40px 0; }
html[data-theme="dark"] .site-footer { background:#08162b; color:#c8d7e9; }
.site-footer .footer-inner { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.35fr); align-items:start; gap:32px; }
.site-footer .footer-brand { min-width:0; }
.site-footer .footer-copyright { margin:0 0 12px; font-weight:600; color:var(--ink); }
.site-footer .footer-tagline { margin:0; }
.site-footer .footer-link-groups { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; }
.site-footer .footer-heading { margin:0 0 8px; font-size:.9rem; font-weight:700; color:var(--ink); letter-spacing:0; }
.site-footer .footer-service-links { display:flex; flex-direction:column; align-items:flex-start; gap:2px; }
.site-footer .footer-service-links a { display:inline-flex; align-items:center; min-height:44px; max-width:100%; font-size:.9rem; line-height:1.45; overflow-wrap:anywhere; }
.site-footer a:hover { color:var(--blue-600); text-decoration:underline; text-underline-offset:3px; }
html[data-theme="dark"] .site-footer a:hover { color:var(--blue-300); }
.site-footer .footer-social { grid-column:1 / -1; padding-top:20px; border-top:1px solid var(--line-strong); }
.site-footer .profile-social-links { margin-top:12px; }
.site-footer .profile-social-links a { border-color:var(--line-strong); color:var(--ink); }
@media (max-width:740px) {
  .site-footer { padding:32px 0; }
  .site-footer .footer-inner { grid-template-columns:minmax(0,1fr); gap:24px; }
  .site-footer .footer-link-groups { gap:16px; }
  .site-footer .footer-social { padding-top:18px; }
}

html:not([data-theme="dark"]) .hero { color:var(--ink); background:radial-gradient(ellipse at 15% 15%,rgba(31,111,235,.12),transparent 60%),linear-gradient(135deg,#f7faff,#e9f1fb); }
html:not([data-theme="dark"]) .hero :is(.hero-lead,.hero-subnote,.stat span) { color:var(--muted); }
html:not([data-theme="dark"]) .hero .stat { background:rgba(255,255,255,.75); border-color:var(--line-strong); }
html:not([data-theme="dark"]) .hero :is(.pill,.badge) { color:var(--blue-700); border-color:var(--line-strong); background:var(--tag-bg); }
html:not([data-theme="dark"]) :is(.hero,.cta) .btn.ghost { color:var(--header-ink); border-color:var(--line-strong); }
html:not([data-theme="dark"]) .section.dark { background:#edf2f9; color:var(--ink); }
html:not([data-theme="dark"]) .section.dark .eyebrow { color:var(--blue-600); }
html:not([data-theme="dark"]) .cta { background:linear-gradient(135deg,#ecf3ff,#f7f9fc); color:var(--ink); }
html:not([data-theme="dark"]) .cta p { color:var(--muted); }
@media (max-width:1100px) {
  .site-header .header-inner { flex-wrap:wrap; gap:8px; padding-block:10px; }
  .site-header .logo { margin-right:auto; }
  .site-header .header-actions { margin-left:0; gap:8px; }
  .site-header .nav-toggle { display:inline-flex; }
  .site-header .site-nav { flex-direction:column; align-items:stretch; width:100%; gap:0; }
  .site-header .site-nav a { color:var(--header-ink); min-height:48px; padding:10px 14px; border-radius:7px; }
  .site-header .site-nav a:hover { background:var(--secondary-hover); }
  .site-header .site-nav a::after { display:none; }
  .site-header .site-nav .nav-mobile-cta { display:inline-flex; border-top:1px solid var(--line-strong); margin-top:8px; padding-top:14px; }
  html[data-ui-enhanced="true"] .site-header .site-nav,
  html[data-ui-ready="true"] .site-header .site-nav { position:absolute; top:100%; left:0; right:0; z-index:201; width:auto; max-height:calc(100vh - 90px); max-height:calc(100dvh - 90px); overflow-y:auto; overscroll-behavior:contain; background:var(--white); color:var(--header-ink); border:1px solid var(--line-strong); border-radius:0 0 14px 14px; padding:10px; box-shadow:var(--shadow-md); }
  /* Keep the no-JS link list usable; enhanced pages reserve the final header
     height from first paint and reveal the dropdown only after it is wired. */
  html[data-ui-enhanced="true"]:not([data-ui-ready="true"]) .site-header .site-nav { visibility:hidden; }
}
@media (max-width:740px) {
  .site-header .theme-toggle [data-theme-toggle-label] { display:none; }
  .site-header .theme-toggle { width:44px; padding:10px; justify-content:center; }
  .site-header .logo { gap:8px; }
  .site-header .logo img { width:36px; height:36px; }
  main,.hero-content,.hero-visual,.pub-story-copy { min-width:0; }
  .hero-grid,.about-grid,.tools-grid,.process-grid { grid-template-columns:minmax(0,1fr); }
  .hero-actions .btn { max-width:100%; white-space:normal; text-align:center; }
  body .pub-filter-panel :is(input:not([type="checkbox"]),select),body .form-control { font-size:16px; }
  .pub-tabs a { display:inline-flex; align-items:center; }
  .pub-job-bottom { align-items:flex-start; }
  .pub-pagination { flex-wrap:wrap; gap:12px; }
}
@media (prefers-reduced-motion:reduce) { html { scroll-behavior:auto; } .btn,.theme-toggle,.site-nav { transition:none; } }

/* Explicit theme canvas also covers mobile browser overscroll and safe areas. */
html[data-theme="light"] { color-scheme:only light; background-color:#f7f8fb; }
html[data-theme="light"] body { color-scheme:only light; background-color:var(--paper); color:var(--ink); }
html[data-theme="dark"] body { color-scheme:dark; }
html[data-theme="dark"] { background-color:#0b1f3a; }
@media (max-width:1100px) {
  /* Safari samples the sticky edge to colour its chrome. Backdrop blur
     interferes with that sampling (WebKit bug 319479). Keep the outer
     mobile header opaque and unfiltered, in the normal safe viewport. */
  .site-header { -webkit-backdrop-filter:none; backdrop-filter:none; }
  html:not([data-theme="dark"]) .site-header { background-color:#f7f8fb; color:var(--header-ink); }
  html[data-theme="dark"] .site-header { background-color:#0b1f3a; color:var(--header-ink); }
  html[data-theme="light"] .site-header .site-nav { background-color:#fff; color:var(--header-ink); }
}
