/* ==========================================================================
   enhance.css — UI/UX upgrade layer
   Loaded AFTER styles.css. Keeps the original palette, content, and class
   contracts intact; adds depth, refined components, and professional motion.
   Theme: "ambiguity resolving into structure."
   ========================================================================== */

/* ==============================
   Extended Design Tokens
   ============================== */
:root {
  /* Accent gradient built from the existing gold + cyan brand colors */
  --gradient-accent: linear-gradient(120deg, var(--accent-gold) 0%, var(--accent-cyan) 100%);

  /* Glow used by the process step markers */
  --gold-glow: rgba(200, 169, 106, 0.16);

  --border-frame: rgba(200, 169, 106, 0.16);
  --border-hover: rgba(124, 200, 218, 0.42);

  /* Richer elevation */
  --shadow-card: 0 18px 44px -18px rgba(0, 0, 0, 0.7);
  --shadow-soft: 0 30px 70px -28px rgba(0, 0, 0, 0.78);
  --shadow-glow-gold: 0 16px 40px -16px rgba(200, 169, 106, 0.28);
  --shadow-glow-cyan: 0 16px 40px -16px rgba(124, 200, 218, 0.26);

  /* Softer, more premium radii */
  --radius-card: 14px;
  --radius-small: 10px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --reveal-dur: 0.62s;
}

/* Let the ambient layers show through — html keeps the base gradient canvas. */
body {
  background: transparent;
}

/* Tabular figures for numeric UI bits */
.process-number,
.experience-period,
.footer-copy {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ==============================
   Ambient Background Layers
   ============================== */
.bg-layers {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}

/* Blueprint grid — the "structure" motif, faded toward the edges */
.bg-grid {
  position: absolute;
  inset: -2px;
  background-image:
    linear-gradient(to right, rgba(124, 200, 218, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(200, 169, 106, 0.045) 1px, transparent 1px);
  background-size: 68px 68px;
  -webkit-mask-image: radial-gradient(ellipse 90% 75% at 50% 28%, #000 0%, rgba(0, 0, 0, 0.55) 55%, transparent 100%);
  mask-image: radial-gradient(ellipse 90% 75% at 50% 28%, #000 0%, rgba(0, 0, 0, 0.55) 55%, transparent 100%);
  opacity: 0.7;
}

/* Drifting aurora — gold and cyan, very low opacity so text stays crisp */
.bg-aurora {
  position: absolute;
  inset: -25%;
  background:
    radial-gradient(38% 38% at 18% 16%, rgba(200, 169, 106, 0.14), transparent 70%),
    radial-gradient(42% 42% at 82% 74%, rgba(124, 200, 218, 0.13), transparent 72%),
    radial-gradient(34% 34% at 65% 22%, rgba(124, 200, 218, 0.07), transparent 70%);
  filter: blur(30px);
  opacity: 0.85;
  animation: aurora-drift 30s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes aurora-drift {
  0% {
    transform: translate3d(-3%, -2%, 0) scale(1);
  }
  50% {
    transform: translate3d(2%, 1%, 0) scale(1.08);
  }
  100% {
    transform: translate3d(3%, 3%, 0) scale(1.04);
  }
}

/* Fine grain for tactile depth */
.bg-grain {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.035;
  mix-blend-mode: overlay;
}

/* Edge vignette to focus the eye on content */
.bg-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 75% 70% at 50% 38%, transparent 52%, rgba(0, 3, 7, 0.55) 100%);
}

/* ==============================
   Scroll Progress Indicator
   ============================== */
.scroll-progress {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 200;
  height: 2px;
  /* Flex anchors the bar to the inline-start: left in LTR, right in RTL,
     so the fill grows toward the reading direction automatically. */
  display: flex;
  background: transparent;
  pointer-events: none;
}

.scroll-progress-bar {
  height: 100%;
  width: var(--scroll-progress, 0%);
  flex: 0 0 auto;
  background: var(--gradient-accent);
  box-shadow: 0 0 10px rgba(124, 200, 218, 0.55);
}

/* ==============================
   Header — elevation on scroll + animated nav underline + scrollspy
   ============================== */
.site-header {
  background: rgba(0, 3, 7, 0.55);
  transition: background 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out),
    border-color 0.35s var(--ease-out), backdrop-filter 0.35s var(--ease-out);
}

.site-header.is-scrolled {
  background: rgba(0, 3, 7, 0.9);
  border-bottom-color: rgba(200, 169, 106, 0.22);
  box-shadow: 0 10px 34px -16px rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px) saturate(1.2);
}

.brand-logo img {
  transition: transform 0.4s var(--ease-spring), filter 0.4s var(--ease-out);
}

.brand-logo:hover img {
  transform: scale(1.05);
  filter: drop-shadow(0 4px 12px rgba(200, 169, 106, 0.35));
}

.nav-links a {
  position: relative;
  transition: color 0.25s var(--ease-out);
}

.nav-links a:hover {
  background: transparent;
}

.nav-links a::after {
  content: "";
  position: absolute;
  inset-inline: 8px;
  inset-block-end: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient-accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.3s var(--ease-out);
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after,
.nav-links a.is-active::after {
  transform: scaleX(1);
}

.nav-links a.is-active {
  color: var(--text-main);
}

/* Language toggle — gold pill with subtle glow when active */
.language-button {
  transition: color 0.25s var(--ease-out), background 0.25s var(--ease-out),
    box-shadow 0.3s var(--ease-out);
}

.language-button.is-active {
  background: var(--accent-gold);
  box-shadow: 0 4px 14px -4px rgba(200, 169, 106, 0.6);
}

.language-button:not(.is-active):hover {
  color: var(--text-main);
}

.menu-toggle {
  transition: border-color 0.25s var(--ease-out), background 0.25s var(--ease-out);
}

.menu-toggle:hover {
  border-color: rgba(200, 169, 106, 0.4);
}

.menu-line {
  transition: transform 0.3s var(--ease-out), opacity 0.25s var(--ease-out);
}

.menu-toggle[aria-expanded="true"] .menu-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-line:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ==============================
   Section Frames — refined, with a top accent hairline
   ============================== */
.section > .section-inner {
  border: 1px solid var(--border-frame);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(124, 200, 218, 0.02), rgba(255, 255, 255, 0.01)),
    rgba(7, 16, 25, 0.28);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 40px 80px -50px rgba(0, 0, 0, 0.9);
  overflow: clip;
}

.section > .section-inner::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline: 14%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200, 169, 106, 0.5), transparent);
  opacity: 0.7;
}

/* Hero breathes — no frame, it's the thesis */
.hero > .section-inner {
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.hero > .section-inner::before {
  display: none;
}

/* Section kicker — add a leading marker line that ties to the grid motif */
.section-kicker,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.section-kicker::before,
.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient-accent);
  flex: 0 0 auto;
}

.section-heading h2,
.contact-copy h2 {
  letter-spacing: -0.015em;
}

/* ==============================
   Buttons — sheen + glow
   ============================== */
.button {
  position: relative;
  overflow: hidden;
  transition: transform 0.25s var(--ease-spring), box-shadow 0.3s var(--ease-out),
    border-color 0.25s var(--ease-out), background 0.25s var(--ease-out), color 0.25s var(--ease-out);
}

/* Moving sheen */
.button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.28) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.6s var(--ease-out);
  pointer-events: none;
}

.button:hover::after {
  transform: translateX(120%);
}

.button-primary {
  background: linear-gradient(120deg, #d8bc81, var(--accent-gold));
  border-color: var(--accent-gold);
}

.button-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-gold);
}

.button-secondary {
  transition: transform 0.25s var(--ease-spring), box-shadow 0.3s var(--ease-out),
    border-color 0.25s var(--ease-out), background 0.25s var(--ease-out);
}

.button-secondary:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  background: rgba(124, 200, 218, 0.16);
  box-shadow: var(--shadow-glow-cyan);
}

.button-ghost:hover {
  transform: translateY(-2px);
  border-color: rgba(200, 169, 106, 0.4);
  background: rgba(255, 255, 255, 0.06);
}

/* Pill toggles + cert/contact links get a consistent lift */
.projects-toggle,
.faq-toggle-more,
.certification-link,
.contact-option-link {
  transition: transform 0.25s var(--ease-spring), border-color 0.25s var(--ease-out),
    background 0.25s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.projects-toggle:hover,
.faq-toggle-more:hover {
  box-shadow: var(--shadow-glow-gold);
}

.projects-toggle-arrow,
.faq-toggle-arrow {
  transition: transform 0.3s var(--ease-spring);
}

.projects-toggle[aria-expanded="true"] .projects-toggle-arrow,
.faq-toggle-more[aria-expanded="true"] .faq-toggle-arrow {
  transform: translateY(-1px);
}

/* ==============================
   Cards — gradient edge on hover + cursor-tracked spotlight
   ============================== */
.card,
.process-card,
.skill-category {
  position: relative;
  isolation: isolate;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out),
    border-color 0.3s var(--ease-out);
}

.card {
  background:
    linear-gradient(180deg, rgba(124, 200, 218, 0.025), transparent 40%),
    rgba(7, 16, 25, 0.92);
}

/* Gradient border ring revealed on hover */
.card::before,
.process-card::before,
.skill-category::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--gradient-accent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
  pointer-events: none;
  z-index: 1;
}

/* Cursor-tracked spotlight */
.card::after,
.process-card::after,
.skill-category::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%),
      rgba(124, 200, 218, 0.1), transparent 62%);
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
  pointer-events: none;
  z-index: 0;
}

.card:hover,
.process-card:hover,
.skill-category:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-soft);
  border-color: transparent;
}

.card:hover::before,
.process-card:hover::before,
.skill-category:hover::before,
.card:hover::after,
.process-card:hover::after,
.skill-category:hover::after {
  opacity: 1;
}

/* Keep real content above the decorative pseudo-layers */
.card > *,
.process-card > *,
.skill-category > * {
  position: relative;
  z-index: 2;
}

/* Card headings get a subtle hover tint */
.card h3,
.process-card h3,
.skill-category h3 {
  transition: color 0.3s var(--ease-out);
}

.card:hover h3,
.process-card:hover h3 {
  color: #fff;
}

/* Info cards + highlights — lighter touch */
.info-card,
.highlight-item {
  transition: transform 0.35s var(--ease-out), border-color 0.3s var(--ease-out),
    background 0.3s var(--ease-out), box-shadow 0.35s var(--ease-out);
}

.info-card:hover,
.highlight-item:hover {
  transform: translateY(-3px);
  border-color: rgba(200, 169, 106, 0.32);
  background: rgba(10, 21, 29, 0.9);
  box-shadow: var(--shadow-card);
}

.highlight-item {
  position: relative;
  padding-inline-start: 16px;
}

.highlight-item::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block: 12px;
  width: 3px;
  border-radius: 3px;
  background: var(--gradient-accent);
  opacity: 0.55;
  transition: opacity 0.3s var(--ease-out);
}

.highlight-item:hover::before {
  opacity: 1;
}

/* Tags / pills — refined, with hover */
.tag,
.pill,
.tag-list > span {
  background: rgba(255, 255, 255, 0.035);
  transition: color 0.25s var(--ease-out), border-color 0.25s var(--ease-out),
    background 0.25s var(--ease-out);
}

.tag:hover,
.pill:hover {
  color: var(--text-main);
  border-color: rgba(124, 200, 218, 0.35);
  background: rgba(124, 200, 218, 0.08);
}

/* ==============================
   Process — refined numbered markers (real sequence)
   ============================== */
.process-card {
  background:
    linear-gradient(160deg, rgba(10, 21, 29, 0.95), rgba(1, 6, 9, 0.92));
}

.process-number {
  position: relative;
  background: rgba(200, 169, 106, 0.1);
  border-color: rgba(200, 169, 106, 0.4);
  box-shadow: 0 0 0 0 var(--gold-glow);
  transition: box-shadow 0.4s var(--ease-out), transform 0.4s var(--ease-spring);
  overflow: hidden;
}

.process-card:hover .process-number {
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 0 0 6px var(--gold-glow);
}

/* ==============================
   Hero — orchestrated load sequence + refined profile frame
   ============================== */
.hero-content h1 {
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #ffffff 0%, #cfd8e2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

[dir="rtl"] .hero-content h1 {
  letter-spacing: 0;
}

.hero-title {
  position: relative;
  display: inline-block;
  padding-bottom: 4px;
}

.hero-title::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block-end: -2px;
  width: 56px;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient-accent);
}

/* Social links — refined hover */
.social-link {
  transition: transform 0.3s var(--ease-spring), border-color 0.3s var(--ease-out),
    background 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.social-link:hover {
  box-shadow: var(--shadow-glow-gold);
}

/* Profile panel — gradient glow ring + gentle float + blueprint corners */
.profile-panel {
  position: relative;
  width: min(100%, 360px);
  background: linear-gradient(180deg, rgba(10, 21, 29, 0.95), rgba(7, 16, 25, 0.86));
  box-shadow: var(--shadow-soft);
}

.profile-panel::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(200, 169, 106, 0.55), rgba(124, 200, 218, 0.3) 60%, transparent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.profile-frame {
  position: relative;
  animation: profile-float 7s ease-in-out infinite;
  will-change: transform;
}

@keyframes profile-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}

.profile-frame img {
  transition: transform 0.6s var(--ease-out);
}

.profile-panel:hover .profile-frame img {
  transform: scale(1.04);
}

.profile-caption {
  background: rgba(0, 3, 7, 0.5);
  backdrop-filter: blur(4px);
}

/* Scroll cue */
.scroll-cue {
  position: absolute;
  inset-block-end: 14px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

[dir="rtl"] .scroll-cue {
  transform: translateX(50%);
}

.scroll-cue-track {
  display: block;
  width: 22px;
  height: 36px;
  border: 1.5px solid rgba(245, 247, 250, 0.3);
  border-radius: 12px;
  position: relative;
}

.scroll-cue-dot {
  position: absolute;
  inset-block-start: 7px;
  inset-inline-start: 50%;
  width: 4px;
  height: 7px;
  margin-inline-start: -2px;
  border-radius: 2px;
  background: var(--accent-gold);
  animation: scroll-cue-bob 1.8s var(--ease-in-out) infinite;
}

@keyframes scroll-cue-bob {
  0% {
    opacity: 0;
    transform: translateY(0);
  }
  35% {
    opacity: 1;
  }
  70% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 0;
    transform: translateY(12px);
  }
}

/* ==============================
   Experience — real vertical timeline
   ============================== */
.timeline {
  position: relative;
  padding-inline-start: 34px;
}

/* One continuous rail down the gutter. */
.timeline::before {
  content: "";
  position: absolute;
  inset-inline-start: 8px;
  inset-block: 10px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent-gold), var(--accent-cyan) 60%, rgba(124, 200, 218, 0));
  opacity: 0.5;
}

.experience-card {
  position: relative;
  transition: border-color 0.3s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

/* Node centered on the rail. box-sizing:border-box is required because the
   global `*` reset does NOT cover pseudo-elements, so without it the 2px
   border would widen the box to 18px and push the node off-center (right in
   LTR, left in RTL). With it, the 14px node centers exactly in both. */
.experience-card::before {
  content: "";
  position: absolute;
  box-sizing: border-box;
  inset-inline-start: -33px;
  inset-block-start: 26px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid var(--accent-gold);
  box-shadow: 0 0 0 4px rgba(200, 169, 106, 0.12);
  transform: scale(0);
  transition: transform 0.4s var(--ease-spring), box-shadow 0.3s var(--ease-out),
    border-color 0.3s var(--ease-out);
  z-index: 2;
}

/* Node pops in when the card reveals; visible by default when JS is off */
.experience-card.is-visible::before,
.experience-card:not(.reveal)::before {
  transform: scale(1);
}

/* Hover feedback on the card — no horizontal shift, so the rail stays straight */
.experience-card:hover {
  border-color: rgba(200, 169, 106, 0.3);
  box-shadow: var(--shadow-card);
}

/* Hover animates the node in place: grows and lights up without moving */
.experience-card:hover::before {
  transform: scale(1.35);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 7px rgba(124, 200, 218, 0.16), 0 0 16px rgba(200, 169, 106, 0.55);
}

/* ==============================
   FAQ — smooth accordion (paired with renderFaq markup change)
   ============================== */
.faq-item {
  transition: border-color 0.3s var(--ease-out), background 0.3s var(--ease-out);
}

.faq-item:hover {
  border-color: rgba(200, 169, 106, 0.28);
}

.faq-item.is-open {
  border-color: rgba(200, 169, 106, 0.32);
  background: rgba(10, 21, 29, 0.92);
}

.faq-question {
  transition: color 0.25s var(--ease-out);
}

.faq-icon {
  transition: transform 0.35s var(--ease-spring), color 0.25s var(--ease-out);
}

.faq-item.is-open .faq-icon {
  transform: scale(1.2);
  color: var(--accent-cyan);
}

/* Animated height via grid-template-rows (0fr -> 1fr) */
.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  padding: 0 20px;
  transition: grid-template-rows 0.4s var(--ease-out), padding 0.4s var(--ease-out);
}

.faq-answer-inner {
  overflow: hidden;
  min-height: 0;
}

.faq-item.is-open .faq-answer {
  grid-template-rows: 1fr;
  padding-block-end: 18px;
}

/* ==============================
   Contact form — focus glow
   ============================== */
.form-field input,
.form-field select,
.form-field textarea {
  transition: border-color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out),
    background 0.25s var(--ease-out);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: rgba(124, 200, 218, 0.6);
  background: rgba(0, 3, 7, 0.78);
  box-shadow: 0 0 0 3px rgba(124, 200, 218, 0.16);
}

.form-field label {
  transition: color 0.25s var(--ease-out);
}

.form-field:focus-within label {
  color: var(--accent-cyan);
}

/* ==============================
   Modal — animated entrance
   ============================== */
.modal:not([hidden]) .modal-backdrop {
  animation: modal-fade 0.3s var(--ease-out);
}

.modal:not([hidden]) .modal-card {
  animation: modal-pop 0.4s var(--ease-spring);
}

@keyframes modal-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modal-pop {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-card {
  box-shadow: var(--shadow-soft);
}

.modal-close {
  transition: transform 0.25s var(--ease-spring), border-color 0.25s var(--ease-out),
    background 0.25s var(--ease-out);
}

.modal-close:hover {
  transform: rotate(90deg);
  border-color: rgba(200, 169, 106, 0.4);
  background: rgba(200, 169, 106, 0.1);
}

/* ==============================
   Footer
   ============================== */
.footer-logo img {
  transition: transform 0.4s var(--ease-spring), filter 0.4s var(--ease-out);
}

.footer-logo:hover img {
  transform: scale(1.05);
  filter: drop-shadow(0 4px 12px rgba(200, 169, 106, 0.35));
}

/* ==============================
   Scroll-reveal (applied by motion.js)
   ============================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--reveal-dur) var(--ease-out),
    transform var(--reveal-dur) var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ==============================
   Hero load sequence (gated by .js so no-JS shows everything)
   ============================== */
.js .hero-content > *,
.js .profile-panel,
.js .scroll-cue {
  opacity: 0;
  transform: translateY(22px);
}

.js .scroll-cue {
  transform: translateX(-50%) translateY(14px);
}

body.is-loaded .hero-content > *,
body.is-loaded .profile-panel,
body.is-loaded .scroll-cue {
  opacity: 1;
  transform: none;
  transition: opacity 0.85s var(--ease-out), transform 0.85s var(--ease-out);
}

body.is-loaded .scroll-cue {
  transform: translateX(-50%);
}

[dir="rtl"] body.is-loaded .scroll-cue {
  transform: translateX(50%);
}

/* Stagger */
body.is-loaded .hero-content > *:nth-child(1) { transition-delay: 0.05s; }
body.is-loaded .hero-content > *:nth-child(2) { transition-delay: 0.13s; }
body.is-loaded .hero-content > *:nth-child(3) { transition-delay: 0.21s; }
body.is-loaded .hero-content > *:nth-child(4) { transition-delay: 0.29s; }
body.is-loaded .hero-content > *:nth-child(5) { transition-delay: 0.37s; }
body.is-loaded .hero-content > *:nth-child(6) { transition-delay: 0.45s; }
body.is-loaded .hero-content > *:nth-child(7) { transition-delay: 0.53s; }
body.is-loaded .profile-panel { transition-delay: 0.32s; }
body.is-loaded .scroll-cue { transition-delay: 0.9s; }

/* ==============================
   Reduced motion — respect the user's preference
   ============================== */
@media (prefers-reduced-motion: reduce) {
  .bg-aurora,
  .profile-frame,
  .scroll-cue-dot {
    animation: none !important;
  }

  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .js .hero-content > *,
  .js .profile-panel,
  .js .scroll-cue {
    opacity: 1;
    transform: none;
  }

  [dir="rtl"] .js .scroll-cue,
  .js .scroll-cue {
    transform: translateX(-50%);
  }

  [dir="rtl"] .js .scroll-cue {
    transform: translateX(50%);
  }

  .experience-card::before {
    transform: scale(1) !important;
  }

  .button::after {
    display: none;
  }

  .modal:not([hidden]) .modal-card,
  .modal:not([hidden]) .modal-backdrop {
    animation: none;
  }

  * {
    scroll-behavior: auto !important;
  }
}

/* ==============================
   Responsive tweaks for new elements
   ============================== */
@media (max-width: 980px) {
  .scroll-cue {
    display: none;
  }

  .profile-frame {
    animation: none;
  }
}

@media (max-width: 640px) {
  .bg-grid {
    background-size: 48px 48px;
  }

  .timeline {
    padding-inline-start: 26px;
  }

  .experience-card::before {
    inset-inline-start: -25px;
  }
}
