/* ==========================================================================
   theme.css — Liquid Glass design system
   Shared tokens, primitives and motion language for every portfolio page.
   Loaded before styles.css (homepage) and project.css (case studies).
   ========================================================================== */

/* ---------------------------------------------------------------
   1. Design tokens
   --------------------------------------------------------------- */
:root {
  /* Canvas */
  --canvas: #07080d;
  --canvas-soft: #0b0d15;
  --canvas-raised: #101320;

  /* Ink */
  --ink: #f4f6fb;
  --ink-2: #cbd1df;
  --ink-3: #99a1b4;
  --ink-4: #7e8698;

  /* Brand + atmosphere lights */
  --brand: #f3961c;
  --brand-bright: #ffb45c;
  --brand-deep: #b56a06;
  --on-brand: #1b1204;
  --violet: #7a5cff;
  --ice: #7fd8ff;

  /* Glass surfaces */
  --glass-line: rgba(255, 255, 255, 0.1);
  --glass-line-soft: rgba(255, 255, 255, 0.06);
  --glass-line-strong: rgba(255, 255, 255, 0.18);
  --glass-tint-1: rgba(255, 255, 255, 0.075);
  --glass-tint-2: rgba(255, 255, 255, 0.042);
  --glass-tint-3: rgba(255, 255, 255, 0.12);
  --glass-body: rgba(11, 13, 21, 0.58);
  --glass-body-soft: rgba(11, 13, 21, 0.38);
  --glass-body-strong: rgba(11, 13, 21, 0.72);
  --glass-fallback: rgba(15, 17, 26, 0.92);

  /* Blur levels */
  --blur-xs: 8px;
  --blur-sm: 14px;
  --blur-md: 22px;
  --blur-lg: 34px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 10px 24px -16px rgba(0, 0, 0, 0.8);
  --shadow-md: 0 24px 50px -28px rgba(0, 0, 0, 0.85);
  --shadow-lg: 0 48px 110px -46px rgba(0, 0, 0, 0.92);
  --shadow-brand: 0 18px 44px -20px rgba(243, 150, 28, 0.5);
  --ring: 0 0 0 2px rgba(243, 150, 28, 0.85);

  /* Radii */
  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-2xl: 42px;
  --r-pill: 999px;

  /* Spacing scale */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 2.5rem;
  --s8: 3rem;
  --s9: 4rem;
  --s10: 5rem;
  --s11: 6.5rem;
  --s12: 8rem;

  /* Typography */
  --font-display: "Sora", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-accent: "Instrument Serif", "Iowan Old Style", Georgia, serif;

  --fs-display: clamp(2.5rem, 1.4rem + 4.2vw, 4.35rem);
  --fs-h1: clamp(2.25rem, 1.4rem + 3.4vw, 3.6rem);
  --fs-h2: clamp(1.9rem, 1.25rem + 2.3vw, 3rem);
  --fs-h3: clamp(1.2rem, 1.05rem + 0.65vw, 1.55rem);
  --fs-h4: clamp(1.05rem, 1rem + 0.3vw, 1.2rem);
  --fs-lede: clamp(1.1rem, 1rem + 0.75vw, 1.5rem);
  --fs-body: clamp(1rem, 0.96rem + 0.18vw, 1.08rem);
  --fs-sm: 0.94rem;
  --fs-xs: 0.83rem;
  --fs-label: 0.76rem;

  --lh-tight: 1.04;
  --lh-snug: 1.2;
  --lh-body: 1.72;
  --track-tight: -0.03em;
  --track-label: 0.16em;

  /* Layout */
  --shell-max: 1240px;
  --shell-pad: clamp(1.15rem, 4vw, 2.75rem);
  --section-y: clamp(4.5rem, 2rem + 8vw, 9rem);
  --topbar-h: 68px;

  /* Motion (iOS-inspired easing) */
  --ease-ios: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-1: 0.18s;
  --dur-2: 0.32s;
  --dur-3: 0.55s;
  --dur-4: 0.9s;

  /* Pointer position, updated by script.js for light response */
  --px: 0.5;
  --py: 0.5;
  --mx: 50%;
  --my: 0%;
}

/* ---------------------------------------------------------------
   2. Reset + base
   --------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

body {
  background-color: var(--canvas);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  min-height: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.is-locked {
  overflow: hidden;
}

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

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

ul,
ol {
  list-style: none;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: var(--track-tight);
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

::selection {
  background: rgba(243, 150, 28, 0.32);
  color: #fff;
}

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

/* Font Awesome icon rows shouldn't break flex alignment */
.fa-solid,
.fa-regular,
.fa-brands {
  line-height: 1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: var(--s4);
  left: 50%;
  z-index: 200;
  padding: 0.7rem 1.15rem;
  border-radius: var(--r-pill);
  background: var(--brand);
  color: var(--on-brand);
  font-size: var(--fs-sm);
  font-weight: 600;
  transform: translate(-50%, calc(-100% - var(--s6)));
  transition: transform var(--dur-2) var(--ease-ios);
}

.skip-link:focus-visible {
  transform: translate(-50%, 0);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------
   3. Adaptive background atmosphere
   --------------------------------------------------------------- */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 12% -10%, rgba(243, 150, 28, 0.16), transparent 58%),
    radial-gradient(100% 80% at 92% 8%, rgba(122, 92, 255, 0.2), transparent 60%),
    linear-gradient(180deg, var(--canvas) 0%, var(--canvas-soft) 48%, #05060a 100%);
}

.atmosphere__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  transform: translate3d(
    calc((var(--px) - 0.5) * 46px),
    calc((var(--py) - 0.5) * 46px),
    0
  );
  transition: transform 1.2s var(--ease-soft);
  will-change: transform;
}

.atmosphere__glow--amber {
  width: 46vw;
  height: 46vw;
  min-width: 320px;
  min-height: 320px;
  top: -14vw;
  left: -10vw;
  background: radial-gradient(circle, rgba(243, 150, 28, 0.5), transparent 66%);
  animation: drift-a 64s var(--ease-soft) infinite alternate;
}

.atmosphere__glow--violet {
  width: 52vw;
  height: 52vw;
  min-width: 360px;
  min-height: 360px;
  right: -14vw;
  bottom: -18vw;
  background: radial-gradient(circle, rgba(122, 92, 255, 0.42), transparent 68%);
  animation: drift-b 78s var(--ease-soft) infinite alternate;
}

.atmosphere__glow--ice {
  width: 30vw;
  height: 30vw;
  min-width: 220px;
  min-height: 220px;
  top: 38%;
  right: 12%;
  opacity: 0.32;
  background: radial-gradient(circle, rgba(127, 216, 255, 0.32), transparent 70%);
  animation: drift-c 90s var(--ease-soft) infinite alternate;
}

.atmosphere__grid {
  position: absolute;
  inset: -2px;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.032) 1px, transparent 1px);
  background-size: 76px 76px;
  -webkit-mask-image: radial-gradient(115% 75% at 50% 0%, #000 8%, transparent 72%);
  mask-image: radial-gradient(115% 75% at 50% 0%, #000 8%, transparent 72%);
}

.atmosphere__grain {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Galaxy layer — faint stars, soft cosmic particles, drifting nebula.
   Generated by script.js and rendered behind every glass surface. */
.atmosphere__nebula {
  position: absolute;
  inset: -12%;
  opacity: 0.62;
  filter: blur(34px);
  background:
    radial-gradient(40% 32% at 24% 16%, rgba(122, 92, 255, 0.24), transparent 72%),
    radial-gradient(34% 28% at 76% 10%, rgba(127, 216, 255, 0.16), transparent 74%),
    radial-gradient(48% 36% at 60% 88%, rgba(243, 150, 28, 0.1), transparent 76%);
  animation: nebula-drift 140s var(--ease-soft) infinite alternate;
  will-change: transform;
}

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

.atmosphere__stars {
  position: absolute;
  inset: 0;
}

.star {
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #fff;
  opacity: var(--star-o, 0.3);
  animation: twinkle var(--star-t, 10s) var(--ease-soft) infinite alternate;
  animation-delay: var(--star-d, 0s);
}

@keyframes twinkle {
  from {
    opacity: calc(var(--star-o, 0.3) * 0.28);
  }
  to {
    opacity: var(--star-o, 0.3);
  }
}

.star--particle {
  filter: blur(1.5px);
  box-shadow: 0 0 14px 3px rgba(150, 172, 255, 0.3);
  background: linear-gradient(140deg, rgba(190, 205, 255, 0.9), rgba(243, 180, 92, 0.55));
  opacity: var(--star-o, 0.18);
  animation: particle-drift var(--star-t, 44s) var(--ease-soft) infinite alternate;
}

@keyframes particle-drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(var(--star-dx, 24px), var(--star-dy, -30px), 0);
  }
}

/* Depth response: pointer light plus a slow scroll shift, per layer */
.atmosphere__stars--far {
  transform: translate3d(
    calc((var(--px) - 0.5) * 8px),
    calc((var(--py) - 0.5) * 8px + var(--stars-y, 0px)),
    0
  );
}

.atmosphere__stars--mid {
  transform: translate3d(
    calc((var(--px) - 0.5) * 17px),
    calc((var(--py) - 0.5) * 17px + var(--stars-y-mid, 0px)),
    0
  );
}

.atmosphere__stars--near {
  transform: translate3d(
    calc((var(--px) - 0.5) * 28px),
    calc((var(--py) - 0.5) * 28px + var(--stars-y-near, 0px)),
    0
  );
}

.shooting-star {
  position: absolute;
  width: 120px;
  height: 1px;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.72));
  opacity: 0;
  transform: rotate(18deg);
  animation: shooting-star 2s var(--ease-out) forwards;
  will-change: transform, opacity;
}

@keyframes shooting-star {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(18deg);
  }
  14% {
    opacity: 0.45;
  }
  72% {
    opacity: 0.3;
  }
  100% {
    opacity: 0;
    transform: translate3d(46vw, 24vh, 0) rotate(18deg);
  }
}

@keyframes drift-a {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(7%, 6%, 0) scale(1.12);
  }
}

@keyframes drift-b {
  from {
    transform: translate3d(0, 0, 0) scale(1.05);
  }
  to {
    transform: translate3d(-8%, -5%, 0) scale(1);
  }
}

@keyframes drift-c {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-6%, 8%, 0);
  }
}

/* Content sits above the atmosphere */
.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

/* ---------------------------------------------------------------
   4. Layout primitives
   --------------------------------------------------------------- */
.shell {
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
  padding-inline: var(--shell-pad);
}

.section {
  padding-block: var(--section-y);
  scroll-margin-top: calc(var(--topbar-h) + var(--s5));
}

.section-head {
  max-width: 68ch;
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ink-3);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, var(--brand), rgba(243, 150, 28, 0));
}

.section-head--center .eyebrow::before {
  display: none;
}

.section-title {
  font-size: var(--fs-h2);
  margin-top: var(--s4);
  color: var(--ink);
}

.section-lede {
  margin-top: var(--s5);
  color: var(--ink-2);
  font-size: var(--fs-lede);
  line-height: 1.55;
  letter-spacing: -0.01em;
}

.section-note {
  margin-top: var(--s4);
  color: var(--ink-3);
  font-size: var(--fs-sm);
}

.accent-italic {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  background: linear-gradient(96deg, var(--brand-bright), var(--brand) 55%, var(--ice));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------------------------------------------------------------
   5. Glass system
   --pane  : primary surfaces (nav, hero frame, large panels)
   --card  : secondary surfaces (cards, meta, tags)
   --float : detached surfaces (chips, CTAs, controls)
   --------------------------------------------------------------- */
.glass {
  position: relative;
  border-radius: var(--r-xl);
  border: 1px solid var(--glass-line-soft);
  background-color: var(--glass-body);
  background-image: linear-gradient(180deg, var(--glass-tint-1), var(--glass-tint-2));
  box-shadow: var(--shadow-md);
  -webkit-backdrop-filter: blur(var(--blur-md)) saturate(150%);
  backdrop-filter: blur(var(--blur-md)) saturate(150%);
  isolation: isolate;
}

/* Light that follows the pointer across the surface */
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(
    130% 100% at var(--mx) var(--my),
    rgba(255, 255, 255, 0.16),
    rgba(255, 255, 255, 0.02) 42%,
    transparent 68%
  );
  opacity: 0;
  transition: opacity var(--dur-3) var(--ease-out);
  pointer-events: none;
}

.glass:hover::before,
.glass:focus-within::before {
  opacity: 1;
}

/* Refraction edge: a light gradient along the top-left rim */
.glass::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    148deg,
    rgba(255, 255, 255, 0.45),
    rgba(255, 255, 255, 0.06) 26%,
    rgba(255, 255, 255, 0) 52%,
    rgba(255, 255, 255, 0.16) 88%
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0.75;
  pointer-events: none;
}

.glass--pane {
  --glass-body: rgba(11, 13, 21, 0.56);
  border-radius: var(--r-2xl);
  -webkit-backdrop-filter: blur(var(--blur-lg)) saturate(165%);
  backdrop-filter: blur(var(--blur-lg)) saturate(165%);
  box-shadow: var(--shadow-lg);
}

.glass--card {
  --glass-body: var(--glass-body-soft);
  border-radius: var(--r-lg);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.022));
  -webkit-backdrop-filter: blur(var(--blur-sm)) saturate(135%);
  backdrop-filter: blur(var(--blur-sm)) saturate(135%);
  box-shadow: var(--shadow-sm);
}

.glass--float {
  --glass-body: rgba(13, 15, 24, 0.66);
  border-radius: var(--r-pill);
  border-color: var(--glass-line);
  background-image: linear-gradient(180deg, var(--glass-tint-3), rgba(255, 255, 255, 0.03));
  -webkit-backdrop-filter: blur(var(--blur-md)) saturate(160%);
  backdrop-filter: blur(var(--blur-md)) saturate(160%);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

/* Browsers without backdrop-filter get a solid, still-legible surface */
@supports not ((backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px))) {
  .glass,
  .glass--pane,
  .glass--card,
  .glass--float {
    background-color: var(--glass-fallback);
    background-image: none;
  }
}

/* ---------------------------------------------------------------
   6. Buttons and links
   --------------------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 46px;
  padding: 0.7rem 1.4rem;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition:
    transform var(--dur-2) var(--ease-ios),
    box-shadow var(--dur-2) var(--ease-ios),
    background-color var(--dur-2) var(--ease-ios),
    border-color var(--dur-2) var(--ease-ios),
    color var(--dur-2) var(--ease-ios);
}

.btn i {
  font-size: 0.85em;
  transition: transform var(--dur-2) var(--ease-ios);
}

.btn--primary {
  color: var(--on-brand);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0) 55%),
    linear-gradient(135deg, var(--brand-bright), var(--brand));
  box-shadow: 0 12px 30px -14px rgba(243, 150, 28, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn--primary:hover {
  transform: translate3d(0, -2px, 0);
  box-shadow: 0 20px 44px -16px rgba(243, 150, 28, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn--glass {
  color: var(--ink);
  background-color: rgba(255, 255, 255, 0.07);
  border-color: var(--glass-line);
  -webkit-backdrop-filter: blur(var(--blur-sm)) saturate(150%);
  backdrop-filter: blur(var(--blur-sm)) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.btn--glass:hover {
  transform: translate3d(0, -2px, 0);
  background-color: rgba(255, 255, 255, 0.12);
  border-color: var(--glass-line-strong);
}

.btn--ghost {
  color: var(--ink-2);
  border-color: transparent;
  padding-inline: var(--s3);
}

.btn--ghost:hover {
  color: var(--ink);
  border-color: var(--glass-line);
  background-color: rgba(255, 255, 255, 0.04);
}

.btn--sm {
  min-height: 38px;
  padding: 0.4rem 0.95rem;
  font-size: var(--fs-xs);
}

.btn:active {
  transform: scale(0.98);
}

.btn:hover i.fa-arrow-right,
.btn:hover i.fa-arrow-up-right-from-square,
.btn:hover i.fa-arrow-left {
  transform: translate3d(2px, 0, 0);
}

.btn:hover i.fa-arrow-left {
  transform: translate3d(-2px, 0, 0);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  color: var(--brand-bright);
  font-weight: 600;
  font-size: var(--fs-sm);
  border-bottom: 1px solid rgba(255, 180, 92, 0.35);
  padding-bottom: 2px;
  transition: color var(--dur-2) var(--ease-soft), border-color var(--dur-2) var(--ease-soft);
}

.text-link:hover {
  color: #fff;
  border-color: #fff;
}

/* ---------------------------------------------------------------
   7. Chips, tags and pills
   --------------------------------------------------------------- */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--glass-line);
  border-radius: var(--r-pill);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025));
  color: var(--ink-2);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.01em;
  -webkit-backdrop-filter: blur(var(--blur-xs));
  backdrop-filter: blur(var(--blur-xs));
}

.chip--tag {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
}

.status-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.16);
  flex: none;
}

.status-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(74, 222, 128, 0.5);
  animation: pulse-ring 3.4s var(--ease-soft) infinite;
}

@keyframes pulse-ring {
  0% {
    opacity: 0.8;
    transform: scale(0.7);
  }
  70%,
  100% {
    opacity: 0;
    transform: scale(1.5);
  }
}

/* ---------------------------------------------------------------
   8. Media frames
   --------------------------------------------------------------- */
.media {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  background: var(--canvas-raised);
  border: 1px solid var(--glass-line);
  isolation: isolate;
}

.media__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform: translate3d(0, var(--parallax-y, 0px), 0) scale(var(--media-scale, 1.04));
  transition: transform var(--dur-4) var(--ease-out);
  will-change: transform;
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Depth glass on top of imagery, keeps text readable without a flat scrim */
.media--tinted::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7, 8, 13, 0) 45%, rgba(7, 8, 13, 0.55)),
    linear-gradient(140deg, rgba(255, 255, 255, 0.14), transparent 42%);
}

.media__glare {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    46% 60% at var(--mx) var(--my),
    rgba(255, 255, 255, 0.24),
    transparent 70%
  );
  transition: opacity var(--dur-3) var(--ease-out);
}

.media:hover .media__glare {
  opacity: 1;
}

/* ---------------------------------------------------------------
   9. Motion utilities
   --------------------------------------------------------------- */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  transition:
    opacity var(--dur-4) var(--ease-out),
    transform var(--dur-4) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.js [data-reveal="scale"] {
  transform: translate3d(0, 22px, 0) scale(0.97);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* Subtle depth response for floating objects */
.float-slow {
  animation: float-slow 9s var(--ease-soft) infinite alternate;
}

@keyframes float-slow {
  from {
    transform: translate3d(0, -6px, 0);
  }
  to {
    transform: translate3d(0, 6px, 0);
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .media__inner {
    transform: none;
  }
}

/* ---------------------------------------------------------------
   10. Narrow-screen atmosphere tuning
   --------------------------------------------------------------- */
@media (max-width: 720px) {
  :root {
    --shell-pad: clamp(1.1rem, 6vw, 1.6rem);
  }

  .atmosphere__glow {
    filter: blur(60px);
    opacity: 0.45;
  }

  .atmosphere__grid {
    background-size: 54px 54px;
  }
}
