/* ==========================================================================
   Renk Optik — Tarık Terzi
   Magic UI Inspired Editorial Maintenance Page
   Components: InteractiveGridPattern, Marquee, Ripple, AnimatedShinyText,
               BlurFade, BorderBeam, ShimmerButton
   ========================================================================== */

:root {
  --bg: #fafafa;
  --surface: rgba(255, 255, 255, 0.88);
  --ink: #09090b;
  --muted: #52525b;
  --subtle: #71717a;
  --border: rgba(9, 9, 11, 0.09);
  --brand-red: #d90429;
  --brand-amber: #f59e0b;
  --radius: 24px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ==========================================================================
   1. Magic UI: InteractiveGridPattern
   ========================================================================== */

.magic-grid-wrap {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  mask-image: radial-gradient(75% 75% at 50% 50%, #000 35%, transparent 100%);
  -webkit-mask-image: radial-gradient(75% 75% at 50% 50%, #000 35%, transparent 100%);
}

.magic-interactive-grid {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  grid-auto-rows: 48px;
}

.grid-cell {
  border-right: 1px solid rgba(9, 9, 11, 0.045);
  border-bottom: 1px solid rgba(9, 9, 11, 0.045);
  transition: background-color 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

.grid-cell.is-lit {
  background-color: rgba(217, 4, 41, 0.055);
  transition: background-color 0.08s ease;
}

/* ==========================================================================
   2. Magic UI: Dual-Row Kinetic Eyewear Marquee
   ========================================================================== */

.eyewear-marquee-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px 0;
  pointer-events: none;
  opacity: 0.72;
  transition: opacity 0.5s ease, filter 0.5s ease;
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 10%,
    black 90%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 10%,
    black 90%,
    transparent 100%
  );
}

body.showcase-mode .eyewear-marquee-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.magic-marquee {
  display: flex;
  overflow: hidden;
  gap: 18px;
  --duration: 44s;
}

.magic-marquee[data-speed="slow"] {
  --duration: 54s;
}

.magic-marquee-track {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 18px;
  min-width: 100%;
  animation: marqueeScroll var(--duration) linear infinite;
}

.magic-marquee[data-direction="reverse"] .magic-marquee-track {
  animation-direction: reverse;
}

.magic-marquee:hover .magic-marquee-track {
  animation-play-state: paused;
}

@keyframes marqueeScroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-100% - 18px));
  }
}

.eyewear-tile {
  flex: 0 0 auto;
  width: 224px;
  height: 118px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(9, 9, 11, 0.075);
  box-shadow: 0 1px 2px rgba(9, 9, 11, 0.03);
  padding: 14px 18px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s ease,
              box-shadow 0.3s ease,
              background-color 0.3s ease;
}

.eyewear-tile:hover {
  transform: translateY(-3px);
  background: #ffffff;
  border-color: rgba(9, 9, 11, 0.16);
  box-shadow: 0 12px 30px -12px rgba(9, 9, 11, 0.14);
}

.eyewear-tile svg {
  width: 100%;
  height: 62px;
  display: block;
}

.tile-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--subtle);
}

.tile-meta strong {
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
  text-transform: none;
  font-size: 0.74rem;
}

/* ==========================================================================
   3. Main Stage & Hero Card + Magic UI: BorderBeam & Ripple
   ========================================================================== */

.stage {
  position: relative;
  z-index: 4;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vw, 32px);
  pointer-events: none;
}

.hero-card {
  position: relative;
  pointer-events: auto;
  width: 100%;
  max-width: 600px;
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow:
    0 24px 64px -24px rgba(9, 9, 11, 0.14),
    0 2px 8px -2px rgba(9, 9, 11, 0.05);
  padding: clamp(28px, 4vw, 42px) clamp(24px, 4.5vw, 48px) clamp(22px, 3vw, 28px);
  text-align: center;
  overflow: hidden;
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

body.showcase-mode .hero-card {
  opacity: 0.2;
  transform: scale(0.96);
}

body.showcase-mode .hero-card:hover {
  opacity: 0.96;
  transform: scale(1);
}

/* Magic UI: BorderBeam (Conic masked 1.5px traveling light beam) */
.magic-border-beam {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  pointer-events: none;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  overflow: hidden;
}

.magic-border-beam::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 160%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(0deg);
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 270deg,
    rgba(217, 4, 41, 0.78) 315deg,
    rgba(245, 158, 11, 0.85) 345deg,
    transparent 360deg
  );
  animation: borderBeamSpin 8s linear infinite;
}

@keyframes borderBeamSpin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Magic UI: Ripple */
.magic-ripple {
  position: absolute;
  top: 122px;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 0;
}

.ripple-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(170px + var(--i) * 86px);
  height: calc(170px + var(--i) * 86px);
  border-radius: 50%;
  border: 1px solid rgba(9, 9, 11, 0.055);
  background: radial-gradient(circle, transparent 65%, rgba(9, 9, 11, 0.015) 100%);
  transform: translate(-50%, -50%) scale(1);
  opacity: calc(0.55 - var(--i) * 0.12);
  animation: ripplePulse 4.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  animation-delay: calc(var(--i) * 0.22s);
}

@keyframes ripplePulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(0.92);
  }
}

/* ==========================================================================
   4. Magic UI: AnimatedShinyText Pill
   ========================================================================== */

.shiny-pill {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid rgba(9, 9, 11, 0.09);
  background: rgba(250, 250, 250, 0.9);
  margin-bottom: 22px;
  box-shadow: 0 1px 2px rgba(9, 9, 11, 0.04);
}

.shiny-text {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: rgba(82, 82, 91, 0.72);
  background: linear-gradient(
    110deg,
    rgba(82, 82, 91, 0.75) 35%,
    #09090b 50%,
    rgba(82, 82, 91, 0.75) 65%
  );
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shinySweep 4.2s ease-in-out infinite;
}

.shiny-sep {
  opacity: 0.6;
}

@keyframes shinySweep {
  0%, 100% {
    background-position: 100% 0;
  }
  50% {
    background-position: 0% 0;
  }
}

/* ==========================================================================
   5. Seamless Brand Logo & Editorial Typography
   ========================================================================== */

.logo-wrap {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
}

.brand-logo {
  width: min(295px, 78%);
  height: auto;
  display: block;
  mix-blend-mode: multiply;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand-logo:hover {
  transform: scale(1.02);
}

.hairline-divider {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(9, 9, 11, 0.1) 25%,
    rgba(9, 9, 11, 0.1) 75%,
    transparent 100%
  );
  margin-bottom: 24px;
}

.headline {
  position: relative;
  z-index: 2;
  font-size: clamp(1.45rem, 3.1vw, 1.92rem);
  font-weight: 600;
  line-height: 1.24;
  letter-spacing: -0.03em;
  color: var(--ink);
  max-width: 24ch;
  margin: 0 auto 12px;
}

.lead {
  position: relative;
  z-index: 2;
  font-size: clamp(0.92rem, 1.6vw, 0.98rem);
  line-height: 1.6;
  color: var(--muted);
  max-width: 44ch;
  margin: 0 auto 26px;
}

/* ==========================================================================
   6. Magic UI: ShimmerButton & Ghost Control
   ========================================================================== */

.actions {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 26px;
}

.magic-shimmer-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 22px;
  border-radius: 999px;
  text-decoration: none;
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  overflow: hidden;
  background: #09090b;
  box-shadow: 0 8px 24px -8px rgba(9, 9, 11, 0.45);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.25s ease;
}

.magic-shimmer-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -8px rgba(9, 9, 11, 0.55);
}

.magic-shimmer-btn:active {
  transform: translateY(0);
}

.shimmer-spark {
  position: absolute;
  inset: -120%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 290deg,
    rgba(255, 255, 255, 0.85) 330deg,
    transparent 360deg
  );
  animation: shimmerRotate 3.4s linear infinite;
}

.shimmer-backdrop {
  position: absolute;
  inset: 1.5px;
  border-radius: inherit;
  background: linear-gradient(180deg, #18181b 0%, #09090b 100%);
}

.shimmer-label {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.shimmer-label svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.btn-sep {
  opacity: 0.45;
}

.phone-num {
  font-variant-numeric: tabular-nums;
  opacity: 0.92;
}

@keyframes shimmerRotate {
  to {
    transform: rotate(360deg);
  }
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(9, 9, 11, 0.12);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  text-decoration: none;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.ghost-btn:hover {
  background: #ffffff;
  border-color: rgba(9, 9, 11, 0.24);
  transform: translateY(-1px);
}

.ghost-btn svg {
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   7. Magic UI: BlurFade Entrance
   ========================================================================== */

.blur-fade {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(10px);
  animation: blurFadeIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes blurFadeIn {
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

/* ==========================================================================
   8. Footer
   ========================================================================== */

.card-footer {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--subtle);
}

.footer-dot {
  opacity: 0.5;
}

/* ==========================================================================
   Responsive & Reduced Motion
   ========================================================================== */

@media (max-width: 640px) {
  .eyewear-marquee-backdrop {
    opacity: 0.45;
  }

  .eyewear-tile {
    width: 186px;
    height: 102px;
    padding: 12px 14px 10px;
  }

  .hero-card {
    border-radius: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .blur-fade {
    opacity: 1;
    filter: none;
    transform: none;
  }
}
