/* ============================================================
   Automation Club — Main Stylesheet
   ------------------------------------------------------------
   Design System: Silent Luxury / Digital Sanctuary
   Depends on:    Tailwind (CDN) — color tokens & utilities are
                  configured inline in index.html <head>.
   Sections:
     1. Base / Typography helpers
     2. Reveal animation system (scroll-triggered)
     3. Editorial decorations (ghost numerals, chapter rows)
     4. Bento cards (cursor glow)
     5. Promise rows (guarantee)
     6. Ambient motion (floating blobs)
     7. Glass buttons (primary / secondary / icon / sizes)
     8. Mobile menu
     9. Process timeline (rail + ring activation)
    10. Responsive polish (mobile < 768px, tiny < 400px)
   ============================================================ */

/* ---------- 1. Base ---------- */
html { scroll-behavior: smooth; }
body { font-feature-settings: "ss01", "ss02"; }
.material-symbols-outlined { font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24; }
.glass-nav { background: rgba(20,19,18,0.82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.ghost-border { box-shadow: inset 0 0 0 1px rgba(69,70,77,0.15); }
.tonal-divider { background: linear-gradient(180deg, transparent, rgba(144,144,151,0.08), transparent); }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details[open] .faq-icon { transform: rotate(45deg); }
.faq-icon { transition: transform .4s cubic-bezier(.2,.8,.2,1); }
.num-ring { font-variant-numeric: tabular-nums; }
input:focus, textarea:focus { outline: none; }
.radio-pill:has(input:checked) { background: #2b2a29; box-shadow: inset 0 0 0 1px rgba(214,196,172,0.45); }
.editorial-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; }

/* ---------- 2. Global reveal animation system ---------- */
[data-reveal] {
  opacity: 0;
  transition: opacity 1.1s cubic-bezier(.2,.8,.2,1),
              transform 1.1s cubic-bezier(.2,.8,.2,1),
              filter 1.1s cubic-bezier(.2,.8,.2,1);
  will-change: opacity, transform, filter;
}
[data-reveal="up"] { transform: translateY(40px); }
[data-reveal="up-sm"] { transform: translateY(18px); }
[data-reveal="right"] { transform: translateX(-40px); }
[data-reveal="left"] { transform: translateX(40px); }
[data-reveal="blur"] { filter: blur(14px); transform: translateY(12px); }
[data-reveal="scale"] { transform: scale(.96); }
[data-reveal].is-in { opacity: 1; transform: none; filter: none; }

/* Mask reveal for lines of text */
.mask-line { overflow: hidden; display: block; }
.mask-line > span {
  display: block;                       /* block = allows natural wrapping on narrow screens */
  transform: translateY(110%);
  transition: transform 1.2s cubic-bezier(.2,.8,.2,1);
  will-change: transform;
}
.mask-line.is-in > span { transform: translateY(0); }

/* ---------- 3. Editorial decorations ---------- */
.ghost-num {
  font-family: "Newsreader", serif;
  font-style: italic;
  font-weight: 200;
  line-height: 0.82;
  letter-spacing: -0.04em;
  color: rgba(190,198,224,0.055);
  pointer-events: none;
  user-select: none;
}
.chapter-row { transition: background .6s ease; }
.chapter-row:hover { background: rgba(255,255,255,0.015); }
.chapter-row:hover .chapter-num { color: rgba(190,198,224,0.12); }
.chapter-num { transition: color .6s ease, transform 1.2s cubic-bezier(.2,.8,.2,1); }

/* ---------- 4. Bento cards ---------- */
.bento-card { position: relative; overflow: hidden; transition: transform .7s cubic-bezier(.2,.8,.2,1), background .7s ease; }
.bento-card::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(600px circle at var(--mx,50%) var(--my,50%), rgba(190,198,224,0.08), transparent 40%);
  opacity: 0;
  transition: opacity .6s ease;
  pointer-events: none;
}
.bento-card:hover::after { opacity: 1; }
.bento-card:hover { background: #2b2a29; }

/* ---------- 5. Promise rows (Guarantee) ---------- */
.promise-row .promise-line {
  display: inline-block;
  position: relative;
}
.promise-row .promise-line::after {
  content: "";
  position: absolute;
  bottom: -8px; right: 0;
  width: 0; height: 1px;
  background: #d6c4ac;
  transition: width 1.2s cubic-bezier(.2,.8,.2,1);
}
.promise-row.is-in .promise-line::after { width: 88px; }

/* ---------- 6. Ambient floating blob ---------- */
@keyframes float-slow {
  0%,100% { transform: translate3d(0,0,0) scale(1); }
  50%     { transform: translate3d(6px,-8px,0) scale(1.02); }
}
.ambient-blob { animation: float-slow 18s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal], .mask-line > span, .chapter-num, .ambient-blob, .promise-row .promise-line::after {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}

/* ============================================================
   7. Glass Buttons — premium dark glass with rim light
   ============================================================ */
.btn-glass {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.95rem 1.75rem;
  border-radius: 9999px;
  font-family: 'Heebo', 'Assistant', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  color: #f3ebe1;
  text-decoration: none;
  cursor: pointer;
  border: 0;
  background:
    linear-gradient(180deg, #2d2c2b 0%, #1a1918 55%, #0d0c0b 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.14),
    inset 0 -1px 0 rgba(0,0,0,0.6),
    0 0 0 1px rgba(255,255,255,0.04),
    0 8px 24px -8px rgba(0,0,0,0.7),
    0 0 26px -6px rgba(190,198,224,0.10);
  transition: all .45s cubic-bezier(.2,.8,.2,1);
  isolation: isolate;
  overflow: hidden;
}
.btn-glass::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 9999px;
  background: radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,0.08), transparent 55%);
  pointer-events: none;
  z-index: -1;
}
.btn-glass:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.22),
    inset 0 -1px 0 rgba(0,0,0,0.55),
    0 0 0 1px rgba(190,198,224,0.18),
    0 14px 36px -10px rgba(0,0,0,0.8),
    0 0 50px -4px rgba(190,198,224,0.28);
}
.btn-glass:active {
  transform: translateY(0) scale(0.985);
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.5),
    inset 0 -1px 0 rgba(255,255,255,0.06),
    0 0 0 1px rgba(255,255,255,0.05),
    0 4px 12px -4px rgba(0,0,0,0.7);
}
.btn-glass:focus-visible {
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.2),
    0 0 0 2px rgba(190,198,224,0.5),
    0 0 40px -4px rgba(190,198,224,0.25);
}

/* Primary variant — warmer rim (more prominent) */
.btn-glass-primary {
  background:
    linear-gradient(180deg, #3a425a 0%, #1a2038 55%, #0f172a 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.2),
    inset 0 -1px 0 rgba(0,0,0,0.55),
    0 0 0 1px rgba(190,198,224,0.12),
    0 10px 30px -8px rgba(0,0,0,0.75),
    0 0 36px -4px rgba(190,198,224,0.22);
}
.btn-glass-primary:hover {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.3),
    inset 0 -1px 0 rgba(0,0,0,0.5),
    0 0 0 1px rgba(190,198,224,0.32),
    0 16px 40px -10px rgba(0,0,0,0.85),
    0 0 60px -4px rgba(190,198,224,0.38);
}

/* Size variants */
.btn-glass-lg {
  min-height: 58px;
  padding: 1.15rem 2.25rem;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
}
.btn-glass-sm {
  min-height: 40px;
  padding: 0.6rem 1.25rem;
  font-size: 0.8rem;
}
.btn-glass-full { width: 100%; }

/* Icon-only round glass button (hamburger etc.) */
.btn-icon-glass {
  width: 44px; height: 44px;
  border-radius: 9999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #2b2a29 0%, #141312 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 -1px 0 rgba(0,0,0,0.5),
    0 0 0 1px rgba(255,255,255,0.04),
    0 6px 18px -6px rgba(0,0,0,0.6);
  color: #e6e1e0;
  transition: all .3s ease;
  border: 0; cursor: pointer;
}
.btn-icon-glass:hover {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    0 0 0 1px rgba(190,198,224,0.18),
    0 8px 20px -6px rgba(0,0,0,0.7);
}

/* ---------- 8. Mobile menu ---------- */
.mobile-menu { visibility: hidden; opacity: 0; transition: opacity .4s ease, visibility .4s ease; }
.mobile-menu.is-open { visibility: visible; opacity: 1; }
.mobile-menu .menu-link {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s cubic-bezier(.2,.8,.2,1), transform .5s cubic-bezier(.2,.8,.2,1);
}
.mobile-menu.is-open .menu-link { opacity: 1; transform: none; }
.mobile-menu.is-open .menu-link:nth-child(1) { transition-delay: .08s; }
.mobile-menu.is-open .menu-link:nth-child(2) { transition-delay: .16s; }
.mobile-menu.is-open .menu-link:nth-child(3) { transition-delay: .24s; }
.mobile-menu.is-open .menu-link:nth-child(4) { transition-delay: .32s; }
.mobile-menu.is-open .menu-link:nth-child(5) { transition-delay: .40s; }
body.menu-open { overflow: hidden; }

/* ---------- 9. Process timeline ---------- */
.rail-progress {
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .25s linear;
  background: linear-gradient(180deg, rgba(190,198,224,0) 0%, rgba(190,198,224,0.9) 15%, rgba(214,196,172,0.85) 60%, rgba(214,196,172,0) 100%);
  filter: drop-shadow(0 0 6px rgba(190,198,224,0.35));
}
.step-item {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s cubic-bezier(.2,.8,.2,1), transform .9s cubic-bezier(.2,.8,.2,1);
}
.step-item.is-visible { opacity: 1; transform: translateY(0); }
.step-ring {
  transition: background .7s cubic-bezier(.2,.8,.2,1), box-shadow .7s cubic-bezier(.2,.8,.2,1), color .7s cubic-bezier(.2,.8,.2,1), transform .7s cubic-bezier(.2,.8,.2,1);
  background: #211f1e;
  box-shadow: inset 0 0 0 1px rgba(69,70,77,0.25);
  color: #bec6e0;
}
.step-item.is-active .step-ring {
  background: linear-gradient(135deg, #bec6e0 0%, #0f172a 100%);
  color: #283044;
  box-shadow: 0 0 0 6px rgba(190,198,224,0.06), 0 0 28px rgba(190,198,224,0.35), inset 0 0 0 1px rgba(190,198,224,0.4);
  transform: scale(1.04);
}
.step-item .step-body { transition: opacity .6s ease, color .6s ease; }
.step-item:not(.is-active) .step-body { opacity: 0.55; }
.step-item.is-active .step-body { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .step-item, .rail-progress, .step-ring { transition: none !important; }
  .step-item { opacity: 1; transform: none; }
}

/* ============================================================
   10. Responsive polish
   ============================================================ */
@media (max-width: 640px) {
  .btn-glass-lg { width: 100%; min-height: 54px; padding: 1rem 1.5rem; font-size: 0.9rem; }
  .hero-cta-row { width: 100%; }
}

@media (max-width: 767px) {
  .ghost-num { font-size: 7.5rem !important; opacity: 0.7; }
  .bento-card { min-height: auto !important; }
  .bento-card.md\:col-span-2.md\:row-span-2 { min-height: 360px !important; }
  .chapter-row { padding-top: 3rem !important; padding-bottom: 3rem !important; }
  .promise-row { padding-top: 3rem !important; padding-bottom: 3rem !important; }
  .radio-pill { min-height: 48px; }
  input, textarea { font-size: 16px !important; } /* prevent iOS zoom on focus */
  section#process ol { max-width: 100% !important; }
}

@media (max-width: 400px) {
  .ghost-num { font-size: 6rem !important; }
}

/* ============================================================
   11. Ambient Motion & Section Dividers
   ============================================================ */

/* ---- Scroll progress bar ---- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 60;
  pointer-events: none;
  background: rgba(69,70,77,0.12);
}
.scroll-progress > div {
  height: 100%;
  width: 100%;
  background: linear-gradient(270deg, #bec6e0 0%, #d6c4ac 100%);
  transform: scaleX(0);
  transform-origin: right center;       /* RTL: grow from right */
  transition: transform .08s linear;
  box-shadow: 0 0 8px rgba(190,198,224,0.4);
}

/* ---- Marquee (tools strip) ---- */
.marquee-strip {
  position: relative;
  overflow: hidden;
  background: #0f0e0d;                  /* surface-container-lowest */
  padding: 1.6rem 0;
  border-top: 1px solid rgba(69,70,77,0.15);
  border-bottom: 1px solid rgba(69,70,77,0.15);
  user-select: none;
}
.marquee-strip::before,
.marquee-strip::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 120px;
  z-index: 2;
  pointer-events: none;
}
.marquee-strip::before { right: 0; background: linear-gradient(270deg, #0f0e0d 0%, rgba(15,14,13,0) 100%); }
.marquee-strip::after  { left: 0;  background: linear-gradient( 90deg, #0f0e0d 0%, rgba(15,14,13,0) 100%); }
.marquee-track {
  display: flex;
  align-items: center;
  gap: 4.5rem;
  width: max-content;
  animation: marquee-scroll 48s linear infinite;
  will-change: transform;
}
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.marquee-strip:hover .marquee-track { animation-play-state: paused; }
.marquee-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(198,198,205,0.32);        /* on-surface-variant, dim */
  transition: color .5s ease, transform .5s ease;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
}
.marquee-item .material-symbols-outlined {
  font-size: 30px;
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}
.marquee-item:hover {
  color: rgba(214,196,172,0.9);         /* secondary */
  transform: translateY(-2px);
}

/* ---- Section dividers ---- */
.section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 3rem 1.5rem;
  max-width: 420px;
  margin: 0 auto;
}
.section-divider .line {
  display: block;
  flex: 1 1 0;
  height: 1px;
  background: rgba(69,70,77,0.3);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 1.4s cubic-bezier(.2,.8,.2,1);
}
.section-divider .glyph {
  display: inline-block;
  font-family: 'Newsreader', serif;
  font-weight: 300;
  font-size: 18px;
  line-height: 1;
  color: rgba(214,196,172,0.65);        /* secondary/65 */
  transform: rotate(-180deg) scale(0.6);
  opacity: 0;
  transition: transform 1.1s cubic-bezier(.2,.8,.2,1) .25s,
              opacity  1.1s ease .25s;
}
.section-divider.is-in .line  { transform: scaleX(1); }
.section-divider.is-in .glyph { transform: rotate(0) scale(1); opacity: 1; }

/* ---- Primary button shimmer ---- */
.btn-glass-primary::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: -45%;
  width: 45%;
  background: linear-gradient(90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.18) 50%,
    rgba(255,255,255,0) 100%);
  transform: translateX(0);
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  border-radius: 9999px;
}
.btn-glass-primary.is-shimmering::after {
  animation: btn-shimmer 1.8s ease-out forwards;
}
@keyframes btn-shimmer {
  0%   { opacity: 0;   transform: translateX(0); }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { opacity: 0;   transform: translateX(360%); }
}

/* ---- Reduced motion overrides ---- */
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none !important; }
  .section-divider .line,
  .section-divider .glyph { transition: none !important; transform: none !important; opacity: 1 !important; }
  .scroll-progress > div { transition: none !important; }
  .btn-glass-primary.is-shimmering::after { animation: none !important; opacity: 0 !important; }
}

/* ---- Mobile polish for motion layer ---- */
@media (max-width: 767px) {
  .marquee-strip { padding: 1.1rem 0; }
  .marquee-item { width: 36px; height: 36px; }
  .marquee-item .material-symbols-outlined { font-size: 26px; }
  .marquee-track { gap: 2.75rem; animation-duration: 38s; }
  .marquee-strip::before, .marquee-strip::after { width: 56px; }
  .section-divider { padding: 2.25rem 1rem; max-width: 280px; gap: 1rem; }
  .section-divider .glyph { font-size: 15px; }
}

/* ============================================================
   12. Continuous Ambient Animations (SVG + UI)
   ------------------------------------------------------------
   Small motions that keep the page feeling alive while scrolling
   ============================================================ */

@keyframes spin-slow         { to { transform: rotate(360deg); } }
@keyframes spin-slow-reverse { to { transform: rotate(-360deg); } }
@keyframes pulse-node {
  0%, 100% { transform: scale(1);    opacity: 0.85; }
  50%      { transform: scale(1.35); opacity: 1;    }
}
@keyframes twinkle {
  0%, 100% { opacity: 0.32; }
  50%      { opacity: 1;    }
}
@keyframes flow-stroke { to { stroke-dashoffset: -36; } }
@keyframes breathe {
  0%, 100% { transform: scale(1);    }
  50%      { transform: scale(1.045); }
}
@keyframes status-pulse-ring {
  0%   { transform: scale(1);    opacity: 0.7; }
  100% { transform: scale(2.8);  opacity: 0;   }
}
@keyframes status-core {
  0%, 100% { opacity: 0.9; }
  50%      { opacity: 1;   }
}

/* SVG-friendly transform-origin for circles/groups */
.anim-spin-slow,
.anim-spin-slow-reverse,
.anim-pulse-node {
  transform-box: fill-box;
  transform-origin: center;
}
.anim-spin-slow         { animation: spin-slow         55s linear infinite; }
.anim-spin-slow-reverse { animation: spin-slow-reverse 42s linear infinite; }
.anim-pulse-node        { animation: pulse-node        3.2s ease-in-out infinite; }

.anim-twinkle-1 { animation: twinkle 2.4s ease-in-out infinite;       }
.anim-twinkle-2 { animation: twinkle 2.8s ease-in-out .6s  infinite; }
.anim-twinkle-3 { animation: twinkle 3.2s ease-in-out 1.2s infinite; }
.anim-twinkle-4 { animation: twinkle 2.6s ease-in-out 1.8s infinite; }

.anim-flow-stroke {
  stroke-dasharray: 4 8;
  animation: flow-stroke 1.8s linear infinite;
}

.anim-breathe {
  display: inline-block;
  animation: breathe 3.5s ease-in-out infinite;
}

/* Status dot — pulsing availability indicator */
.status-dot {
  position: relative;
  display: inline-flex;
  width: 9px; height: 9px;
  border-radius: 9999px;
  background: #d6c4ac;
  box-shadow: 0 0 10px rgba(214,196,172,0.55);
  animation: status-core 2s ease-in-out infinite;
  flex-shrink: 0;
}
.status-dot::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: #d6c4ac;
  animation: status-pulse-ring 2s ease-out infinite;
  z-index: -1;
}

@media (prefers-reduced-motion: reduce) {
  .anim-spin-slow, .anim-spin-slow-reverse,
  .anim-pulse-node, .anim-twinkle-1, .anim-twinkle-2, .anim-twinkle-3, .anim-twinkle-4,
  .anim-flow-stroke, .anim-breathe,
  .status-dot, .status-dot::before {
    animation: none !important;
  }
  .anim-flow-stroke { stroke-dasharray: none !important; }
}

/* ============================================================
   13. Ambient Background Layers (drifting dots + aurora)
   ------------------------------------------------------------
   Subtle motion "behind" components — gives sections depth
   ============================================================ */

/* Drifting particle field — CSS-only dot cloud */
.bg-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.8;
  background-image:
    radial-gradient(1px 1px at 18% 22%, rgba(214,196,172,0.35) 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 55%, rgba(190,198,224,0.28) 50%, transparent 51%),
    radial-gradient(1px 1px at 38% 78%, rgba(214,196,172,0.22) 50%, transparent 51%),
    radial-gradient(1px 1px at 86% 12%, rgba(190,198,224,0.32) 50%, transparent 51%),
    radial-gradient(1px 1px at 8%  65%, rgba(214,196,172,0.26) 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 30%, rgba(190,198,224,0.2)  50%, transparent 51%),
    radial-gradient(1px 1px at 92% 88%, rgba(214,196,172,0.24) 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 48%, rgba(190,198,224,0.18) 50%, transparent 51%);
  background-size: 420px 560px;
  background-repeat: repeat;
  animation: particles-drift 90s linear infinite;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 40%, transparent 100%);
}
@keyframes particles-drift {
  from { background-position: 0 0; }
  to   { background-position: -420px -560px; }
}

/* Aurora — slow spinning conic gradient felt more than seen */
.bg-aurora {
  position: absolute;
  inset: -30%;
  pointer-events: none;
  z-index: 0;
  background: conic-gradient(from 0deg at 50% 50%,
    rgba(190,198,224,0)    0%,
    rgba(190,198,224,0.09) 18%,
    rgba(214,196,172,0.06) 40%,
    rgba(190,198,224,0)    55%,
    rgba(214,196,172,0.08) 75%,
    rgba(190,198,224,0)    100%);
  filter: blur(40px);
  animation: aurora-spin 110s linear infinite;
  opacity: 0.7;
  will-change: transform;
  contain: layout paint;
}
@keyframes aurora-spin { to { transform: rotate(360deg); } }

/* Ghost decorative glyph (large background glyph for editorial depth) */
.ghost-glyph {
  position: absolute;
  font-family: 'Newsreader', serif;
  font-style: italic;
  font-weight: 200;
  line-height: 0.8;
  color: rgba(214,196,172,0.045);
  pointer-events: none;
  user-select: none;
  letter-spacing: -0.04em;
}

/* ---- Task loop terminal ---- */
.task-loop-wrap { direction: rtl; }
.task-loop {
  list-style: none;
  margin: 0; padding: 0;
  color: rgba(198,198,205,0.55);
  animation: task-scroll 18s linear infinite;
  will-change: transform;
}
.task-loop li {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

@media (max-width: 640px) {
  .task-loop { font-size: 0.75rem; letter-spacing: 0.02em; line-height: 2.4; }
}
.task-loop li:nth-child(odd)  { color: rgba(198,198,205,0.45); }
.task-loop li:nth-child(even) { color: rgba(190,198,224,0.65); }
@keyframes task-scroll {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .task-loop { animation: none !important; }
}

/* ---- Stat cards ---- */
.stat-card {
  transition: background .4s ease, box-shadow .4s ease;
}
.stat-card:hover {
  background: #2b2a29;
  box-shadow: inset 0 0 0 1px rgba(190,198,224,0.15), 0 8px 32px -8px rgba(0,0,0,0.6);
}
.stat-card-bar {
  position: absolute;
  bottom: 0; right: 0; left: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(190,198,224,0.5), rgba(214,196,172,0.4), transparent);
  transform: scaleX(0);
  transform-origin: right;
  animation: bar-in 1.2s cubic-bezier(.2,.8,.2,1) forwards;
}
@keyframes bar-in {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .stat-card-bar { animation: none !important; transform: scaleX(1); }
}

/* ---- Scan line ---- */
.bg-scan-line {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-scan-line::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 120px;
  background: linear-gradient(180deg,
    transparent                    0%,
    rgba(190,198,224,0.07)         40%,
    rgba(190,198,224,0.13)         50%,
    rgba(190,198,224,0.07)         60%,
    transparent                    100%);
  animation: scan-down 8s linear infinite;
  will-change: transform;
}
@keyframes scan-down {
  from { transform: translateY(-120px); }
  to   { transform: translateY(calc(100vh + 120px)); }
}

@media (prefers-reduced-motion: reduce) {
  .bg-scan-line::before { animation: none !important; opacity: 0 !important; }
}

@media (prefers-reduced-motion: reduce) {
  .bg-particles, .bg-aurora { animation: none !important; }
}

/* ============================================================
   14. Case Studies — Cards + Hover Reveal
   ------------------------------------------------------------
   Silent Luxury rules:
     - No 1px solid borders. Surface tonal shifts only.
     - Glass overlay = surface @ 70% + 24px backdrop blur.
     - Hover: surface-container -> surface-bright + soft ambient shadow.
     - Stack chips = secondary-container (warm callout).
   ============================================================ */

.case-card {
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem;                /* rounded-xl */
  background: #211f1e;                  /* surface-container */
  isolation: isolate;
  transition:
    background .45s cubic-bezier(.2,.8,.2,1),
    box-shadow .55s cubic-bezier(.2,.8,.2,1),
    transform .6s cubic-bezier(.2,.8,.2,1);
  cursor: pointer;
  outline: none;
}

.case-card:hover,
.case-card:focus-within {
  background: #3b3938;                  /* surface-bright */
  box-shadow:
    0 0 0 1px rgba(190,198,224,0.06),   /* ghost border @ 6% — well below 15% rule */
    0 28px 48px -16px rgba(0,0,0,0.55),
    0 0 60px -8px rgba(190,198,224,0.10);  /* soft ambient glow */
  transform: translateY(-2px);
}

.case-card:focus-visible {
  box-shadow:
    0 0 0 2px rgba(190,198,224,0.45),   /* visible focus ring */
    0 28px 48px -16px rgba(0,0,0,0.55);
}

/* Visual area — hosts SVG schematic; subtle scale on hover for "lift" */
.case-card-visual {
  position: relative;
  height: 180px;
  overflow: hidden;
  transition: transform .9s cubic-bezier(.2,.8,.2,1), opacity .6s ease;
  transform-origin: center;
}
.case-card:hover .case-card-visual,
.case-card:focus-within .case-card-visual {
  transform: scale(1.02);
}

.case-card-front {
  position: relative;
  z-index: 1;
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: opacity .4s ease, transform .5s cubic-bezier(.2,.8,.2,1);
}
.case-card:hover .case-card-front,
.case-card:focus-within .case-card-front {
  opacity: 0.4;
  transform: translateY(-6px);
}

/* Reveal overlay — glass panel sliding up from the bottom edge */
.case-card-reveal {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  background: rgba(20,19,18,0.72);      /* surface @ ~72% */
  backdrop-filter: blur(24px) saturate(120%);
  -webkit-backdrop-filter: blur(24px) saturate(120%);
  padding: 1.5rem 1.5rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 78%;
  overflow-y: auto;
  transform: translateY(100%);
  opacity: 0;
  transition:
    transform .55s cubic-bezier(.22, 1, 0.36, 1),
    opacity .45s ease;
  pointer-events: none;
}
.case-card-reveal::-webkit-scrollbar { width: 4px; }
.case-card-reveal::-webkit-scrollbar-thumb { background: rgba(214,196,172,0.2); border-radius: 4px; }

.case-card:hover .case-card-reveal,
.case-card:focus-within .case-card-reveal {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Stagger inner blocks AFTER container starts moving */
.case-card-reveal > .reveal-block {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity .35s ease,
    transform .45s cubic-bezier(.2,.8,.2,1);
}
.case-card:hover .case-card-reveal > .reveal-block,
.case-card:focus-within .case-card-reveal > .reveal-block {
  opacity: 1;
  transform: none;
}
.case-card:hover .case-card-reveal > .reveal-block:nth-child(1),
.case-card:focus-within .case-card-reveal > .reveal-block:nth-child(1) { transition-delay: 100ms; }
.case-card:hover .case-card-reveal > .reveal-block:nth-child(2),
.case-card:focus-within .case-card-reveal > .reveal-block:nth-child(2) { transition-delay: 180ms; }
.case-card:hover .case-card-reveal > .reveal-block:nth-child(3),
.case-card:focus-within .case-card-reveal > .reveal-block:nth-child(3) { transition-delay: 260ms; }
.case-card:hover .case-card-reveal > .reveal-block:nth-child(4),
.case-card:focus-within .case-card-reveal > .reveal-block:nth-child(4) { transition-delay: 340ms; }

.reveal-block .eyebrow {
  font-family: 'Assistant', 'Heebo', sans-serif;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(214,196,172,0.65);        /* secondary @ 65% */
  margin-bottom: 6px;
  display: block;
}

.reveal-block p {
  font-family: 'Assistant', 'Heebo', sans-serif;
  font-size: 13px;
  line-height: 1.55;
  color: #e6e1e0;                       /* on-surface */
  margin: 0;
}

.reveal-block .metric {
  font-family: 'Newsreader', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 26px;
  line-height: 1.05;
  color: #bec6e0;                       /* primary */
  letter-spacing: -0.02em;
  display: block;
  margin-bottom: 4px;
}

/* Stack chips inside reveal */
.case-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.case-tag {
  display: inline-flex;
  align-items: center;
  font-family: 'Assistant', 'Heebo', sans-serif;
  font-size: 10px;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 9999px;
  white-space: nowrap;
  opacity: 0;
  transform: scale(0.92);
  transition:
    opacity .3s ease,
    transform .35s cubic-bezier(.2,.8,.2,1);
}
.case-card:hover .case-tag,
.case-card:focus-within .case-tag {
  opacity: 1;
  transform: none;
}
.case-card:hover .case-tag:nth-child(1),
.case-card:focus-within .case-tag:nth-child(1) { transition-delay: 230ms; }
.case-card:hover .case-tag:nth-child(2),
.case-card:focus-within .case-tag:nth-child(2) { transition-delay: 260ms; }
.case-card:hover .case-tag:nth-child(3),
.case-card:focus-within .case-tag:nth-child(3) { transition-delay: 290ms; }
.case-card:hover .case-tag:nth-child(4),
.case-card:focus-within .case-tag:nth-child(4) { transition-delay: 320ms; }
.case-card:hover .case-tag:nth-child(5),
.case-card:focus-within .case-tag:nth-child(5) { transition-delay: 350ms; }

.case-tag--stack {
  background: #544735;                  /* secondary-container */
  color: #f3e0c7;                       /* on-secondary-container */
}

.case-tag--front {
  background: rgba(43,42,41,0.6);       /* surface-container-high @ 60% */
  color: rgba(198,198,205,0.85);        /* on-surface-variant */
  opacity: 1;                           /* always visible on front */
  transform: none;
}

/* Reveal CTA — text-only with hover underline */
.case-card-cta {
  font-family: 'Assistant', 'Heebo', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #d6c4ac;                       /* secondary */
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  position: relative;
  padding-bottom: 4px;
  margin-top: 6px;
  align-self: flex-start;
}
.case-card-cta::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 1px;
  background: #d6c4ac;
  transition: width .35s cubic-bezier(.2,.8,.2,1);
}
.case-card:hover .case-card-cta::after,
.case-card-cta:hover::after,
.case-card-cta:focus-visible::after {
  width: 100%;
}
.case-card-cta .arrow {
  display: inline-block;
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.case-card-cta:hover .arrow { transform: translateX(-3px); }  /* RTL: arrow points left */

/* Front meta line — industry / size */
.case-card-meta {
  font-family: 'Assistant', 'Heebo', sans-serif;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(198,198,205,0.55);
}

.case-card-title {
  font-family: 'Heebo', 'Manrope', sans-serif;
  font-weight: 300;
  font-size: 22px;
  line-height: 1.2;
  color: #e6e1e0;
  margin: 0;
}
.case-card-title .accent { color: #bec6e0; }

/* Anchor flash — subtle pulse when card is target of #case-N nav */
@keyframes case-anchor-flash {
  0%   { box-shadow: 0 0 0 0 rgba(190,198,224,0.0); transform: scale(1); }
  20%  { box-shadow: 0 0 0 6px rgba(190,198,224,0.18), 0 0 60px -4px rgba(190,198,224,0.4); transform: scale(1.012); }
  100% { box-shadow: 0 0 0 0 rgba(190,198,224,0.0); transform: scale(1); }
}
.case-card.is-anchor-flash {
  animation: case-anchor-flash 1.4s cubic-bezier(.2,.8,.2,1);
}

/* SVG schematic helpers */
.svg-schematic {
  width: 100%;
  height: 100%;
  display: block;
}

@keyframes case4-cell-cycle {
  0%, 100% { fill-opacity: 0.18; }
  10%      { fill-opacity: 0.85; }
  30%      { fill-opacity: 0.18; }
}
.case4-cell { fill: #bec6e0; transform-origin: center; }
.case4-cell.c1 { animation: case4-cell-cycle 4.5s ease-in-out infinite;        }
.case4-cell.c2 { animation: case4-cell-cycle 4.5s ease-in-out 0.5s infinite;   }
.case4-cell.c3 { animation: case4-cell-cycle 4.5s ease-in-out 1.0s infinite;   }
.case4-cell.c4 { animation: case4-cell-cycle 4.5s ease-in-out 1.5s infinite;   }
.case4-cell.c5 { animation: case4-cell-cycle 4.5s ease-in-out 2.0s infinite;   }
.case4-cell.c6 { animation: case4-cell-cycle 4.5s ease-in-out 2.5s infinite;   }
.case4-cell.c7 { animation: case4-cell-cycle 4.5s ease-in-out 3.0s infinite;   }
.case4-cell.c8 { animation: case4-cell-cycle 4.5s ease-in-out 3.5s infinite;   }
.case4-cell.c9 { animation: case4-cell-cycle 4.5s ease-in-out 4.0s infinite;   }

@keyframes case5-ring-pulse {
  0%, 100% { transform: scale(1);    opacity: 0.55; }
  50%      { transform: scale(1.06); opacity: 0.85; }
}
.case5-ring { transform-box: fill-box; transform-origin: center; }
.case5-ring.r1 { animation: case5-ring-pulse 4s ease-in-out infinite; }
.case5-ring.r2 { animation: case5-ring-pulse 4s ease-in-out 0.6s infinite; }
.case5-ring.r3 { animation: case5-ring-pulse 4s ease-in-out 1.2s infinite; }

/* Mobile reveal — show always (no hover on touch) */
@media (max-width: 767px) {
  .case-card-visual { height: 140px; }

  /* Kill sticky-hover state — tap on touch devices triggers :hover */
  .case-card:hover,
  .case-card:focus-within {
    transform: none;
    background: #211f1e;          /* surface-container — stay flat */
    box-shadow: none;
  }
  .case-card:hover .case-card-visual,
  .case-card:focus-within .case-card-visual {
    transform: none;
  }
  .case-card:hover .case-card-front,
  .case-card:focus-within .case-card-front {
    opacity: 1;
    transform: none;
  }

  .case-card-reveal {
    position: relative;
    inset: auto;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    max-height: none;
    padding: 0 1.5rem 1.5rem;
  }
  .case-card-reveal > .reveal-block {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .case-card-front { opacity: 1 !important; transform: none !important; }
  .case-tag {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  /* Battery savers — heavy bg layers softened on mobile */
  .bg-aurora { display: none; }     /* 40px blur conic-gradient = drain */
  .bg-particles { opacity: 0.4; }   /* still visible, less work */

  /* Slow expensive SVG spins (less repaint) */
  .anim-spin-slow         { animation-duration: 90s !important; }
  .anim-spin-slow-reverse { animation-duration: 75s !important; }
}

/* Reduced motion — disable slide/scale/cycle, keep opacity-only */
@media (prefers-reduced-motion: reduce) {
  .case-card,
  .case-card-visual,
  .case-card-front,
  .case-card-reveal,
  .case-card-reveal > .reveal-block,
  .case-tag,
  .case-card-cta::after,
  .case-card-cta .arrow {
    transition-duration: 0s !important;
    animation: none !important;
    transform: none !important;
  }
  .case-card-reveal {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
  .case-card-reveal > .reveal-block,
  .case-tag {
    opacity: 1;
  }
  .case4-cell, .case5-ring {
    animation: none !important;
    fill-opacity: 0.4 !important;
  }
  .case-card.is-anchor-flash { animation: none !important; }
}
