/* Universal critical CSS — covers above-the-fold for every template so the
   rest of the stylesheets can be deferred without FOUC. Kept small (≈3KB)
   and limited to what visible-without-scroll usually needs: reset, body,
   headings, container, header chrome, nav, hero shell, link colour. */

*,*::before,*::after{box-sizing:border-box}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
html,body{margin:0;padding:0;line-height:1.5;color:#0f172a;background:#fff;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,sans-serif}
body{min-height:100vh;display:flex;flex-direction:column;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased}
main{flex:1}
img,picture,video,canvas,svg{max-width:100%;height:auto;display:block}
img{vertical-align:middle}
a{color:#2563eb;text-decoration:none;background:transparent}
a:hover{text-decoration:underline}
button,input,select,textarea{font:inherit;color:inherit}
h1,h2,h3,h4,h5,h6{margin:0 0 .5em;line-height:1.2;font-weight:700;color:inherit}
h1{font-size:clamp(1.75rem,1.3rem+1.6vw,2.5rem)}
h2{font-size:clamp(1.4rem,1.15rem+1.0vw,1.875rem)}
h3{font-size:clamp(1.15rem,1.05rem+.5vw,1.4rem)}
p{margin:0 0 1em}
small{font-size:.875em}
hr{border:0;border-top:1px solid #e5e7eb;margin:1em 0}
.container{width:100%;max-width:1200px;margin-inline:auto;padding-inline:1rem}
.skip{position:absolute;left:-9999px;top:0;background:#0f172a;color:#fff;padding:8px 12px;z-index:9999;border-radius:0 0 6px 0}
.skip:focus{left:0}
[hidden]{display:none!important}
.hp-hidden{position:absolute;left:-9999px;top:-9999px;width:1px;height:1px;overflow:hidden;opacity:0;pointer-events:none}
.ab-cap-overlay{position:fixed;inset:0;background:rgba(15,23,42,.6);display:flex;align-items:center;justify-content:center;z-index:9999;padding:1rem}
.ab-cap-overlay[hidden]{display:none}
.ab-cap-box{background:#fff;color:#0f172a;border-radius:12px;padding:24px;max-width:380px;width:100%;box-shadow:0 20px 50px rgba(0,0,0,.3)}
.ab-cap-box h3{margin:0 0 12px;font-size:1.25rem}
.ab-cap-box .ab-cap-msg{margin:0 0 8px;color:#475569;font-size:.95rem}
.ab-cap-box .ab-cap-q{margin:0 0 12px;font-size:1.5rem;font-weight:700;text-align:center;background:#f1f5f9;padding:12px;border-radius:8px}
.ab-cap-box .ab-cap-input{width:100%;padding:10px;border:1px solid #cbd5e1;border-radius:6px;font-size:1rem}
.ab-cap-box .ab-cap-buttons{margin-top:14px;display:flex;gap:8px;justify-content:flex-end}

/* Generic header/footer/nav scaffolding — colours come from theme CSS later */
.gh-head,.site-header,.ws-head,.ml-head{position:sticky;top:0;z-index:40;backdrop-filter:blur(12px);transition:background .2s ease}
header .container,header > div{display:flex;align-items:center;justify-content:space-between}
nav a{display:inline-block;padding:.4em .6em}

/* Hero shell — most templates use a tall image-block at the top */
.gh-hero,.hero,.ml-hero{position:relative;min-height:280px;overflow:hidden}
.gh-hero-bg,.hero-bg{position:absolute;inset:0;z-index:0}
.gh-hero-content,.hero-content{position:relative;z-index:1}

/* Page-grid: feed cards / sections rendered as grid */
.gh-feed,.ws-grid,.ml-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:24px}

/* CSS-only fallback for prefers-color-scheme: covers the no-data-theme race */
@media (prefers-color-scheme: dark){
  html:not([data-theme]),html:not([data-theme]) body{background:#111827;color:#e5e7eb}
  html:not([data-theme]) a{color:#60a5fa}
  html:not([data-theme]) hr{border-top-color:#374151}
}

*, *::before, *::after { box-sizing: border-box; }

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 9999;
  padding: 10px 14px;
  border-radius: 10px;
}
.skip:focus { left: 16px; }

.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .5s ease, transform .5s ease;
}
.reveal.is-visible,
.reveal.in-view,
.reveal.is-in,
.reveal.in {
  opacity: 1;
  transform: none;
}

.hidden { display: none !important; }

.snippet-list { margin: 1rem 0; }
.snippet-block {
  border: 1px solid var(--w-border, #e2e8f0);
  border-radius: 12px;
  background: var(--w-surface, #f8fafc);
  padding: 14px;
  margin: 12px 0;
}
.snippet-testimonial blockquote { margin: 0 0 .5rem; font-style: italic; }
.snippet-testimonial figcaption { font-weight: 600; }
.snippet-testimonial .snippet-role { margin-left: .4rem; color: var(--w-muted, #64748b); font-weight: 500; }
.snippet-portfolio-item img,
.snippet-album img,
.snippet-video video {
  width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
}
.snippet-portfolio-item h3,
.snippet-album h3,
.snippet-video h3 { margin: .3rem 0 .35rem; }
.snippet-portfolio-item p,
.snippet-album p,
.snippet-video p {
  margin: 0;
  color: var(--w-secondary, #64748b);
}
.snippet-album-grid {
  margin-top: .7rem;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.snippet-link-wrap { text-decoration: none; color: inherit; display: block; }

:root {
  --w-primary: #2563eb;
  --w-secondary: #64748b;
  --w-bg: #ffffff;
  --w-text: #1e293b;
  --w-accent: #3b82f6;
  --w-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --w-font-heading: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --w-header-bg: #ffffff;
  --w-header-text: #1e293b;
  --w-footer-bg: #f8fafc;
  --w-footer-text: #64748b;
  --w-border: #e2e8f0;
  --w-surface: #f8fafc;
  --w-muted: #94a3b8;
  --w-nav-hover: #2563eb;
  --w-primary: #1e293b;
  --w-accent: #f59e0b;
  --docs-bg: var(--w-bg, #ffffff);
  --docs-fg: var(--w-text, #0f172a);
  --docs-muted: var(--w-muted, #64748b);
  --docs-border: var(--w-border, #e5e7eb);
  --docs-surface: var(--w-surface, #f8fafc);
  --docs-link: var(--w-accent, #2563eb);
  --docs-accent: var(--w-primary, #7c3aed);
  --docs-font: var(--w-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif);
  --docs-font-heading: var(--w-font-heading, Georgia, "Times New Roman", serif);
}
