/* ─────────────────────────────────────────────
   Vortex — Dark Premium UI
   Inspired by Taste Skill aesthetic
───────────────────────────────────────────── */

:root {
  --bg:       #0a0a0b;
  --surface:  rgba(255,255,255,0.03);
  --border:   rgba(255,255,255,0.07);
  --border-h: rgba(255,255,255,0.14);
  --text:     #e8e8e8;
  --muted:    #555;
  --muted2:   #888;
  --accent:   #6366f1;
  --accent-h: #7c7ff5;
  --success:  #22c55e;
  --error:    #ef4444;
  --radius:   14px;
  --font:     'Inter', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

img { max-width: 100%; height: auto; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Grain overlay ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.025;
  pointer-events: none;
  z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px;
}

/* ─────────────────────────────────────────────
   Header
───────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(10,10,11,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
}
.logo-icon {
  font-size: 1.3rem;
  color: var(--accent);
}
.logo-text {
  display: flex;
  align-items: baseline;
  gap: 0;
}
.logo-primary {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
  color: var(--accent);
  transition: opacity 0.2s ease, transform 0.2s ease;
  will-change: opacity, transform;
}
.logo-sep {
  font-size: 0.68rem;
  color: var(--muted);
  margin: 0 5px;
  opacity: 0.35;
  font-weight: 400;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.logo-secondary {
  font-weight: 400;
  font-size: 0.72rem;
  letter-spacing: 0;
  color: var(--muted);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
/* Logo swap animation */
.logo-text.logo-animating .logo-primary,
.logo-text.logo-animating .logo-sep,
.logo-text.logo-animating .logo-secondary {
  opacity: 0;
  transform: translateY(-5px);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─────────────────────────────────────────────
   Buttons
───────────────────────────────────────────── */
.btn-ghost {
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted2);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: border-color .2s, color .2s;
}
.btn-ghost:hover {
  border-color: var(--border-h);
  color: var(--text);
}
.btn-lang {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .05em;
  padding: 5px 12px;
  min-width: 44px;
  text-align: center;
  transition: border-color .2s, color .2s, transform .15s;
  overflow: hidden;
  position: relative;
  will-change: transform;
}
.btn-lang.lang-switching {
  animation: lang-flip 0.3s ease;
}
@keyframes lang-flip {
  0%   { transform: rotateX(0deg);   opacity: 1; }
  40%  { transform: rotateX(90deg);  opacity: 0; }
  60%  { transform: rotateX(-90deg); opacity: 0; }
  100% { transform: rotateX(0deg);   opacity: 1; }
}

.btn-primary {
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s, transform .1s;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--accent-h); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ─────────────────────────────────────────────
   Hero
───────────────────────────────────────────── */
.hero {
  padding: 100px 24px 80px;
  text-align: center;
}
.hero-inner {
  max-width: 660px;
  margin: 0 auto;
}

.tag {
  display: inline-block;
  padding: 4px 14px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 32px;
}

.hero-title {
  font-size: clamp(3.5rem, 8vw, 6.5rem);
  font-weight: 300;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 20px;
}
.hero-title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--accent) 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
/* Cycling word animation */
.hero-cycling {
  display: inline-block;
}
.hero-cycling.cycling-out {
  animation: cycling-out 0.25s ease forwards;
}
.hero-cycling.cycling-in {
  animation: cycling-in 0.35s ease forwards;
}
@keyframes cycling-out {
  to { opacity: 0; transform: translateY(-16px); }
}
@keyframes cycling-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* i18n content fade */
[data-i18n] {
  transition: opacity 0.15s ease;
}
.lang-fade [data-i18n],
.lang-fade [data-i18n-placeholder] {
  opacity: 0;
}

.hero-sub {
  font-size: 1rem;
  color: var(--muted2);
  line-height: 1.6;
  margin-bottom: 48px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* ─────────────────────────────────────────────
   Input block
───────────────────────────────────────────── */
.input-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: left;
  transition: border-color .25s;
}
.input-block:focus-within {
  border-color: var(--border-h);
}

textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.92rem;
  line-height: 1.5;
  resize: none;
  min-height: 48px;
}
textarea::placeholder { color: var(--muted); }

.input-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.format-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
  flex-shrink: 0;
}
.format-btn {
  padding: 6px 16px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  letter-spacing: 0.02em;
}
.format-btn.active {
  background: rgba(99,102,241,0.15);
  color: var(--accent);
}

/* ─────────────────────────────────────────────
   Account strip
───────────────────────────────────────────── */
.account-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.8rem;
  flex-wrap: wrap;
}
.account-user  { color: var(--text); font-weight: 500; }
.account-tier  { font-size: 0.7rem; padding: 2px 8px; border-radius: 100px;
                 border: 1px solid rgba(99,102,241,0.35); color: var(--accent); }
.account-tier.tier-expired { border-color: rgba(239,68,68,0.35); color: var(--error); }
.account-balance { color: var(--accent); font-weight: 500; margin-left: auto; }
.btn-watch-ad {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--muted2);
  font-family: var(--font);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all .2s;
}
.btn-watch-ad:hover { border-color: var(--success); color: var(--success); }
.btn-link-small {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all .2s;
}
.btn-link-small:hover { color: var(--text); border-color: var(--border-h); }

/* ─────────────────────────────────────────────
   Cards
───────────────────────────────────────────── */
.cards-section {
  padding: 0 24px 80px;
}
.cards-inner {
  max-width: 660px;
  margin: 0 auto;
}

#cards { display: flex; flex-direction: column; gap: 10px; }

.card {
  display: flex;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  animation: fadeUp .35s cubic-bezier(.16,1,.3,1);
}
@keyframes fadeUp {
  from { opacity:0; transform:translateY(10px); }
  to   { opacity:1; transform:translateY(0); }
}

.card-thumb {
  width: 112px;
  min-width: 112px;
  height: 74px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 1.5rem;
}

.card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.card-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-meta {
  font-size: 0.72rem;
  color: var(--muted2);
}

.card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: 6px;
  width: 100%;
}

/* ── Download progress bar ── */
.prog-wrap {
  height: 3px;
  background: rgba(255,255,255,.08);
  border-radius: 2px;
  overflow: hidden;
  width: 100%;
  margin: 2px 0 3px;
}
.prog-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width .9s linear;
  min-width: 3px;
}
.prog-foot {
  display: flex;
  align-items: center;
  gap: 10px;
}
.prog-pct {
  font-size: .75rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 30px;
}
.prog-meta {
  font-size: .71rem;
  color: var(--muted2);
}

.btn-dl {
  padding: 5px 14px;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s;
}
.btn-dl:hover { background: var(--accent-h); }
.btn-dl:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-dl.done { background: var(--success); }
.btn-dl.error { background: var(--error); }

.q-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}
.q-chip {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: transparent;
  color: var(--muted2);
  font-family: var(--font);
  font-size: 0.68rem;
  cursor: pointer;
  transition: all .18s;
}
.q-chip.active { border-color: var(--accent); color: var(--accent); background: rgba(99,102,241,.08); }
.q-chip:hover:not(.active) { border-color: var(--border-h); color: var(--text); }

.card-status {
  font-size: 0.7rem;
  color: var(--muted2);
}
.card-status.ok  { color: var(--success); }
.card-status.err { color: var(--error); }

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.07) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 5px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Error card */
.card.card-err { border-color: rgba(239,68,68,.18); }
.card-err-msg { font-size: 0.75rem; color: var(--error); }
.card-err-url { font-size: 0.68rem; color: var(--muted); word-break: break-all; }

/* Download all bar */
.dl-all {
  margin-top: 12px;
}
.btn-dl-all {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.btn-dl-all:hover { border-color: var(--border-h); background: rgba(255,255,255,0.05); }

/* ─────────────────────────────────────────────
   Features
───────────────────────────────────────────── */
.features {
  padding: 60px 24px;
  border-top: 1px solid var(--border);
}
.features-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.feature-card {
  background: var(--bg);
  padding: 40px 36px;
}
.feature-num {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}
.feature-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}
.feature-desc {
  font-size: 0.85rem;
  color: var(--muted2);
  line-height: 1.65;
}

/* ─────────────────────────────────────────────
   Footer
───────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 52px 24px 28px;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
}
/* 3-column grid */
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col-brand { gap: 8px; }
.footer-col-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.footer-col a {
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s;
  width: fit-content;
}
.footer-col a:hover { color: var(--text); }
/* Footer logo in footer-col */
.footer-logo {
  display: flex;
  align-items: baseline;
  gap: 0;
  margin-bottom: 2px;
}
.footer-logo .logo-primary {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.footer-logo .logo-sep {
  font-size: 0.68rem;
  color: var(--muted);
  margin: 0 5px;
  opacity: 0.35;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.footer-logo .logo-secondary {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
/* Footer logo swap animation */
.footer-logo.logo-animating .logo-primary,
.footer-logo.logo-animating .logo-sep,
.footer-logo.logo-animating .logo-secondary {
  opacity: 0;
  transform: translateY(-5px);
}
.footer-tagline {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.55;
  max-width: 210px;
}
/* Footer bottom bar */
.footer-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.footer-copy { font-size: 0.74rem; color: var(--muted); white-space: nowrap; }
.footer-legal {
  font-size: 0.67rem;
  color: var(--muted);
  line-height: 1.65;
  text-align: right;
  max-width: 560px;
}
.footer-legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.footer-legal a:hover { color: var(--muted2); }

/* ─────────────────────────────────────────────
   Modal
───────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
}
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 201;
  width: min(440px, calc(100vw - 32px));
  animation: fadeUp .25s ease;
}
.modal-card {
  background: #111114;
  border: 1px solid var(--border-h);
  border-radius: 18px;
  padding: 32px;
}
.modal-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}
.modal-desc {
  font-size: 0.84rem;
  color: var(--muted2);
  line-height: 1.8;
  margin-bottom: 20px;
}
.modal-desc a { color: var(--accent); text-decoration: none; }
.modal-desc code {
  background: rgba(99,102,241,.12);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.88rem;
}
.modal-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: monospace;
  font-size: 1.3rem;
  text-align: center;
  letter-spacing: 0.2em;
  outline: none;
  transition: border-color .2s;
  margin-bottom: 10px;
}
.modal-input:focus { border-color: var(--accent); }
.modal-error { font-size: 0.8rem; color: var(--error); min-height: 18px; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; }
.modal-actions .btn-primary { flex: 1; }

/* ─────────────────────────────────────────────
   Spinner
───────────────────────────────────────────── */
.spin {
  display: inline-block;
  width: 10px; height: 10px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─────────────────────────────────────────────
   Services Preview
───────────────────────────────────────────── */
.services-preview {
  padding: 60px 24px;
  background: linear-gradient(180deg, rgba(99,102,241,0.05) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
}
.services-preview-inner {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}
.services-preview h2 {
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 12px;
}
.services-preview-desc {
  color: var(--muted2);
  font-size: 0.95rem;
  margin-bottom: 32px;
}
/* ── Infinite Marquee (Services) ── */
.marquee-wrap {
  overflow: hidden;
  margin: 16px 0 44px;
  -webkit-mask-image: linear-gradient(to right,
    transparent 0%, rgba(0,0,0,.6) 6%, #000 14%, #000 86%, rgba(0,0,0,.6) 94%, transparent 100%);
  mask-image: linear-gradient(to right,
    transparent 0%, rgba(0,0,0,.6) 6%, #000 14%, #000 86%, rgba(0,0,0,.6) 94%, transparent 100%);
}
.marquee-row {
  display: flex;
  margin-bottom: 12px;
}
.marquee-row:last-child { margin-bottom: 0; }
.marquee-track {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
  will-change: transform;
}
/* Service card */
.c-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--muted2);
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .2s, border-color .2s, color .2s, box-shadow .2s;
  user-select: none;
  cursor: default;
}
.c-item:hover {
  background: rgba(99,102,241,.1);
  border-color: rgba(99,102,241,.4);
  color: var(--text);
  box-shadow: 0 4px 24px rgba(99,102,241,.15);
}
.c-item svg {
  flex-shrink: 0;
  color: var(--accent);
}
.c-item-label {
  font-size: .78rem;
  color: var(--muted);
  margin-top: 1px;
}

.btn-secondary {
  display: inline-block;
  padding: 12px 28px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all .25s;
}
.btn-secondary:hover {
  border-color: var(--accent);
  background: rgba(99,102,241,0.12);
  color: var(--accent);
}

/* ─────────────────────────────────────────────
   Responsive
───────────────────────────────────────────── */
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-col-brand { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .hero { padding: 60px 20px 48px; }
  .hero-title { font-size: 3.2rem; }
  .header-nav .btn-ghost:first-child { display: none; }
  .card { flex-direction: column; }
  .card-thumb { width: 100%; min-width: unset; height: 140px; }
  .card-title { white-space: normal; }
  .features-inner { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .footer-legal { text-align: left; max-width: 100%; }
}
