/* ==========================================================================
   EzTunes, Apple design language. dark only, calm, no glow, no flashing.
   shared by index.html and fixes/index.html
   ========================================================================== */

:root {
  color-scheme: dark;

  --bg: #000000;
  --surface: #1c1c1e;
  --surface-2: #2c2c2e;
  --surface-3: #3a3a3c;
  --fill: rgba(120, 120, 128, 0.20);
  --fill-2: rgba(120, 120, 128, 0.32);
  --sep: rgba(255, 255, 255, 0.08);
  --sep-2: rgba(255, 255, 255, 0.15);

  --text: #f5f5f7;
  --muted: rgba(235, 235, 245, 0.62);
  --muted2: rgba(235, 235, 245, 0.36);

  --green: #30d158;
  --green-rgb: 48, 209, 88;
  --on-green: #04140a;
  --amber: #ffd60a;
  --red: #ff453a;

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 32px;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --smooth: cubic-bezier(0.4, 0, 0.2, 1);

  --nav-h: 56px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI Variable Display", "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

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

html {
  background: #000;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  padding-top: calc(var(--nav-h) + 28px);
  line-height: 1.5;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font-family: inherit; }

::selection { background: rgba(var(--green-rgb), 0.35); color: #fff; }

:focus { outline: none; }
:focus-visible {
  outline: 3px solid rgba(var(--green-rgb), 0.55);
  outline-offset: 3px;
  border-radius: 10px;
}

* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.22) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 999px; border: 3px solid #000; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.32); }

.container { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }

h1, h2, h3, h4 { letter-spacing: -0.025em; }

/* one calm static glow at the very top, never animated */
.ambient {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 72% 44% at 50% -10%, rgba(var(--green-rgb), 0.11), transparent 70%), #000;
}

/* ---------------------------------- nav ---------------------------------- */

.nav {
  position: fixed; z-index: 100;
  top: 12px; left: 50%;
  transform: translateX(-50%);
  width: min(1180px, calc(100% - 24px));
  height: var(--nav-h);
  border-radius: 22px;
  background: rgba(28, 28, 30, 0.62);
  border: 1px solid var(--sep);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 30px rgba(0,0,0,0.35);
  transition: background 0.4s var(--smooth), box-shadow 0.4s var(--smooth), border-color 0.4s var(--smooth);
}
.nav.scrolled {
  background: rgba(22, 22, 24, 0.82);
  border-color: var(--sep-2);
  box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset, 0 14px 44px rgba(0,0,0,0.55);
}
.nav-inner {
  height: 100%;
  display: flex; align-items: center; gap: 20px;
  padding: 0 10px 0 16px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0; font-weight: 650; font-size: 16px; letter-spacing: -0.02em;
}
.brand img { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; }

.nav-links { display: flex; align-items: center; gap: 2px; flex: 1; }
.nav-links a {
  padding: 7px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 500; color: var(--muted);
  transition: color 0.25s var(--smooth), background-color 0.3s var(--smooth), transform 0.4s var(--ease);
}
.nav-links a:hover { color: var(--text); background: var(--fill); }
.nav-links a.active { color: var(--text); background: var(--fill); }
.nav-links a:active { transform: scale(0.95); }

.nav-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.lang {
  display: inline-flex; padding: 3px; border-radius: 999px; background: var(--fill);
}
.lang-btn {
  border: 0; background: transparent; color: var(--muted);
  padding: 5px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: 0; cursor: pointer;
  transition: background-color 0.3s var(--smooth), color 0.3s var(--smooth), transform 0.3s var(--ease);
}
.lang-btn:hover { color: var(--text); }
.lang-btn.active { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,0.4); }
.lang-btn:active { transform: scale(0.94); }

.menu-btn {
  display: none;
  width: 40px; height: 40px; border: 0; border-radius: 999px;
  background: var(--fill); color: var(--text); cursor: pointer;
  align-items: center; justify-content: center;
  transition: background-color 0.3s var(--smooth), transform 0.3s var(--ease);
}
.menu-btn:active { transform: scale(0.92); }
.menu-btn svg { width: 18px; height: 18px; }
.menu-btn .l1, .menu-btn .l2 { transition: transform 0.45s var(--ease), opacity 0.3s; transform-origin: center; }
.nav.open .menu-btn .l1 { transform: translateY(3px) rotate(45deg); }
.nav.open .menu-btn .l2 { transform: translateY(-3px) rotate(-45deg); }

/* --------------------------------- buttons -------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 9px 20px; border-radius: 999px;
  border: 0; cursor: pointer; white-space: nowrap;
  font-size: 14px; font-weight: 600; letter-spacing: -0.012em;
  transition:
    transform 0.45s var(--ease),
    background-color 0.3s var(--smooth),
    color 0.3s var(--smooth),
    filter 0.3s var(--smooth),
    box-shadow 0.4s var(--smooth);
}
.btn:active { transform: scale(0.96); transition-duration: 0.12s; }

.btn-green { background: var(--green); color: var(--on-green); }
.btn-green:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-green:active { transform: scale(0.96); }

.btn-ghost { background: var(--fill); color: var(--text); }
.btn-ghost:hover { background: var(--fill-2); transform: translateY(-1px); }
.btn-ghost:active { transform: scale(0.96); }

.btn-sm { min-height: 36px; padding: 7px 16px; font-size: 13px; }
.btn-lg { min-height: 52px; padding: 13px 30px; font-size: 16px; }

/* ------------------------------ scroll reveal ----------------------------- */

@keyframes apFailsafe { to { opacity: 1; transform: none; } }
@keyframes apRise {
  from { opacity: 0; transform: translate3d(0, 24px, 0); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
  html.js .rv:not(.in) {
    opacity: 0;
    transform: translate3d(0, 28px, 0) scale(0.985);
    animation: apFailsafe 0.01s linear 3.5s forwards;
  }
  html.js .rv {
    transition:
      opacity 0.9s var(--ease) var(--rd, 0s),
      transform 1s var(--ease) var(--rd, 0s),
      border-color 0.3s var(--smooth),
      box-shadow 0.5s var(--smooth),
      background-color 0.3s var(--smooth);
  }
  html.js .rv.done { transition: border-color 0.3s var(--smooth), box-shadow 0.5s var(--smooth), background-color 0.3s var(--smooth), transform 0.5s var(--ease); }
}

/* ------------------------------ section basics ---------------------------- */

section { padding: 110px 0; }

.section-label {
  display: inline-block;
  font-size: 13px; font-weight: 600; letter-spacing: 0.01em;
  color: var(--green); margin-bottom: 12px;
}
.section-head { margin-bottom: 44px; }
.section-head h2 {
  font-size: clamp(32px, 5vw, 56px); font-weight: 700;
  line-height: 1.07; letter-spacing: -0.035em; margin-bottom: 14px;
}
.section-head h2 em { font-style: normal; color: var(--green); }
.section-head p { color: var(--muted); font-size: clamp(16px, 1.4vw, 19px); line-height: 1.5; max-width: 52ch; }

/* ---------------------------------- footer -------------------------------- */

footer { border-top: 1px solid var(--sep); padding: 64px 0 32px; background: #000; }
.footer-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 48px; margin-bottom: 48px;
}
.footer-brand img { width: 36px; height: 36px; border-radius: 10px; margin-bottom: 14px; display: block; }
.footer-brand strong { display: block; font-size: 16px; font-weight: 650; margin-bottom: 10px; }
.footer-brand p { font-size: 13px; color: var(--muted); line-height: 1.6; max-width: 28ch; }
.footer-col h4 { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 16px; letter-spacing: 0; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col ul li a { font-size: 13px; color: var(--muted); transition: color 0.25s var(--smooth); }
.footer-col ul li a:hover { color: var(--text); }
.footer-bottom {
  border-top: 1px solid var(--sep); padding-top: 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 12px; color: var(--muted2);
}
.footer-bottom a { color: var(--muted2); transition: color 0.25s var(--smooth); }
.footer-bottom a:hover { color: var(--text); }
.footer-bottom strong { color: var(--muted) !important; font-weight: 600; }

.dev-credit {
  position: fixed; right: 16px; bottom: 16px; z-index: 60;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(28, 28, 30, 0.72);
  border: 1px solid var(--sep);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  font-size: 12px; color: var(--muted);
  transition: color 0.25s var(--smooth), transform 0.45s var(--ease), border-color 0.3s var(--smooth);
}
.dev-credit:hover { color: var(--text); border-color: var(--sep-2); transform: translateY(-2px); }
.dev-credit strong { color: #64a8ff; font-weight: 600; }

/* --------------------------------- responsive ------------------------------ */

@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  section { padding: 84px 0; }
}

@media (max-width: 860px) {
  .menu-btn { display: inline-flex; }
  .nav-links {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px; flex: none;
    padding: 8px; border-radius: 22px;
    background: rgba(28, 28, 30, 0.9);
    border: 1px solid var(--sep-2);
    -webkit-backdrop-filter: saturate(180%) blur(30px);
    backdrop-filter: saturate(180%) blur(30px);
    box-shadow: 0 24px 60px rgba(0,0,0,0.6);
    opacity: 0; visibility: hidden; pointer-events: none;
    transform: translateY(-8px) scale(0.98); transform-origin: top center;
    transition: opacity 0.35s var(--ease), transform 0.5s var(--ease), visibility 0s linear 0.35s;
  }
  .nav.open .nav-links {
    opacity: 1; visibility: visible; pointer-events: auto; transform: none;
    transition: opacity 0.35s var(--ease), transform 0.5s var(--ease), visibility 0s;
  }
  .nav-links a { padding: 13px 16px; font-size: 16px; border-radius: 14px; }
  .nav-right .btn-ghost { display: none; }
  .nav-inner { gap: 8px; }
  .brand { flex: 1; }
}

@media (max-width: 540px) {
  .container { width: min(1180px, calc(100% - 32px)); }
  body { padding-top: calc(var(--nav-h) + 20px); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .dev-credit { right: 12px; bottom: 12px; }
  section { padding: 68px 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ==========================================================================
   v2: motion layer (loader, progress, split text, spotlight, marquee, ...)
   ========================================================================== */

@view-transition { navigation: auto; }

@property --ang { syntax: '<angle>'; initial-value: 0deg; inherits: false; }

/* ------------------------------- intro loader ------------------------------ */
.loader {
  position: fixed; inset: 0; z-index: 999; background: #000;
  display: grid; place-items: center; align-content: center; gap: 22px;
  animation: loaderOut 0.7s var(--smooth) 3s forwards; /* failsafe if js dies */
}
.loader img {
  width: 88px; height: 88px; border-radius: 26%;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12), 0 24px 60px rgba(0,0,0,0.7);
  animation: loaderPulse 1.6s var(--ease) infinite alternate;
}
.loader .bar { width: 120px; height: 3px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.loader .bar i { display: block; height: 100%; width: 100%; background: var(--green); transform-origin: left; animation: loaderBar 1.1s var(--ease) forwards; }
.loader.hide { opacity: 0; visibility: hidden; transition: opacity 0.7s var(--smooth), visibility 0s linear 0.7s; animation: none; }
html.no-loader .loader { display: none; }
@keyframes loaderOut { to { opacity: 0; visibility: hidden; } }
@keyframes loaderPulse { from { transform: scale(0.94); } to { transform: scale(1.04); } }
@keyframes loaderBar { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ------------------------------ scroll progress ---------------------------- */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 300; pointer-events: none;
  background: var(--green); transform-origin: left; transform: scaleX(var(--p, 0));
}

/* ------------------------------- split words -------------------------------- */
.split.ready .w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 0.03em 0.14em; margin-bottom: -0.14em; }
.split.ready .wi { display: inline-block; transform: translate3d(0, 108%, 0); opacity: 0; filter: blur(10px); }
.split.ready.in .wi {
  transform: none; opacity: 1; filter: none;
  transition:
    transform 1.1s var(--ease) calc(var(--i, 0) * 60ms + var(--sd, 0ms)),
    opacity 0.9s var(--ease) calc(var(--i, 0) * 60ms + var(--sd, 0ms)),
    filter 0.9s var(--ease) calc(var(--i, 0) * 60ms + var(--sd, 0ms));
}
.split.ready.instant .wi { transition: none !important; }
.split.ready:not(.in) .wi { animation: wiFail 0.01s linear 4.5s forwards; }
@keyframes wiFail { to { transform: none; opacity: 1; filter: none; } }
.split em .wi { color: var(--green); }

/* -------------------------------- spotlight --------------------------------- */
.spot { position: relative; }
.spot::before, .spot::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  opacity: 0; transition: opacity 0.5s var(--smooth); z-index: 2;
}
.spot::before { background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,0.065), transparent 62%); }
.spot::after {
  padding: 1.5px;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(var(--green-rgb), 0.7), transparent 65%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.spot:hover::before, .spot:hover::after { opacity: 1; }

/* ---------------------------- magnetic + 3d tilt --------------------------- */
[data-magnet] { translate: var(--tx, 0px) var(--ty, 0px); transition: translate 0.5s var(--ease), transform 0.45s var(--ease), background-color 0.3s var(--smooth), filter 0.3s var(--smooth); }
[data-tilt3d] { transform-style: preserve-3d; will-change: transform; }
.tilt-wrap { perspective: 1200px; }
[data-tilt3d] { transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 0.6s var(--ease); }
[data-tilt3d].tilting { transition: transform 0.12s linear; }

/* ------------------------------ ticker / marquee ---------------------------- */
.ticker {
  overflow: hidden; padding: 30px 0; border-block: 1px solid var(--sep);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.ticker-track { display: flex; align-items: center; gap: 56px; width: max-content; animation: tick 38s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item {
  display: inline-flex; align-items: center; gap: 56px; white-space: nowrap;
  font-size: clamp(26px, 3.6vw, 44px); font-weight: 700; letter-spacing: -0.035em; color: var(--text);
}
.ticker-item.out { color: transparent; -webkit-text-stroke: 1.2px rgba(255,255,255,0.32); }
.ticker-item svg { width: 20px; height: 20px; color: var(--green); flex-shrink: 0; }
@keyframes tick { to { transform: translateX(-50%); } }

/* ----------------------------- footer wordmark ------------------------------ */
.wordmark {
  position: relative; overflow: hidden; text-align: center; user-select: none;
  font-size: clamp(88px, 24vw, 360px); font-weight: 800; letter-spacing: -0.065em; line-height: 0.82;
  margin: 18px 0 -0.14em;
  background: linear-gradient(180deg, rgba(255,255,255,0.20), rgba(255,255,255,0.02) 85%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-mask-image: linear-gradient(180deg, #000 40%, transparent 98%);
  mask-image: linear-gradient(180deg, #000 40%, transparent 98%);
}

/* ---------------------------------- orbs ------------------------------------ */
.orbs { position: absolute; inset: -10% 0 0; overflow: hidden; pointer-events: none; z-index: -1;
  -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent); mask-image: linear-gradient(180deg, #000 60%, transparent); }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); will-change: transform; }
.orb.a { width: 620px; height: 620px; left: -8%; top: 4%; background: rgba(var(--green-rgb), 0.26); animation: drift 26s ease-in-out infinite alternate; }
.orb.b { width: 560px; height: 560px; right: -6%; top: 14%; background: rgba(11, 217, 160, 0.20); animation: drift 32s ease-in-out -8s infinite alternate-reverse; }
.orb.c { width: 460px; height: 460px; left: 34%; top: 38%; background: rgba(10, 132, 255, 0.12); animation: drift 38s ease-in-out -14s infinite alternate; }
@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(70px, -40px, 0) scale(1.12); }
  100% { transform: translate3d(-50px, 50px, 0) scale(0.95); }
}

@media (max-width: 540px) {
  .orb { filter: blur(70px); }
  .orb.a, .orb.b { width: 380px; height: 380px; }
  .ticker-track, .ticker-item { gap: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track, .orb, .loader img { animation: none !important; }
}
