/* Site-wide dark theme with a full-screen laser (Unicorn Studio "Huly Laser", violet base).
   Loaded on every themed page; bg/laser.js adds body.laser. The accent hue (--lh) drifts
   violet -> blue -> teal and back; the laser is hue-rotated to match. Reduced motion = static violet. */

@property --lh { syntax: "<number>"; inherits: true; initial-value: 258; }
:root { --lh: 258; color-scheme: dark; }
@keyframes laser-hue { 0%, 26% { --lh: 258; } 33%, 59% { --lh: 218; } 66%, 92% { --lh: 175; } 100% { --lh: 258; } }
@media (prefers-reduced-motion: no-preference) { :root.laser-cycle { animation: laser-hue 45s ease-in-out infinite; } }

body.laser {
  --accent: hsl(var(--lh) 90% 68%);
  --accent-soft: hsl(var(--lh) 90% 68% / .18);
  --black: #fff; --white: #000; --card: rgba(16, 14, 26, .78); --line: rgba(255, 255, 255, .12);
  --gray: #a1a1aa; --gray-dark: #d4d4d8; --green: var(--accent); --green-dark: var(--accent);
  --shadow: 0 25px 50px -12px rgba(0, 0, 0, .7);
  background: #000 !important; background-image: none !important; color: #fff;
}
body.laser main { background-image: none !important; }
body.laser ::selection { background: var(--accent); color: #000; }

/* the laser layer */
.laser-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  filter: hue-rotate(calc((var(--lh) - 258) * 1deg));
  background: radial-gradient(70% 40% at 50% 100%, rgba(139, 92, 246, .45), transparent 70%),
              linear-gradient(90deg, transparent 49.85%, rgba(139, 92, 246, .6) 50%, transparent 50.15%), #000; }
.laser-bg > [data-us-project-src] { position: absolute; inset: 0; }
.laser-bg::after { content: ""; position: absolute; inset: 0;
  background: radial-gradient(38% 55% at 50% 30%, rgba(0,0,0,.5), transparent 75%),
              linear-gradient(90deg, rgba(0,0,0,.05), rgba(0,0,0,.45) 38%, rgba(0,0,0,.45) 62%, rgba(0,0,0,.05)),
              linear-gradient(rgba(0,0,0,.1), rgba(0,0,0,.4)); }
/* Laser sits BELOW all content: body is its own stacking context, the layer takes z-index -1.
   No blanket position:relative on body children (that broke fixed overlays: dialogs, /talk's gate). */
body.laser { isolation: isolate; }
body.laser > .skip-link { z-index: 9999; }
body.laser .skip-link { background: var(--accent); color: #000; }
body.laser h1, body.laser .sub, body.laser .lead { text-shadow: 0 2px 20px rgba(0,0,0,.8); }

/* glass surfaces: anything that used the light card color */
body.laser .card, body.laser .proof div, body.laser .row, body.laser .callout, body.laser .door, body.laser .svc,
body.laser .d-tier, body.laser .empty, body.laser .post-row, body.laser .note-list a, body.laser .article-cta,
body.laser .pullquote, body.laser article pre, body.laser .prose blockquote {
  background: var(--card); border-color: var(--line); }
/* no backdrop-filter on cards: each blurred card re-blurs the animating laser every frame, which is what made scrolling heavy */
body.laser .svc:hover, body.laser .door:hover, body.laser .post-row:hover, body.laser .note-list a:hover {
  background: rgba(30, 26, 48, .75); border-color: hsl(var(--lh) 90% 68% / .55);
  box-shadow: 0 0 0 1px hsl(var(--lh) 90% 68% / .35), 0 25px 60px -12px hsl(var(--lh) 90% 60% / .5); }
body.laser .card-featured, body.laser .door-featured { border-color: hsl(var(--lh) 90% 68% / .7);
  background-image: linear-gradient(135deg, hsl(var(--lh) 90% 68% / .22), hsl(var(--lh) 90% 68% / .06) 60%, rgba(255,255,255,.04));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 0 0 1px hsl(var(--lh) 90% 68% / .25), 0 30px 70px -20px hsl(var(--lh) 90% 60% / .55); }

/* pills, tags, buttons: no white fills */
body.laser .chip { background: rgba(20,18,30,.7); color: #fff; border: 1px solid rgba(255,255,255,.16); }
body.laser .chip:hover { background: rgba(255,255,255,.14); opacity: 1; }
body.laser .chip[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #000; }
body.laser .tag, body.laser .cat-head .tag, body.laser .post-row-tag { background: rgba(255,255,255,.1); color: #fff; }
body.laser .tile:not(.tile-group) { background: rgba(255,255,255,.08); color: #fff; box-shadow: inset 0 0 0 1px var(--line); }
body.laser .tag-green, body.laser .flag, body.laser .check-icon { background: var(--accent); color: #000; }
body.laser .btn-black, body.laser .apply-submit, body.laser .door-featured .btn, body.laser .article-cta a {
  background: var(--accent); border-color: var(--accent); color: #000; }
body.laser .btn-black:hover, body.laser .door-featured:hover .btn { background: hsl(var(--lh) 90% 76%); }
body.laser .btn-white, body.laser .btn, body.laser .filter, body.laser .close {
  background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.2); color: #fff; }
body.laser .btn-white:hover, body.laser .door:hover .btn, body.laser .filter:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.35); }
body.laser .filter[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #000; }
body.laser .more, body.laser .read-more { color: var(--accent); }

/* bars, fields, dialogs */
body.laser .toolbar { background: rgba(0,0,0,.5); border-color: rgba(255,255,255,.1); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
body.laser input, body.laser select, body.laser textarea { background: rgba(255,255,255,.05) !important; color: #fff; border-color: rgba(255,255,255,.18) !important; }
body.laser input::placeholder, body.laser textarea::placeholder { color: rgba(255,255,255,.45); }
body.laser select option, body.laser select optgroup { background: #111; color: #fff; }
body.laser dialog { background: rgba(10, 9, 18, .92); border-color: rgba(255,255,255,.14); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
body.laser .apply-form-error { background: rgba(185, 28, 28, .15); border-color: rgba(248, 113, 113, .4); color: #fca5a5; }
body.laser .apply-form-note:not(:empty).err, body.laser #formerr:not(:empty) { color: #fca5a5; }
body.laser .form-group [aria-invalid="true"] { border-color: #f87171 !important; box-shadow: 0 0 0 1px #f87171; }
body.laser .faq-item summary::after { color: rgba(255,255,255,.6); }
body.laser a:focus-visible, body.laser button:focus-visible, body.laser summary:focus-visible,
body.laser input:focus-visible, body.laser select:focus-visible, body.laser textarea:focus-visible { outline-color: var(--accent); }

/* long reads (blog posts and daily notes) sit on a dark glass panel so the beam never runs under body text */
body.laser main article { background: rgba(8, 7, 14, .62); border: 1px solid var(--line); border-radius: 12px; padding: 22px 20px;
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }

/* ── Glass outlines on cards ───────────────────────────────────────── */
body.laser .card, body.laser .proof div, body.laser .row, body.laser .callout, body.laser .door, body.laser .svc,
body.laser .d-tier, body.laser .empty, body.laser .post-row, body.laser .note-list a, body.laser .article-cta, body.laser main article {
  background-image: linear-gradient(135deg, rgba(255,255,255,.09), rgba(255,255,255,.02) 55%, rgba(255,255,255,.05));
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), inset 0 0 0 1px rgba(255,255,255,.03), 0 20px 50px -20px rgba(0,0,0,.8); }
body.laser .svc:hover, body.laser .door:hover, body.laser .post-row:hover, body.laser .note-list a:hover {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 0 0 1px hsl(var(--lh) 90% 68% / .45), 0 25px 60px -12px hsl(var(--lh) 90% 60% / .5); }

/* ── Specular buttons (ReactBits "Specular Button", rebuilt without React/OGL) ──
   Glass body, static edge stroke, and a thin light streak on the edge that points at the
   cursor and fades in within 250px. Touch devices get a slow automatic sweep instead. */
@property --sa { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@property --si { syntax: "<number>"; inherits: false; initial-value: 0; }
body.laser .spec { position: relative; isolation: isolate; overflow: visible; border-radius: 18px;
  background: rgba(20,18,30,.72); border: 1px solid rgba(255,255,255,.22); color: #f5f5f5; transition: background .2s, border-color .2s; }
body.laser .spec.spec-primary { background: hsl(var(--lh) 90% 68% / .2); border-color: hsl(var(--lh) 90% 70% / .45); color: #fff; }
body.laser .spec:hover { background: rgba(255,255,255,.12); }
body.laser .spec.spec-primary:hover { background: hsl(var(--lh) 90% 68% / .3); }
body.laser .spec::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; pointer-events: none; z-index: 1;
  background: conic-gradient(from calc(var(--sa) - 30deg), transparent 0deg, var(--spec-line, #fff) 30deg, transparent 60deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: var(--si); filter: drop-shadow(0 0 4px var(--spec-line, #fff)); }
body.laser .spec.spec-primary { --spec-line: hsl(var(--lh) 95% 80%); }
body.laser .spec > * { position: relative; z-index: 2; }
body.laser .close.spec { position: absolute; border-radius: 9999px; }
@media (hover: none) and (prefers-reduced-motion: no-preference) {
  body.laser .spec { --si: .9; animation: spec-sweep 4s linear infinite; }
  @keyframes spec-sweep { to { --sa: 360deg; } }
}
@media (prefers-reduced-motion: reduce) { body.laser .spec::before { display: none; } }

/* ── Stroke wordmark (ReactBits "Stroke Text", rebuilt as inline SVG) ──
   Each letter's outline draws on, staggered, then the fill floods in. "thomas" takes the accent. */
body.laser a.brand svg { display: block; overflow: visible; }
body.laser a.brand text { font-family: var(--font); font-weight: 700; }
body.laser a.brand tspan { fill: #fff; fill-opacity: 0; stroke: #fff; stroke-width: 1.4; stroke-linejoin: round;
  stroke-dasharray: 340; stroke-dashoffset: 340; paint-order: stroke fill; }
body.laser a.brand tspan.accent { fill: var(--accent); stroke: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  body.laser a.brand tspan { animation: brand-draw 1.6s cubic-bezier(.2,.7,.2,1) forwards, brand-fill .6s ease forwards; animation-delay: calc(var(--i) * .05s), calc(1.5s + var(--i) * .05s); }
}
@media (prefers-reduced-motion: reduce) { body.laser a.brand tspan { stroke-dashoffset: 0; fill-opacity: 1; stroke-width: 0; } }
@keyframes brand-draw { to { stroke-dashoffset: 0; } }
@keyframes brand-fill { to { fill-opacity: 1; stroke-width: 0; } }

/* dropdowns: no native OS chrome */
body.laser select { -webkit-appearance: none; appearance: none; padding-right: 30px !important;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%23ffffff' stroke-width='1.6' stroke-linecap='round'/></svg>") !important;
  background-repeat: no-repeat !important; background-position: right 10px center !important; background-size: 12px 8px !important; }

/* thumb-sized targets: nav chips, social icons, footer links */
body.laser .chip { min-height: 36px; padding: 4px 16px; }
body.laser .footer-links a, body.laser .foot a { display: inline-block; padding: 10px 6px; min-height: 40px; }
@media (max-width: 640px) { body.laser .chip { min-height: 40px; min-width: 44px; justify-content: center; } }
body.laser .footer-links a { min-width: 44px; text-align: center; }

/* icon-only social row in every footer */
.social { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.social .soc { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 9999px; color: #fff; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.16); transition: background .15s, border-color .15s, color .15s; }
.social .soc:hover { background: hsl(var(--lh) 90% 68% / .25); border-color: hsl(var(--lh) 90% 68% / .6); }
.social .soc svg { display: block; }
