/* == NOFLASHSTUDIO.COM == STATIC | NO COOKIES | DARK MODE == */

/* ===== CUSTOM PROPERTIES ===== */
:root {
  --deep-black: #121212;
  --card-dark: #1a1a1a;
  --electric-blue: #00BFFF;
  --electric-blue-dark: #0099CC;
  --white: #ffffff;
  --white-70: rgba(255, 255, 255, 0.7);
  --white-60: rgba(255, 255, 255, 0.6);
  --white-40: rgba(255, 255, 255, 0.4);
  --white-10: rgba(255, 255, 255, 0.1);
  --white-05: rgba(255, 255, 255, 0.05);
}

/* ===== BASE STYLES ===== */
html {
  scroll-behavior: smooth;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--deep-black);
  color: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ===== PARALLAX BACKGROUND ===== */
.parallax-bg {
  will-change: transform;
  transition: transform 0.1s linear;
}

/* ===== SERVICE CARDS ===== */
.service-card {
  background: var(--card-dark);
  border-radius: 1.5rem;
  border: 1px solid var(--white-05);
  overflow: hidden;
  transition: all 0.3s ease;
}

.service-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(0, 191, 255, 0.3);
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(0, 191, 255, 0.15);
}

/* ===== NAVIGATION ===== */
.nav-scrolled {
  background: rgba(18, 18, 18, 0.95) !important;
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--electric-blue);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* ===== GALLERY FILTERS ===== */
.portfolio-filter.active {
  background: var(--electric-blue) !important;
  color: var(--deep-black) !important;
}

.gallery-item {
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.gallery-item.hidden {
  opacity: 0;
  transform: scale(0.8);
  display: none !important;
}

/* ===== FORM STYLES ===== */
.form-input {
  width: 100%;
  padding: 1rem 1.25rem;
  background: var(--card-dark);
  border: 1px solid var(--white-10);
  border-radius: 0.75rem;
  color: var(--white);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--electric-blue);
  box-shadow: 0 0 0 3px rgba(0, 191, 255, 0.1);
}

.form-input::placeholder {
  color: rgba(255, 255, 255, 0.55); /* Upgraded from 0.40 for better visibility - placeholders need 3:1 minimum */
}

/* ===== BUTTON GLOW EFFECT ===== */
.btn-glow {
  position: relative;
  overflow: hidden;
}

.btn-glow::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn-glow:hover::before {
  width: 300px;
  height: 300px;
}

/* ===== SCROLL ANIMATIONS ===== */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.floating {
  animation: float 3s ease-in-out infinite;
}

/* ===== GRADIENT TEXT ===== */
.gradient-text {
  background: linear-gradient(135deg, var(--electric-blue), #60a5fa, #22d3d1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  /* Refined edge highlight using text-stroke */
  -webkit-text-stroke: 0.5px rgba(255, 255, 230, 0.4);
  /* Alternative: Use filter for glow if stroke isn't visible enough */
  filter: drop-shadow(0 -1px 0 rgba(255, 255, 240, 0.3))
          drop-shadow(0 -2px 1px rgba(255, 255, 250, 0.15))
          drop-shadow(0 1px 1px rgba(0, 0, 0, 0.1));
  /* Prevent clipping */
  display: inline-block;
  padding: 0.05em 0.1em;
}

/* ===== NEON GLOW ===== */
.neon-glow {
  text-shadow: 
    0 0 5px var(--electric-blue),
    0 0 10px var(--electric-blue),
    0 0 20px var(--electric-blue),
    0 0 40px var(--electric-blue);
}

/* ===== LOADING SKELETON ===== */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--card-dark) 25%,
    rgba(255, 255, 255, 0.1) 50%,
    var(--card-dark) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--deep-black);
}

::-webkit-scrollbar-thumb {
  background: var(--card-dark);
  border-radius: 5px;
  border: 2px solid var(--deep-black);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--electric-blue);
}

/* ===== NUMBERED CIRCLE FIX (How It Works Section) ===== */
/* Prevents diorama scroll transforms from distorting numbered circles */
/* UPDATED: More aggressive isolation to prevent distortion */
.flex.gap-4[data-diorama] .rounded-full {
  /* Create completely isolated rendering context */
  isolation: isolate;
  /* Force circle to ignore parent transforms completely */
  transform: translate3d(0, 0, 0) !important;
  filter: none !important;
  opacity: 1 !important;
  /* Prevent any animation/transition interference */
  transition: none !important;
  /* Force perfect circle with aspect ratio */
  aspect-ratio: 1 / 1;
  border-radius: 50% !important;
  /* GPU acceleration for independent rendering */
  will-change: transform;
  /* Strict containment to isolate from parent */
  contain: layout style paint;
  /* Ensure proper stacking */
  position: relative;
  z-index: 1;
  /* Prevent backface issues */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* ===== RESPONSIVE UTILITIES ===== */
@media (max-width: 768px) {
  .service-card:hover {
    transform: translateY(-4px);
  }
}

/* ===== LIGHTBOX ===== */
#lightbox {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#lightbox.active {
  opacity: 1;
  visibility: visible;
}

/* ===== PULSE ANIMATION ===== */
@keyframes pulse-ring {
  0% {
    transform: scale(0.8);
    opacity: 1;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.pulse-ring {
  position: relative;
}

.pulse-ring::before {
  content: '';
  position: absolute;
  inset: -4px;
  border: 2px solid var(--electric-blue);
  border-radius: 50%;
  animation: pulse-ring 1.5s ease-out infinite;
}

/* ===== EMAIL REVEAL BUTTON ===== */
.email-reveal-btn,
.email-reveal-btn-alt {
  position: relative;
  overflow: hidden;
  font-weight: 500;
  transition: all 0.3s ease;
}

.email-reveal-btn:hover,
.email-reveal-btn-alt:hover {
  border-color: rgba(0, 191, 255, 0.5);
  background: rgba(0, 191, 255, 0.15);
}

.email-reveal-btn:focus,
.email-reveal-btn-alt:focus {
  outline: 2px solid var(--electric-blue);
  outline-offset: 2px;
}

.email-link,
.email-link-alt {
  word-break: break-all;
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== FOOTER CONTACT ===== */
.footer-contact {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .footer-contact {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .email-reveal-btn,
  .email-reveal-btn-alt {
    width: 100%;
  }
}

/* ===== FOCUS WHEEL COMPONENT ===== */
/* Core design element - mandatory on all pages */
.focus-wheel {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
  transition: opacity 0.5s ease;
}

.focus-wheel--hero {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(600px, 80vw);
  height: min(600px, 80vw);
}

.focus-wheel--corner {
  width: min(400px, 50vw);
  height: min(400px, 50vw);
}

.focus-wheel--top-right {
  top: -10%;
  right: -10%;
}

.focus-wheel--bottom-left {
  bottom: -10%;
  left: -10%;
}

.focus-wheel__container {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Animated rings */
.focus-wheel__ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid transparent;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.focus-wheel__ring--1 {
  width: 100%;
  height: 100%;
  border-color: rgba(0, 191, 255, 0.1);
  animation: focusRingPulse 4s ease-in-out infinite, focusRingSpin 30s linear infinite;
}

.focus-wheel__ring--2 {
  width: 80%;
  height: 80%;
  border-color: rgba(0, 191, 255, 0.15);
  animation: focusRingPulse 4s ease-in-out infinite 0.5s, focusRingSpin 25s linear infinite reverse;
}

.focus-wheel__ring--3 {
  width: 60%;
  height: 60%;
  border-color: rgba(0, 191, 255, 0.2);
  animation: focusRingPulse 4s ease-in-out infinite 1s, focusRingSpin 20s linear infinite;
}

.focus-wheel__ring--4 {
  width: 40%;
  height: 40%;
  border-color: rgba(0, 191, 255, 0.25);
  animation: focusRingPulse 4s ease-in-out infinite 1.5s, focusRingSpin 15s linear infinite reverse;
}

.focus-wheel__ring--5 {
  width: 20%;
  height: 20%;
  border-color: rgba(0, 191, 255, 0.3);
  animation: focusRingPulse 4s ease-in-out infinite 2s, focusRingSpin 10s linear infinite;
}

/* Core glow */
.focus-wheel__core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10%;
  height: 10%;
  background: radial-gradient(circle, rgba(0, 191, 255, 0.4) 0%, transparent 70%);
  border-radius: 50%;
  animation: focusCoreGlow 3s ease-in-out infinite;
}

/* Focus wheel keyframes */
@keyframes focusRingPulse {
  0%, 100% {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.02);
  }
}

@keyframes focusRingSpin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes focusCoreGlow {
  0%, 100% {
    opacity: 0.4;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1.3);
  }
}

/* Focus wheel with dashed ring accent */
.focus-wheel__ring--dashed {
  border-style: dashed;
  border-width: 2px;
}

/* Gradient ring variant */
.focus-wheel__ring--gradient {
  border: none;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(0, 191, 255, 0.3) 90deg,
    transparent 180deg,
    rgba(0, 191, 255, 0.3) 270deg,
    transparent 360deg
  );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), black calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), black calc(100% - 2px));
}

/* ===== ENHANCED IN/OUT ANIMATIONS ===== */
/* These complement AOS library for consistent site-wide feel */

/* Fade animations */
.animate-fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

.animate-fade-out {
  animation: fadeOut 0.6s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Slide animations */
.animate-slide-up {
  animation: slideUp 0.6s ease-out forwards;
}

.animate-slide-down {
  animation: slideDown 0.6s ease-out forwards;
}

.animate-slide-left {
  animation: slideLeft 0.6s ease-out forwards;
}

.animate-slide-right {
  animation: slideRight 0.6s ease-out forwards;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideLeft {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideRight {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scale animations */
.animate-scale-in {
  animation: scaleIn 0.5s ease-out forwards;
}

.animate-scale-out {
  animation: scaleOut 0.5s ease-out forwards;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes scaleOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

/* Rotate fade in */
.animate-rotate-in {
  animation: rotateIn 0.7s ease-out forwards;
}

@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-10deg) scale(0.95);
  }
  to {
    opacity: 1;
    transform: rotate(0deg) scale(1);
  }
}

/* Blur fade in */
.animate-blur-in {
  animation: blurIn 0.6s ease-out forwards;
}

@keyframes blurIn {
  from {
    opacity: 0;
    filter: blur(10px);
  }
  to {
    opacity: 1;
    filter: blur(0);
  }
}

/* Stagger animation delays for lists */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }
.stagger-7 { animation-delay: 0.7s; }
.stagger-8 { animation-delay: 0.8s; }

/* Initially hidden for animation triggers */
.animate-hidden {
  opacity: 0;
}

/* ===== ENHANCED FLOATING ANIMATION VARIANTS ===== */
@keyframes floatSlow {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-15px) rotate(2deg);
  }
}

@keyframes floatFast {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes floatDrift {
  0%, 100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(5px, -10px);
  }
  50% {
    transform: translate(-5px, -15px);
  }
  75% {
    transform: translate(3px, -8px);
  }
}

.floating-slow {
  animation: floatSlow 5s ease-in-out infinite;
}

.floating-fast {
  animation: floatFast 2s ease-in-out infinite;
}

.floating-drift {
  animation: floatDrift 6s ease-in-out infinite;
}

/* ===== GLOW PULSE EFFECTS ===== */
@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.2);
  }
  50% {
    box-shadow: 0 0 40px rgba(0, 191, 255, 0.4), 0 0 60px rgba(0, 191, 255, 0.2);
  }
}

.glow-pulse {
  animation: glowPulse 3s ease-in-out infinite;
}

/* ===== TEXT SHIMMER EFFECT ===== */
@keyframes textShimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

.text-shimmer {
  background: linear-gradient(
    90deg,
    var(--electric-blue) 0%,
    #60a5fa 25%,
    #22d3d1 50%,
    #60a5fa 75%,
    var(--electric-blue) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: textShimmer 4s linear infinite;
}

/* ===== BORDER ANIMATION ===== */
@keyframes borderGlow {
  0%, 100% {
    border-color: rgba(0, 191, 255, 0.2);
  }
  50% {
    border-color: rgba(0, 191, 255, 0.5);
  }
}

.border-glow {
  animation: borderGlow 2s ease-in-out infinite;
}

/* ===== DIORAMA SCROLL EFFECT ===== */
/* Cinematic tilt-shift scroll system - mandatory on all pages */
/* Replaces AOS for continuous scroll-linked transformations */

/* Base element styles */
.diorama-element {
  transform-style: preserve-3d;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Initial hidden state (before entering view) */
[data-diorama]:not(.diorama-visible) {
  opacity: 0;
}

/* Visible state */
.diorama-visible {
  opacity: 1;
}

/* Focus zone indicators (debug mode - uncomment to visualize) */
/*
body::before,
body::after {
  content: '';
  position: fixed;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0, 191, 255, 0.5), transparent);
  z-index: 9999;
  pointer-events: none;
}

body::before {
  top: 20vh;
}

body::after {
  bottom: 20vh;
}
*/

/* Gradient overlays for top/bottom blur zones */
.diorama-overlay-top,
.diorama-overlay-bottom {
  position: fixed;
  left: 0;
  right: 0;
  height: 15vh;
  pointer-events: none;
  z-index: 40;
}

.diorama-overlay-top {
  top: 0;
  background: linear-gradient(
    to bottom,
    rgba(18, 18, 18, 0.6) 0%,
    rgba(18, 18, 18, 0.3) 40%,
    transparent 100%
  );
}

.diorama-overlay-bottom {
  bottom: 0;
  background: linear-gradient(
    to top,
    rgba(18, 18, 18, 0.6) 0%,
    rgba(18, 18, 18, 0.3) 40%,
    transparent 100%
  );
}

/* Preset-specific base styles */
[data-diorama-preset="hero"] {
  transform-origin: center center;
}

[data-diorama-preset="section"],
[data-diorama-preset="text"] {
  transform-origin: left center;
}

[data-diorama-preset="card"] {
  transform-origin: center center;
}

[data-diorama-preset="grid-left"] {
  transform-origin: left center;
}

[data-diorama-preset="grid-center"] {
  transform-origin: center center;
}

[data-diorama-preset="grid-right"] {
  transform-origin: right center;
}

[data-diorama-preset="list-item"] {
  transform-origin: left center;
}

/* Direction-specific origins */
[data-diorama-direction="left"] {
  transform-origin: left center;
}

[data-diorama-direction="right"] {
  transform-origin: right center;
}

[data-diorama-direction="center"] {
  transform-origin: center center;
}

/* Intensity visual hints (subtle shadow increase for dramatic) */
[data-diorama-intensity="dramatic"].diorama-visible {
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Staggered children animation delays */
[data-diorama] > *:nth-child(1) { transition-delay: 0s; }
[data-diorama] > *:nth-child(2) { transition-delay: 0.05s; }
[data-diorama] > *:nth-child(3) { transition-delay: 0.1s; }
[data-diorama] > *:nth-child(4) { transition-delay: 0.15s; }
[data-diorama] > *:nth-child(5) { transition-delay: 0.2s; }
[data-diorama] > *:nth-child(6) { transition-delay: 0.25s; }

/* Grid container stagger for cards */
.diorama-grid > [data-diorama]:nth-child(1) { transition-delay: 0s; }
.diorama-grid > [data-diorama]:nth-child(2) { transition-delay: 0.08s; }
.diorama-grid > [data-diorama]:nth-child(3) { transition-delay: 0.16s; }
.diorama-grid > [data-diorama]:nth-child(4) { transition-delay: 0.24s; }
.diorama-grid > [data-diorama]:nth-child(5) { transition-delay: 0.32s; }
.diorama-grid > [data-diorama]:nth-child(6) { transition-delay: 0.4s; }
.diorama-grid > [data-diorama]:nth-child(7) { transition-delay: 0.48s; }
.diorama-grid > [data-diorama]:nth-child(8) { transition-delay: 0.56s; }
.diorama-grid > [data-diorama]:nth-child(9) { transition-delay: 0.64s; }

/* ===== REDUCED MOTION SUPPORT ===== */
@media (prefers-reduced-motion: reduce) {
  /* ...existing reduced motion styles... */
  
  /* Diorama specific */
  .diorama-element,
  [data-diorama] {
    transform: none !important;
    filter: none !important;
    transition: opacity 0.3s ease !important;
  }
  
  [data-diorama]:not(.diorama-visible) {
    opacity: 0.5;
  }
  
  .diorama-overlay-top,
  .diorama-overlay-bottom {
    display: none;
  }
  
  /* Accordion animations */
  details summary,
  details[open] summary {
    transition: none !important;
  }
  
  details p,
  details div {
    animation: none !important;
  }
}

/* ===== FAQ ACCORDION ANIMATIONS ===== */
/* Elegant expand/collapse animations for details elements */

details {
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

details summary {
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: all 0.3s ease;
}

/* Hide default marker */
details summary::-webkit-details-marker {
  display: none;
}

details summary::marker {
  display: none;
}

/* Summary hover state */
details summary:hover {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 1rem;
}

/* Content wrapper animation */
details[open] {
  background: rgba(0, 191, 255, 0.02);
  border-color: rgba(0, 191, 255, 0.2);
}

/* Smooth height animation on open */
details[open] summary {
  margin-bottom: 0.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Content fade-in animation */
details[open] > p,
details[open] > div:not(summary) {
  animation: accordionSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes accordionSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Arrow icon smooth rotation - already handled by Tailwind group-open:rotate-180 */
details summary span {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
  will-change: transform;
}

/* Enhanced focus state for accessibility */
details summary:focus {
  outline: 2px solid var(--electric-blue);
  outline-offset: 2px;
  border-radius: 1rem;
}

details summary:focus:not(:focus-visible) {
  outline: none;
}

/* Content spacing - p tags already have mt-4 from Tailwind */
details p {
  line-height: 1.7;
}

/* Enhanced glow on open state */
details[open] {
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.3),
    0 0 30px rgba(0, 191, 255, 0.08);
  transform: translateY(-2px);
}

/* Smooth scale effect on click */
details:active:not([open]) summary {
  transform: scale(0.99);
}

/* Mobile menu panel helper */
.mobile-menu-panel {
  z-index: 60;
  width: 100vw;
  max-width: 100vw;
  left: 0;
  right: 0;
  overflow-x: hidden;
}

/* ===== HIGH CONTRAST ACCESSIBILITY TOGGLE ===== */
/* Universal accessibility feature for all users */

.high-contrast-toggle {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
  cursor: pointer;
}

.high-contrast-toggle:hover {
  background: rgba(0, 191, 255, 0.1);
  border-color: var(--electric-blue) !important;
  transform: translateY(-2px);
}

.high-contrast-toggle:active {
  transform: translateY(0);
}

.high-contrast-toggle.active {
  background: rgba(0, 191, 255, 0.15);
  border-color: var(--electric-blue) !important;
  box-shadow: 0 0 20px rgba(0, 191, 255, 0.3);
}

.high-contrast-toggle.active .toggle-icon {
  animation: togglePulse 2s ease-in-out infinite;
}

@keyframes togglePulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.high-contrast-toggle:focus {
  outline: 2px solid var(--electric-blue);
  outline-offset: 2px;
}

.high-contrast-toggle:focus:not(:focus-visible) {
  outline: none;
}

/* Toggle icon styles */
.toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  color: var(--electric-blue);
}

.toggle-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  color: inherit;
}

/* Toggle text */
.toggle-text {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.025em;
}

/* ===== NAVBAR-INTEGRATED TOGGLE BUTTON ===== */
/* Positioned LEFT of the logo in the navigation bar */

.high-contrast-toggle--navbar {
  background: transparent;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.high-contrast-toggle--navbar:hover {
  background: rgba(0, 191, 255, 0.1);
  transform: none;
}

.high-contrast-toggle--navbar .toggle-icon {
  color: var(--white-70);
  transition: color 0.3s ease;
}

.high-contrast-toggle--navbar .toggle-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.high-contrast-toggle--navbar:hover .toggle-icon {
  color: var(--electric-blue);
}

.high-contrast-toggle--navbar.active .toggle-icon {
  color: var(--electric-blue);
}

.high-contrast-toggle--navbar .toggle-text {
  color: var(--white-70);
  font-size: 0.75rem;
}

.high-contrast-toggle--navbar:hover .toggle-text {
  color: var(--white);
}

/* Mobile navbar toggle adjustments */
@media (max-width: 640px) {
  .high-contrast-toggle--navbar {
    padding: 0.375rem 0.5rem;
    margin-right: 0.5rem;
  }
  
  .high-contrast-toggle--navbar .toggle-icon {
    font-size: 1.125rem;
  }
}

/* Floating button specific styles (for pages without navbar) */
.high-contrast-toggle.fixed {
  background: rgba(26, 26, 26, 0.9);
  z-index: 50 !important;
  pointer-events: auto !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.high-contrast-toggle.fixed:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 191, 255, 0.3);
}

.high-contrast-toggle.fixed.active {
  background: rgba(0, 191, 255, 0.15);
  box-shadow: 0 10px 40px rgba(0, 191, 255, 0.4);
}

.high-contrast-toggle.fixed.active .toggle-icon {
  color: var(--electric-blue);
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
  .high-contrast-toggle .toggle-text {
    font-size: 1rem;
  }
  
  /* Adjust floating button position for mobile */
  .high-contrast-toggle.fixed {
    top: 1rem;
    left: 1rem;
    padding: 0.75rem 1rem;
  }
}

/* E-reader mode - ALWAYS show toggle button */
.ereader-mode .high-contrast-toggle {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: #FFFFFF !important;
  border: 2px solid #000000 !important;
  color: #000000 !important;
  pointer-events: auto !important;
  z-index: 9999 !important;
}

.ereader-mode .high-contrast-toggle .toggle-icon {
  filter: none !important;
  -webkit-text-stroke: 0 !important;
  text-stroke: 0 !important;
  color: #000000 !important;
}

.ereader-mode .high-contrast-toggle .toggle-text {
  color: #000000 !important;
}

.ereader-mode .high-contrast-toggle:hover {
  background: #F0F0F0 !important;
  border-color: #000000 !important;
  transform: none !important;
}

/* High contrast reload notification */
#hc-reload-notification {
  animation: slideInFromLeft 0.3s ease-out;
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ===== WCAG 2.2 AA ACCESSIBILITY STYLES ===== */

/* Skip Navigation Link - WCAG 2.4.1 Bypass Blocks */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  padding: 1rem 2rem;
  background: var(--electric-blue);
  color: var(--deep-black);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border-radius: 0 0 0.5rem 0.5rem;
  transition: top 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--white);
  outline-offset: 2px;
}

.skip-link:hover {
  background: var(--electric-blue-dark);
}

/* Screen Reader Only - Hidden but accessible to assistive technology */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Make sr-only content visible when focused (for skip links) */
.sr-only:focus,
.sr-only:focus-within {
  position: static;
  width: auto;
  height: auto;
  padding: inherit;
  margin: inherit;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* ===== ENHANCED FOCUS INDICATORS - WCAG 2.4.7 ===== */

/* Universal focus style for interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--electric-blue);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Remove default focus for mouse users, keep for keyboard */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}

/* Enhanced focus for navigation links */
.nav-link:focus-visible {
  outline: 2px solid var(--electric-blue);
  outline-offset: 4px;
  border-radius: 4px;
}

/* Enhanced focus for portfolio filter buttons */
.portfolio-filter:focus-visible {
  outline: 3px solid var(--electric-blue);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(0, 191, 255, 0.3);
}

/* Enhanced focus for gallery items */
.gallery-item:focus-visible {
  outline: 3px solid var(--electric-blue);
  outline-offset: 4px;
  box-shadow: 0 0 20px rgba(0, 191, 255, 0.4);
}

/* Enhanced focus for service cards */
.service-card:focus-visible {
  outline: 3px solid var(--electric-blue);
  outline-offset: 2px;
}

/* Enhanced focus for form inputs */
.form-input:focus-visible {
  outline: none; /* Already has border-color focus style */
  box-shadow: 0 0 0 3px rgba(0, 191, 255, 0.3);
}

/* ===== IMPROVED COLOR CONTRAST - WCAG 1.4.3 ===== */

/* High contrast text utilities (4.5:1 minimum for normal text) */
.text-accessible {
  color: rgba(255, 255, 255, 0.87); /* ~10:1 on dark background */
}

.text-accessible-muted {
  color: rgba(255, 255, 255, 0.75); /* ~4.6:1 on dark background - meets AA */
}

/* 
 * WCAG 2.2 AA Contrast Reference on #121212 background:
 * - white/40 (~2.1:1) - FAILS AA
 * - white/50 (~2.6:1) - FAILS AA  
 * - white/60 (~3.2:1) - FAILS AA for normal text
 * - white/70 (~4.0:1) - FAILS AA for normal text
 * - white/75 (~4.6:1) - PASSES AA for normal text
 * - white/80 (~5.2:1) - PASSES AA for normal text
 * 
 * Minimum required: 4.5:1 for normal text, 3:1 for large text (18pt+/14pt bold)
 */

/* Override low contrast utility classes for accessibility */
/* These provide fallback colors that meet WCAG AA */
.a11y-text-60 {
  color: rgba(255, 255, 255, 0.80) !important; /* Upgraded from 0.60 */
}

.a11y-text-50 {
  color: rgba(255, 255, 255, 0.75) !important; /* Upgraded from 0.50 */
}

.a11y-text-40 {
  color: rgba(255, 255, 255, 0.70) !important; /* Upgraded from 0.40 - for large text only */
}

/* ===== GLOBAL LOW-CONTRAST TEXT FIXES ===== */
/* These overrides ensure site-wide WCAG AA compliance without modifying every HTML file */

/* Tagline text - upgraded from white/50 to white/75 */
.text-white\/50 {
  color: rgba(255, 255, 255, 0.75) !important;
}

/* Secondary body text - upgraded from white/60 to white/75 */
.text-white\/60 {
  color: rgba(255, 255, 255, 0.75) !important;
}

/* Decorative/tertiary text - upgraded from white/40 to white/70 (acceptable for large text) */
.text-white\/40 {
  color: rgba(255, 255, 255, 0.70) !important;
}

/* ===== HIGH CONTRAST MODE SUPPORT ===== */
@media (prefers-contrast: more) {
  .skip-link {
    background: #FFFFFF;
    color: #000000;
    border: 2px solid #000000;
  }
  
  a:focus-visible,
  button:focus-visible,
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible {
    outline: 3px solid #FFFFFF;
    outline-offset: 3px;
  }
  
  .text-white\/50,
  .text-white\/60,
  .text-white\/70 {
    color: rgba(255, 255, 255, 0.9) !important;
  }
}
