/* =========================================================
   ATECH — Editorial Hybrid Design System
   (ui-ux-pro-max × brand-guidelines)
   ========================================================= */
:root {
  --atech-primary: #1a1a1a;
  --atech-footer: #0d0d0d;
  --atech-gold: #ffd700;
  --atech-bronze: #cd7f32;
  --atech-pearl: #f8f9fa;
  --atech-gray: #e5e5e5;
  --atech-ink: #0f172a;
  --atech-muted: #475569;
  --atech-gold-glow: rgba(255, 215, 0, 0.22);
  /* Shared motion tokens (index + showcase) */
  --motion-fast: 220ms;
  --motion-base: 280ms;
  --motion-slow: 420ms;
  --motion-sweep: 720ms;
  --ease-premium: cubic-bezier(0.22, 1, 0.36, 1);
}

html,
body {
  background-color: #f8f9fa;
}
body {
  font-family: 'Inter', system-ui, 'Segoe UI', Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
  color: var(--atech-ink);
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.01em;
}
.font-display {
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.025em;
  font-weight: 800;
}

/* --- Gold metal fills (brand-exact) --- */
.gold-metal-bg {
  background: linear-gradient(135deg, #ffd700 0%, #cd7f32 100%) !important;
  color: var(--atech-primary) !important;
}
.gold-metal-text {
  background-image: linear-gradient(125deg, #ffd700 0%, #e5b000 45%, #cd7f32 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* =========================================================
   CHAPTER FLIP — dark ↔ pearl alternation
   ========================================================= */
.chapter-dark {
  background-color: var(--atech-primary);
  color: var(--atech-pearl);
}
.chapter-pearl {
  background-color: var(--atech-pearl);
  color: var(--atech-ink);
}
.chapter-dark .eyebrow {
  color: var(--atech-gold);
}
.chapter-pearl .eyebrow {
  color: var(--atech-bronze);
}

/* =========================================================
   HERO EYEBROW — premium pill (micro-interaction, no layout shift)
   ========================================================= */
.hero-eyebrow {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: border-color 240ms ease, box-shadow 280ms ease, background-color 240ms ease;
}
.hero-eyebrow::before {
  content: '';
  position: absolute;
  inset: -55%;
  z-index: 0;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(255, 215, 0, 0.22) 70deg,
    rgba(205, 127, 50, 0.18) 140deg,
    transparent 220deg,
    rgba(255, 215, 0, 0.14) 300deg,
    transparent 360deg
  );
  animation: hero-eyebrow-orbit 14s linear 600ms 1 both;
  pointer-events: none;
  opacity: 0.55;
}
.hero-eyebrow::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(248, 249, 250, 0.18) 48%,
    rgba(255, 215, 0, 0.22) 50%,
    transparent 100%
  );
  transform: translateX(-130%);
  animation: hero-eyebrow-shine 5.2s ease-in-out 1.1s 1 both;
  pointer-events: none;
  mix-blend-mode: screen;
}
@keyframes hero-eyebrow-orbit {
  to { transform: rotate(360deg); }
}
@keyframes hero-eyebrow-shine {
  0%, 28% { transform: translateX(-130%); opacity: 0; }
  38% { opacity: 1; }
  58% { transform: translateX(130%); opacity: 0.85; }
  100% { transform: translateX(130%); opacity: 0; }
}
.hero-eyebrow > * {
  position: relative;
  z-index: 1;
}
.hero-eyebrow:hover {
  border-color: rgba(255, 215, 0, 0.55) !important;
  box-shadow:
    0 0 0 1px rgba(255, 215, 0, 0.12),
    0 12px 36px -14px rgba(255, 215, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.hero-eyebrow__dot {
  animation: none;
}
@keyframes hero-eyebrow-dot {
  0%, 100% { transform: scale(1); opacity: 1; box-shadow: 0 0 10px rgba(255, 215, 0, 0.8); }
  50% { transform: scale(1.18); opacity: 0.92; box-shadow: 0 0 16px rgba(255, 215, 0, 0.95); }
}
body[data-ui-theme='light'] .hero-eyebrow:hover {
  box-shadow:
    0 0 0 1px rgba(205, 127, 50, 0.2),
    0 12px 32px -12px rgba(205, 127, 50, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

/* Brand cinematic background for dark chapters (no square grid) */
.gold-mesh {
  position: relative;
  background:
    radial-gradient(120% 90% at 12% -10%, rgba(255, 215, 0, 0.18) 0%, rgba(255, 215, 0, 0.04) 38%, transparent 68%),
    radial-gradient(95% 70% at 88% 12%, rgba(205, 127, 50, 0.16) 0%, rgba(205, 127, 50, 0.05) 40%, transparent 70%),
    radial-gradient(110% 90% at 50% 118%, rgba(255, 215, 0, 0.14) 0%, rgba(255, 215, 0, 0.02) 48%, transparent 74%),
    linear-gradient(165deg, #0d0d0d 0%, #1a1a1a 42%, #111111 100%);
  overflow: hidden;
  isolation: isolate;
}
.gold-mesh::before {
  content: '';
  position: absolute;
  inset: -30%;
  pointer-events: none;
  z-index: 0;
  background:
    conic-gradient(
      from 210deg at 50% 50%,
      transparent 0deg,
      rgba(255, 215, 0, 0.08) 62deg,
      transparent 118deg,
      rgba(205, 127, 50, 0.08) 182deg,
      transparent 248deg,
      rgba(255, 215, 0, 0.06) 310deg,
      transparent 360deg
    );
  filter: blur(38px);
  transform: translate3d(0, 0, 0);
  animation: none;
}
.gold-mesh::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 22% 24%, rgba(248, 249, 250, 0.14) 0.6px, transparent 1.3px),
    radial-gradient(circle at 78% 74%, rgba(255, 215, 0, 0.16) 0.5px, transparent 1.2px);
  background-size: 3px 3px, 4px 4px;
  mix-blend-mode: screen;
  opacity: 0.22;
}
.gold-mesh > * {
  position: relative;
  z-index: 1;
}
@keyframes brand-bg-orbit {
  0% {
    transform: rotate(0deg) scale(1);
    opacity: 0.8;
  }
  50% {
    transform: rotate(180deg) scale(1.08);
    opacity: 1;
  }
  100% {
    transform: rotate(360deg) scale(1);
    opacity: 0.8;
  }
}

/* =========================================================
   TOPBAR — Auto motion (always visible, no hover needed)
   ========================================================= */
.topbar-shell {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
  background: linear-gradient(180deg, #171717 0%, #0f0f0f 100%);
  color: #f8f9fa;
}
.topbar-shell::before {
  content: '';
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 215, 0, 0.75) 50%, transparent 100%);
  pointer-events: none;
}
.topbar-shell::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -32%;
  width: 28%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.95), transparent);
  filter: blur(0.25px);
  animation: topbar-scan 5.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  pointer-events: none;
}
@keyframes topbar-scan {
  0% { transform: translateX(0); opacity: 0; }
  16% { opacity: 1; }
  52% { opacity: 0.95; }
  100% { transform: translateX(480%); opacity: 0; }
}
.topbar-inner {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.72rem;
  padding: 0.22rem 0;
}
.topbar-mark {
  display: inline-grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(255, 215, 0, 0.32);
  background: rgba(255, 215, 0, 0.06);
}
.topbar-mark img {
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.42));
  animation: topbar-logo-float 3.8s ease-in-out infinite;
}
@keyframes topbar-logo-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1.5px); }
}
.topbar-copy {
  letter-spacing: 0.02em;
  color: rgba(248, 249, 250, 0.92);
}
.topbar-copy__signal {
  background: linear-gradient(90deg, rgba(248, 249, 250, 0.72), #ffd700 45%, rgba(248, 249, 250, 0.9) 70%, rgba(248, 249, 250, 0.72));
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: none;
}
@keyframes topbar-text-shimmer {
  0%, 100% { background-position: 100% 50%; }
  50% { background-position: 0% 50%; }
}
.topbar-live {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  margin-left: 0.55rem;
  padding-left: 0.7rem;
  border-left: 1px solid rgba(248, 249, 250, 0.2);
  color: rgba(248, 249, 250, 0.72);
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}
.topbar-live__dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: #ffd700;
  box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.5);
  animation: none;
}
@keyframes topbar-dot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.45); }
  80% { box-shadow: 0 0 0 8px rgba(255, 215, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
}
@media (max-width: 639px) {
  .topbar-live {
    display: none;
  }
}

/* =========================================================
   NAVBAR — glass morphing between dark & pearl
   ========================================================= */
#site-nav {
  background: rgba(26, 26, 26, 0.82);
  border-bottom: 1px solid rgba(255, 215, 0, 0.08);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  transition: background 360ms ease, border-color 360ms ease, box-shadow 360ms ease;
}
#site-nav.on-pearl {
  background: rgba(248, 249, 250, 0.9);
  border-bottom-color: rgba(26, 26, 26, 0.08);
  box-shadow: 0 12px 40px -28px rgba(26, 26, 26, 0.35);
}
#site-nav .nav-link {
  color: rgba(248, 249, 250, 0.82);
  transition: color 220ms ease;
}
#site-nav .nav-link:hover {
  color: var(--atech-gold);
}
#site-nav.on-pearl .nav-link {
  color: var(--atech-ink);
}
#site-nav.on-pearl .nav-link:hover {
  color: var(--atech-bronze);
}
.ui-toggle {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  min-height: 44px;
  min-width: 64px;
  border: 1px solid rgba(248, 249, 250, 0.26);
  background:
    linear-gradient(145deg, rgba(248, 249, 250, 0.14), rgba(248, 249, 250, 0.03));
  color: rgba(248, 249, 250, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(248, 249, 250, 0.25),
    0 10px 24px -16px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition:
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    border-color 220ms ease,
    background 220ms ease,
    color 220ms ease,
    box-shadow 240ms ease;
}
.ui-toggle::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 215, 0, 0.24) 48%, transparent 100%);
  transform: translateX(-120%);
  opacity: 0;
  transition: transform 420ms ease, opacity 260ms ease;
}
.ui-toggle__icon {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  opacity: 0.86;
  transition: opacity 220ms ease, transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
}
.ui-toggle__label {
  line-height: 1;
}
.ui-toggle--theme .icon-sun,
.ui-toggle--theme .icon-moon {
  position: absolute;
  left: 0;
  top: 0;
}
.ui-toggle--theme .ui-toggle__icon {
  position: relative;
}
.ui-toggle--theme .icon-sun {
  opacity: 0;
  transform: translateY(1px) rotate(-16deg) scale(0.84);
}
.ui-toggle--theme .icon-moon {
  opacity: 1;
  transform: translateY(0) rotate(0deg) scale(1);
}
body[data-ui-theme='dark'] .ui-toggle--theme .icon-sun {
  opacity: 1;
  transform: translateY(0) rotate(0deg) scale(1);
}
body[data-ui-theme='dark'] .ui-toggle--theme .icon-moon {
  opacity: 0;
  transform: translateY(-1px) rotate(14deg) scale(0.84);
}
.ui-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 215, 0, 0.62);
  background:
    linear-gradient(145deg, rgba(255, 215, 0, 0.2), rgba(248, 249, 250, 0.06));
  color: var(--atech-gold);
  box-shadow:
    inset 0 1px 0 rgba(248, 249, 250, 0.35),
    0 14px 30px -16px rgba(255, 215, 0, 0.45);
}
.ui-toggle:hover .ui-toggle__icon {
  opacity: 1;
  transform: translateY(-1px);
}
.ui-toggle--theme.is-switching {
  animation: ui-toggle-theme-flash 440ms ease;
}
.ui-toggle--theme.is-switching .ui-toggle__icon {
  transform: translateY(-1px) rotate(18deg) scale(1.08);
}
@keyframes ui-toggle-theme-flash {
  0% {
    box-shadow:
      inset 0 1px 0 rgba(248, 249, 250, 0.35),
      0 0 0 0 rgba(255, 215, 0, 0.42),
      0 14px 30px -16px rgba(255, 215, 0, 0.32);
    filter: brightness(1);
  }
  45% {
    box-shadow:
      inset 0 1px 0 rgba(248, 249, 250, 0.42),
      0 0 0 6px rgba(255, 215, 0, 0.08),
      0 18px 36px -16px rgba(255, 215, 0, 0.5);
    filter: brightness(1.1);
  }
  100% {
    box-shadow:
      inset 0 1px 0 rgba(248, 249, 250, 0.25),
      0 10px 24px -16px rgba(0, 0, 0, 0.5);
    filter: brightness(1);
  }
}
.ui-toggle:hover::before {
  transform: translateX(115%);
  opacity: 1;
}
.ui-toggle:active {
  transform: translateY(0);
}
.ui-toggle:focus-visible {
  outline: none;
  border-color: rgba(255, 215, 0, 0.78);
  box-shadow:
    0 0 0 3px rgba(255, 215, 0, 0.2),
    inset 0 1px 0 rgba(248, 249, 250, 0.35),
    0 12px 26px -14px rgba(255, 215, 0, 0.48);
}
#site-nav.on-pearl .ui-toggle {
  border-color: rgba(26, 26, 26, 0.14);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(248, 249, 250, 0.82));
  color: var(--atech-ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 12px 28px -18px rgba(15, 23, 42, 0.26);
}
#site-nav.on-pearl .ui-toggle:hover {
  border-color: rgba(205, 127, 50, 0.54);
  background:
    linear-gradient(145deg, rgba(255, 247, 230, 0.95), rgba(255, 255, 255, 0.82));
  color: var(--atech-bronze);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 14px 32px -18px rgba(205, 127, 50, 0.35);
}
#site-nav.on-pearl .ui-toggle:focus-visible {
  border-color: rgba(205, 127, 50, 0.72);
  box-shadow:
    0 0 0 3px rgba(205, 127, 50, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 12px 26px -14px rgba(205, 127, 50, 0.32);
}
body[data-ui-theme='light'] .topbar-shell {
  border-bottom-color: rgba(26, 26, 26, 0.16);
  background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
  color: #0f172a;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 8px 18px -14px rgba(15, 23, 42, 0.28);
}
body[data-ui-theme='light'] .topbar-shell::before {
  background: linear-gradient(90deg, transparent 0%, rgba(205, 127, 50, 0.72) 50%, transparent 100%);
}
body[data-ui-theme='light'] .topbar-shell::after {
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(205, 127, 50, 0.92) 50%, transparent 100%);
  filter: blur(0.35px);
  animation: topbar-scan-light 4.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
body[data-ui-theme='light'] .topbar-copy,
body[data-ui-theme='light'] .topbar-live {
  color: rgba(26, 26, 26, 0.78);
}
body[data-ui-theme='light'] .topbar-copy [class*='text-[#FFD700'] {
  color: #b7791f !important;
}
body[data-ui-theme='light'] .topbar-copy .opacity-40 {
  color: rgba(15, 23, 42, 0.52);
  opacity: 0.7;
}
body[data-ui-theme='light'] .topbar-copy__signal {
  position: relative;
  display: inline-block;
  background: none !important;
  color: rgba(15, 23, 42, 0.82) !important;
  -webkit-text-fill-color: rgba(15, 23, 42, 0.82);
  animation: topbar-light-pulse 3.2s ease-in-out infinite !important;
}
body[data-ui-theme='light'] .topbar-copy__signal::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -0.18em;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(183, 121, 31, 0.65) 50%, transparent 100%);
  opacity: 0.5;
  transform-origin: center;
  animation: topbar-light-underline 3.2s ease-in-out infinite;
}
@keyframes topbar-light-pulse {
  0%, 100% { color: rgba(15, 23, 42, 0.76); text-shadow: 0 0 0 rgba(183, 121, 31, 0); }
  50% { color: rgba(15, 23, 42, 0.9); text-shadow: 0 0 10px rgba(183, 121, 31, 0.22); }
}
@keyframes topbar-light-underline {
  0%, 100% { opacity: 0.35; transform: scaleX(0.94); }
  50% { opacity: 0.78; transform: scaleX(1); }
}
@keyframes topbar-scan-light {
  0% { transform: translateX(0); opacity: 0; }
  14% { opacity: 0.9; }
  52% { opacity: 0.75; }
  100% { transform: translateX(470%); opacity: 0; }
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .topbar-copy__signal {
    background: none !important;
    color: currentColor !important;
    -webkit-text-fill-color: currentColor;
    animation: none;
  }
}
body[data-ui-theme='light'] .topbar-live {
  color: rgba(15, 23, 42, 0.72);
  border-left-color: rgba(15, 23, 42, 0.24);
}
body[data-ui-theme='light'] .topbar-live__dot {
  background: #c3872a;
  box-shadow: 0 0 0 0 rgba(195, 135, 42, 0.42);
}
body[data-ui-theme='light'] .topbar-mark {
  border-color: rgba(205, 127, 50, 0.4);
  background: rgba(205, 127, 50, 0.08);
}
body[data-ui-theme='light'] #site-nav {
  background: rgba(248, 249, 250, 0.94);
  border-bottom-color: rgba(26, 26, 26, 0.09);
  box-shadow: 0 12px 40px -28px rgba(26, 26, 26, 0.3);
}
body[data-ui-theme='light'] #site-nav .nav-link {
  color: var(--atech-ink);
}
body[data-ui-theme='light'] #site-nav .nav-link:hover {
  color: var(--atech-bronze);
}
body[data-ui-theme='light'] #nav-drawer {
  border-top-color: rgba(26, 26, 26, 0.14);
  background: #f8f9fa;
}
body[data-ui-theme='light'] .chapter-dark {
  background:
    radial-gradient(120% 82% at 8% -6%, rgba(255, 215, 0, 0.2) 0%, rgba(255, 215, 0, 0.06) 42%, transparent 74%),
    radial-gradient(95% 70% at 92% 14%, rgba(205, 127, 50, 0.14) 0%, rgba(205, 127, 50, 0.04) 38%, transparent 72%),
    linear-gradient(165deg, #f8f9fa 0%, #ffffff 52%, #f6f7f9 100%) !important;
  position: relative;
  overflow: hidden;
}
body[data-ui-theme='light'] .chapter-dark::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0%, rgba(255, 215, 0, 0.08) 48%, transparent 100%),
    repeating-linear-gradient(
      90deg,
      rgba(15, 23, 42, 0.03) 0px,
      rgba(15, 23, 42, 0.03) 1px,
      transparent 1px,
      transparent 34px
    );
  mix-blend-mode: multiply;
  opacity: 0.42;
}
body[data-ui-theme='light'] .chapter-dark::after {
  content: '';
  position: absolute;
  inset: -25% -8%;
  pointer-events: none;
  background: radial-gradient(ellipse 45% 28% at 50% 14%, rgba(255, 215, 0, 0.2) 0%, transparent 74%);
  filter: blur(16px);
  opacity: 0.55;
}
body[data-ui-theme='light'] .chapter-dark .aurora {
  display: none;
}
body[data-ui-theme='light'] .chapter-dark :is(h1, h2, h3, p, li, a, span, label, blockquote, figcaption, strong, em) {
  color: #0f172a;
}
body[data-ui-theme='light'] .chapter-dark [class*='text-[#FFD700'],
body[data-ui-theme='light'] .chapter-dark .gold-metal-text,
body[data-ui-theme='light'] .chapter-dark .gold-sweep {
  color: #cd7f32 !important;
}
body[data-ui-theme='light'] .chapter-dark .bento-card--dark {
  background: #ffffff;
  border-color: #e5e5e5;
}
body[data-ui-theme='light'] .chapter-dark .input-dark {
  background: #ffffff;
  color: #0f172a;
  border-color: #e5e5e5;
}
body[data-ui-theme='light'] .chapter-dark .input-dark::placeholder {
  color: #64748b;
}
body[data-ui-theme='light'] .chapter-dark .btn-ghost-dark {
  color: #0f172a;
  border-color: #e5e5e5;
  background: #ffffff;
}
body[data-ui-theme='light'] .chapter-dark .btn-ghost-dark:hover {
  color: #cd7f32;
  border-color: #cd7f32;
  background: #fff7e6;
}
body[data-ui-theme='light'] footer {
  background: #f8f9fa !important;
  color: rgba(15, 23, 42, 0.8);
}
body[data-ui-theme='light'] footer .aurora {
  display: none;
}
body[data-ui-theme='light'] footer :is(h3, p, a, span, li) {
  color: rgba(15, 23, 42, 0.82);
}
body[data-ui-theme='light'] footer [class*='text-[#FFD700'] {
  color: #cd7f32 !important;
}
body[data-ui-theme='light'] footer [class*='border-[#FFD700'] {
  border-color: rgba(205, 127, 50, 0.24) !important;
}
.drawer-link {
  transition: color 220ms ease;
}
body[data-ui-theme='light'] .drawer-link {
  color: rgba(26, 26, 26, 0.86) !important;
}
body[data-ui-theme='light'] .drawer-link:hover {
  color: var(--atech-bronze) !important;
}
/* Master logo (gold, transparent) — same on dark + pearl, no swap */
#site-nav .logo-master {
  position: relative;
  display: inline-block;
  line-height: 0;
  transition: transform 480ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
#site-nav .logo-master img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter:
    drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35))
    drop-shadow(0 0 14px rgba(255, 215, 0, 0.35));
  transition: filter 360ms ease, transform 480ms cubic-bezier(0.22, 1, 0.36, 1);
}
#site-nav.on-pearl .logo-master img {
  filter:
    drop-shadow(0 6px 14px rgba(205, 127, 50, 0.35))
    drop-shadow(0 0 18px rgba(255, 215, 0, 0.45));
}
.nav-brand:hover .logo-master {
  transform: rotate(-6deg) scale(1.04);
}
.nav-brand:hover .logo-master img {
  filter:
    drop-shadow(0 6px 14px rgba(0, 0, 0, 0.4))
    drop-shadow(0 0 22px rgba(255, 215, 0, 0.7));
}
/* Wordmark — dark/pearl swap (only the wordmark needs it) */
#site-nav .word-dark { opacity: 1; }
#site-nav .word-light { opacity: 0; }
#site-nav.on-pearl .word-dark { opacity: 0; }
#site-nav.on-pearl .word-light { opacity: 1; }
#site-nav .logo-stack {
  position: relative;
}
#site-nav .logo-stack > img {
  transition: opacity 280ms ease;
}
#site-nav .logo-stack > img.stacked {
  position: absolute;
  inset: 0;
}

/* =========================================================
   GOLD SWEEP underline — runs once when H2 enters viewport
   ========================================================= */
.gold-sweep {
  position: relative;
  display: inline-block;
}
.gold-sweep::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -0.25em;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, transparent, #ffd700 40%, #cd7f32 100%);
  border-radius: 3px;
  transform: scaleX(1);
  transform-origin: left center;
  transition: transform var(--motion-sweep) var(--ease-premium);
}
html.motion-ready .gold-sweep::after {
  transform: scaleX(0);
}
html.motion-ready .gold-sweep.is-visible::after {
  transform: scaleX(1);
}

/* =========================================================
   MAGNETIC CTA — JS sets --mx/--my
   ========================================================= */
.btn-magnetic {
  --btn-scale: 1;
  transform: translate3d(var(--mx, 0), var(--my, 0), 0) scale(var(--btn-scale));
  transition: transform var(--motion-base) var(--ease-premium), box-shadow var(--motion-base) ease;
}

/* =========================================================
   Buttons — brand-exact
   ========================================================= */
.btn-primary {
  background: linear-gradient(135deg, #ffd700 0%, #cd7f32 100%);
  color: var(--atech-primary);
  box-shadow: 0 12px 28px -10px rgba(255, 215, 0, 0.45);
}
.btn-primary {
  --btn-scale: 1;
  transform: translate3d(var(--mx, 0), var(--my, 0), 0) scale(var(--btn-scale));
  transition: transform var(--motion-fast) var(--ease-premium), box-shadow var(--motion-base) ease;
}
.btn-primary:hover {
  --btn-scale: 1.02;
  box-shadow: 0 18px 38px -12px rgba(205, 127, 50, 0.55);
}
.btn-primary:active {
  --btn-scale: 0.99;
}
@media (hover: none) {
  .btn-primary:hover { --btn-scale: 1; }
}
.btn-ghost-dark {
  color: var(--atech-pearl);
  border: 1px solid rgba(248, 249, 250, 0.22);
  background: rgba(248, 249, 250, 0.04);
}
.btn-ghost-dark:hover {
  border-color: var(--atech-gold);
  color: var(--atech-gold);
  background: rgba(255, 215, 0, 0.06);
}
.btn-ghost-light {
  color: var(--atech-ink);
  border: 1px solid var(--atech-gray);
  background: #ffffff;
}
.btn-ghost-light:hover {
  border-color: var(--atech-bronze);
  color: var(--atech-bronze);
}

/* =========================================================
   AURORA — dark chapters ambient
   ========================================================= */
.aurora {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  isolation: isolate;
}
.aurora::before,
.aurora::after {
  content: '';
  position: absolute;
  inset: -18%;
  pointer-events: none;
  will-change: transform, opacity;
}
.aurora::before {
  background:
    radial-gradient(ellipse 62% 46% at 18% 24%, rgba(255, 215, 0, 0.16), transparent 72%),
    radial-gradient(ellipse 54% 42% at 82% 74%, rgba(205, 127, 50, 0.14), transparent 72%);
  filter: blur(28px);
  mix-blend-mode: screen;
  opacity: 0.65;
  animation: aurora-mesh-shift 32s ease-in-out infinite alternate;
}
.aurora::after {
  background: conic-gradient(
    from 20deg at 50% 50%,
    transparent 0deg,
    rgba(255, 215, 0, 0.16) 62deg,
    transparent 138deg,
    rgba(248, 249, 250, 0.1) 198deg,
    transparent 360deg
  );
  filter: blur(52px);
  mix-blend-mode: soft-light;
  opacity: 0.38;
  animation: aurora-veil-spin 38s linear infinite;
}
.aurora__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(86px) saturate(115%);
  will-change: transform, opacity;
  mix-blend-mode: screen;
}
.aurora__blob--a {
  width: min(88vw, 620px);
  height: min(88vw, 620px);
  top: -34%;
  left: -16%;
  background:
    radial-gradient(circle at 35% 35%, rgba(255, 215, 0, 0.32) 0%, rgba(255, 215, 0, 0.06) 46%, transparent 76%),
    radial-gradient(circle at 72% 64%, rgba(248, 249, 250, 0.09) 0%, transparent 70%);
  animation: aurora-drift-a 26s cubic-bezier(0.4, 0.02, 0.22, 1) infinite;
}
.aurora__blob--b {
  width: min(74vw, 500px);
  height: min(74vw, 500px);
  bottom: -28%;
  right: -14%;
  background:
    radial-gradient(circle at 42% 42%, rgba(205, 127, 50, 0.28) 0%, rgba(205, 127, 50, 0.08) 48%, transparent 76%),
    radial-gradient(circle at 70% 34%, rgba(255, 215, 0, 0.12) 0%, transparent 66%);
  animation: aurora-drift-b 30s cubic-bezier(0.38, 0.06, 0.2, 1) infinite;
  animation-delay: -9s;
}
@keyframes aurora-drift-a {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.58; }
  50% { transform: translate3d(6%, 7%, 0) scale(1.12); opacity: 0.9; }
}
@keyframes aurora-drift-b {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.44; }
  50% { transform: translate3d(-5%, -6%, 0) scale(1.15); opacity: 0.82; }
}
@keyframes aurora-mesh-shift {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.52; }
  100% { transform: translate3d(3%, -2%, 0) scale(1.08); opacity: 0.72; }
}
@keyframes aurora-veil-spin {
  0% { transform: rotate(0deg) scale(1); opacity: 0.24; }
  50% { opacity: 0.42; }
  100% { transform: rotate(360deg) scale(1.06); opacity: 0.24; }
}

/* Smaller screens keep the depth cues but avoid stacking several blurred,
   full-viewport loops on mobile GPUs. */
@media (max-width: 767px) {
  .aurora::before,
  .aurora::after,
  .aurora__blob {
    animation: none;
  }
  .aurora::before { filter: blur(22px); }
  .aurora::after { filter: blur(34px); }
  .aurora__blob { filter: blur(56px) saturate(108%); }
}

/* Pearl chapter ambient */
.pearl-ambient {
  background:
    radial-gradient(ellipse 90% 55% at 50% -10%, rgba(255, 215, 0, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 80%, rgba(205, 127, 50, 0.08), transparent 50%),
    linear-gradient(180deg, #f8f9fa 0%, #ffffff 60%, #f8f9fa 100%);
}

/* =========================================================
   3T ARC — Hero 3D cinematic stage
   Tilted glass disc base + radar sweep, three orbit rings
   carrying gold chips (Tâm · Tín · Tiến), glass orb at center
   floating with parallax tilt, halo glow + star particles.
   ========================================================= */
.stage-3d {
  position: relative;
  width: min(100%, 520px);
  aspect-ratio: 1;
  margin-inline: auto;
  perspective: 1400px;
  perspective-origin: 50% 38%;
  transform-style: preserve-3d;
}
@media (max-width: 389px) {
  .stage-3d {
    width: min(94vw, 380px);
  }
}
.hero-arc-panel {
  position: relative;
  border-radius: 1.35rem;
  padding: 0;
}
body[data-ui-theme='light'] .hero-arc-panel {
  background: transparent;
  border: 0;
  box-shadow: none;
}
body[data-ui-theme='light'] .hero-arc-panel.is-visible {
  box-shadow: none;
}
body[data-ui-theme='light'] .hero-arc-panel::before {
  content: none;
}
body[data-ui-theme='light'] .hero-arc-panel .stage-3d__stars {
  opacity: 0.62;
  filter: saturate(108%);
}
body[data-ui-theme='light'] .hero-arc-panel .arc-3t__disc {
  background:
    radial-gradient(ellipse at 50% 38%, rgba(255, 215, 0, 0.28) 0%, rgba(255, 215, 0, 0.08) 40%, transparent 70%),
    radial-gradient(ellipse at 50% 75%, rgba(15, 23, 42, 0.22) 0%, transparent 65%);
  box-shadow:
    0 54px 120px -44px rgba(205, 127, 50, 0.36),
    inset 0 0 0 1px rgba(205, 127, 50, 0.22);
}
body[data-ui-theme='light'] .hero-arc-panel .arc-3t__disc::before {
  background:
    repeating-radial-gradient(
      circle at 50% 50%,
      transparent 0,
      transparent 26px,
      rgba(205, 127, 50, 0.2) 26px,
      rgba(205, 127, 50, 0.2) 27px
    );
}
body[data-ui-theme='light'] .hero-arc-panel .arc-3t__orbit {
  border-color: rgba(205, 127, 50, 0.45);
}
body[data-ui-theme='light'] .hero-arc-panel .arc-3t__orbit--mid {
  border-color: rgba(205, 127, 50, 0.55);
}
body[data-ui-theme='light'] .hero-arc-panel .arc-3t__orbit--inner {
  border-color: rgba(183, 121, 31, 0.62);
}
body[data-ui-theme='light'] .hero-arc-panel .arc-3t__orb {
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.82) 0%, rgba(255, 215, 0, 0.24) 32%, rgba(15, 23, 42, 0.72) 82%),
    radial-gradient(circle at 70% 78%, rgba(205, 127, 50, 0.42) 0%, transparent 56%);
  box-shadow:
    inset 0 0 34px rgba(15, 23, 42, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.52),
    0 28px 74px -20px rgba(205, 127, 50, 0.5),
    0 0 0 1px rgba(205, 127, 50, 0.36);
}
body[data-ui-theme='light'] .hero-arc-panel > p {
  color: rgba(71, 85, 105, 0.86) !important;
}
@keyframes hero-arc-light-sweep {
  0%, 100% { transform: translateX(-120%); opacity: 0; }
  30% { opacity: 0.58; }
  60% { transform: translateX(120%); opacity: 0.18; }
}
/* Star field — extends slightly beyond stage */
.stage-3d__stars {
  position: absolute;
  inset: -8%;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, rgba(255, 215, 0, 0.85) 50%, transparent 60%),
    radial-gradient(1px 1px at 82% 28%, rgba(248, 249, 250, 0.75) 50%, transparent 60%),
    radial-gradient(1.4px 1.4px at 28% 78%, rgba(205, 127, 50, 0.85) 50%, transparent 60%),
    radial-gradient(1.1px 1.1px at 68% 84%, rgba(255, 215, 0, 0.7) 50%, transparent 60%),
    radial-gradient(1px 1px at 92% 62%, rgba(248, 249, 250, 0.55) 50%, transparent 60%),
    radial-gradient(1.6px 1.6px at 6% 56%, rgba(255, 215, 0, 0.55) 50%, transparent 60%),
    radial-gradient(1px 1px at 48% 6%, rgba(248, 249, 250, 0.7) 50%, transparent 60%);
  animation: stars-twinkle 5.5s ease-in-out infinite;
}
@keyframes stars-twinkle {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

.arc-3t {
  position: absolute;
  inset: 6%;
  transform-style: preserve-3d;
  z-index: 1;
}

/* Tilted glass disc — gives the 3D base feel */
.arc-3t__disc {
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  transform: rotateX(62deg);
  transform-origin: 50% 50%;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(255, 215, 0, 0.22) 0%, rgba(255, 215, 0, 0.04) 38%, transparent 70%),
    radial-gradient(ellipse at 50% 75%, rgba(13, 13, 13, 0.6) 0%, transparent 65%);
  box-shadow:
    0 60px 140px -40px rgba(255, 215, 0, 0.45),
    inset 0 0 0 1px rgba(255, 215, 0, 0.18);
  overflow: hidden;
}
/* Concentric rings on the disc — like a vinyl / radar grid */
.arc-3t__disc::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    repeating-radial-gradient(
      circle at 50% 50%,
      transparent 0,
      transparent 26px,
      rgba(255, 215, 0, 0.12) 26px,
      rgba(255, 215, 0, 0.12) 27px
    );
  mask: radial-gradient(circle at 50% 50%, #000 0%, #000 65%, transparent 95%);
  -webkit-mask: radial-gradient(circle at 50% 50%, #000 0%, #000 65%, transparent 95%);
}
/* Radar sweep — single conic arm rotating */
.arc-3t__disc::after {
  content: '';
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(255, 215, 0, 0.0) 0deg,
    rgba(255, 215, 0, 0.45) 22deg,
    rgba(255, 215, 0, 0.0) 70deg,
    rgba(255, 215, 0, 0.0) 360deg
  );
  animation: disc-sweep 6.5s linear infinite;
  filter: blur(1px);
}
@keyframes disc-sweep { to { transform: rotate(360deg); } }

/* Halo glow behind central orb */
.arc-3t__halo {
  position: absolute;
  inset: 26%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 215, 0, 0.55) 0%, rgba(255, 215, 0, 0.12) 35%, transparent 70%);
  filter: blur(22px);
  z-index: 2;
  animation: halo-pulse 4.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes halo-pulse {
  0%, 100% { opacity: 0.65; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

/* Flat orbits — sit above disc, carry the 3T chips */
.arc-3t__orbit {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 215, 0, 0.32);
  z-index: 3;
  animation: orbit-cw 30s linear infinite;
  will-change: transform;
}
.arc-3t__orbit--mid {
  inset: 14%;
  border-style: dashed;
  border-color: rgba(255, 215, 0, 0.42);
  animation: orbit-ccw 22s linear infinite;
}
.arc-3t__orbit--inner {
  inset: 28%;
  border-color: rgba(205, 127, 50, 0.5);
  animation: orbit-cw 16s linear infinite;
}
@keyframes orbit-cw  { to { transform: rotate(360deg); } }
@keyframes orbit-ccw { to { transform: rotate(-360deg); } }

/* Gold chip pinned to top of each orbit; counter-rotates so text
   stays upright while orbit spins. */
.arc-3t__chip {
  position: absolute;
  top: -0.95rem;
  left: 50%;
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 0.66rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #1A1A1A;
  background: linear-gradient(135deg, #FFE980 0%, #FFD700 45%, #CD7F32 100%);
  padding: 0.35rem 0.95rem;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow:
    0 10px 24px -8px rgba(255, 215, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.35) inset,
    0 -2px 4px rgba(0, 0, 0, 0.18) inset;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  animation: chip-ccw 30s linear infinite;
}
.arc-3t__orbit--mid .arc-3t__chip { animation: chip-cw 22s linear infinite; }
.arc-3t__orbit--inner .arc-3t__chip { animation: chip-ccw 16s linear infinite; }
@keyframes chip-cw  { from { transform: translateX(-50%) rotate(0); }   to { transform: translateX(-50%) rotate(360deg); } }
@keyframes chip-ccw { from { transform: translateX(-50%) rotate(0); }   to { transform: translateX(-50%) rotate(-360deg); } }

/* Central glass orb with master logo, parallax tilt via JS vars */
.arc-3t__orb {
  position: absolute;
  inset: 32%;
  border-radius: 50%;
  z-index: 4;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.55) 0%, rgba(255, 215, 0, 0.18) 28%, rgba(13, 13, 13, 0.85) 78%),
    radial-gradient(circle at 70% 78%, rgba(205, 127, 50, 0.45) 0%, transparent 55%);
  box-shadow:
    inset 0 0 36px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 30px 80px -10px rgba(255, 215, 0, 0.5),
    0 0 0 1px rgba(255, 215, 0, 0.35);
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  transform: translate3d(0, 0, 0)
    rotateX(var(--tilt-x))
    rotateY(var(--tilt-y));
  transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.arc-3t__orb::after {
  /* Specular highlight overlay */
  content: '';
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.05) 28%, transparent 50%);
  pointer-events: none;
  mix-blend-mode: screen;
}
.arc-3t__orb img {
  width: 66%;
  height: auto;
  position: relative;
  z-index: 1;
  filter:
    drop-shadow(0 6px 18px rgba(0, 0, 0, 0.55))
    drop-shadow(0 0 22px rgba(255, 215, 0, 0.6));
  animation: orb-float 5.4s ease-in-out infinite;
}
@keyframes orb-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.02); }
}

/* =========================================================
   BENTO CARDS — pearl chapter
   ========================================================= */
.bento-card {
  position: relative;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--atech-gray);
  border-radius: 1.75rem;
  transition: transform var(--motion-slow) var(--ease-premium), box-shadow var(--motion-slow) ease, border-color var(--motion-base) ease;
}
.bento-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 215, 0, 0.55);
  box-shadow: 0 28px 60px -28px rgba(205, 127, 50, 0.35);
}
.bento-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(600px circle at var(--sx, 50%) var(--sy, 0%), rgba(255, 215, 0, 0.14), transparent 45%);
  opacity: 0;
  transition: opacity var(--motion-slow) ease;
  pointer-events: none;
}
.bento-card:hover::before { opacity: 1; }

/* Touch / coarse pointer: no hover lift (design · mobile UX) */
@media (hover: none) {
  .bento-card:hover {
    transform: none;
    border-color: var(--atech-gray);
    box-shadow: none;
  }
  .bento-card:active {
    transform: scale(0.992);
    border-color: rgba(205, 127, 50, 0.55);
  }
  .bento-card:hover::before {
    opacity: 0;
  }
}

.bento-card--dark {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 215, 0, 0.14);
  color: var(--atech-pearl);
}
.bento-card--dark:hover {
  border-color: rgba(255, 215, 0, 0.45);
  box-shadow: 0 28px 60px -22px rgba(0, 0, 0, 0.6);
}

.icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.9rem;
  background: linear-gradient(135deg, #ffd700 0%, #cd7f32 100%);
  color: var(--atech-primary);
  box-shadow: 0 10px 20px -8px rgba(255, 215, 0, 0.45);
}

/* =========================================================
   3T MANIFESTO — ghost numbers
   ========================================================= */
.ghost-num {
  position: absolute;
  inset-block-start: -0.45rem;
  inset-inline-start: 0;
  z-index: 0;
  pointer-events: none;
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: clamp(4rem, 9vw, 7.5rem);
  line-height: 1;
  color: rgba(255, 215, 0, 0.12);
  letter-spacing: -0.04em;
}
#triet-ly article > div {
  position: relative;
  z-index: 1;
}
@media (max-width: 639px) {
  #triet-ly .ghost-num {
    inset-block-start: -0.2rem;
    font-size: clamp(3.5rem, 18vw, 5rem);
  }
}
body[data-ui-theme='light'] #triet-ly .ghost-num {
  color: rgba(205, 127, 50, 0.14);
}

/* =========================================================
   CONTENT SHELL (max-w-7xl) — containment + premium edge
   ui-ux-pro-max: consistent container, no horizontal scroll,
   ease-out motion, rim cue per chapter tone
   ========================================================= */
.atech-shell {
  isolation: isolate;
}
.chapter-dark .atech-shell[data-shell]::before,
.chapter-pearl .atech-shell[data-shell]::before {
  content: '';
  position: absolute;
  left: 6%;
  right: 6%;
  top: 0;
  height: 1px;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 520ms cubic-bezier(0.22, 1, 0.36, 1) 80ms;
}
.chapter-dark .atech-shell[data-shell]::before {
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.42), transparent);
}
.chapter-pearl .atech-shell[data-shell]::before {
  background: linear-gradient(90deg, transparent, rgba(205, 127, 50, 0.28), transparent);
}
footer .atech-shell[data-shell]::before {
  content: '';
  position: absolute;
  left: 6%;
  right: 6%;
  top: 0;
  height: 1px;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 520ms cubic-bezier(0.22, 1, 0.36, 1) 80ms;
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.22), transparent);
}
html.motion-ready .atech-shell[data-shell]:not(.is-shell-visible) {
  opacity: 0.91;
  transform: translate3d(0, 14px, 0);
  transition:
    opacity 620ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 620ms cubic-bezier(0.22, 1, 0.36, 1);
}
.atech-shell[data-shell].is-shell-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}
.atech-shell[data-shell].is-shell-visible::before {
  opacity: 1;
}

/* =========================================================
   REVEAL on scroll
   ========================================================= */
[data-reveal] {
  --d: 0ms;
  opacity: 1;
  transform: none;
}
html.motion-ready [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  /* Only transform + opacity: reveal remains compositor-friendly. */
  transition:
    opacity 900ms cubic-bezier(0.22, 1, 0.36, 1) var(--d),
    transform 900ms cubic-bezier(0.22, 1, 0.36, 1) var(--d);
}
html.motion-ready [data-reveal].is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}
/* Hero: CSS autoplay, không chờ JS/IO, với transform + opacity only. */
#hero [data-reveal] {
  opacity: 1;
  transform: none;
  transition: none;
  animation: hero-rise 800ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--d);
}
/* H1 = LCP element: hiển thị tức thì, không animate opacity (LCP không bị trễ).
   Vẫn giữ chuyển động nhẹ qua transform-only. */
#hero-title,
#hero .mx-auto.mt-7.max-w-xl {
  animation-name: hero-rise-lcp;
}
@keyframes hero-rise-lcp {
  from {
    transform: translate3d(0, 20px, 0);
  }
  to {
    transform: translate3d(0, 0, 0);
  }
}
@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translate3d(0, 28px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

/* =========================================================
   CURSOR HALO (pointer:fine only)
   ========================================================= */
@media (pointer: fine) {
  .cursor-halo {
    position: fixed;
    width: 280px;
    height: 280px;
    left: 0;
    top: 0;
    border-radius: 999px;
    pointer-events: none;
    z-index: 40;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.22) 0%, rgba(255, 215, 0, 0.09) 38%, rgba(255, 215, 0, 0) 72%);
    filter: blur(12px);
    opacity: 0.7;
    transform: translate3d(-999px, -999px, 0);
    mix-blend-mode: screen;
  }
}
@media (pointer: coarse) {
  .cursor-halo { display: none; }
}

/* =========================================================
   Chapter rail (sticky on desktop)
   ========================================================= */
.chapter-rail {
  position: fixed;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  display: none;
  gap: 0.75rem;
  flex-direction: column;
}
@media (min-width: 1440px) {
  .chapter-rail { display: flex; }
}
.chapter-rail a {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border-radius: 999px;
  transition: background 220ms ease, transform 220ms ease;
}
.chapter-rail a::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: rgba(26, 26, 26, 0.25);
  transition: background-color 220ms ease, transform 220ms ease;
}
.chapter-rail a:hover {
  background: rgba(255, 215, 0, 0.08);
}
.chapter-rail a.is-active {
  background: rgba(255, 215, 0, 0.1);
  transform: translateX(-2px);
}
.chapter-rail a.is-active::before {
  background: var(--atech-gold);
  transform: scale(1.35);
}
body.nav-dark .chapter-rail a {
  background: transparent;
}
body.nav-dark .chapter-rail a::before {
  background: rgba(248, 249, 250, 0.42);
}
body.nav-dark .chapter-rail a.is-active {
  background: rgba(255, 215, 0, 0.1);
}
body.nav-dark .chapter-rail a.is-active::before {
  background: var(--atech-gold);
}

.legal-page h1,
.legal-page h2,
.legal-page h3 {
  text-wrap: balance;
}
.legal-page p,
.legal-page li {
  overflow-wrap: anywhere;
}

/* Mobile drawer: the hidden class keeps it out of the tab order before JS;
   the open state adds a short, bounded transition once interaction starts. */
#nav-drawer {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1;
  max-height: calc(100dvh - 4.5rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  transform: translateY(-8px);
  visibility: hidden;
  pointer-events: none;
  box-shadow: 0 18px 34px -24px rgba(0, 0, 0, 0.7);
  transition:
    opacity 220ms ease,
    transform 420ms var(--ease-premium),
    visibility 0s linear 420ms;
}
#nav-drawer.is-open {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}
.language-fab {
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px)) !important;
  right: max(1rem, env(safe-area-inset-right, 0px)) !important;
}

/* =========================================================
   Tool strip — horizontal scroll on mobile
   ========================================================= */
.tool-strip {
  display: grid;
  gap: 1rem;
  grid-auto-flow: column;
  /* 82% cứng (không minmax(0,…)): track phải overflow thì mới thành carousel vuốt ngang */
  grid-auto-columns: 82%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  padding-bottom: 1rem;
  scrollbar-width: thin;
}
.tool-strip > * {
  scroll-snap-align: start;
}
@media (min-width: 768px) {
  .tool-strip {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-columns: auto;
    gap: 1.5rem;
    overflow: visible;
    padding-bottom: 0;
  }
}

/* =========================================================
   Form dark glass
   ========================================================= */
.input-dark {
  background: rgba(248, 249, 250, 0.05);
  border: 1px solid rgba(248, 249, 250, 0.14);
  color: var(--atech-pearl);
  transition: border-color 200ms ease, box-shadow 200ms ease, background 200ms ease;
}
.input-dark::placeholder { color: rgba(248, 249, 250, 0.42); }
.input-dark:focus {
  outline: none;
  border-color: var(--atech-gold);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.18);
  background: rgba(248, 249, 250, 0.07);
}

/* =========================================================
   Focus visible — brand gold ring
   ========================================================= */
:focus-visible {
  outline: none;
}
a:focus-visible,
button:focus-visible,
[role='button']:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.55);
  border-radius: 0.5rem;
}

/* Form validation: viền xanh khi field hợp lệ sau khi user tương tác (:user-valid),
   đỏ nhạt khi không hợp lệ — trạng thái thật, không decoration */
#contact-form input:user-valid,
#contact-form textarea:user-valid {
  border-color: rgba(34, 197, 94, 0.6);
}
#contact-form input:user-invalid,
#contact-form textarea:user-invalid {
  border-color: rgba(239, 68, 68, 0.55);
}

/* =========================================================
   Reduced motion — full guard
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .aurora__blob,
  .arc-3t__orbit,
  .arc-3t__orbit--mid,
  .arc-3t__orbit--inner,
  .arc-3t__chip,
  .arc-3t__halo,
  .arc-3t__orb img,
  .stage-3d__stars,
  .arc-3t__disc::after,
  .topbar-live__dot,
  .topbar-shell::after,
  .topbar-mark img,
  .topbar-copy__signal,
  .hero-eyebrow::before,
  .hero-eyebrow::after,
  .hero-eyebrow__dot,
  .ui-toggle::before {
    animation: none !important;
  }
  .ui-toggle--theme.is-switching {
    animation: none !important;
  }
  .ui-toggle {
    transition: none !important;
  }
  .arc-3t__orb {
    transform: none !important;
  }
  .cursor-halo { display: none !important; }
  html { scroll-behavior: auto !important; }
  [data-reveal],
  #hero [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  .atech-shell[data-shell] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .atech-shell[data-shell]::before {
    opacity: 1 !important;
    transition: none !important;
  }
  .gold-sweep::after {
    width: 100% !important;
    transform: none !important;
  }
  .btn-magnetic { transform: none !important; }
  #nav-drawer,
  #nav-drawer.is-open {
    transition: none !important;
    transform: none !important;
  }
}

/* ---------- Mobile-first polish (brand tokens · touch · safe-area) ---------- */
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 5.5rem;
}
body {
  overflow-x: clip;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
body.consent-banner-visible {
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 11rem);
}
@media (min-width: 640px) {
  body.consent-banner-visible {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 6rem);
  }
}
/* Khi banner đang mở: bớt chiều cao hero (mobile) để CTA không nằm dưới vùng dock cố định */
@media (max-width: 639px) {
  body.consent-banner-visible #hero .atech-shell {
    padding-top: 2.25rem !important;
    padding-bottom: 3.5rem !important;
  }
  body.consent-banner-visible #hero .grid.items-center.gap-14 {
    gap: 1.35rem !important;
  }
  body.consent-banner-visible #hero #hero-title {
    margin-top: 0.75rem !important;
  }
  body.consent-banner-visible #hero .mt-10.flex.flex-col.items-stretch {
    margin-top: 1rem !important;
  }
}
/* Viewport thấp (vd 360×740 + banner): gọn typography để CTA không đè dock */
@media (max-width: 639px) and (max-height: 780px) {
  body.consent-banner-visible #hero #hero-title {
    font-size: 2rem !important;
    line-height: 1.06 !important;
    margin-top: 0.45rem !important;
  }
  body.consent-banner-visible #hero div.text-center > p.max-w-xl.rounded-2xl {
    margin-top: 0.55rem !important;
    padding: 0.65rem 0.9rem !important;
    font-size: 0.875rem !important;
    line-height: 1.45 !important;
  }
  body.consent-banner-visible #hero .grid.items-center.gap-14 {
    gap: 1rem !important;
  }
  body.consent-banner-visible #hero .mt-10.flex.flex-col.items-stretch {
    margin-top: 0.65rem !important;
  }
  body.consent-banner-visible #hero .atech-shell {
    padding-top: 1.65rem !important;
    padding-bottom: 2.35rem !important;
  }
  body.consent-banner-visible #consent-banner {
    max-height: min(22vh, 9rem);
    gap: 0.35rem;
    padding: 0.5rem 0.65rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
  }
}
button,
.btn-primary,
.btn-ghost-dark,
.drawer-link,
.nav-link,
#nav-open,
.gold-metal-bg {
  touch-action: manipulation;
}

@media (max-width: 479px) {
  .topbar-inner {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 0.35rem;
    max-width: 100%;
  }
  .topbar-copy {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.15rem 0.45rem;
    font-size: 0.72rem;
    line-height: 1.35;
    max-width: 100%;
  }
  .topbar-copy > span.mx-2.opacity-40 {
    display: none;
  }
  .topbar-copy__signal {
    flex: 1 1 100%;
    text-align: center;
    font-size: 0.68rem;
    line-height: 1.4;
    background: none !important;
    -webkit-background-clip: unset !important;
    background-clip: unset !important;
    color: rgba(248, 249, 250, 0.88) !important;
    -webkit-text-fill-color: rgba(248, 249, 250, 0.88) !important;
    animation: none !important;
  }
  #nav-drawer .ui-toggle {
    width: 100%;
    justify-content: center;
    min-height: 44px;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  #nav-drawer .ui-toggle__icon {
    width: 14px;
    height: 14px;
    flex-basis: 14px;
  }
}

/* Cookie / analytics consent bar */
#consent-banner {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  /* Compact trên mobile để không che CTA hero (QA: ~390×844) */
  max-height: min(30vh, 12.5rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-top: 1px solid rgba(255, 215, 0, 0.22);
  background: rgba(13, 13, 13, 0.94);
  color: #f8f9fa;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 404px) {
  #consent-banner {
    max-height: min(24vh, 10.25rem);
    gap: 0.4rem;
    padding: 0.55rem 0.7rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
  }
}
@media (min-width: 640px) {
  #consent-banner {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    max-height: none;
    overflow: visible;
    padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom, 0px));
  }
}
#consent-banner[hidden] {
  display: none !important;
}
@media (prefers-reduced-motion: reduce) {
  #consent-banner {
    backdrop-filter: none;
  }
}

/* Smooth scroll — chỉ khi user không bật Reduce Motion */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* === CSP hardening: moved from inline style attributes (style-src 'self') === */
/* Stagger delays for [data-reveal] — formerly style="--d: Nms" */
[data-d="0"]{--d:0ms}
[data-d="90"]{--d:90ms}
[data-d="170"]{--d:170ms}
[data-d="180"]{--d:180ms}
[data-d="200"]{--d:200ms}
[data-d="220"]{--d:220ms}
[data-d="240"]{--d:240ms}
[data-d="260"]{--d:260ms}
[data-d="300"]{--d:300ms}
[data-d="320"]{--d:320ms}
[data-d="340"]{--d:340ms}
[data-d="360"]{--d:360ms}
[data-d="380"]{--d:380ms}
[data-d="400"]{--d:400ms}
[data-d="420"]{--d:420ms}
[data-d="460"]{--d:460ms}
[data-d="480"]{--d:480ms}
/* Logo wordmark filters — formerly inline style="filter: …" */
.word-dark { filter: brightness(1.08) contrast(1.02); }
.word-light { filter: invert(1) brightness(0.12) contrast(1.15); }
.logo-footer-word { filter: brightness(1.08); }

/* =========================================================
   WOW PACK — cinematic intro · particles · keyword rotator · scroll story
   Compositor-only; mọi chuyển động tự phát đều gated reduced-motion.
   ========================================================= */

/* Thanh tiến độ scroll — indicator theo thao tác user, giữ cả khi reduced-motion */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, #ffd700, #cd7f32);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.45);
  z-index: 130;
  pointer-events: none;
}
@supports (animation-timeline: scroll()) {
  #scroll-progress {
    animation: progress-grow linear both;
    animation-timeline: scroll(root);
  }
}
@keyframes progress-grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* Canvas particle hero — nằm trên aurora, dưới nội dung (shell đứng sau trong DOM) */
.hero-particles {
  position: absolute;
  inset: 0;
  /* canvas = replaced element: phải set width/height tường minh, inset không stretch */
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.85;
}

/* Gold text — transform-only flip support for rotating keywords and headings. */
.gold-metal-text {
  display: inline-block;
  text-align: center;
  transform-origin: 50% 100%;
  backface-visibility: hidden;
}
/* The paint guard belongs only to the Hero rotator. Applying it to every
   gold-metal-text changes the containing box of gold-sweep underlines. */
#hero-title .gold-metal-text {
  /* background-clip:text chỉ tô gradient trong border box — leading 1.02 làm dấu
     tiếng Việt (ữ/ệ/ộ) nhô ra ngoài box thành TRONG SUỐT. Nới vùng paint bằng
     padding, bù margin âm để layout/width-lock không đổi (box-sizing: border-box). */
  padding: 0.3em 0.12em 0.22em;
  margin: -0.3em -0.12em -0.22em;
}
.rot-out {
  animation: rot-out 320ms cubic-bezier(0.55, 0, 0.55, 0.2) both;
}
.rot-in {
  animation: rot-in 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes rot-out {
  to { transform: translateY(-0.35em) rotateX(78deg); opacity: 0; }
}
@keyframes rot-in {
  from { transform: translateY(0.35em) rotateX(-78deg); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: no-preference) {
  /* (nav-drop đã gỡ: animate element có backdrop-filter ép repaint nền mỗi frame — TBT) */

  /* Orb 3T "khởi động": scale-only (compositor) + flare qua opacity của halo */
  #hero .arc-3t {
    animation: orb-ignite 1.3s cubic-bezier(0.22, 1, 0.36, 1) 200ms both;
  }
  @keyframes orb-ignite {
    0% { transform: scale(0.92); }
    55% { transform: scale(1.015); }
    100% { transform: scale(1); }
  }
  #hero .arc-3t__halo {
    animation-name: halo-flare;
    animation-duration: 1.3s;
    animation-delay: 200ms;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
    animation-fill-mode: backwards;
  }
  @keyframes halo-flare {
    0% { opacity: 0.2; }
    55% { opacity: 1; }
    100% { opacity: 0.6; }
  }

  /* Vệt sáng gold quét ngang H1 một lần sau khi load.
     Leading 1.02 rất chặt → dấu tiếng Việt chồng tầng (ẫ/ằ/ữ) vượt line box;
     overflow:hidden sẽ cắt dấu nếu không chừa headroom bằng padding. */
  #hero-title {
    position: relative;
    overflow: hidden;
    padding-top: 0.18em;
    padding-bottom: 0.08em;
    margin-top: calc(1.75rem - 0.18em); /* bù mt-7 để nhịp khoảng cách không đổi */
  }
  #hero-title::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
      115deg,
      transparent 42%,
      rgba(255, 215, 0, 0.35) 50%,
      rgba(255, 255, 255, 0.18) 54%,
      transparent 62%
    );
    transform: translateX(-130%);
    animation: h1-streak 1.15s ease-out 500ms both;
  }
  @keyframes h1-streak {
    to { transform: translateX(130%); }
  }

  /* (aurora parallax đã gỡ: promote blob blur lớn thành layer quá đắt — TBT/GPU) */
}

@media (prefers-reduced-motion: reduce) {
  #hero-title::after { display: none; }
  .hero-particles { display: none !important; }
  .rot-out,
  .rot-in { animation: none !important; }
}
