/* ==========================================================================
   DeLaViaTH — design system
   Replaces Bootstrap. ~4 KB gzipped instead of 220 KB, no alpha-channel CDN.
   ========================================================================== */

:root {
  color-scheme: dark;

  --bg: #0b0e14;
  --bg-elevated: #121722;
  --bg-sunken: #080a10;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);

  --fg: #e8eef8;
  --fg-muted: #96a2b8;
  --fg-dim: #6b7688;

  --accent: #78aaff;
  --accent-strong: #4d8bff;
  --accent-contrast: #05070c;
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;

  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px -12px rgba(0, 0, 0, 0.7);
  --shadow-accent: 0 0 0 1px rgba(120, 170, 255, 0.35), 0 18px 50px -18px rgba(120, 170, 255, 0.45);

  --container: 1080px;
  --nav-height: 64px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* --------------------------------------------------------------- reset --- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 24px);
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.96rem + 0.18vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* NOTE: the old site had `overflow-y: hidden` here, which silently clipped
     every page taller than the viewport (phones, 120% zoom, landscape). */
  overflow-x: hidden;
}

/* Ambient background so pages never look like a flat empty canvas. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60rem 60rem at 12% -10%, rgba(77, 139, 255, 0.16), transparent 60%),
    radial-gradient(48rem 48rem at 105% 8%, rgba(120, 170, 255, 0.1), transparent 62%);
  pointer-events: none;
}

img,
picture,
svg,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.5em;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 1.5rem + 2.6vw, 3.35rem);
}

h2 {
  font-size: clamp(1.45rem, 1.25rem + 1vw, 2rem);
}

h3 {
  font-size: clamp(1.125rem, 1.05rem + 0.4vw, 1.3rem);
}

p {
  margin: 0 0 1rem;
  text-wrap: pretty;
}

a {
  color: var(--accent);
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-underline-offset: 3px;
  transition: color 0.15s var(--ease), text-decoration-color 0.15s var(--ease);
}

a:hover {
  color: var(--fg);
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

code,
kbd,
pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code {
  padding: 0.15em 0.4em;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
}

hr {
  height: 1px;
  margin: 2.5rem 0;
  border: 0;
  background: var(--border);
}

::selection {
  background: rgba(120, 170, 255, 0.3);
  color: #fff;
}

/* ----------------------------------------------------------- utilities --- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 4vw, 2rem);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0;
  left: 50%;
  translate: -50% -120%;
  z-index: 200;
  padding: 0.7rem 1.2rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
  text-decoration: none;
  transition: translate 0.18s var(--ease);
}

.skip-link:focus-visible {
  translate: -50% 0;
  color: var(--accent-contrast);
}

.eyebrow {
  display: block;
  margin-bottom: 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.lede {
  font-size: clamp(1.05rem, 1rem + 0.35vw, 1.25rem);
  color: var(--fg-muted);
  max-width: 62ch;
}

.muted {
  color: var(--fg-muted);
}

.text-center {
  text-align: center;
}

.stack > * + * {
  margin-top: var(--stack-gap, 1rem);
}

/* ---------------------------------------------------------------- nav --- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.site-nav[data-scrolled="true"] {
  border-bottom-color: var(--border);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}

.site-nav__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--nav-height);
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 4vw, 2rem);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-decoration: none;
  white-space: nowrap;
}

.brand:hover {
  color: var(--fg);
}

.brand__mark {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--border-strong);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
}

.nav-toggle:hover {
  background: var(--surface-hover);
}

.nav-toggle__bars {
  display: grid;
  gap: 4px;
  justify-items: center;
}

.nav-toggle__bars span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  color: var(--fg-muted);
  font-size: 0.93rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s var(--ease), background-color 0.15s var(--ease);
}

.nav-links a:hover {
  color: var(--fg);
  background: var(--surface);
}

.nav-links a[aria-current="page"] {
  color: var(--fg);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
}

.nav-links .external::after {
  content: " ↗";
  font-size: 0.85em;
  color: var(--fg-dim);
}

@media (max-width: 760px) {
  .nav-toggle {
    display: grid;
    place-items: center;
  }

  .nav-links {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    margin: 0;
    padding: 0.6rem clamp(1.15rem, 4vw, 2rem) 1rem;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }

  .nav-links[data-open="false"] {
    display: none;
  }

  .nav-links a {
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
  }
}

/* -------------------------------------------------------------- hero --- */

.hero {
  position: relative;
  padding-block: clamp(2.5rem, 6vw, 5rem) clamp(2rem, 5vw, 4rem);
  overflow-x: clip;
}

/* ==========================================================================
   Site-wide background video.

   Fixed to the viewport, so it stays visible on every page and at every scroll
   position instead of scrolling away with the hero.

   Layer order, back to front:

     1  .site-bg__wash   animated golden-hour gradient, pure CSS, no payload
     2  .site-bg__video  the YouTube embed (muted, looping, autoplay)
     3  .site-bg::after  contrast veil, keeps body text readable over the video

   "Golden Hour" by BlueSkyWhaler, via youtube-nocookie.com.
   ========================================================================== */

.site-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  /* Own compositing layer: the fixed iframe never repaints while scrolling.
     layout+paint rather than `strict`, so the element still gets its size from
     the inset box instead of relying on size containment. */
  contain: layout paint;
  /* Promote once, up front, instead of letting the compositor decide. */
  transform: translateZ(0);
}

/* --- 1: animated golden-hour wash --------------------------------------- */

.site-bg__wash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(42rem 30rem at 22% 78%, rgba(255, 176, 84, 0.34), transparent 68%),
    radial-gradient(38rem 28rem at 82% 24%, rgba(255, 214, 138, 0.26), transparent 66%),
    radial-gradient(34rem 26rem at 52% 112%, rgba(255, 126, 72, 0.24), transparent 70%);
  animation: site-bg-drift 34s ease-in-out infinite alternate;
  will-change: transform;
}

/* A second, slower pass at a different angle keeps the motion from looking like
   one big sliding layer. */
.site-bg__wash::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(30rem 24rem at 68% 62%, rgba(120, 170, 255, 0.16), transparent 70%),
    radial-gradient(26rem 20rem at 12% 18%, rgba(255, 196, 120, 0.18), transparent 68%);
  animation: site-bg-drift-alt 52s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes site-bg-drift {
  from {
    transform: translate3d(-2%, 1%, 0) scale(1.05);
  }

  to {
    transform: translate3d(3%, -2%, 0) scale(1.12);
  }
}

@keyframes site-bg-drift-alt {
  from {
    transform: translate3d(2%, -1%, 0) scale(1.1);
  }

  to {
    transform: translate3d(-3%, 2%, 0) scale(1.02);
  }
}

/* Once real video is on screen the gradient is almost entirely hidden behind
   it, so stop animating two full-viewport layers: it is pure GPU cost for an
   effect nobody can see. The gradient still animates while the player buffers,
   and for visitors whose embed never loads. */
.site-bg--live .site-bg__wash,
.site-bg--live .site-bg__wash::after {
  animation: none;
}

/* --- 2: the video ------------------------------------------------------- */

.site-bg__video {
  position: absolute;
  top: 50%;
  left: 50%;
  /* Exact "cover" for a 16:9 source: 100vw x 56.25vw, floored at 100vh, with
     min-width 177.78vh (= 100vh * 16/9). No overshoot: an inflating 120% box
     made the compositor rasterise ~44% more pixels every frame for nothing. */
  width: 100vw;
  height: 56.25vw;
  min-width: 177.78vh;
  min-height: 100vh;
  max-width: none;
  max-height: none;
  border: 0;
  translate: -50% -50%;
  object-fit: cover;
  /* Held at 0 until the player reports it is actually playing, so a blocked
     embed falls back to the gradient instead of a black rectangle. */
  opacity: 0;
  transition: opacity 0.9s var(--ease);
  /* No blur() here on purpose. A Gaussian blur over a full-viewport iframe is
     re-run on the GPU for every single video frame and was the main cause of
     the stutter. The burned-in captions are hidden by the veil below instead,
     which costs nothing. */
}

.site-bg--live .site-bg__video {
  /* Visible behind every section, but dim enough that body copy stays readable
     through the veil below. */
  opacity: 0.42;
}

/* --- 3: contrast veil --------------------------------------------------- */

/* Painted above the video but inside .site-bg, so it applies to every page
   without each page needing its own scrim. */
.site-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(115% 90% at 50% 0%, rgba(11, 14, 20, 0.52), rgba(11, 14, 20, 0.74) 55%, rgba(11, 14, 20, 0.88) 100%),
    linear-gradient(180deg, rgba(11, 14, 20, 0.34), rgba(11, 14, 20, 0.68));
}

/* --- playback toggle ---------------------------------------------------- */

/* Fixed, so it is reachable at any scroll position on any page.
   Deliberately NOT hidden under prefers-reduced-motion.

   Kept as a small circle rather than a labelled pill: it is fixed, so anything
   wide would sit on top of paragraph text at some scroll position. The label
   stays in the DOM for assistive tech, and the title attribute gives sighted
   users a hover hint. */
.site-bg__toggle {
  position: fixed;
  right: clamp(1rem, 3vw, 1.75rem);
  bottom: clamp(0.9rem, 2.5vw, 1.5rem);
  z-index: 95;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: rgba(11, 14, 20, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--fg-muted);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.18s var(--ease), background-color 0.18s var(--ease), border-color 0.18s var(--ease),
    color 0.18s var(--ease), transform 0.18s var(--ease);
}

.site-bg__toggle:hover,
.site-bg__toggle:focus-visible {
  opacity: 1;
  background: rgba(11, 14, 20, 0.92);
  border-color: rgba(255, 255, 255, 0.45);
  color: var(--fg);
  transform: scale(1.06);
}

.site-bg__toggle-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast);
}

.site-bg__toggle-icon svg {
  width: 10px;
  height: 10px;
  fill: currentColor;
}

/* Show exactly one glyph, driven by aria-pressed:
   pressed = video playing = offer "pause". */
.site-bg__icon-play,
.site-bg__toggle[aria-pressed="false"] .site-bg__icon-pause {
  display: none;
}

.site-bg__toggle[aria-pressed="false"] .site-bg__icon-play {
  display: block;
  margin-left: 1px;
}

/* Kept for the accessible name, hidden visually. */
.site-bg__toggle-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Gradient motion stops for reduced-motion — it is purely decorative. The video
   keeps its own toggle, and the toggle stays visible. */
@media (prefers-reduced-motion: reduce) {
  .site-bg__wash,
  .site-bg__wash::after {
    animation: none;
  }
}

@media (max-width: 760px) {
  .site-bg--live .site-bg__video {
    opacity: 0.46;
  }

  .site-bg__toggle {
    width: 36px;
    height: 36px;
  }
}

.hero__inner {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 4vw, 2rem);
}

.hero__avatar {
  width: clamp(150px, 22vw, 220px);
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--border-strong), 0 0 0 8px rgba(120, 170, 255, 0.07), var(--shadow);
}

@media (min-width: 860px) {
  .hero__inner {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .hero__avatar {
    order: 2;
  }
}

.hero__title {
  margin-bottom: 0.75rem;
}

.hero__title-accent {
  background: linear-gradient(100deg, var(--accent), #a78bfa 55%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__roles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.25rem 0 1.75rem;
  padding: 0;
  list-style: none;
}

.hero__roles li {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

/* ------------------------------------------------------------ buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s var(--ease), background-color 0.15s var(--ease), border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-contrast);
}

.btn--primary:hover {
  background: #9dc0ff;
  color: var(--accent-contrast);
  box-shadow: var(--shadow-accent);
}

.btn--ghost {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--fg);
}

.btn--ghost:hover {
  background: var(--surface-hover);
  color: var(--fg);
}

/* ------------------------------------------------------------- cards --- */

.card {
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), transparent);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), background-color 0.2s var(--ease);
}

a.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.card__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 1.08rem;
}

.card__meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--fg-dim);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
}

.tag {
  padding: 0.16rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-sunken);
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

/* -------------------------------------------------------------- grid --- */

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
}

.section {
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}

.section__head h2 {
  margin-bottom: 0;
}

/* ------------------------------------------------------------- table --- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  padding: 0.7rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

thead th {
  background: var(--surface);
  color: var(--fg);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: var(--surface);
}

/* ------------------------------------------------------------- forms --- */

.field {
  display: grid;
  gap: 0.35rem;
}

.field label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg-muted);
}

.input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-sunken);
  color: var(--fg);
  font: inherit;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.input::placeholder {
  color: var(--fg-dim);
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(120, 170, 255, 0.18);
}

.input:invalid:not(:placeholder-shown) {
  border-color: var(--danger);
}

.field__hint {
  font-size: 0.82rem;
  color: var(--fg-dim);
}

/* ------------------------------------------------------------ alerts --- */

.alert {
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.93rem;
}

.alert--success {
  border-color: color-mix(in srgb, var(--success) 45%, transparent);
  background: color-mix(in srgb, var(--success) 10%, transparent);
  color: #b9f6cd;
}

.alert--warning {
  border-color: color-mix(in srgb, var(--warning) 45%, transparent);
  background: color-mix(in srgb, var(--warning) 10%, transparent);
  color: #fde8ad;
}

.alert--danger {
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  color: #fecaca;
}

/* ------------------------------------------------------------ footer --- */

.site-footer {
  margin-top: auto;
  padding-block: 2.5rem;
  border-top: 1px solid var(--border);
  background: var(--bg-sunken);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 4vw, 2rem);
  color: var(--fg-dim);
  font-size: 0.88rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}

.site-footer a {
  color: var(--fg-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--fg);
  text-decoration: underline;
}

/* ---------------------------------------------------------- motion --- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------------------------------------------------- printing --- */

@media print {
  body::before,
  .site-nav,
  .site-footer,
  .site-bg,
  .site-bg__toggle,
  .hero__actions {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}

/* ==========================================================================
   Page sections.

   Everything below used to live in home.css and pages.css, which were linked
   only from the pages that needed them. With client-side navigation that broke:
   a page reached through the router never loaded its own stylesheet, because the
   document is not reloaded. One file for every page is both simpler and immune
   to that class of bug. Rules here are page-scoped by class name, so loading
   them everywhere costs nothing.
   ========================================================================== */

/* ------------------------------------------------------------- home --- */
.home {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* Short bio block under the hero. */
.about {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
}

@media (min-width: 820px) {
  .about {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    align-items: start;
  }
}

.about__facts {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.about__facts div {
  display: grid;
  /* Wide enough for "Good at" / "Learning" without wrapping mid-label. */
  grid-template-columns: 6rem 1fr;
  gap: 0.75rem;
  font-size: 0.92rem;
  align-items: baseline;
}

.about__facts dt {
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-top: 0.15rem;
}

.about__facts dd {
  margin: 0;
  color: var(--fg);
}

/* "Now" strip — what is being worked on. */
.now {
  padding: clamp(1.25rem, 3vw, 1.75rem);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(120, 170, 255, 0.08), transparent 60%);
}

.now h2 {
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
}

.now ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--fg-muted);
}

.now li + li {
  margin-top: 0.35rem;
}

/* Project highlight cards on the home page. */
.mini-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease), transform 0.18s var(--ease);
}

.mini-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  color: inherit;
  transform: translateY(-2px);
}

.mini-card__label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent);
}

.mini-card__title {
  font-size: 1.02rem;
  font-weight: 600;
}

.mini-card__desc {
  margin: 0;
  font-size: 0.9rem;
  color: var(--fg-muted);
}

/* Contact row. */
.contact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--fg);
  font-size: 0.9rem;
  text-decoration: none;
  transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}

.contact-list a:hover {
  border-color: var(--accent);
  background: rgba(120, 170, 255, 0.1);
}


/* --------------------------------------------------- projects / uses --- */
.page-head {
  padding-block: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 3vw, 1.5rem);
}

.page-head h1 {
  margin-bottom: 0.75rem;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
}

.filter-bar button {
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--fg-muted);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.15s var(--ease), background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}

.filter-bar button:hover {
  color: var(--fg);
  background: var(--surface);
}

.filter-bar button[aria-pressed="true"] {
  border-color: var(--accent);
  background: rgba(120, 170, 255, 0.14);
  color: var(--fg);
}

/* Project cards */
.project {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  height: 100%;
  padding: clamp(1.15rem, 2.5vw, 1.5rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), transparent);
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease);
}

.project:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.project[hidden] {
  display: none;
}

.project__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.project__name {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.project__name a {
  color: var(--fg);
  text-decoration: none;
}

.project__name a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.project__desc {
  flex: 1;
  margin: 0;
  font-size: 0.92rem;
  color: var(--fg-muted);
}

.project__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.badge {
  flex-shrink: 0;
  padding: 0.12rem 0.5rem;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--bg-sunken);
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  white-space: nowrap;
}

.badge--live {
  border-color: rgba(74, 222, 128, 0.4);
  color: #9df0b8;
}

.badge--fork {
  border-color: rgba(251, 191, 36, 0.35);
  color: #fbd97a;
}

/* Uses page */
/* Groups carry their own rhythm, so drop the generic .section padding that
   would otherwise stack with the margin between groups. */
.uses-group.section {
  padding-block: 0;
}

.uses-group + .uses-group {
  margin-top: clamp(2rem, 4vw, 3rem);
}

.uses-group__title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.15rem;
  font-size: 1.15rem;
}

.uses-group__title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.uses-list {
  display: grid;
  gap: 0.85rem;
  margin: 0;
}

.uses-list div {
  display: grid;
  gap: 0.15rem 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.uses-list div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

@media (min-width: 640px) {
  .uses-list div {
    grid-template-columns: 11rem 1fr;
    align-items: baseline;
  }
}

.uses-list dt {
  color: var(--fg);
  font-weight: 600;
  font-size: 0.95rem;
}

.uses-list dd {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.93rem;
}

/* 404 page */
.error-page {
  display: grid;
  place-items: center;
  min-height: 62vh;
  padding-block: clamp(2rem, 6vw, 4rem);
  text-align: center;
}

.error-page__code {
  display: block;
  margin-bottom: 0.5rem;
  font-family: var(--font-mono);
  font-size: clamp(4rem, 3rem + 8vw, 8rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.05em;
  background: linear-gradient(180deg, var(--fg) 20%, rgba(232, 238, 248, 0.2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.error-page p {
  max-width: 46ch;
  margin-inline: auto;
  color: var(--fg-muted);
}

.error-page__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin-top: 1.5rem;
}
