/* =============================================================================
   Stryx Skills: the shared page layer (2026-10-14, the earlier night look; now the glass world).
   Tokens live in /assets/css/tokens.css (load it first). This file holds no literal colour.

   Layers, back to front:
     html::before   the meadow plate: night sky, the forest's tree line, the grass (a picture of the local GPU)
     canvas.glow    the old light canvas (retired 2026-10-14)
     main           the words
   ========================================================================== */

/* one colour per group of skills: --g is text-safe, --g-mark is the bright light of its swarm */
[data-group="plan"]      { --g: var(--color-ember); --g-mark: var(--mark-rust); }
[data-group="quality"]   { --g: var(--color-teal);  --g-mark: var(--mark-teal); }
[data-group="design"]    { --g: var(--color-plum);  --g-mark: var(--mark-plum); }
[data-group="languages"] { --g: var(--color-blue);  --g-mark: var(--mark-blue); }
[data-group="web"]       { --g: var(--color-green); --g-mark: var(--mark-green); }
[data-group="writing"]   { --g: var(--color-rose);  --g-mark: var(--mark-rose); }
[data-group="workflow"]  { --g: var(--color-amber); --g-mark: var(--mark-amber); }
[data-group="modes"]     { --g: var(--color-slate); --g-mark: var(--mark-slate); }

/* resolution tiers: the whole layout is in rem, so one number scales it (HD to 5K) */
html { font-size: 100%; }
@media (min-width: 1920px) { html { font-size: 106.25%; } }
@media (min-width: 2560px) { html { font-size: 125%; } }
@media (min-width: 3200px) { html { font-size: 150%; } }
@media (min-width: 3840px) { html { font-size: 200%; } }
@media (min-width: 5120px) { html { font-size: 250%; } }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-padding-top: calc(var(--topnav-h) + 1.5rem); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--color-paper); scrollbar-color: var(--color-line-strong) var(--color-paper); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
html, body { min-height: 100svh; }
body {
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: 1.6;
  color: var(--color-ink-soft);
  background: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.012em;   /* the Display cut of the text face sets tight at reading sizes: open it a little */
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

/* ---------- the meadow: the sky first (paints at once), the plate over it when it has loaded ---------- */
html::before, html::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: -2; }
html::before {
  background:
    var(--meadow-plate) center bottom / cover no-repeat,
    radial-gradient(80% 50% at 70% 72%, var(--night-violet), transparent 70%),
    linear-gradient(180deg, var(--night-zenith) 0%, var(--night-mid) 55%, var(--night-horizon) 78%, var(--color-paper-deep) 100%);
}
/* the reading veil: a little more night on the left, where the words stand */
html::after { z-index: -1; background: linear-gradient(90deg, var(--glass-fill) 0%, transparent 58%); }
/* the plate, picked by the real pixels across the screen (set only when the file exists) */
html.has-plate { --meadow-plate: image-set(url('/assets/meadow/meadow-1920.avif') type('image/avif'), url('/assets/meadow/meadow-1920.webp') type('image/webp')); }
@media (min-width: 2000px), (min-width: 1300px) and (min-resolution: 1.4dppx) {
  html.has-plate { --meadow-plate: image-set(url('/assets/meadow/meadow-3840.avif') type('image/avif'), url('/assets/meadow/meadow-3840.webp') type('image/webp')); }
}
@media (min-width: 4000px), (min-width: 3000px) and (min-resolution: 1.4dppx) {
  html.has-plate { --meadow-plate: image-set(url('/assets/meadow/meadow-5120.avif') type('image/avif'), url('/assets/meadow/meadow-5120.webp') type('image/webp')); }
}
@media (max-width: 700px) and (orientation: portrait) {
  html.has-plate { --meadow-plate: image-set(url('/assets/meadow/meadow-phone.avif') type('image/avif'), url('/assets/meadow/meadow-phone.webp') type('image/webp')); }
  html::after { background: linear-gradient(180deg, transparent 0%, var(--glass-fill) 70%); }
}

/* the old light canvas: fixed, behind the words, never takes a pointer */
canvas.glow { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 1200ms var(--ease-premium); }
canvas.glow.is-on { opacity: 1; }
@media print { html::before, html::after, canvas.glow { display: none; } }
@media (forced-colors: active) { html::before, html::after, canvas.glow { display: none; } }

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--glow); color: var(--color-paper); }
:focus-visible { outline: 2px solid var(--glow); outline-offset: 3px; border-radius: 0.5rem; }
main:focus { outline: none; }
main { display: block; padding-top: var(--topnav-h); position: relative; z-index: 2; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* the shared header in the site's own type */
html .stryx-topnav { font-family: var(--font-sans); }
html .stryx-topnav__links a { letter-spacing: 0.1em; }

/* ---------- the grid ---------- */
.wrap { width: min(100% - 2 * var(--gutter), 84rem); margin-inline: auto; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); }
.section { padding-block: var(--section); }
.section--tight { padding-block: calc(var(--section) * 0.6); }

/* ---------- type levels ---------- */
.display, .h2, .h3 { font-family: var(--font-serif); color: var(--color-ink); font-weight: 400; text-wrap: balance; text-shadow: var(--halo); }
.display { font-size: var(--t-display); line-height: 0.98; letter-spacing: -0.02em; }
.h2 { font-size: var(--t-h2); line-height: 1.04; letter-spacing: -0.015em; }
.h3 { font-size: var(--t-h3); line-height: 1.15; letter-spacing: -0.008em; }
.display em, .h2 em, .h3 em { font-style: italic; color: var(--color-rust); }
/* the signature phrase: warm light on one italic phrase per page */
.aurora-text {
  font-style: italic;
  background: var(--gradient-aurora);
  -webkit-background-clip: text; background-clip: text; /* design-detect: allow gradient-text the one signature phrase per page; every stop is 14 to 1 or more on the night ground */
  -webkit-text-fill-color: transparent; color: transparent;
  text-shadow: none;
  padding-inline-end: 0.06em;
}
@media (forced-colors: active) { .aurora-text { -webkit-text-fill-color: CanvasText; color: CanvasText; background: none; } }
.lede { font-size: var(--t-lede); line-height: 1.55; color: var(--color-ink-soft); max-inline-size: 58ch; text-shadow: var(--halo-small); }
.lede a, .prose a { color: var(--color-rust); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.lede a:hover, .prose a:hover { text-decoration-thickness: 2px; }
.kicker {
  display: inline-flex; align-items: center; gap: 0.75rem;
  font-family: var(--font-sans); font-size: var(--t-micro); font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--color-ink-soft); text-shadow: var(--halo-small);
}
.kicker .dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--g-mark, var(--glow)); box-shadow: 0 0 0.6rem var(--g-mark, var(--glow)); flex-shrink: 0; }
.kicker .ord { color: var(--g, var(--color-rust)); font-weight: 500; }
.mono { font-family: var(--font-mono); }
.num { font-variant-numeric: tabular-nums lining-nums; }

/* ---------- glass sheet: dense reading sits on it ---------- */
.sheet {
  background: var(--glass-fill);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  backdrop-filter: blur(16px) saturate(120%);
  box-shadow: 0 1.5rem 3.75rem -2rem var(--glass-shadow), inset 0 1px 0 var(--glass-shine);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .sheet { background: var(--glass-fill-strong); } }
@media (forced-colors: active) { .sheet { border: 1px solid CanvasText; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.625rem;
  min-height: 3rem; padding: 0 1.5rem;
  font-family: var(--font-sans); font-size: 0.875rem; font-weight: 500; letter-spacing: 0.06em; text-decoration: none; white-space: nowrap;
  color: var(--color-ink); background: var(--glass-fill); border: 1px solid var(--color-control-line); border-radius: 999px; cursor: pointer;
  transition: background-color var(--duration-normal) ease, color var(--duration-normal) ease, border-color var(--duration-normal) ease, transform 100ms ease;
}
.btn:hover { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-paper); }
.btn:active { transform: scale(0.98); }
.btn--primary { background: var(--glow); border-color: var(--glow); color: var(--color-paper); }
.btn--primary:hover { background: var(--glow-core); border-color: var(--glow-core); color: var(--color-paper); }
.btn--brand { background: var(--gradient-brand); border: 0; color: var(--color-on-brand); }
.btn--brand:hover { background: var(--gradient-brand); color: var(--color-on-brand); transform: translateY(-1px); }
.btn .arrow { transition: transform var(--duration-normal) var(--ease-premium); }
.btn:hover .arrow { transform: translateX(0.2rem); }
.btn:hover .arrow--down { transform: translateY(0.2rem); }
.btn-row { display: flex; flex-wrap: wrap; gap: 1rem; }

/* ---------- commands with a copy button ---------- */
.cmds { display: grid; gap: 1rem; }
.cmd {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 1rem; row-gap: 0.5rem;
  padding: 1.25rem 1.25rem 1.25rem 1.5rem;
  background: var(--code-bg); color: var(--code-ink); border: 1px solid var(--glass-line); border-radius: var(--radius-inner);
}
.cmd__label { grid-column: 1 / -1; font-family: var(--font-sans); font-size: var(--t-micro); font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--code-label); }
.cmd__code { font-family: var(--font-mono); font-size: var(--t-small); line-height: 1.6; overflow-x: auto; white-space: nowrap; padding-block: 0.25rem; scrollbar-width: thin; min-width: 0; }
.cmd__code:focus-visible { outline-color: var(--code-ink); }
.cmd .pr { color: var(--code-prompt); user-select: none; margin-right: 0.5rem; }
.cmd .arg { color: var(--code-arg); }
.cmd .url { color: var(--code-url); }
.cmd__copy {
  min-height: 2.75rem; min-width: 5.5rem; padding: 0 1rem;
  font-family: var(--font-sans); font-size: var(--t-micro); font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--code-ink); background: transparent; border: 1px solid var(--code-label); border-radius: 999px; cursor: pointer;
  transition: background-color var(--duration-normal) ease, color var(--duration-normal) ease, transform 100ms ease;
}
.cmd__copy:hover { background: var(--code-ink); color: var(--code-bg); }
.cmd__copy:active { transform: scale(0.97); }
.cmd__copy:focus-visible { outline-color: var(--code-ink); }
.cmd__copy[data-state="done"] { background: var(--code-prompt); border-color: var(--code-prompt); color: var(--code-bg); }
html:not(.js) .cmd__copy { display: none; }

/* the one install: the whole set, one command (every page that offers it uses this block) */
.get { display: grid; gap: 1rem; }
.get__line { font-size: var(--t-small); color: var(--color-ink-soft); text-shadow: var(--halo-small); }
.get__line b { color: var(--color-ink); font-weight: 500; }

/* ---------- footer ---------- */
.foot { position: relative; z-index: 2; border-top: 1px solid var(--color-line); padding-block: 3rem 6rem; background: linear-gradient(180deg, transparent, var(--color-paper-deep)); }
.foot__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2rem var(--gap); }
.foot__brand { grid-column: span 4; }
.foot__col { grid-column: span 2; }
.foot__col--wide { grid-column: span 4; }
.foot h2 { font-family: var(--font-sans); font-size: var(--t-micro); font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--color-ink-mute); margin-bottom: 0.75rem; }
.foot ul { list-style: none; display: grid; gap: 0.25rem; }
.foot a { display: inline-flex; align-items: center; min-height: 2rem; font-size: var(--t-small); color: var(--color-ink); text-decoration: none; }
.foot a:hover { color: var(--color-rust); text-decoration: underline; text-underline-offset: 0.2em; }
.foot__name { font-family: var(--font-serif); font-size: var(--t-h3); color: var(--color-ink); line-height: 1.1; }
.foot__name em { font-style: italic; color: var(--color-rust); }
.foot__note { margin-top: 0.75rem; font-size: var(--t-small); color: var(--color-ink-mute); max-inline-size: 36ch; }
@media (max-width: 900px) { .foot__brand, .foot__col--wide { grid-column: 1 / -1; } .foot__col { grid-column: span 6; } }

/* ---------- fixed helpers: scroll progress, the pause button ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 96; pointer-events: none; background: var(--gradient-aurora); transform-origin: left center; transform: scaleX(0); }
.fly-toggle {
  position: fixed; left: 1rem; bottom: 1rem; z-index: 60;   /* left: the shared sound player (sound.js) owns the bottom right */
  display: none; align-items: center; gap: 0.5rem; min-height: 2.75rem; padding: 0 1rem;
  font-family: var(--font-sans); font-size: var(--t-micro); font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--color-ink); background: var(--glass-fill-strong); border: 1px solid var(--color-control-line); border-radius: 999px; cursor: pointer;
  transition: background-color var(--duration-normal) ease, color var(--duration-normal) ease;
}
.fly-toggle.is-ready { display: inline-flex; }
.fly-toggle:hover { background: var(--color-ink); color: var(--color-paper); }
.fly-toggle__icon { width: 0.625rem; height: 0.75rem; border-inline: 0.1875rem solid currentColor; }
.fly-toggle[aria-pressed="true"] .fly-toggle__icon { width: 0; height: 0; border-inline: 0; border-left: 0.625rem solid currentColor; border-block: 0.375rem solid transparent; }
@media (max-width: 700px) {
  .fly-toggle { width: 2.75rem; padding: 0; justify-content: center; left: 0.75rem; bottom: 0.75rem; }
  .fly-toggle__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* ---------- motion: blocks enter once; the first screen arrives once ---------- */
@media (prefers-reduced-motion: no-preference) {
  html.js .reveal { opacity: 0; transform: translateY(1.5rem); transition: opacity 700ms var(--ease-premium), transform 700ms var(--ease-premium); transition-delay: var(--d, 0ms); }
  html.js .reveal.in { opacity: 1; transform: none; }
  html.js .arrive { animation: arrive var(--duration-scene) var(--ease-premium) both; animation-delay: var(--d, 0ms); }
}
@keyframes arrive { from { opacity: 0; transform: translateY(0.4em); } to { opacity: 1; transform: none; } }
.d1 { --d: 120ms; } .d2 { --d: 240ms; } .d3 { --d: 380ms; } .d4 { --d: 520ms; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

@media print {
  html { background: none; }
  body { background: none; color: CanvasText; }
  .progress, .fly-toggle, canvas.glow, .stryx-topnav { display: none; }
}
