/* ShieldTech — craft layer. Loaded last in <helmet> on every page.
   Changes NO colors, fonts, or grid structure. It refines the things that
   separate a studio site from a template: optical typography, hairline
   surfaces, honest elevation, restrained hover physics, and section indexing. */

/* ── 1. OPTICAL TYPOGRAPHY ─────────────────────────────────────────────── */
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
body { font-feature-settings: "kern" 1, "liga" 1, "calt" 1; font-variant-ligatures: common-ligatures; }

/* display sizes get tighter tracking + real optical alignment */
h1, h2 { text-wrap: balance; font-feature-settings: "kern" 1, "liga" 1, "ss01" 1; }
h1 { letter-spacing: -0.028em !important; }
h2 { letter-spacing: -0.022em !important; }
h3, h4 { letter-spacing: -0.012em !important; text-wrap: balance; }

/* body copy: capped measure and a hanging-friendly rhythm */
main p { text-wrap: pretty; }
main p:not([style*="max-width"]) { max-width: 74ch; }

/* numerals in data/metadata contexts align in columns */
[style*="IBM Plex Mono"], time, td, th { font-variant-numeric: tabular-nums; }

/* mono metadata reads as engineering notation, not shouting */
[style*="IBM Plex Mono"] { font-feature-settings: "kern" 1; }

/* ── 2. HAIRLINE SURFACES + HONEST ELEVATION ───────────────────────────── */
/* one hairline, one inner highlight — no double borders, no heavy shadows */
main [style*="border-radius: 18px"],
main [style*="border-radius: 16px"],
main [style*="border-radius: 20px"],
main article, main figure {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.045), 0 1px 2px rgba(0,0,0,0.4);
}

/* borders thin out to true hairlines on high-DPI screens */
@media (min-resolution: 1.5dppx) {
  main [style*="border: 1px solid rgba(255, 255, 255"] { border-width: 0.5px; }
}

/* ── 3. HOVER PHYSICS — one system, everywhere ─────────────────────────── */
/* Transitions belong to things that actually respond. A blanket selector here is
   what made every panel on the site twitch under the cursor. */
main a[href], main button, main summary,
main a[href] [style*="border-radius: 18px"] {
  transition: transform .34s cubic-bezier(.2,.7,.2,1),
              border-color .34s cubic-bezier(.2,.7,.2,1),
              box-shadow .34s cubic-bezier(.2,.7,.2,1),
              background-color .34s cubic-bezier(.2,.7,.2,1),
              color .2s ease;
}
/* Static cards still get a quiet border/shadow response — but they never move. */
main article, main details,
main [style*="border-radius: 18px"], main [style*="border-radius: 16px"] {
  transition: border-color .34s cubic-bezier(.2,.7,.2,1),
              box-shadow .34s cubic-bezier(.2,.7,.2,1),
              color .2s ease;
}
@media (hover: hover) and (min-width: 769px) {
  /* ONLY clickable things lift: links with an href, and buttons. */
  main a[href]:hover, main button:not([disabled]):hover {
    transform: translateY(-2px);
  }
  /* A clickable card also warms its border and casts. */
  main a[href]:hover, main a[href]:hover > [style*="border-radius: 18px"] {
    border-color: rgba(92,184,255,0.28) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.07), 0 12px 34px rgba(0,0,0,0.5);
  }
  /* Non-interactive cards: border only, no movement, no shadow bloom. */
  main article:not(:has(a[href])):hover,
  main [style*="border-radius: 18px"]:not(:has(a[href])):not(a):not(button):hover {
    border-color: rgba(92,184,255,0.2) !important;
  }
  /* primary buttons compress rather than float — reads as physical */
  main a[style*="linear-gradient(135deg, rgb(0, 112, 248)"]:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(0,112,248,0.42); }
  main a[style*="linear-gradient(135deg, rgb(0, 112, 248)"]:active { transform: translateY(0) scale(0.994); }
}
@media (prefers-reduced-motion: reduce) {
  main a[href]:hover, main button:hover { transform: none !important; }
}

/* ── 4. LINKS: underline as a considered detail ───────────────────────── */
main p a, main li a {
  color: #9fd0ff;
  text-decoration: underline;
  text-decoration-color: rgba(159,208,255,0.32);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
main p a:hover, main li a:hover { text-decoration-color: #9fd0ff; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 1.5px solid #5cb8ff; outline-offset: 3px; border-radius: 4px;
}

/* ── 5. SECTION INDEXING — the studio-portfolio detail ─────────────────── */
main { counter-reset: shieldsec; }
main > section[data-screen-label] { position: relative; counter-increment: shieldsec; }
@media (min-width: 1500px) {
  main > section[data-screen-label]::before {
    content: counter(shieldsec, decimal-leading-zero);
    position: absolute; left: clamp(8px, 1.1vw, 18px); top: 46px;
    font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 1.5px;
    color: rgba(159,208,255,0.26); pointer-events: none; user-select: none;
  }
}

/* ── 6. SECTION SEAMS — hairline, not a slab ──────────────────────────── */
main > section + section[style*="border-top: 1px solid"] { border-top-color: rgba(255,255,255,0.055) !important; }

/* ── 7. FORMS: field craft ─────────────────────────────────────────────── */
input, select, textarea { transition: border-color .25s ease, background-color .25s ease, box-shadow .25s ease; }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px rgba(92,184,255,0.12); }
::placeholder { color: rgba(163,174,190,0.5); }

/* ── 8. SELECTION + SCROLLBAR ─────────────────────────────────────────── */
::selection { background: rgba(92,184,255,0.26); color: #f6f9ff; }
@media (min-width: 769px) {
  * { scrollbar-width: thin; scrollbar-color: rgba(92,184,255,0.28) transparent; }
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: rgba(92,184,255,0.22); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
  ::-webkit-scrollbar-thumb:hover { background: rgba(92,184,255,0.4); background-clip: content-box; }
}

/* ── 9. FIGURES: canvases sit flush, never letterboxed ────────────────── */
main figure canvas, main figure video, main figure img { display: block; }

/* ── 10. MOTION RESPECT ───────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
