/* ══════════════════════════════════════════════════════════════
   DASHT SEO — Premium Design Layer
   Advanced visual polish, micro-interactions, and motion design
   ══════════════════════════════════════════════════════════════ */

/* ── 1. NOISE / GRAIN TEXTURE (desktop only — performance) ── */
@media (min-width: 769px) {
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: .028;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
  }
  html[data-theme="dark"] body::before { opacity: .04; }
}

/* ── 2. CUSTOM SELECTION COLOR ── */
::selection { background: var(--c-primary); color: #fff; }
::-moz-selection { background: var(--c-primary); color: #fff; }
html[data-theme="dark"] ::selection { background: var(--c-accent); color: var(--bg); }

/* ── 3. GRADIENT ANIMATED TEXT ── */
.dasht-gradient-text {
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent), var(--c-secondary), var(--c-primary));
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: dasht-gradient-shift 6s ease infinite;
}
@keyframes dasht-gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ── 4. UNDERLINE ANIMATION (links & nav) — desktop only ── */
/* NOTE: fixes.css also sets nav underline via .nav-links a::after.
   Both use the same positioning, so they coexist without conflict.
   premium-design.css uses width transition, fixes.css uses scaleX. */
@media (min-width: 769px) {
  .dasht-animated-link {
    position: relative;
    text-decoration: none;
  }
  .dasht-animated-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 0;
    height: 1.5px;
    background: var(--c-primary);
    transition: width .4s cubic-bezier(.22, 1, .36, 1);
  }
  .dasht-animated-link:hover::after {
    width: 100%;
  }
  /* Active nav item underline handled by fixes.css for consistency */
}

/* ── 5. BUTTON RIPPLE EFFECT ── */
.btn, .dasht-form-submit, .dasht-comment-submit {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.dasht-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.35);
  transform: scale(0);
  animation: dasht-ripple-anim .6s ease-out forwards;
  pointer-events: none;
  z-index: 0;
}
@keyframes dasht-ripple-anim {
  to { transform: scale(4); opacity: 0; }
}

/* ── 6. CARD 3D TILT ── */
.dasht-tilt-card {
  transform-style: preserve-3d;
  transition: transform .4s cubic-bezier(.22, 1, .36, 1), box-shadow .4s ease;
}
.dasht-tilt-card:hover {
  box-shadow: 0 20px 40px rgba(0,0,0,.08), 0 0 0 1px var(--c-primary);
}
html[data-theme="dark"] .dasht-tilt-card:hover {
  box-shadow: 0 20px 40px rgba(0,0,0,.3), 0 0 0 1px var(--c-primary);
}

/* ── 7. GLASSMORPHISM CARDS ── */
.dasht-glass {
  background: rgba(255,254,250,.6);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.5);
}
html[data-theme="dark"] .dasht-glass {
  background: rgba(18,22,29,.65);
  border-color: rgba(244,239,227,.08);
}

/* ── 8. SCROLL REVEAL — Scale In ── */
.dasht-scale-in {
  opacity: 0;
  transform: scale(.92);
  transition: opacity .8s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1);
}
.dasht-scale-in.in {
  opacity: 1;
  transform: scale(1);
}

/* ── 9. SCROLL REVEAL — Slide Variants ── */
.dasht-slide-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1);
}
.dasht-slide-up.in { opacity: 1; transform: translateY(0); }

.dasht-slide-right {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1);
}
.dasht-slide-right.in { opacity: 1; transform: translateX(0); }

.dasht-slide-left {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1);
}
.dasht-slide-left.in { opacity: 1; transform: translateX(0); }

/* ── 10. FLOATING LABEL INPUTS ── */
.dasht-float-field {
  position: relative;
}
.dasht-float-field input,
.dasht-float-field textarea {
  padding-top: 22px;
}
.dasht-float-field label {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  font-size: .88rem;
  color: var(--ink-mute);
  pointer-events: none;
  transition: all .25s cubic-bezier(.22,1,.36,1);
  transform-origin: right center;
}
.dasht-float-field textarea ~ label { top: 18px; transform: none; }
.dasht-float-field input:focus ~ label,
.dasht-float-field input:not(:placeholder-shown) ~ label,
.dasht-float-field textarea:focus ~ label,
.dasht-float-field textarea:not(:placeholder-shown) ~ label {
  top: 6px;
  transform: translateY(0) scale(.78);
  color: var(--c-primary);
  font-weight: 600;
}

/* ── 11. SKELETON LOADING ── */
.dasht-skeleton {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--paper) 50%, var(--bg-2) 75%);
  background-size: 200% 100%;
  animation: dasht-skeleton-shimmer 1.5s ease infinite;
  border-radius: var(--r-sm);
}
@keyframes dasht-skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.dasht-skeleton-line { height: 14px; margin-bottom: 10px; }
.dasht-skeleton-line:last-child { width: 60%; }
.dasht-skeleton-circle { width: 48px; height: 48px; border-radius: 50%; }
.dasht-skeleton-card { height: 200px; border-radius: var(--r-lg); }

/* ── 12. TOAST NOTIFICATIONS ── */
.dasht-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 99999;
  padding: 14px 28px;
  border-radius: 14px;
  font-size: .86rem;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 14px 40px rgba(0,0,0,.2);
  opacity: 0;
  transition: all .45s cubic-bezier(.16,1,.3,1);
  pointer-events: none;
}
.dasht-toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.dasht-toast-success { background: var(--c-primary); }
.dasht-toast-error { background: #ef4444; }
.dasht-toast-info { background: var(--ink); }

/* ── 13. CHECKBOX / RADIO ANIMATIONS ── */
.dasht-check-animated {
  -webkit-appearance: none;
  appearance: none;
  width: 20px; height: 20px;
  border: 2px solid var(--line-soft);
  border-radius: 5px;
  background: var(--paper);
  cursor: pointer;
  position: relative;
  transition: all .25s cubic-bezier(.22,1,.36,1);
}
.dasht-check-animated:checked {
  background: var(--c-primary);
  border-color: var(--c-primary);
  animation: dasht-check-bounce .3s cubic-bezier(.22,1,.36,1);
}
.dasht-check-animated:checked::after {
  content: '';
  position: absolute;
  left: 5px; top: 1px;
  width: 6px; height: 11px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
@keyframes dasht-check-bounce {
  0% { transform: scale(1); }
  40% { transform: scale(.85); }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* ── 14. SVG WAVE SEPARATOR ── */
.dasht-wave-separator {
  width: 100%;
  height: 60px;
  overflow: hidden;
  line-height: 0;
  position: relative;
  z-index: 1;
}
.dasht-wave-separator svg {
  width: 100%;
  height: 100%;
  display: block;
}
.dasht-wave-separator .wave-fill { fill: var(--bg); }

/* ── 15. SCROLL PROGRESS (VERTICAL DOTS) ── */
.dasht-scroll-indicator {
  position: fixed;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s;

  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dasht-scroll-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--line-soft);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all .35s cubic-bezier(.22,1,.36,1);
  position: relative;
}
.dasht-scroll-dot.active {
  background: var(--c-primary);
  transform: scale(1.5);
  box-shadow: 0 0 0 4px rgba(92,138,106,.2);
}

.dasht-scroll-dot::before {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 15px); /* Changed from right to left so it appears inside the screen */
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  font-size: .7rem;
  font-weight: 700;
  color: var(--ink);
  opacity: 0;
  background: var(--paper);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--line-soft);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transition: opacity .3s ease, transform .3s cubic-bezier(0.2, 1, 0.3, 1);
  pointer-events: none;
}
.dasht-scroll-dot:hover::before { 
  opacity: 1; 
  transform: translateY(-50%) translateX(0); 
}
.dasht-scroll-dot.active::before { 
  opacity: 1; 
  color: var(--c-primary);
  border-color: rgba(92,138,106,.2);
  transform: translateY(-50%) translateX(0); 
}
/* Initial state for nice animation */
.dasht-scroll-dot::before {
  transform: translateY(-50%) translateX(-8px);
}
@media (max-width: 1200px) { .dasht-scroll-indicator { display: none; } }

/* ── 16. COUNTER ANIMATION ── */
.dasht-counter { font-variant-numeric: tabular-nums; }

/* ── 17. PARALLAX LAYER ── */
.dasht-parallax-wrap { overflow: hidden; position: relative; }
.dasht-parallax-layer {
  will-change: transform;
  transition: transform .1s linear;
}

/* ── 18. HERO SPLIT TEXT ── */
.dasht-split-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(30px) rotateX(-40deg);
  animation: dasht-char-reveal .5s cubic-bezier(.16,1,.3,1) forwards;
  transform-origin: bottom center;
}
@keyframes dasht-char-reveal {
  to { opacity: 1; transform: translateY(0) rotateX(0); }
}

/* ── 19. MARQUEE / INFINITE SCROLL ── */
.dasht-marquee-track {
  display: flex;
  width: max-content;
  animation: dasht-marquee-scroll var(--marquee-speed, 30s) linear infinite;
}
.dasht-marquee-track:hover { animation-play-state: paused; }
@keyframes dasht-marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── 20. BETTER TYPOGRAPHY SCALE ── */
/* Removed global h1/h2/h3 overrides — these break component-specific sizes set in main.css.
   Component classes (.hero-title, .sec-title, .display, etc.) already handle responsive sizing. */

/* ── 21. IMAGE HOVER ZOOM ── */
.dasht-img-zoom { overflow: hidden; border-radius: var(--r-lg); }
.dasht-img-zoom img {
  transition: transform .6s cubic-bezier(.16,1,.3,1);
  will-change: transform;
}
.dasht-img-zoom:hover img { transform: scale(1.05); }

/* ── 22. FOCUS RING ── */
:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 3px;
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(92,138,106,.18);
  border-color: var(--c-primary);
}

/* ── 23. SMOOTH BORDER-RADIUS ON HOVER ── */
.work-item, .price-card, .svc-row, .process-step,
.dasht-post-card, .dasht-related-card, .dasht-archive-card {
  transition: transform .5s cubic-bezier(.16,1,.3,1),
              box-shadow .5s ease,
              border-color .3s ease,
              border-radius .4s cubic-bezier(.16,1,.3,1);
}

/* ── 24. REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .dasht-split-char { opacity: 1; transform: none; animation: none; }
  .dasht-marquee-track { animation: none; }
  body::before { display: none; }
  .dasht-parallax-layer { transform: none !important; }
}

.dasht-scroll-indicator.is-visible { opacity: 1; visibility: visible; }
