/* SKYCUT design system — dark glow, Urbanist 400/600/900, cyan+violet */

:root {
  --bg: #05070f;
  --bg-2: #0a0e1d;
  --panel: rgba(17, 23, 44, 0.55);
  --line: rgba(120, 160, 255, 0.14);
  --text: #eef2ff;
  --text-dim: rgba(238, 242, 255, 0.62);
  --cyan: #38e8ff;
  --violet: #8b5cf6;
  --glow: 0 0 24px rgba(56, 232, 255, 0.35), 0 0 64px rgba(139, 92, 246, 0.18);
  --radius: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background:
    radial-gradient(1100px 600px at 80% -10%, rgba(139, 92, 246, 0.14), transparent 60%),
    radial-gradient(900px 500px at 10% 30%, rgba(56, 232, 255, 0.08), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: Urbanist, system-ui, -apple-system, sans-serif;
  font-weight: 400;
  overflow-x: hidden;
  line-height: 1.55;
}
a { color: var(--cyan); text-decoration: none; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }

/* ------------------------------------------------ unsupported banner */
#unsupported {
  display: none;
  position: fixed; left: 12px; right: 12px; bottom: 16px; z-index: 60;
  background: linear-gradient(90deg, #4c1d95, #155e75);
  padding: 12px 20px; text-align: center; font-weight: 600;
  border-radius: 14px; box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}
#unsupported.show { display: block; }

/* ------------------------------------------------ nav */
.nav {
  position: fixed; inset: 18px 18px auto; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px 10px 20px;
  border-radius: 999px;
  background: rgba(8, 11, 24, 0.62);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; letter-spacing: 0.14em; color: var(--text); font-size: 1.05rem; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 6px;
  background: conic-gradient(from 210deg, var(--cyan), var(--violet), var(--cyan));
  box-shadow: var(--glow);
  clip-path: polygon(50% 8%, 92% 88%, 72% 88%, 50% 48%, 28% 88%, 8% 88%);
}
.nav-pills { display: flex; align-items: center; gap: 6px; }
.nav-pills a {
  color: var(--text-dim); padding: 8px 16px; border-radius: 999px;
  font-weight: 600; font-size: 0.92rem; transition: color 0.2s, background 0.2s;
}
.nav-pills a:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.nav-pills .pill-cta {
  color: #04121a; background: linear-gradient(90deg, var(--cyan), #7dd3fc);
  box-shadow: 0 0 18px rgba(56, 232, 255, 0.4);
}
.nav-pills .pill-cta:hover { background: linear-gradient(90deg, #7ff0ff, #a5e2ff); color: #04121a; }

/* ------------------------------------------------ hero */
.hero { position: relative; min-height: 100svh; display: grid; place-items: center; overflow: hidden; }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-inner { position: relative; z-index: 2; text-align: center; padding: 120px 24px 80px; max-width: 980px; }
.hero-kicker {
  font-weight: 600; letter-spacing: 0.42em; font-size: 0.78rem; color: var(--cyan);
  text-shadow: 0 0 18px rgba(56, 232, 255, 0.6); margin-bottom: 18px;
}
.hero h1 {
  font-weight: 900; font-size: clamp(2.6rem, 7vw, 5.4rem); line-height: 1.02;
  letter-spacing: -0.015em; text-wrap: balance;
}
.glow-text {
  background: linear-gradient(92deg, var(--cyan), #a78bfa 70%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 22px rgba(56, 232, 255, 0.35));
}
.hero-sub { margin: 26px auto 0; max-width: 640px; color: var(--text-dim); font-size: 1.06rem; }
.hero-sub strong { color: var(--text); font-weight: 600; }
.hero-cta { margin-top: 36px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-fade { position: absolute; left: 0; right: 0; bottom: 0; height: 180px; background: linear-gradient(transparent, var(--bg)); }

.btn-primary {
  display: inline-block;
  background: linear-gradient(92deg, var(--cyan), #67d8f7);
  color: #04121a; font-weight: 900; letter-spacing: 0.02em;
  padding: 14px 30px; border: none; border-radius: 999px;
  box-shadow: 0 0 26px rgba(56, 232, 255, 0.45);
  transition: transform 0.18s, box-shadow 0.18s;
}
.btn-primary:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 0 40px rgba(56, 232, 255, 0.65); }
.btn-primary:active { transform: translateY(0) scale(0.97); }
.chip:active, .aspect-btn:active, .btn-ghost:active { transform: scale(0.95); }
.btn-primary.big { font-size: 1.15rem; padding: 16px 40px; }
.btn-ghost {
  display: inline-block; color: var(--text); font-weight: 600;
  padding: 13px 26px; border-radius: 999px; background: transparent;
  border: 1px solid var(--line); transition: border-color 0.2s, background 0.2s;
}
.btn-ghost:hover { border-color: rgba(56, 232, 255, 0.5); background: rgba(56, 232, 255, 0.06); }
.btn-ghost.small { padding: 6px 16px; font-size: 0.85rem; }

/* ------------------------------------------------ sections */
.section { padding: 110px 24px; max-width: 1120px; margin: 0 auto; }
.section-title {
  font-weight: 900; font-size: clamp(1.9rem, 4.4vw, 3.1rem);
  letter-spacing: -0.01em; margin-bottom: 46px; text-align: center;
}
/* reveal only hides when JS is confirmed running (html.js set in main.js) */
html.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s ease; }
html.js .reveal.vis { opacity: 1; transform: none; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 22px; perspective: 1000px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 26px; backdrop-filter: blur(10px);
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
.card.tilt-l { transform: rotateY(6deg) rotateX(2deg); }
.card.tilt-r { transform: rotateY(-6deg) rotateX(2deg); }
.card:hover { transform: translateY(-6px); border-color: rgba(56, 232, 255, 0.45); box-shadow: var(--glow); }
.card.tilt-l:hover { transform: rotateY(6deg) rotateX(2deg) translateY(-6px); }
.card.tilt-r:hover { transform: rotateY(-6deg) rotateX(2deg) translateY(-6px); }
.card-num { font-weight: 900; font-size: 0.85rem; color: var(--cyan); letter-spacing: 0.3em; }
.card h3 { font-weight: 900; font-size: 1.25rem; margin: 10px 0 10px; }
.card p { color: var(--text-dim); font-size: 0.97rem; }

/* ------------------------------------------------ studio */
.studio { max-width: 980px; }
.panel { display: none; }
.panel.active { display: block; animation: panelIn 0.45s ease; }
@keyframes panelIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

#dropzone {
  border: 2px dashed rgba(56, 232, 255, 0.35); border-radius: var(--radius);
  padding: 64px 24px; text-align: center; cursor: pointer;
  background: rgba(56, 232, 255, 0.03);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
#dropzone:hover, #dropzone.drag { border-color: var(--cyan); background: rgba(56, 232, 255, 0.07); box-shadow: var(--glow); }
.dz-icon {
  width: 54px; height: 54px; margin: 0 auto 18px; border-radius: 14px;
  background: conic-gradient(from 210deg, var(--cyan), var(--violet), var(--cyan));
  clip-path: polygon(50% 6%, 94% 90%, 70% 90%, 50% 46%, 30% 90%, 6% 90%);
  filter: drop-shadow(0 0 16px rgba(56, 232, 255, 0.6));
  animation: bob 3s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.dz-big { font-weight: 900; font-size: 1.3rem; }
.dz-small { color: var(--text-dim); margin-top: 6px; }

/* upload progress rows */
.upload-progress { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.up-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid rgba(56, 232, 255, 0.35); border-radius: 12px;
  padding: 10px 16px; animation: panelIn 0.3s ease;
}
.up-track { flex: 1; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.up-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--cyan), var(--violet)); box-shadow: 0 0 10px rgba(56, 232, 255, 0.6); transition: width 0.15s ease; }
.up-pct { min-width: 44px; text-align: right; color: var(--cyan); font-weight: 600; font-size: 0.88rem; }

/* vault library */
.lib-head { display: none; align-items: baseline; justify-content: space-between; margin: 22px 4px 6px; }
.lib-title { font-weight: 900; letter-spacing: 0.14em; font-size: 0.8rem; color: var(--text); }
.lib-usage { color: var(--text-dim); font-size: 0.8rem; }
.file-pick { accent-color: var(--cyan); width: 17px; height: 17px; flex: none; }

/* song chips */
.song-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.song-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 6px 6px 14px;
  color: var(--text-dim); font-size: 0.85rem; font-weight: 600; cursor: pointer;
  transition: all 0.2s; max-width: 260px;
}
.song-chip .song-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-chip.on { color: var(--text); border-color: rgba(56, 232, 255, 0.55); background: rgba(56, 232, 255, 0.08); }
.song-x { background: none; border: none; color: var(--text-dim); font-size: 1.1rem; line-height: 1; padding: 2px 8px; }
.song-x:hover { color: #ff7d9d; }
.opt-note { color: var(--text-dim); font-size: 0.75rem; }

.file-count { margin: 18px 4px 8px; color: var(--cyan); font-weight: 600; }
.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 16px; animation: panelIn 0.3s ease;
}
.file-name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { color: var(--text-dim); font-size: 0.88rem; }
.file-x { background: none; border: none; color: var(--text-dim); font-size: 1.3rem; line-height: 1; padding: 4px 8px; }
.file-x:hover { color: #ff7d9d; }

.import-actions { display: none; margin-top: 28px; }
.import-actions.show { display: block; animation: panelIn 0.35s ease; }
.opt-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.opt-label { width: 64px; font-weight: 900; letter-spacing: 0.12em; font-size: 0.78rem; color: var(--text-dim); }
.aspect-btn {
  background: transparent; border: 1px solid var(--line); color: var(--text-dim);
  padding: 8px 18px; border-radius: 999px; font-weight: 600; transition: all 0.2s;
}
.aspect-btn.on { color: #04121a; background: linear-gradient(90deg, var(--cyan), #7dd3fc); border-color: transparent; box-shadow: 0 0 14px rgba(56, 232, 255, 0.4); }
.auto-label { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); }
.auto-label input { accent-color: var(--cyan); width: 18px; height: 18px; }
.len-row { display: flex; align-items: center; gap: 10px; transition: opacity 0.2s; }
.len-row.dim { opacity: 0.35; pointer-events: none; }
.len-row input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 160px; height: 6px;
  border-radius: 999px; background: linear-gradient(90deg, var(--cyan), var(--violet));
}
.len-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: none; box-shadow: 0 0 12px rgba(56, 232, 255, 0.8);
}
.len-row input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: none; box-shadow: 0 0 12px rgba(56, 232, 255, 0.8);
}
#len-value { font-weight: 600; color: var(--cyan); min-width: 52px; }
#notes {
  flex: 1; min-width: 240px; background: rgba(8, 11, 24, 0.7); border: 1px solid var(--line);
  border-radius: 999px; padding: 10px 18px; color: var(--text); outline: none;
}
#notes:focus { border-color: rgba(56, 232, 255, 0.5); }
#btn-create { margin-top: 10px; }
.legal-line { margin-top: 14px; font-size: 0.8rem; color: var(--text-dim); }

/* ------------------------------------------------ processing */
.phases { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.phase {
  padding: 8px 18px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--text-dim); font-weight: 600; font-size: 0.9rem; transition: all 0.3s;
}
.phase.on {
  color: #04121a; background: linear-gradient(90deg, var(--cyan), #7dd3fc);
  box-shadow: 0 0 18px rgba(56, 232, 255, 0.5); border-color: transparent;
  animation: pulse 1.6s ease-in-out infinite;
}
.phase.done { color: var(--cyan); border-color: rgba(56, 232, 255, 0.5); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 14px rgba(56, 232, 255, 0.4); } 50% { box-shadow: 0 0 30px rgba(56, 232, 255, 0.75); } }
#btn-cancel { margin-left: auto; }

.progress-track { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); overflow: hidden; border: 1px solid var(--line); }
#progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  box-shadow: 0 0 18px rgba(56, 232, 255, 0.7);
  transition: width 0.25s ease;
}
.progress-label { margin: 12px 2px 22px; color: var(--text-dim); font-weight: 600; }

.filmstrip {
  display: flex; gap: 4px; overflow: hidden; border-radius: 10px;
  justify-content: flex-end; /* newest scan frame slides in at the right */
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.filmstrip img { height: 56px; border-radius: 6px; animation: panelIn 0.4s ease; }

.moments { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 22px; }
.moment {
  border-radius: 10px; overflow: hidden; border: 1px solid var(--line);
  background: var(--bg-2); opacity: 0.45; transition: opacity 0.4s, border-color 0.4s, transform 0.4s;
}
.moment.seen { opacity: 1; border-color: rgba(56, 232, 255, 0.5); transform: translateY(-2px); }
.moment img { width: 100%; display: block; aspect-ratio: 16/9; object-fit: cover; }
.moment figcaption { padding: 6px 9px; font-size: 0.72rem; color: var(--text-dim); min-height: 2.2em; }

.render-stage { display: none; margin-top: 24px; }
.render-stage.show { display: block; }
#render-canvas {
  width: 100%; border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: 0 10px 60px rgba(56, 232, 255, 0.15);
}

/* ------------------------------------------------ result */
.result-title { font-weight: 900; font-size: clamp(1.6rem, 4vw, 2.6rem); letter-spacing: 0.02em; }
.result-stats { color: var(--text-dim); margin: 6px 0 18px; font-weight: 600; }
#result-video {
  width: 100%; border-radius: var(--radius); border: 1px solid var(--line);
  box-shadow: 0 14px 70px rgba(56, 232, 255, 0.16); background: #000;
}
.result-actions { display: flex; gap: 14px; margin: 20px 0 30px; flex-wrap: wrap; }

.chat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.chat-log {
  max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px;
  scrollbar-width: thin; scrollbar-color: rgba(56, 232, 255, 0.35) transparent;
}
.msg { padding: 10px 16px; border-radius: 14px; max-width: 85%; font-size: 0.95rem; }
.msg.you { align-self: flex-end; background: rgba(56, 232, 255, 0.14); border: 1px solid rgba(56, 232, 255, 0.3); }
.msg.skycut { align-self: flex-start; background: rgba(139, 92, 246, 0.14); border: 1px solid rgba(139, 92, 246, 0.3); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip {
  background: transparent; border: 1px solid var(--line); color: var(--text-dim);
  padding: 7px 14px; border-radius: 999px; font-size: 0.85rem; font-weight: 600; transition: all 0.2s;
}
.chip:hover { color: var(--cyan); border-color: rgba(56, 232, 255, 0.5); }
.chat-row { display: flex; gap: 10px; }
#chat-input {
  flex: 1; min-width: 0; background: rgba(8, 11, 24, 0.7); border: 1px solid var(--line);
  border-radius: 999px; padding: 12px 18px; color: var(--text); outline: none;
}
#chat-input:focus { border-color: rgba(56, 232, 255, 0.5); }
#notes::placeholder, #chat-input::placeholder { color: rgba(238, 242, 255, 0.38); }

/* ------------------------------------------------ account + modal */
#btn-account { border: none; }
#btn-account.signed { color: var(--text); background: rgba(56, 232, 255, 0.1); border: 1px solid rgba(56, 232, 255, 0.4); max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(3, 5, 12, 0.72); backdrop-filter: blur(6px);
}
.modal-backdrop.show { display: flex; animation: panelIn 0.25s ease; }
.modal {
  position: relative; width: 100%; max-width: 420px;
  background: linear-gradient(180deg, rgba(17, 23, 44, 0.95), rgba(10, 14, 29, 0.98));
  border: 1px solid rgba(56, 232, 255, 0.28); border-radius: var(--radius);
  padding: 30px 26px; box-shadow: var(--glow);
}
.modal-close { position: absolute; top: 12px; right: 14px; background: none; border: none; color: var(--text-dim); font-size: 1.6rem; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-title { font-weight: 900; font-size: 1.4rem; margin-bottom: 8px; }
.modal-sub { color: var(--text-dim); font-size: 0.92rem; margin-bottom: 18px; }
.modal-input {
  width: 100%; background: rgba(8, 11, 24, 0.8); border: 1px solid var(--line);
  border-radius: 12px; padding: 13px 16px; color: var(--text); outline: none; margin-bottom: 14px;
  font-size: 1rem;
}
.modal-input:focus { border-color: rgba(56, 232, 255, 0.55); }
#auth-code { letter-spacing: 0.4em; text-align: center; font-size: 1.3rem; font-weight: 700; }
.auth-agree { display: flex; align-items: flex-start; gap: 8px; font-size: 0.82rem; color: var(--text-dim); margin-bottom: 16px; }
.auth-agree input { accent-color: var(--cyan); width: 17px; height: 17px; margin-top: 1px; flex: none; }
.modal .btn-primary { width: 100%; text-align: center; }
.modal .btn-ghost.small { width: 100%; margin-top: 10px; }
.modal-msg { margin-top: 12px; font-size: 0.86rem; text-align: center; min-height: 1.2em; }
.modal-msg.ok { color: var(--cyan); }
.modal-msg.err { color: #ff7d9d; }

/* my films gallery */
.myfilms-empty { text-align: center; color: var(--text-dim); }
.myfilms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.film-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}
.film-card:hover { border-color: rgba(56, 232, 255, 0.45); transform: translateY(-4px); box-shadow: var(--glow); }
.film-card video { width: 100%; display: block; aspect-ratio: 16/9; object-fit: cover; background: #000; }
.film-body { padding: 14px 16px; }
.film-title { font-weight: 900; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.film-meta { color: var(--text-dim); font-size: 0.82rem; margin: 4px 0 12px; }
.film-actions { display: flex; gap: 8px; }
.film-actions a, .film-actions button {
  flex: 1; text-align: center; padding: 7px 10px; border-radius: 999px; font-size: 0.82rem; font-weight: 600;
  border: 1px solid var(--line); background: transparent; color: var(--text-dim); transition: all 0.2s;
}
.film-actions a:hover { color: var(--cyan); border-color: rgba(56, 232, 255, 0.5); }
.film-actions .film-del:hover { color: #ff7d9d; border-color: rgba(255, 125, 157, 0.5); }

/* ------------------------------------------------ footer + toast */
.footer {
  border-top: 1px solid var(--line); margin-top: 60px; padding: 34px 24px 44px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  color: var(--text-dim); font-size: 0.9rem;
}
.footer > span:first-child { font-weight: 900; letter-spacing: 0.18em; color: var(--text); }
.footer nav { display: flex; gap: 22px; }
.footer-fine { font-size: 0.78rem; text-align: center; }

#toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px);
  background: rgba(10, 14, 29, 0.95); border: 1px solid rgba(56, 232, 255, 0.4);
  color: var(--text); padding: 12px 22px; border-radius: 999px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity 0.3s, transform 0.3s;
  z-index: 70; max-width: min(90vw, 600px); text-align: center;
  box-shadow: var(--glow);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------ responsive */
@media (max-width: 720px) {
  .nav { inset: 10px 10px auto; }
  .nav-pills a:not(.pill-cta) { display: none; }
  .section { padding: 70px 16px; }
  .card.tilt-l, .card.tilt-r { transform: none; }
  #btn-cancel { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .hero {
    background:
      radial-gradient(600px 400px at 50% 60%, rgba(56, 232, 255, 0.12), transparent 70%),
      radial-gradient(500px 350px at 70% 30%, rgba(139, 92, 246, 0.1), transparent 70%);
  }
}
