/* style.css — Verso Nebula theme
   - Dark nebula background (radial gradients + canvas starfield)
   - Clean inputs, glass card, result panel expanding beneath the form
   - Toast + copy-check microinteraction
   - Accessibility: prefers-reduced-motion respected
*/
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=Orbitron:wght@600&display=swap');

:root{
  --bg-900: #07041A;
  --bg-800: #0b0722;
  --nebula-1: rgba(27,16,54,0.9);
  --nebula-2: rgba(43,26,91,0.9);
  --accent: #7C5CFF;
  --accent-2: #00D1FF;
  --muted: #98A0B3;
  --text: #E6EDF3;
  --card: rgba(255,255,255,0.03);
  --glass: rgba(255,255,255,0.04);
  --radius: 14px;
  --shadow-1: 0 8px 30px rgba(11,7,34,0.6);
  --speed: 1;
}

/* Reset */
*{box-sizing:border-box}
html,body{height:100%}
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  background:
    radial-gradient(120% 120% at 10% 20%, rgba(124, 92, 255, 0.12), transparent 40%),
    radial-gradient(120% 120% at 90% 80%, rgba(0, 209, 255, 0.06), transparent 40%),
    linear-gradient(180deg, var(--bg-900) 0%, var(--bg-800) 100%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* starfield canvas sits behind page content */
#starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  display: block;
}

/* Page container */
.container{
  max-width:980px;
  margin:56px auto;
  padding:28px;
  border-radius:18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  box-shadow: var(--shadow-1);
  border: 1px solid rgba(124,92,255,0.06);
  position:relative;
  z-index:2;
}

/* Header / brand */
.header {
  display:flex;
  align-items:center;
  gap:14px;
  margin-bottom:8px;
}
.brand {
  display:inline-flex;
  align-items:center;
  gap:10px;
  color:var(--text);
  text-decoration:none;
  user-select:none;
}
.brand svg { display:block }
.title-row { display:flex; align-items:baseline; gap:12px; justify-content:space-between; width:100% }
h1{ font-family:'Orbitron', 'Inter', sans-serif; font-weight:600; letter-spacing:1px; font-size:28px; margin:0; color:var(--text) }
.lead { color:var(--muted); margin:6px 0 14px 0; font-size:15px }

/* form */
.form-wrap { margin-top:6px; display:flex; flex-direction:column; gap:12px; }
form.inline { display:flex; gap:12px; align-items:center; }
input[type="url"]{
  flex:1;
  padding:14px 16px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.04);
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.02));
  color:var(--text);
  font-size:15px;
  transition: box-shadow .18s ease, transform .12s ease;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,0.01);
}
input[type="url"]::placeholder{ color: rgba(230,237,243,0.42) }
input[type="url"]:focus{ outline:none; box-shadow:0 6px 24px rgba(124,92,255,0.12); border-color:var(--accent) }

button[type="submit"]{
  padding:12px 18px;
  border-radius:10px;
  border:none;
  background: linear-gradient(90deg,var(--accent),var(--accent-2));
  color:#fff;
  font-weight:700;
  cursor:pointer;
  box-shadow: 0 10px 30px rgba(124,92,255,0.14);
  transition: transform .12s ease, box-shadow .12s ease;
}
button[type="submit"]:hover{ transform: translateY(-3px) }
button[type="submit"]:active{ transform: translateY(0) }
button[disabled]{ opacity:.6; cursor:not-allowed }

/* History small list */
.history {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:6px;
}
.tag { padding:6px 10px; border-radius:999px; background:rgba(255,255,255,0.02); color:var(--muted); font-size:13px; border:1px solid rgba(255,255,255,0.02); cursor:pointer; }

/* result panel (built-in under form) */
.result-panel{
  margin-top:14px;
  overflow:hidden;
  max-height:0;
  transition:max-height .36s cubic-bezier(.2,.9,.2,1), opacity .22s ease;
  opacity:0;
  border-radius:12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.02);
  box-shadow: 0 12px 34px rgba(2,6,23,0.18);
  padding:0 16px;
}
.result-panel.open{ opacity:1 }
.result-inner{ padding:16px 0; display:block }
.result-row{ display:flex; gap:12px; align-items:center; margin-bottom:12px; flex-wrap:wrap }
.result-row .label{ min-width:120px; color:var(--muted); font-size:14px }
.sheet-short-input{ flex:1; padding:10px 12px; border-radius:10px; border:1px solid rgba(255,255,255,0.04); background:#0f0b1a; color:var(--text); font-weight:600 }

/* action buttons inside panel */
.result-actions{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-top:6px }
.btn { padding:8px 12px; border-radius:10px; border:1px solid rgba(255,255,255,0.04); background:transparent; color:var(--text); cursor:pointer; font-weight:600; }
.btn.primary { background: linear-gradient(90deg,var(--accent),var(--accent-2)); color:#fff; border:none; box-shadow:0 8px 24px rgba(124,92,255,0.12) }

/* QR small */
.qrcode-container{ background:#fff; padding:8px; border-radius:8px; display:inline-block }
.qrcode-container img{ max-width:160px; display:block; border-radius:6px }

/* small utilities */
.error{ background: rgba(255,80,80,0.08); color:#ffd7d7; padding:10px; border-radius:8px; margin-bottom:12px; border:1px solid rgba(255,80,80,0.12) }
.download-btn{ color:var(--accent); text-decoration:none; border:1px solid rgba(124,92,255,0.08); padding:8px 10px; border-radius:8px }

/* toast */
#toast {
  position:fixed;
  left:50%;
  transform:translateX(-50%) translateY(16px);
  bottom:28px;
  background:rgba(3,7,23,0.9);
  color:#fff;
  padding:10px 14px;
  border-radius:10px;
  z-index:9999;
  box-shadow:0 8px 30px rgba(2,6,23,0.6);
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease, transform .18s ease;
}
#toast.show { opacity:1; transform:translateX(-50%) translateY(0); pointer-events:auto }

/* copy-check animation */
.copy-btn { position:relative }
.copy-btn .check {
  position:absolute;
  right:10px;
  top:50%;
  transform:translateY(-50%) scale(0);
  width:18px; height:18px;
  display:flex; align-items:center; justify-content:center;
  background:linear-gradient(90deg,var(--accent),var(--accent-2));
  border-radius:999px; color:#fff;
  transition:transform .18s cubic-bezier(.2,.9,.2,1), opacity .12s;
  opacity:0;
}
.copy-btn.copied .check { transform:translateY(-50%) scale(1); opacity:1 }

/* responsive */
@media (max-width:780px){
  .container { margin:20px 16px; padding:18px }
  h1 { font-size:22px }
  .result-row .label { min-width:90px }
  .qrcode-container img{ max-width:120px }
  input[type="url"]{ padding:12px }
}

/* reduce-motion */
@media (prefers-reduced-motion: reduce){
  *{ transition:none !important; animation:none !important; }
  #starfield { display:none; }
}


/* ===== Verso Nebula — Typography upgrade ===== */

/* Scale + typographic tokens */
:root{
  --fs-base: 16px;
  --scale-ratio: 1.25; /* modular scale */
  --lh-base: 1.55;
  --h1-size: calc(var(--fs-base) * 2.2);   /* ~35px */
  --h2-size: calc(var(--fs-base) * 1.6);   /* ~25.6px */
  --h3-size: calc(var(--fs-base) * 1.25);  /* ~20px */
  --muted: #98A0B3;
  --text: #E6EDF3;
  --accent: #7C5CFF;
  --gradient-head: linear-gradient(90deg, #7C5CFF 0%, #00D1FF 100%);
}

/* Base */
html { font-size: var(--fs-base); }
body { line-height: var(--lh-base); color: var(--text); -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale; }

/* Headings */
h1, h2, h3, h4 {
  margin: 0;
  color: var(--text);
  font-weight: 700;
  line-height: 1.05;
  text-wrap: balance;
  -webkit-font-smoothing:antialiased;
}

/* H1: hero / brand title */
h1 {
  font-family: 'Orbitron', 'Space Grotesk', 'Inter', system-ui, sans-serif;
  font-size: var(--h1-size);
  letter-spacing: 0.6px;
  margin-bottom: 6px;
  /* subtle gradient text, accessible: fallback color applied if background-clip unsupported */
  background: var(--gradient-head);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 1px 0 rgba(0,0,0,0.25);
  display: inline-block;
}

/* H2, H3 used for sections and labels */
h2 {
  font-size: var(--h2-size);
  letter-spacing: 0.2px;
  color: var(--text);
}
h3 {
  font-size: var(--h3-size);
  letter-spacing: 0.2px;
  color: var(--text);
}

/* Lead / subtitle */
.lead {
  font-size: 1.02rem;
  color: var(--muted);
  margin-top: 6px;
  margin-bottom: 14px;
  font-weight: 400;
  opacity: 0.95;
  max-width: 72ch;
}

/* Paragraphs */
p {
  margin: 0 0 1rem 0;
  color: var(--muted);
  font-size: 0.97rem;
}

/* Labels (small UI labels used in result rows) */
.label {
  display: inline-block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  font-weight: 600;
}

/* Value: prominent text next to labels (urls, stats) */
.value {
  font-size: 1rem;
  color: var(--text);
  font-weight: 600;
  /* tabular numbers for counters */
  font-variant-numeric: tabular-nums;
}

/* Long URL link */
.long-url {
  color: var(--text);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(124,92,255,0.12);
  text-decoration-skip-ink: auto;
  text-underline-offset: 4px;
  transition: color .18s ease, text-decoration-color .18s ease, transform .12s ease;
  display: inline-block;
}
.long-url:hover, .long-url:focus {
  color: var(--accent);
  text-decoration-color: rgba(124,92,255,0.32);
  transform: translateY(-1px);
}

/* Buttons typography */
button, .btn {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.4px;
  line-height: 1;
  text-transform: none;
  font-family: 'Inter', system-ui, sans-serif;
}

/* Small tags (history pills) */
.tag {
  font-size: 0.85rem;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.02);
  color: var(--muted);
  border: 1px solid rgba(255,255,255,0.02);
  cursor: pointer;
  transition: background .12s ease, color .12s ease, transform .08s ease;
}
.tag:hover { background: rgba(124,92,255,0.06); color: var(--text); transform: translateY(-2px); }

/* Input typography */
input[type="url"], .sheet-short-input {
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.1px;
  color: var(--text);
}

/* Stats numeric emphasis */
.stats-box p, .value strong {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

/* Small helper text */
.small {
  font-size: 0.82rem;
  color: var(--muted);
}

/* Accessibility: focus outlines more visible */
:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(124,92,255,0.12);
  border-radius: 8px;
}

/* Responsive adjustments */
@media (max-width: 680px) {
  :root { --h1-size: calc(var(--fs-base) * 1.6); }
  h1 { font-size: var(--h1-size); letter-spacing: 0.2px; }
  .lead { font-size: 0.95rem; }
  .label { min-width: 80px; }
}

/* Reduced motion: avoid animated gradient clip jitter */
@media (prefers-reduced-motion: reduce){
  h1 { background-clip: border-box; color: var(--text); -webkit-background-clip: unset; }
  * { transition: none !important; animation: none !important; }
}



/* STARFIELD & NEBULA BLUR */
#starfield {
  position: fixed;
  inset: 0;            /* top:0; right:0; bottom:0; left:0; */
  width: 100%;
  height: 100vh;       /* гарантированно покрывает вьюпорт */
  min-height: 100vh;
  z-index: -1;         /* под UI */
  display: block;
}

/* фиксированный слой блюра/небулы, который ложится НАД starfield и ПОД UI 


/* контейнер (контент сайта) должен иметь z-index > .nebula-blur */
.container { position: relative; z-index: 2; }


/* убираем фон у body */
body {
  background: var(--bg-900); /* or plain solid; gradient удалён */
}

/* body: базовый тёмный фон (оставляем здесь линейный градиент) */
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  background:
    linear-gradient(180deg, var(--bg-900) 0%, var(--bg-800) 100%); /* только темная база */
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* canvas — звёздное небо */
#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  z-index: -1;
  display: block;
  pointer-events: none;
}

/* nebula overlay — только полупрозрачные туманности, НИКАКОГО плотного линейного градиента */
.nebula-blur{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0; /* между canvas (z:-1) и .container (z:2) */
  /* только мягкие радиальные пятна с прозрачными краями */
  background:
    radial-gradient(120% 120% at 10% 20%, rgba(124,92,255,0.12) 0%, rgba(124,92,255,0) 40%),
    radial-gradient(120% 120% at 90% 80%, rgba(0,209,255,0.06) 0%, rgba(0,209,255,0) 40%);
  -webkit-backdrop-filter: blur(8px) saturate(1.05);
  backdrop-filter: blur(8px) saturate(1.05);
  transition: opacity .18s ease;
  opacity: 1;
}


/* тело оставляем с фоном (темная база) */
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  background: linear-gradient(180deg, var(--bg-900) 0%, var(--bg-800) 100%);
  color: var(--text);
  position: relative;
}

/* starfield фиксирован и занимает весь вьюпорт */
#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

/* nebula overlay — фиксированный поверх canvas */
.nebula-blur {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(120% 120% at 10% 20%, rgba(124,92,255,0.12) 0%, rgba(124,92,255,0) 40%),
    radial-gradient(120% 120% at 90% 80%, rgba(0,209,255,0.06) 0%, rgba(0,209,255,0) 40%);
  -webkit-backdrop-filter: blur(8px) saturate(1.05);
  backdrop-filter: blur(8px) saturate(1.05);
}

/* контент центрируем, но без вертикального скролла страницы */
.container {
  max-width: 980px;
  margin: 56px auto;
  padding: 28px;
  border-radius: 18px;
  position: relative;
  z-index: 2;
}

/* Базовый фон оставляем на body (тёмная основа) */
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  background: linear-gradient(180deg, var(--bg-900) 0%, var(--bg-800) 100%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Canvas: фиксирован и покрывает вьюпорт */
#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  z-index: -2;      /* под nebula */
  display: block;
  pointer-events: none;
}

/* Nebula overlay — только полупрозрачные туманности, НЕ плотный линейный градиент */
.nebula-blur{
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0; /* между canvas (-2) и .container (2) */
  background:
    radial-gradient(120% 120% at 10% 20%, rgba(124,92,255,0.12) 0%, rgba(124,92,255,0) 40%),
    radial-gradient(120% 120% at 90% 80%, rgba(0,209,255,0.06) 0%, rgba(0,209,255,0) 40%);
  -webkit-backdrop-filter: blur(6px) saturate(1.05);
  backdrop-filter: blur(6px) saturate(1.05);
  transition: opacity .18s ease;
  opacity: 1;
}

/* Контент (чтобы был над nebula) */
.container { position: relative; z-index: 2; }


/* canvas: звёзды выше nebula overlay, но ниже UI */
#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  z-index: 1;       /* <- звёзды поверх nebula */
  pointer-events: none;
  background: transparent; /* canvas прозрачный, рисует только звёзды */
}

/* nebula overlay (backdrop-filter должен оставаться ниже звёзд) */
.nebula-blur {
  position: fixed;
  inset: 0;
  z-index: 0;       /* <- блюр под звёздами */
  pointer-events: none;
  background:
    radial-gradient(120% 120% at 10% 20%, rgba(124,92,255,0.12) 0%, rgba(124,92,255,0) 40%),
    radial-gradient(120% 120% at 90% 80%, rgba(0,209,255,0.06) 0%, rgba(0,209,255,0) 40%);
  -webkit-backdrop-filter: blur(6px) saturate(1.05);
  backdrop-filter: blur(6px) saturate(1.05);
}

/* Контент над всем (кнопки, карточки и т.п.) */
.container {
  position: relative;
  z-index: 2; /* выше звёзд, чтобы UI был интерактивен и читабелен */
}


/* Убедитесь, что body имеет правильный градиентный фон на всю высоту */
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  background: 
    radial-gradient(120% 120% at 10% 20%, rgba(124,92,255,0.12) 0%, rgba(124,92,255,0) 40%),
    radial-gradient(120% 120% at 90% 80%, rgba(0,209,255,0.06) 0%, rgba(0,209,255,0) 40%),
    linear-gradient(180deg, var(--bg-900) 0%, var(--bg-800) 100%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Обновите .nebula-blur - уберите градиенты, оставьте только размытие */
.nebula-blur {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: transparent; /* Градиенты теперь в body */
  -webkit-backdrop-filter: blur(6px) saturate(1.05);
  backdrop-filter: blur(6px) saturate(1.05);
  transition: opacity .18s ease;
  opacity: 1;
}


#starfield {
  z-index: 1; /* Под nebula-blur */
}

.nebula-blur {
  z-index: 0; /* Между звездами и контентом */
}

.container {
  z-index: 2; /* Над всем */
}


/* Убираем градиенты из body */
body {
  background: var(--bg-800) !important; /* solid color вместо градиента */
  min-height: 100vh;
}

/* Обновляем .nebula-blur */
.nebula-blur {
  position: fixed;
  inset: 0;
  height: 100vh; /* Ограничиваем высотой viewport */
  background: 
    radial-gradient(120% 120% at 10% 20%, rgba(124,92,255,0.12) 0%, rgba(124,92,255,0) 40%),
    radial-gradient(120% 120% at 90% 80%, rgba(0,209,255,0.06) 0%, rgba(0,209,255,0) 40%) !important;
  -webkit-backdrop-filter: blur(6px) saturate(1.05);
  backdrop-filter: blur(6px) saturate(1.05);
  z-index: 0;
  pointer-events: none;
}

/* Убедимся, что контент поверх всех эффектов */
.container {
  position: relative;
  z-index: 2;
  background: rgba(255, 255, 255, 0.02); /* Лёгкая прозрачность для стеклянного эффекта */
  backdrop-filter: blur(10px); /* Добавляем размытие самому контейнеру */
}

/* Для длинного контента - плавный переход */
body::after {
  content: '';
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 20vh;
  background: linear-gradient(to top, var(--bg-800), transparent);
  pointer-events: none;
  z-index: 1;
}

/* Стили для выпадающего списка */
select.sheet-short-input {
  background: #0f0b1a;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.04);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.1px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2398A0B3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

select.sheet-short-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent);
}

/* Адаптивность для превью видео */
#videoThumbnail img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

@media (max-width: 780px) {
  #videoThumbnail img {
    max-width: 150px;
  }
}