/* Self-hosted WOFF2 fonts: served from our domain to avoid third-party requests.
   font-display: swap keeps text visible with a fallback while fonts load, preventing invisible text. */
@font-face {
  font-family: "Clash Grotesk";
  src: url("/fonts/ClashGrotesk-Extralight.woff2") format("woff2");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Clash Grotesk";
  src: url("/fonts/ClashGrotesk-Light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Clash Grotesk";
  src: url("/fonts/ClashGrotesk-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Clash Grotesk";
  src: url("/fonts/ClashGrotesk-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Clash Grotesk";
  src: url("/fonts/ClashGrotesk-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Metric-adjusted fallback to reduce layout shift while the webfont loads */
@font-face {
  font-family: "Clash Grotesk Fallback";
  src: local("Arial");
  size-adjust: 100%;
  ascent-override: 95%;
  descent-override: 25%;
  line-gap-override: 0%;
}

/* Design tokens
   - Centralized CSS variables for colors, effects, typography, spacing, and motion.
   - Theme-behavior tokens (decor/snow visibility, header layout, avatar/toggle styles)
     let light/dark themes switch presentation without duplicating many element rules. */
:root {
  color-scheme: dark;

  /* Core palette and ambient effect values (dark theme defaults) */
  --color-background: #10100e;
  --rgb-text-primary: 255, 255, 227;
  --color-text-primary: #ffffe3;
  --color-text-secondary: #c0c0ab;
  --color-text-muted: #9a9a89;
  --color-link: #6bb3ff;
  --rgb-effect: 255, 255, 227;
  --nebula-opacity: 0.14;
  --stars-twinkle-min: 0.25;
  --stars-twinkle-max: 0.65;

  /* Decorative element tokens (snow, avatar halo, focus ring, layering, control sizes) */
  --color-snowflake: #ffffff;
  --color-snow-pile-start: #d8e8f5;
  --color-snow-pile-mid: #edf6ff;
  --color-snow-pile-end: #ffffff;
  --shadow-snow-pile-inset: inset 0 3px 8px rgb(255 255 255 / 90%);
  --shadow-snow-pile-drop: drop-shadow(0 -3px 8px rgb(58 92 130 / 35%));
  --shadow-avatar-from: 0 2px 14px 2px rgb(var(--rgb-effect) / 8%);
  --shadow-avatar-to: 0 6px 28px 4px rgb(var(--rgb-effect) / 22%);
  --size-toggle: 1.85rem;
  --size-toggle-icon: 1rem;
  --focus-outline-width: 2px;
  --focus-outline-offset: 3px;
  --focus-outline-radius: 2px;
  --z-background: 0;
  --z-content: 1;
  --z-overlay: 10;

  /* Theme-behavior tokens: header layout and which decorative/effect styles are active */
  --site-header-width: 100vw;
  --site-header-margin-inline: calc(50% - 50vw);
  --site-header-overflow: hidden;
  --decor-display: block;
  --snow-display: none;
  --avatar-animation: avatar-halo 6s ease-in-out infinite alternate;
  --avatar-box-shadow: var(--shadow-avatar-from);
  --site-header-h1-weight: var(--font-weight-extralight);

  /* Theme toggle appearance tokens (icon visibility and interactive colors) */
  --theme-toggle-border-color: color-mix(
    in srgb,
    var(--color-text-primary) 25%,
    transparent
  );
  --theme-toggle-color: color-mix(
    in srgb,
    var(--color-text-primary) 55%,
    transparent
  );
  --theme-toggle-hover-bg: transparent;
  --theme-toggle-hover-border-color: color-mix(
    in srgb,
    var(--color-text-primary) 45%,
    transparent
  );
  --theme-toggle-hover-color: var(--color-text-primary);
  --theme-toggle-sun-display: block;
  --theme-toggle-moon-display: none;

  /* Typography tokens */
  --font-sans: "Clash Grotesk", "Clash Grotesk Fallback", "Noto Sans Bengali",
    system-ui, sans-serif;

  --font-size-sm: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);
  --font-size-base: clamp(1.0625rem, 1.04rem + 0.15vw, 1.125rem);
  --font-size-lg: clamp(1.1875rem, 1.1rem + 0.4vw, 1.4375rem);
  --font-size-xl: clamp(1.625rem, 1.3rem + 1.25vw, 2.125rem);
  --icon-size: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);

  --font-weight-extralight: 200;
  --font-weight-light: 300;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;

  --line-height-body: 1.6;
  --line-height-heading: 1.2;

  /* Spacing, transition, and shape tokens */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;

  --transition-duration: 0.2s;
  --transition-timing: ease;
  --transition-color: color var(--transition-duration) var(--transition-timing),
    text-decoration-color var(--transition-duration) var(--transition-timing);

  /* Scroll-reveal animation tokens (used with Intersection Observer in script.js) */
  --reveal-distance: 0.75rem;
  --reveal-duration: 0.6s;
  --reveal-easing: cubic-bezier(0.22, 1, 0.36, 1);

  --radius-full: 999px;
  --radius-circle: 50%;
}

/* Light theme for system preference, unless the user explicitly selected dark.
   Values are token overrides so components can adapt without duplicated element selectors. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;

    /* Light palette overrides */
    --color-background: linear-gradient(180deg, #bdd0e2 0%, #ffffff 50%, #95b4ce 100%);
    --rgb-text-primary: 32, 54, 92;
    --color-text-primary: #1b2d4d;
    --color-text-secondary: #20365c;
    --color-text-muted: #475467;
    --color-link: #0b63c9;
    --rgb-effect: 60, 70, 120;
    --nebula-opacity: 0.08;
    --stars-twinkle-min: 0.12;
    --stars-twinkle-max: 0.35;
    --color-soft-overlay: rgb(239 239 239 / 30%);
    --color-dark-overlay-80: rgb(0 0 0 / 80%);
    --color-dark-overlay-30: rgb(0 0 0 / 30%);

    /* Light theme-behavior overrides: simpler header, snow visible, dark decor hidden */
    --site-header-width: 100%;
    --site-header-margin-inline: 0;
    --site-header-overflow: visible;
    --decor-display: none;
    --snow-display: block;
    --avatar-animation: none;
    --avatar-box-shadow: none;
    --site-header-h1-weight: var(--font-weight-light);

    /* Light theme toggle appearance overrides */
    --theme-toggle-border-color: var(--color-dark-overlay-30);
    --theme-toggle-color: color-mix(
      in srgb,
      var(--color-text-primary) 55%,
      transparent
    );
    --theme-toggle-hover-bg: var(--color-soft-overlay);
    --theme-toggle-hover-border-color: var(--color-dark-overlay-80);
    --theme-toggle-hover-color: var(--color-text-primary);
    --theme-toggle-sun-display: none;
    --theme-toggle-moon-display: block;
  }
}

/* Explicit light theme selection (same token overrides as system-light behavior). */
:root[data-theme="light"] {
  color-scheme: light;

  /* Light palette overrides */
  --color-background: linear-gradient(180deg, #bdd0e2 0%, #ffffff 50%, #95b4ce 100%);
  --rgb-text-primary: 32, 54, 92;
  --color-text-primary: #1b2d4d;
  --color-text-secondary: #20365c;
  --color-text-muted: #475467;
  --color-link: #0b63c9;
  --rgb-effect: 60, 70, 120;
  --nebula-opacity: 0.08;
  --stars-twinkle-min: 0.12;
  --stars-twinkle-max: 0.35;
  --color-soft-overlay: rgb(239 239 239 / 30%);
  --color-dark-overlay-80: rgb(0 0 0 / 80%);
  --color-dark-overlay-30: rgb(0 0 0 / 30%);

  /* Light theme-behavior overrides: simpler header, snow visible, dark decor hidden */
  --site-header-width: 100%;
  --site-header-margin-inline: 0;
  --site-header-overflow: visible;
  --decor-display: none;
  --snow-display: block;
  --avatar-animation: none;
  --avatar-box-shadow: none;
  --site-header-h1-weight: var(--font-weight-light);

  /* Light theme toggle appearance overrides */
  --theme-toggle-border-color: var(--color-dark-overlay-30);
  --theme-toggle-color: color-mix(
    in srgb,
    var(--color-text-primary) 55%,
    transparent
  );
  --theme-toggle-hover-bg: var(--color-soft-overlay);
  --theme-toggle-hover-border-color: var(--color-dark-overlay-80);
  --theme-toggle-hover-color: var(--color-text-primary);
  --theme-toggle-sun-display: none;
  --theme-toggle-moon-display: block;
}

/* Explicit dark theme selection marker; base :root already defines dark defaults. */
:root[data-theme="dark"] {
  color-scheme: dark;
}


/* Base reset and document defaults */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--color-background);
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* Avoid fixed background attachment on touch/coarse-pointer devices for smoother scrolling */
@media (hover: none), (pointer: coarse) {
  body {
    background-attachment: scroll;
  }
}

/* Page layout container */
.container {
  position: relative;
  z-index: var(--z-content);
  width: min(100% - 2rem, 50ch);
  min-height: 100dvh;
  margin-inline: auto;
  padding-block: var(--space-5);
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* Typography and link styles */
h1,
h2,
h3 {
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-heading);
}

h1 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
}

h2 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
}

a {
  color: var(--color-link);
  text-decoration-color: var(--color-link);
  text-underline-offset: 0.2em;
  transition: var(--transition-color);
}

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

a:focus-visible {
  outline: var(--focus-outline-width) solid var(--color-link);
  outline-offset: var(--focus-outline-offset);
  border-radius: var(--focus-outline-radius);
}

/* Header and hero section
   Width/overflow are token-driven to support full-bleed dark decor and simpler light layout. */
.site-header {
  position: relative;
  text-align: center;
  overflow: var(--site-header-overflow);
  width: var(--site-header-width);
  margin-inline: var(--site-header-margin-inline);
  padding-block: 1.2rem var(--space-2);
}

.site-header > * {
  position: relative;
  z-index: var(--z-content);
}

/* Starfield layers (pseudo-elements) used in dark/decor theme */
.site-header::before,
.site-header::after {
  content: "";
  position: absolute;
  inset: -200px;
  pointer-events: none;
}

.site-header::before {
  background-image:
    radial-gradient(1px 1px at 20px 30px, rgba(var(--rgb-effect), 0.5), transparent),
    radial-gradient(1.5px 1.5px at 55px 75px, rgba(var(--rgb-effect), 0.4), transparent),
    radial-gradient(2px 2px at 110px 50px, rgba(var(--rgb-effect), 0.55), transparent),
    radial-gradient(1px 1px at 160px 120px, rgba(var(--rgb-effect), 0.35), transparent),
    radial-gradient(1.5px 1.5px at 30px 140px, rgba(var(--rgb-effect), 0.45), transparent),
    radial-gradient(2.5px 2.5px at 180px 20px, rgba(var(--rgb-effect), 0.45), transparent),
    radial-gradient(1px 1px at 90px 15px, rgba(var(--rgb-effect), 0.35), transparent),
    radial-gradient(2px 2px at 140px 95px, rgba(var(--rgb-effect), 0.5), transparent),
    radial-gradient(1px 1px at 45px 110px, rgba(var(--rgb-effect), 0.4), transparent),
    radial-gradient(1.5px 1.5px at 190px 70px, rgba(var(--rgb-effect), 0.45), transparent),
    radial-gradient(1px 1px at 75px 45px, rgba(var(--rgb-effect), 0.3), transparent),
    radial-gradient(2px 2px at 10px 85px, rgba(var(--rgb-effect), 0.5), transparent),
    radial-gradient(1.5px 1.5px at 125px 135px, rgba(var(--rgb-effect), 0.4), transparent);
  background-size: 200px 160px;
  animation:
    stars-drift 20s linear infinite,
    stars-twinkle 4s ease-in-out infinite alternate;
}

.site-header::after {
  background-image:
    radial-gradient(1px 1px at 40px 40px, rgba(var(--rgb-effect), 0.4), transparent),
    radial-gradient(1.5px 1.5px at 90px 100px, rgba(var(--rgb-effect), 0.45), transparent),
    radial-gradient(2px 2px at 140px 30px, rgba(var(--rgb-effect), 0.4), transparent),
    radial-gradient(1px 1px at 10px 110px, rgba(var(--rgb-effect), 0.35), transparent),
    radial-gradient(2.5px 2.5px at 170px 90px, rgba(var(--rgb-effect), 0.35), transparent),
    radial-gradient(1px 1px at 70px 20px, rgba(var(--rgb-effect), 0.3), transparent),
    radial-gradient(1.5px 1.5px at 120px 70px, rgba(var(--rgb-effect), 0.4), transparent),
    radial-gradient(2px 2px at 30px 75px, rgba(var(--rgb-effect), 0.45), transparent),
    radial-gradient(1px 1px at 160px 130px, rgba(var(--rgb-effect), 0.35), transparent),
    radial-gradient(1.5px 1.5px at 55px 130px, rgba(var(--rgb-effect), 0.4), transparent);
  background-size: 180px 140px;
  animation:
    stars-drift-alt 30s linear infinite,
    stars-twinkle 6s ease-in-out infinite alternate-reverse;
}

@keyframes stars-drift {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(200px, 160px, 0);
  }
}

@keyframes stars-drift-alt {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(-180px, 140px, 0);
  }
}

@keyframes stars-twinkle {
  from {
    opacity: var(--stars-twinkle-min);
  }

  to {
    opacity: var(--stars-twinkle-max);
  }
}

/* Comet decorative elements (randomized via script.js CSS custom properties) */
.comet-sky .comet {
  position: absolute;
  top: var(--comet-top, 12%);
  width: var(--comet-width, 110px);
  height: var(--comet-height, 2px);
  border-radius: var(--radius-full);
  background: linear-gradient(
    to right,
    transparent,
    rgba(var(--rgb-effect), var(--comet-tail-alpha, 0.1)) 35%,
    rgba(var(--rgb-effect), var(--comet-core-alpha, 0.7))
  );
  /* Drop-shadow filter removed to reduce GPU cost on animated elements (head glow remains) */
  opacity: 0;
  z-index: var(--z-background);
  pointer-events: none;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-duration: var(--comet-duration, 18s);
  animation-delay: var(--comet-delay, 5s);
}

.comet-sky .comet::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: var(--comet-head, 4px);
  height: var(--comet-head, 4px);
  border-radius: var(--radius-circle);
  background: rgba(var(--rgb-effect), var(--comet-head-alpha, 0.95));
  box-shadow: 0 0 var(--comet-head-glow-size, 6px) 2px
    rgba(var(--rgb-effect), var(--comet-head-glow-alpha, 0.5));
  transform: translate(50%, -50%);
}

.comet-sky .comet.comet-dir-1 {
  left: -180px;
  animation-name: comet-ltr;
}

.comet-sky .comet.comet-dir-2 {
  right: -180px;
  left: auto;
  animation-name: comet-rtl;
  background: linear-gradient(
    to left,
    transparent,
    rgba(var(--rgb-effect), var(--comet-tail-alpha, 0.1)) 35%,
    rgba(var(--rgb-effect), var(--comet-core-alpha, 0.7))
  );
}

.comet-sky .comet.comet-dir-2::after {
  right: auto;
  left: 0;
  transform: translate(-50%, -50%);
}

.comet-sky .comet.comet-dir-3 {
  left: -180px;
  animation-name: comet-ltr-steep;
}

.comet-sky .comet.comet-dir-4 {
  right: -180px;
  left: auto;
  animation-name: comet-rtl-steep;
  background: linear-gradient(
    to left,
    transparent,
    rgba(var(--rgb-effect), var(--comet-tail-alpha, 0.1)) 35%,
    rgba(var(--rgb-effect), var(--comet-core-alpha, 0.7))
  );
}

.comet-sky .comet.comet-dir-4::after {
  right: auto;
  left: 0;
  transform: translate(-50%, -50%);
}

@keyframes comet-ltr {
  0% {
    opacity: 0;
    transform: translate(0, 0) rotate(18deg);
  }
  2% {
    opacity: 1;
  }
  12% {
    opacity: 1;
    transform: translate(calc(100vw + 360px), 80px) rotate(18deg);
  }
  13%,
  100% {
    opacity: 0;
    transform: translate(calc(100vw + 360px), 80px) rotate(18deg);
  }
}

@keyframes comet-rtl {
  0% {
    opacity: 0;
    transform: translate(0, 0) rotate(-18deg);
  }
  2% {
    opacity: 1;
  }
  12% {
    opacity: 1;
    transform: translate(calc(-100vw - 360px), 80px) rotate(-18deg);
  }
  13%,
  100% {
    opacity: 0;
    transform: translate(calc(-100vw - 360px), 80px) rotate(-18deg);
  }
}

@keyframes comet-ltr-steep {
  0% {
    opacity: 0;
    transform: translate(0, 0) rotate(32deg);
  }
  2% {
    opacity: 1;
  }
  12% {
    opacity: 1;
    transform: translate(calc(100vw + 360px), 140px) rotate(32deg);
  }
  13%,
  100% {
    opacity: 0;
    transform: translate(calc(100vw + 360px), 140px) rotate(32deg);
  }
}

@keyframes comet-rtl-steep {
  0% {
    opacity: 0;
    transform: translate(0, 0) rotate(-32deg);
  }
  2% {
    opacity: 1;
  }
  12% {
    opacity: 1;
    transform: translate(calc(-100vw - 360px), 140px) rotate(-32deg);
  }
  13%,
  100% {
    opacity: 0;
    transform: translate(calc(-100vw - 360px), 140px) rotate(-32deg);
  }
}

/* Nebula glow accents in the header (dark/decor theme) */
.site-header .nebula {
  position: absolute;
  border-radius: 50%;
  /* Reduced blur radius for better mobile/GPU performance while keeping a soft glow */
  filter: blur(30px);
  opacity: 0;
  z-index: var(--z-background);
  pointer-events: none;
}

.site-header .nebula-1 {
  width: 380px;
  height: 220px;
  top: 0%;
  left: 10%;
  background: radial-gradient(
    ellipse at center,
    rgba(var(--rgb-effect), 0.25),
    transparent 70%
  );
  animation:
    nebula-drift-1 28s ease-in-out infinite alternate,
    nebula-fade-in 3s ease 0.4s forwards;
}

.site-header .nebula-2 {
  width: 320px;
  height: 180px;
  bottom: -20%;
  right: 5%;
  background: radial-gradient(
    ellipse at center,
    rgba(var(--rgb-effect), 0.18),
    transparent 70%
  );
  animation:
    nebula-drift-2 22s ease-in-out infinite alternate-reverse,
    nebula-fade-in 4s ease 0.8s forwards;
}

@keyframes nebula-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: var(--nebula-opacity);
  }
}

@keyframes nebula-drift-1 {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }

  to {
    transform: translate3d(40px, 20px, 0) scale(1.08);
  }
}

@keyframes nebula-drift-2 {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }

  to {
    transform: translate3d(-30px, -15px, 0) scale(1.12);
  }
}

/* Decorative layer containers
   Visibility is controlled by theme-behavior tokens (--decor-display / --snow-display). */
.comet-sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: var(--z-background);
  display: var(--decor-display);
}

.site-header::before,
.site-header::after,
.site-header .nebula {
  display: var(--decor-display);
}

.snow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: var(--z-background);
  display: var(--snow-display);
  -webkit-mask-image: linear-gradient(
    to bottom,
    rgb(0 0 0 / 100%) 0%,
    rgb(0 0 0 / 45%) 40%,
    rgb(0 0 0 / 20%) 82%,
    rgb(0 0 0 / 100%) 100%
  );
  mask-image: linear-gradient(
    to bottom,
    rgb(0 0 0 / 100%) 0%,
    rgb(0 0 0 / 45%) 40%,
    rgb(0 0 0 / 20%) 82%,
    rgb(0 0 0 / 100%) 100%
  );
}

.snowflake {
  position: absolute;
  top: -12px;
  border-radius: var(--radius-circle);
  background: var(--color-snowflake);
  opacity: 1;
  animation-name: snow-fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  z-index: var(--z-background);
}

.snow-pile {
  position: absolute;
  left: -5%;
  bottom: -2px;
  width: 110%;
  height: 0;
  background: linear-gradient(
    to top,
    var(--color-snow-pile-start) 0%,
    var(--color-snow-pile-mid) 50%,
    var(--color-snow-pile-end) 100%
  );
  box-shadow: var(--shadow-snow-pile-inset);
  filter: var(--shadow-snow-pile-drop);
  opacity: 0;
  transition: opacity 0.4s ease;
  will-change: height, opacity, clip-path;
  z-index: var(--z-content);
}

.snow-pile.is-visible {
  opacity: 1;
}

@keyframes snow-fall {
  from {
    transform: translate3d(var(--start-x, 0px), -12px, 0);
  }

  to {
    transform: translate3d(var(--drift, 0px), 110vh, 0);
  }
}

/* Header content: intro text and avatar */
.site-header h1 {
  margin-bottom: 0;
  font-size: var(--font-size-base);
  font-weight: var(--site-header-h1-weight);
  line-height: var(--line-height-body);
}

.site-header p {
  margin-top: 0;
  margin-bottom: 0;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-heading);
}

.site-header hgroup {
  padding-inline: var(--space-3);
}

.avatar {
  width: clamp(100px, 80px + 5vw, 140px);
  height: clamp(100px, 80px + 5vw, 140px);
  border-radius: var(--radius-circle);
  object-fit: cover;
  /* Adjust the vertical value to center your face in the frame (e.g. 50% 25%) */
  object-position: 50% 30%;
  box-shadow: var(--avatar-box-shadow);
  animation: var(--avatar-animation);
}

@keyframes avatar-halo {
  from {
    box-shadow: var(--shadow-avatar-from);
  }

  to {
    box-shadow: var(--shadow-avatar-to);
  }
}

/* Social/contact icon links */
.intro-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin: var(--space-1) 0 var(--space-4);
}

.intro-links a {
  display: inline-flex;
  color: color-mix(in srgb, var(--color-text-primary) 55%, transparent);
}

.intro-links a:hover {
  color: var(--color-text-primary);
}

.intro-links svg {
  width: var(--icon-size);
  height: var(--icon-size);
}

/* Content sections */
.about p,
.tech-stack p {
  color: var(--color-text-secondary);
}

.tech-label {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-medium);
}

.stay-tuned {
  text-align: center;
  margin-block: var(--space-5);
}

.animated-dots span {
  animation: dot-pulse 1.4s infinite both;
}

.animated-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.animated-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dot-pulse {
  0%,
  80%,
  100% {
    opacity: 0.2;
  }

  40% {
    opacity: 1;
  }
}


/* Utility text styling */
.muted {
  color: var(--color-text-muted);
  transition: color var(--transition-duration) var(--transition-timing);
}

.muted:hover {
  color: var(--color-text-primary);
}

/* Accessibility: respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .muted,
  a,
  .theme-toggle,
  .lang-toggle,
  .reveal {
    transition: none;
  }

  .site-header::before,
  .site-header::after,
  .comet-sky .comet,
  .site-header .nebula,
  .snowflake,
  .avatar,
  .animated-dots span {
    animation: none;
  }

  .site-header .nebula {
    opacity: var(--nebula-opacity);
  }

  .snow-pile {
    transition: none;
  }

  /* Keep revealed content immediately visible when motion is reduced */
  .js-reveal .reveal {
    opacity: 1;
    transform: none;
  }
}


/* Fixed top-right controls: language switch and theme toggle */
.lang-toggle {
  position: fixed;
  top: var(--space-3);
  right: calc(var(--space-3) + var(--size-toggle) + var(--space-2));
  z-index: var(--z-overlay);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--size-toggle);
  padding: 0 var(--space-2);
  border: 1px solid var(--theme-toggle-border-color);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--theme-toggle-color);
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-color),
    border-color var(--transition-duration) var(--transition-timing),
    background-color var(--transition-duration) var(--transition-timing);
}

.lang-toggle:hover {
  border-color: var(--theme-toggle-hover-border-color);
  background: var(--theme-toggle-hover-bg);
  color: var(--theme-toggle-hover-color);
  text-decoration: none;
}

.lang-toggle:focus-visible {
  outline: var(--focus-outline-width) solid var(--color-link);
  outline-offset: var(--focus-outline-offset);
}

/* Theme toggle control (colors/icon visibility are driven by theme tokens) */
.theme-toggle {
  position: fixed;
  top: var(--space-3);
  right: var(--space-3);
  z-index: var(--z-overlay);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--size-toggle);
  height: var(--size-toggle);
  padding: 0;
  border: 1px solid var(--theme-toggle-border-color);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--theme-toggle-color);
  cursor: pointer;
  transition: var(--transition-color),
    border-color var(--transition-duration) var(--transition-timing),
    background-color var(--transition-duration) var(--transition-timing);
}

.theme-toggle:hover {
  border-color: var(--theme-toggle-hover-border-color);
  background: var(--theme-toggle-hover-bg);
  color: var(--theme-toggle-hover-color);
}

.theme-toggle:focus-visible {
  outline: var(--focus-outline-width) solid var(--color-link);
  outline-offset: var(--focus-outline-offset);
}

.theme-toggle svg {
  width: var(--size-toggle-icon);
  height: var(--size-toggle-icon);
}

.theme-toggle .icon-sun {
  display: var(--theme-toggle-sun-display);
}

.theme-toggle .icon-moon {
  display: var(--theme-toggle-moon-display);
}


/* Scroll reveal (activated by script.js; content remains visible without JS or with reduced motion) */
.js-reveal .reveal {
  opacity: 0;
  transform: translateY(var(--reveal-distance));
  transition:
    opacity var(--reveal-duration) var(--reveal-easing) var(--reveal-delay, 0s),
    transform var(--reveal-duration) var(--reveal-easing) var(--reveal-delay, 0s);
}

.js-reveal .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Preserve footer's existing color hover transition when it is also a reveal target */
.js-reveal .muted.reveal {
  transition:
    opacity var(--reveal-duration) var(--reveal-easing) var(--reveal-delay, 0s),
    transform var(--reveal-duration) var(--reveal-easing) var(--reveal-delay, 0s),
    color var(--transition-duration) var(--transition-timing);
}

/* Footer */
footer {
  text-align: center;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-light);
  margin-top: var(--space-4);
}
