/* Complements Tailwind: accessibility, glass panel, motion system */

/* ----- Obsidian/Sanguine skin helpers (purely visual) ----- */
body {
  background: radial-gradient(circle at 15% 20%, rgba(60, 74, 65, 0.35) 0%, rgba(18, 20, 22, 1) 60%);
}

/* Detail pages: keep only section panels (no body slab) */
body[data-detail-slug="hybrid-action-combat-system"] .article-body-live,
body[data-detail-slug="dungeon-clash"] .article-body-live {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-top: 0 !important;
}

/* Remove drifting grid overlay on these pages */
body[data-detail-slug="hybrid-action-combat-system"] .article-body-live::before,
body[data-detail-slug="dungeon-clash"] .article-body-live::before {
  opacity: 0 !important;
}

body[data-detail-slug="hybrid-action-combat-system"] .article-section,
body[data-detail-slug="dungeon-clash"] .article-section {
  background: rgba(60, 74, 65, 0.10) !important;
  border-color: rgba(90, 64, 60, 0.18) !important;
}

/* Remove "big black rectangles" (video frames) so they blend */
body[data-detail-slug="hybrid-action-combat-system"] .hero-frame,
body[data-detail-slug="dungeon-clash"] .hero-frame,
body[data-detail-slug="hybrid-action-combat-system"] .media-frame,
body[data-detail-slug="dungeon-clash"] .media-frame {
  background: rgba(60, 74, 65, 0.12) !important;
  border-color: rgba(90, 64, 60, 0.22) !important;
  box-shadow: 0 24px 48px -28px rgba(0, 0, 0, 0.55);
}

body[data-detail-slug="hybrid-action-combat-system"] iframe,
body[data-detail-slug="dungeon-clash"] iframe {
  background: transparent !important;
}

.glass-panel {
  background: rgba(60, 74, 65, 0.18);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.entry-title-live {
  background-image: linear-gradient(
    105deg,
    #e2e2e5 0%,
    #ffb4a8 24%,
    #bbcabf 52%,
    #e2e2e5 78%,
    #ffb4a8 100%
  );
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: title-shimmer 10s linear infinite;
}

@keyframes title-shimmer {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 200% center;
  }
}

/* Report-style reference grids (portfolio detail sections) */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.85rem;
}

@media (min-width: 768px) {
  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
    gap: 1rem;
  }
}

.media-grid-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: cover;
  object-position: center;
}

/* Video tiles (e.g. rig demos) need room — go 2-up on desktop, 1-up on mobile */
.media-grid--video {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .media-grid--video {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
  }
}

.media-grid-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: contain;
  background: #000;
}

.media-grid-video[data-zoomable] {
  cursor: zoom-in;
  transition: opacity 0.2s ease;
}

.media-grid-video[data-zoomable]:hover {
  opacity: 0.9;
}

.media-grid-figure,
.media-grid-card {
  margin: 0;
}

.media-grid-figure .media-grid-img {
  cursor: zoom-in;
  transition: opacity 0.2s ease;
}

.media-grid-figure .media-grid-img:hover {
  opacity: 0.9;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(6px);
  cursor: zoom-out;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-img,
.lightbox-video {
  max-width: 95vw;
  max-height: 86vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.5rem;
  box-shadow: 0 24px 64px -16px rgba(0, 0, 0, 0.8);
  cursor: default;
  background: #000;
}

.lightbox-cap {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.5rem 1rem;
  background: #ffb4a8;
  color: #410000;
  z-index: 100;
  font-weight: 700;
  border-radius: 9999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
}

.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;
}

/* Mobile primary nav overlay */
@media (max-width: 767px) {
  .site-header .site-nav#site-nav {
    position: fixed;
    inset: 0;
    z-index: 60;
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    max-width: none;
    max-height: none;
    margin: 0;
    background: rgba(9, 9, 11, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow-y: auto;
    padding: 5rem 1.5rem 2rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
      opacity 0.2s ease,
      visibility 0.2s ease;
  }

  .site-header .site-nav#site-nav.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .site-header .site-nav#site-nav .site-nav-link {
    font-size: 1.125rem;
    line-height: 1.3;
    padding: 0.35rem 0;
  }

  .site-header .nav-toggle {
    position: relative;
    z-index: 70;
  }
}

@media (min-width: 768px) {
  .site-header .site-nav#site-nav {
    position: static !important;
    inset: auto !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    background: transparent !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    padding: 0 !important;
    overflow-x: auto !important;
  }
}

.nav-toggle:focus-visible,
.site-nav-link:focus-visible {
  outline: 2px solid #ffb4a8;
  outline-offset: 3px;
}

/* ----- Simple article layout (project report pages — clean header, no TOC, compact hero) ----- */
html:has(body[data-article-layout="simple"]) {
  scroll-padding-top: 5.5rem;
}

body[data-article-layout="simple"] #hero-root > .pointer-events-none {
  display: none;
}

body[data-article-layout="simple"] #lottie-slot {
  display: none !important;
}

body[data-article-layout="simple"] #hero-root .entry-badge {
  margin-bottom: 1rem;
}

body[data-article-layout="simple"] #hero-root .entry-title-live {
  font-size: clamp(1.625rem, 4.5vw, 2.75rem);
  line-height: 1.1;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  body[data-article-layout="simple"] #hero-root .entry-title-live {
    font-size: clamp(2rem, 3.5vw, 3.25rem);
  }
}

body[data-article-layout="simple"] #hero-root .entry-excerpt {
  font-size: 1rem;
  line-height: 1.6;
}

@media (min-width: 768px) {
  body[data-article-layout="simple"] #hero-root .entry-excerpt {
    font-size: 1.0625rem;
  }
}

body[data-article-layout="simple"] #hero-root .hero-feature {
  margin-top: 1.5rem;
}

body[data-article-layout="simple"] .article-body-live {
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}

@media (min-width: 768px) {
  body[data-article-layout="simple"] .article-body-live {
    padding-top: 3rem;
    padding-bottom: 4rem;
  }
}

body[data-article-layout="simple"] .article-body-live::before,
body[data-article-layout="simple"] .article-ambient {
  opacity: 0.55;
}

@media (prefers-reduced-motion: reduce) {
  body[data-article-layout="simple"] .article-body-live::before,
  body[data-article-layout="simple"] .article-ambient {
    opacity: 0.35;
  }
}

/* ----- Portfolio pieces: blend into dark hero, horizontal frames like reel ----- */
.portfolio-pieces-section {
  position: relative;
  z-index: 20;
  margin-top: -5.5rem;
  padding-top: calc(5.5rem + 2.5rem);
  padding-bottom: 4rem;
  background: linear-gradient(
    180deg,
    rgba(14, 14, 15, 0) 0%,
    rgba(14, 14, 15, 0.45) 2.5rem,
    rgba(14, 14, 15, 0.88) 6rem,
    #0e0e0f 9rem,
    #131314 100%
  );
}

@media (min-width: 768px) {
  .portfolio-pieces-section {
    margin-top: -7rem;
    padding-top: calc(7rem + 3rem);
    background: linear-gradient(
      180deg,
      rgba(14, 14, 15, 0) 0%,
      rgba(14, 14, 15, 0.5) 3rem,
      rgba(14, 14, 15, 0.9) 7rem,
      #0e0e0f 11rem,
      #131314 100%
    );
  }
}

.portfolio-pieces-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 20rem));
  gap: 2.5rem 1.25rem;
  align-items: start;
  justify-items: center;
  justify-content: center;
}

.portfolio-piece {
  width: 100%;
  max-width: 20rem;
}

@media (min-width: 640px) {
  .portfolio-pieces-grid {
    gap: 3rem 1.75rem;
  }
}

@media (min-width: 1024px) {
  .portfolio-pieces-grid {
    gap: 3rem 1.5rem;
  }
}

.portfolio-piece-card {
  display: block;
  text-decoration: none;
  color: #f4f4f5;
  border-radius: 0.5rem;
}

.portfolio-piece-visual {
  width: 100%;
  margin-bottom: 1rem;
}

.portfolio-piece-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
  border-radius: 0.75rem;
  border: 1px solid rgba(90, 64, 60, 0.45);
  background: #000;
  box-shadow:
    0 0 0 1px rgba(255, 180, 168, 0.06),
    0 24px 48px -24px rgba(0, 0, 0, 0.65);
}

.portfolio-piece-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.portfolio-piece-thumb--placeholder {
  min-height: 100%;
  background: linear-gradient(
    145deg,
    #1a191b 0%,
    #262627 40%,
    #1a191b 100%
  );
  box-shadow: inset 0 0 0 1px rgba(143, 245, 255, 0.08);
}

.portfolio-piece-label {
  margin: 0;
  padding: 0 0.25rem;
  text-align: center;
  font-family:
    "Space Grotesk",
    system-ui,
    sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e4e4e7;
}

@media (min-width: 768px) {
  .portfolio-piece-label {
    font-size: 0.8125rem;
  }
}

.portfolio-piece-sub {
  margin: 0.35rem 0 0;
  padding: 0 0.25rem;
  text-align: center;
  font-size: 0.7rem;
  line-height: 1.35;
  color: #a1a1aa;
}

@media (min-width: 768px) {
  .portfolio-piece-sub {
    font-size: 0.75rem;
  }
}

@media (hover: hover) and (pointer: fine) {
  .portfolio-piece-card {
    transition:
      transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
      color 0.2s ease;
  }

  .portfolio-piece-card:hover {
    transform: translateY(-6px);
  }

  .portfolio-piece-card:hover .portfolio-piece-frame {
    border-color: rgba(255, 180, 168, 0.28);
    box-shadow:
      0 0 0 1px rgba(255, 180, 168, 0.12),
      0 28px 56px -20px rgba(0, 0, 0, 0.7),
      0 0 36px -12px rgba(187, 202, 191, 0.12);
  }

  .portfolio-piece-card:hover .portfolio-piece-label {
    color: #ffb4a8;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portfolio-piece-card {
    transition: none;
  }

  .portfolio-piece-card:hover {
    transform: none;
  }
}

.glass-panel {
  background: rgba(44, 44, 45, 0.4);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

/* ----- Scroll reveal ----- */
[data-reveal] {
  --reveal-delay: 0ms;
  --reveal-duration: 720ms;
  --reveal-y: 1.125rem;
  opacity: 0;
  transform: translate3d(0, var(--reveal-y), 0);
  transition:
    opacity var(--reveal-duration) cubic-bezier(0.22, 1, 0.36, 1),
    transform var(--reveal-duration) cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.5s ease,
    border-color 0.5s ease;
  transition-delay: var(--reveal-delay);
  will-change: opacity, transform;
}

[data-reveal].is-inview {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  will-change: auto;
}

/* Section cards: subtle glow when revealed */
[data-reveal].reveal-section.is-inview {
  box-shadow:
    0 0 0 1px rgba(143, 245, 255, 0.12),
    0 24px 48px -24px rgba(0, 0, 0, 0.55),
    0 0 40px -20px rgba(135, 76, 255, 0.15);
  border-color: rgba(143, 245, 255, 0.22);
}

/* Hero background — slow Ken Burns */
.hero-bg-img {
  transform: scale(1.06);
  animation: hero-kenburns 28s ease-in-out infinite alternate;
}

@keyframes hero-kenburns {
  0% {
    transform: scale(1.06) translate(0, 0);
  }
  100% {
    transform: scale(1.12) translate(-1.2%, -0.8%);
  }
}

/* TOC link entrance */
@keyframes toc-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#toc-nav.toc-loaded .toc-link {
  animation: toc-fade-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

#toc-nav.toc-loaded .toc-link:nth-child(1) {
  animation-delay: 0.04s;
}
#toc-nav.toc-loaded .toc-link:nth-child(2) {
  animation-delay: 0.08s;
}
#toc-nav.toc-loaded .toc-link:nth-child(3) {
  animation-delay: 0.12s;
}
#toc-nav.toc-loaded .toc-link:nth-child(4) {
  animation-delay: 0.16s;
}
#toc-nav.toc-loaded .toc-link:nth-child(5) {
  animation-delay: 0.2s;
}
#toc-nav.toc-loaded .toc-link:nth-child(6) {
  animation-delay: 0.24s;
}
#toc-nav.toc-loaded .toc-link:nth-child(7) {
  animation-delay: 0.28s;
}
#toc-nav.toc-loaded .toc-link:nth-child(8) {
  animation-delay: 0.32s;
}
#toc-nav.toc-loaded .toc-link:nth-child(9) {
  animation-delay: 0.36s;
}
#toc-nav.toc-loaded .toc-link:nth-child(10) {
  animation-delay: 0.4s;
}
#toc-nav.toc-loaded .toc-link:nth-child(11) {
  animation-delay: 0.44s;
}
#toc-nav.toc-loaded .toc-link:nth-child(12) {
  animation-delay: 0.48s;
}

/* Tag stagger (inside revealed row) */
.tags-row.is-inview .tag {
  animation: toc-fade-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.tags-row.is-inview .tag:nth-child(1) {
  animation-delay: 0.05s;
}
.tags-row.is-inview .tag:nth-child(2) {
  animation-delay: 0.1s;
}
.tags-row.is-inview .tag:nth-child(3) {
  animation-delay: 0.15s;
}
.tags-row.is-inview .tag:nth-child(4) {
  animation-delay: 0.2s;
}
.tags-row.is-inview .tag:nth-child(5) {
  animation-delay: 0.25s;
}
.tags-row.is-inview .tag:nth-child(6) {
  animation-delay: 0.3s;
}
.tags-row.is-inview .tag:nth-child(7) {
  animation-delay: 0.35s;
}
.tags-row.is-inview .tag:nth-child(8) {
  animation-delay: 0.4s;
}

/* Header scroll state */
.site-header {
  transition:
    background-color 0.35s ease,
    box-shadow 0.35s ease,
    border-color 0.35s ease;
}

.site-header.is-scrolled {
  background-color: rgba(9, 9, 11, 0.72) !important;
  box-shadow: 0 1px 0 rgba(143, 245, 255, 0.06), 0 12px 40px -20px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html.reduced-motion [data-reveal],
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
    will-change: auto !important;
  }

  html.reduced-motion .hero-bg-img,
  .hero-bg-img {
    animation: none !important;
    transform: scale(1.05) !important;
  }

  #toc-nav.toc-loaded .toc-link {
    animation: none !important;
    opacity: 1 !important;
  }

  .tags-row.is-inview .tag {
    animation: none !important;
  }

  .site-header.is-scrolled {
    transition: none;
  }

  .fx-canvas,
  .fx-canvas-article {
    display: none;
  }

  .article-ambient .article-orb {
    animation: none !important;
  }

  .reveal-section.is-inview .article-h2,
  .reveal-section.is-inview .ornament,
  .reveal-section.is-inview .prose .prose-p,
  .reveal-section.is-inview figure.media-bleed,
  .reveal-section.is-inview .article-h3,
  .reveal-section.is-inview .tech-grid .tech-block,
  #final-thoughts.is-inview .article-h2,
  #thanks-block.is-inview .article-h2,
  #contact.is-inview .article-h2,
  #final-thoughts.is-inview .prose .prose-p,
  #thanks-block.is-inview .thanks-list,
  #contact.is-inview .contact-lede,
  #contact.is-inview .contact-links {
    animation: none !important;
  }

  @media (hover: hover) {
    #toc-nav .toc-link:hover,
    [data-reveal].reveal-section.is-inview:hover {
      transform: none !important;
    }
  }
}

html.reduced-motion [data-reveal].reveal-section.is-inview {
  box-shadow: none;
}

/* ----- Phase 2: Hero ambient orbs ----- */
.hero-ambient {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(88px);
  opacity: 0.42;
  pointer-events: none;
}

.hero-orb--a {
  width: min(55vw, 420px);
  height: min(55vw, 420px);
  left: -8%;
  top: 18%;
  background: radial-gradient(
    circle,
    rgba(143, 245, 255, 0.85) 0%,
    rgba(0, 238, 252, 0.2) 55%,
    transparent 70%
  );
  animation: orb-drift-a 22s ease-in-out infinite alternate;
}

.hero-orb--b {
  width: min(48vw, 380px);
  height: min(48vw, 380px);
  right: -5%;
  top: 35%;
  background: radial-gradient(
    circle,
    rgba(172, 137, 255, 0.75) 0%,
    rgba(112, 0, 255, 0.2) 55%,
    transparent 70%
  );
  animation: orb-drift-b 18s ease-in-out infinite alternate;
}

.hero-orb--c {
  width: min(42vw, 320px);
  height: min(42vw, 320px);
  left: 28%;
  bottom: -5%;
  background: radial-gradient(
    circle,
    rgba(255, 107, 152, 0.45) 0%,
    rgba(252, 0, 120, 0.12) 60%,
    transparent 72%
  );
  animation: orb-drift-c 26s ease-in-out infinite alternate;
}

@keyframes orb-drift-a {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(6%, -4%) scale(1.08);
  }
}

@keyframes orb-drift-b {
  0% {
    transform: translate(0, 0) scale(1.02);
  }
  100% {
    transform: translate(-7%, 5%) scale(0.95);
  }
}

@keyframes orb-drift-c {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(-5%, -6%) scale(1.1);
  }
}

/* Article background drift */
.article-body-live::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.055;
  background-image:
    linear-gradient(
      rgba(255, 180, 168, 0.22) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(187, 202, 191, 0.16) 1px,
      transparent 1px
    );
  background-size: 48px 48px;
  animation: article-grid-drift 90s linear infinite;
}

.article-body-live > .article-ambient,
.article-body-live > .fx-canvas-article {
  z-index: 0;
}

.article-body-live > *:not(.article-ambient):not(.fx-canvas-article) {
  position: relative;
  z-index: 1;
}

/* Article ambient orbs (scroll area) */
.article-ambient {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.article-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  opacity: 0.28;
  pointer-events: none;
}

.article-orb--1 {
  width: min(70vw, 520px);
  height: min(70vw, 520px);
  left: -20%;
  top: 8%;
  background: radial-gradient(
    circle,
    rgba(143, 245, 255, 0.5) 0%,
    transparent 65%
  );
  animation: article-orb-drift-1 32s ease-in-out infinite alternate;
}

.article-orb--2 {
  width: min(55vw, 420px);
  height: min(55vw, 420px);
  right: -15%;
  bottom: 15%;
  background: radial-gradient(
    circle,
    rgba(172, 137, 255, 0.45) 0%,
    transparent 62%
  );
  animation: article-orb-drift-2 26s ease-in-out infinite alternate;
}

@keyframes article-orb-drift-1 {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(8%, 6%) scale(1.06);
  }
}

@keyframes article-orb-drift-2 {
  0% {
    transform: translate(0, 0) scale(1.02);
  }
  100% {
    transform: translate(-6%, -5%) scale(0.96);
  }
}

.fx-canvas-article {
  display: block;
}

/* Stagger content inside sections when they enter view */
@keyframes block-peek {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal-section.is-inview .article-h2 {
  animation: block-peek 0.58s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: 0.04s;
}

.reveal-section.is-inview .ornament {
  animation: block-peek 0.52s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: 0.08s;
}

.reveal-section.is-inview .prose .prose-p:nth-child(1) {
  animation: block-peek 0.52s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: 0.12s;
}
.reveal-section.is-inview .prose .prose-p:nth-child(2) {
  animation: block-peek 0.52s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: 0.18s;
}
.reveal-section.is-inview .prose .prose-p:nth-child(3) {
  animation: block-peek 0.52s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: 0.24s;
}
.reveal-section.is-inview .prose .prose-p:nth-child(4) {
  animation: block-peek 0.52s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: 0.3s;
}
.reveal-section.is-inview .prose .prose-p:nth-child(5) {
  animation: block-peek 0.52s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: 0.36s;
}
.reveal-section.is-inview .prose .prose-p:nth-child(6) {
  animation: block-peek 0.52s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: 0.42s;
}

.reveal-section.is-inview figure.media-bleed {
  animation: block-peek 0.65s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: 0.14s;
}

.reveal-section.is-inview .article-h3 {
  animation: block-peek 0.52s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: 0.1s;
}

.reveal-section.is-inview .tech-grid .tech-block {
  animation: block-peek 0.5s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.reveal-section.is-inview .tech-grid .tech-block:nth-child(1) {
  animation-delay: 0.12s;
}

.reveal-section.is-inview .tech-grid .tech-block:nth-child(2) {
  animation-delay: 0.2s;
}

.reveal-section.is-inview .tech-grid .tech-block:nth-child(3) {
  animation-delay: 0.28s;
}

/* Design references — show the three reference boards side by side */
#design-references .tech-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

#design-references .tech-grid .tech-block {
  padding: 1rem;
}

#design-references .tech-grid .tech-title {
  font-size: 0.7rem;
}

@media (max-width: 768px) {
  #design-references .tech-grid {
    grid-template-columns: 1fr;
  }
}

/* Final / thanks / contact blocks (use reveal-section or data-reveal on section) */
#final-thoughts.is-inview .article-h2,
#thanks-block.is-inview .article-h2,
#contact.is-inview .article-h2 {
  animation: block-peek 0.55s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: 0.05s;
}

#final-thoughts.is-inview .prose .prose-p,
#thanks-block.is-inview .thanks-list,
#contact.is-inview .contact-lede,
#contact.is-inview .contact-links {
  animation: block-peek 0.52s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: 0.12s;
}

/* TOC topic hover — pop */
@media (hover: hover) and (pointer: fine) {
  #toc-nav .toc-link {
    transition:
      transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
      color 0.2s ease,
      border-color 0.2s ease,
      text-shadow 0.25s ease;
    display: inline-block;
    transform-origin: center bottom;
  }

  #toc-nav .toc-link:hover {
    transform: translateY(-5px) scale(1.06);
    color: #fff;
    text-shadow: 0 0 24px rgba(143, 245, 255, 0.45);
    border-bottom-color: rgba(143, 245, 255, 0.85);
  }

  [data-reveal].reveal-section.is-inview {
    transition:
      transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
      box-shadow 0.28s ease,
      border-color 0.28s ease;
  }

  [data-reveal].reveal-section.is-inview:hover {
    transform: translate3d(0, -8px, 0) scale(1.012);
  }
}

@keyframes article-grid-drift {
  0% {
    background-position: 0 0, 0 0;
  }
  100% {
    background-position: 48px 48px, -48px 48px;
  }
}

.fx-canvas {
  display: block;
}

html.reduced-motion .fx-canvas,
html.reduced-motion .fx-canvas-article {
  display: none;
}

html.reduced-motion .article-ambient .article-orb {
  animation: none !important;
}

/* Phase 2 + 3 reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero-ambient,
  .hero-orb {
    animation: none !important;
  }

  .entry-title-live {
    animation: none !important;
    background: none !important;
    -webkit-background-clip: unset !important;
    background-clip: unset !important;
    -webkit-text-fill-color: #ffffff !important;
    color: #ffffff !important;
  }

  .article-body-live::before {
    animation: none !important;
  }
}

html.reduced-motion .hero-ambient,
html.reduced-motion .hero-orb {
  animation: none !important;
}

html.reduced-motion .entry-title-live {
  animation: none !important;
  background: none !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
  -webkit-text-fill-color: #ffffff !important;
  color: #ffffff !important;
}

html.reduced-motion .article-body-live::before {
  animation: none !important;
}
