/* Graceful fallback if JavaScript is disabled */
html:not(.js) .reveal,
html:not(.js) .split-char,
html:not(.js) .split-line,
html:not(.js) .hero-line {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}

/* ---------- Navbar state helpers ---------- */
.navbar.is-scrolled {
  background: color-mix(in srgb, var(--background) 85%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.navbar.menu-open {
  background: color-mix(in srgb, var(--background) 85%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.navbar.menu-open .nav-mobile-panel {
  opacity: 1;
  pointer-events: auto;
}

/* Hamburger morphing menu icon */
.hamburger-line {
  position: absolute;
  left: 0;
  height: 2px;
  background: currentColor;
  transition: all 0.3s;
  transform-origin: left;
}
.hamburger-line-1 {
  top: 0;
  width: 100%;
}
.hamburger-line-2 {
  top: 50%;
  width: 70%;
  opacity: 1;
}
.hamburger-line-3 {
  bottom: 0;
  width: 100%;
}
.navbar.menu-open .hamburger-line-1 {
  top: 50%;
  transform: rotate(45deg);
}
.navbar.menu-open .hamburger-line-2 {
  opacity: 0;
}
.navbar.menu-open .hamburger-line-3 {
  top: 50%;
  transform: rotate(-45deg);
}

/* ---------- Active nav link ---------- */
a.nav-underline.active {
  color: var(--primary);
}
a.nav-underline.active::after {
  transform: scaleX(1);
}

/* ---------- Work filter ---------- */
[data-work-card].is-hidden {
  display: none;
}

/* ---------- FAQ accordion state ---------- */
.faq-item.is-open .faq-answer {
  grid-template-rows: 1fr;
}
.faq-item.is-open [data-faq-icon] {
  border-color: color-mix(in srgb, var(--primary) 50%, transparent);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  transform: rotate(45deg);
}
.faq-item.is-open [data-faq-question] {
  color: var(--primary);
}

/* ---------- Theme switch ---------- */
.theme-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 3.5rem;
  height: 2rem;
  padding: 0;
  border-radius: 9999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--primary) 6%, transparent);
  cursor: pointer;
  transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}
.theme-switch:hover,
.theme-switch:focus-visible {
  border-color: color-mix(in srgb, var(--primary) 40%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 10%, transparent);
  outline: none;
}
.theme-switch-track {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}
.theme-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 9999px;
  background: var(--foreground);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: left 0.35s cubic-bezier(0.4, 1.4, 0.5, 1), background 0.3s;
  z-index: 2;
}
html.light .theme-switch-thumb {
  left: calc(100% - 1.4rem - 3px);
  background: var(--primary);
}
.theme-switch-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  color: var(--primary);
  pointer-events: none;
  transition: color 0.3s, opacity 0.3s;
  z-index: 1;
}
.theme-switch-icon-sun {
  left: 6px;
  opacity: 0.35;
}
.theme-switch-icon-moon {
  right: 6px;
  opacity: 1;
}
html.light .theme-switch-icon-sun {
  opacity: 1;
}
html.light .theme-switch-icon-moon {
  opacity: 0.35;
}

/* ---------- Video reveal player (lightbox) ---------- */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.video-modal.is-open {
  opacity: 1;
  visibility: visible;
}
.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.video-modal-card {
  position: relative;
  z-index: 1;
  width: min(96vw, 1100px);
  transform: scale(0.96);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.video-modal.is-open .video-modal-card {
  transform: scale(1);
}
.video-modal-card video {
  display: block;
  width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: #000;
  box-shadow: 0 40px 120px -30px rgba(232, 51, 28, 0.35);
}
.video-modal-close {
  position: absolute;
  top: -3rem;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--line);
  border-radius: 9999px;
  background: color-mix(in srgb, var(--background) 85%, transparent);
  color: var(--foreground);
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s, background 0.3s, transform 0.3s;
}
.video-modal-close:hover,
.video-modal-close:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  transform: rotate(90deg);
  outline: none;
}
body.video-modal-open {
  overflow: hidden;
}