:root {
  color-scheme: dark;
  --bg: #050506;
  --text: #f5f7fb;
  --muted: #848b98;
  --soft: #c4cad4;
  --line: rgba(255, 255, 255, .12);
  --line-strong: rgba(255, 255, 255, .18);
  --ice: #9fd4ff;
  --green: #98f5c2;
  --max: 1340px;
  --ease: cubic-bezier(.2, .72, .2, 1);
}

* { box-sizing: border-box; }

/* Ensure [hidden] wins over explicit display rules (e.g. label { display: grid }). */
[hidden] { display: none !important; }

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font-family: "Hanken Grotesk", sans-serif;
  background:
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px) 50% 0 / 96px 96px,
    linear-gradient(180deg, #060607 0%, #040405 48%, #030303 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 440px at 50% -240px, rgba(159, 212, 255, .12), transparent 70%),
    radial-gradient(680px 360px at 80% 16%, rgba(152, 245, 194, .035), transparent 70%);
  z-index: -1;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }

.wrap {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

/* ---------- topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 5, 6, .72);
  backdrop-filter: blur(18px) saturate(130%);
}

.topbar .wrap {
  position: relative;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-center { display: flex; align-items: center; }

.logo {
  --logo-size: 24px;
  display: inline-flex;
  align-items: center;
  gap: .16em;
  font-family: "Unbounded", sans-serif;
  font-size: var(--logo-size);
  font-weight: 700;
  letter-spacing: -.045em;
  line-height: 1;
  white-space: nowrap;
}

.logo-star {
  width: .76em;
  height: .76em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  filter: drop-shadow(0 0 16px rgba(159, 212, 255, .72)) drop-shadow(0 1px 2px rgba(0, 0, 0, .55));
  transform: translateY(.02em);
}

.logo-star svg { width: 100%; height: 100%; display: block; fill: currentColor; }

.logo-word {
  display: inline-block;
  background-image: linear-gradient(115deg, #ffffff 0%, #dff3ff 18%, #9fd4ff 32%, #ffffff 46%, #b9e2ff 60%, #ecf8ff 74%, #78bdf2 90%, #ffffff 100%);
  background-size: 360% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: logo-flow 5.4s linear infinite;
  filter: drop-shadow(0 0 9px rgba(159, 212, 255, .26)) drop-shadow(0 2px 2px rgba(0, 0, 0, .34));
}

.co {
  font-family: "Outfit", sans-serif;
  font-size: 1.23em;
  font-weight: 300;
  letter-spacing: -.02em;
}

@keyframes logo-flow {
  from { background-position: 0% 50%; }
  to { background-position: 360% 50%; }
}

.nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 18px;
}

.nav-link {
  color: var(--soft);
  font-size: 13px;
  font-weight: 600;
  transition: color .2s var(--ease);
}

.nav-link:hover { color: var(--text); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--soft);
  background: rgba(255, 255, 255, .035);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s var(--ease), color .2s var(--ease), background .2s var(--ease);
}

.nav-cta:hover {
  color: var(--text);
  border-color: rgba(159, 212, 255, .4);
  background: rgba(159, 212, 255, .08);
}

/* ---------- main / auth layout ---------- */
main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: clamp(40px, 8vw, 88px) 0;
}

.auth {
  width: min(440px, calc(100% - 40px));
  margin: 0 auto;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.026), rgba(255,255,255,.008));
  padding: clamp(26px, 4vw, 34px);
  box-shadow: 0 28px 80px rgba(0,0,0,.42), 0 0 0 1px rgba(255,255,255,.03) inset;
}

.eyebrow {
  margin: 0 0 14px;
  width: fit-content;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: "Unbounded", sans-serif;
  font-size: clamp(28px, 4.6vw, 34px);
  font-weight: 600;
  letter-spacing: -.05em;
  line-height: 1;
}

.lead {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

/* ---------- forms ---------- */
form, .stack {
  margin-top: 24px;
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0,0,0,.28);
  color: var(--text);
  padding: 0 14px;
  font: inherit;
  transition: border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}

input::placeholder { color: #5b626e; }

input:focus {
  outline: none;
  border-color: rgba(159, 212, 255, .45);
  background: rgba(0,0,0,.34);
  box-shadow: 0 0 0 3px rgba(159, 212, 255, .12);
}

input#code {
  font-family: "Unbounded", sans-serif;
  font-size: 20px;
  letter-spacing: .42em;
  text-align: center;
  padding-right: 0;
}

/* ---------- buttons ---------- */
button, .button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: var(--text);
  color: #050506;
  padding: 0 20px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 0 42px rgba(255, 255, 255, .1);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease), color .2s var(--ease);
}

button:hover, .button:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 54px rgba(159, 212, 255, .18);
}

button:disabled {
  opacity: .6;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.button.secondary, button.secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .025);
  color: var(--soft);
  font-weight: 700;
  box-shadow: none;
}

.button.secondary:hover, button.secondary:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, .05);
  box-shadow: none;
}

/* ---------- status ---------- */
.status {
  min-height: 20px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.status.error { color: #ff9f9f; }
.status.success { color: var(--green); }

.launch {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid rgba(159, 212, 255, .22);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(159, 212, 255, .07), rgba(159, 212, 255, .015));
}

.launch-copy {
  margin: 0 0 16px;
  color: var(--soft);
  font-size: 14.5px;
  line-height: 1.5;
}

.launch .button { width: 100%; }

.launch-done {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--green);
  font-size: 14px;
  font-weight: 700;
}

.launch .alt { margin: 14px 0 0; text-align: left; }

.identity {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.identity strong { color: var(--text); font-weight: 700; }

.identity a {
  color: var(--soft);
  font-weight: 700;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
  transition: color .2s var(--ease), border-color .2s var(--ease);
}

.identity a:hover { color: var(--text); border-color: rgba(159, 212, 255, .4); }

.alt {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
}

.alt a {
  color: var(--soft);
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  transition: color .2s var(--ease), border-color .2s var(--ease);
}

.alt a:hover { color: var(--text); border-color: rgba(159, 212, 255, .4); }

/* ---------- dashboard kv ---------- */
.kv {
  display: grid;
  gap: 0;
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, .015);
}

.kv div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}

.kv div:last-child { border-bottom: 0; }

.kv span:first-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.kv strong {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

.kv strong.muted { color: var(--muted); font-weight: 600; }

.credits-value {
  font-family: "Unbounded", sans-serif;
  letter-spacing: -.03em;
  color: var(--ice);
}

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 26px 0 34px;
  color: #636a76;
  font-size: 13px;
}

.footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer .logo { --logo-size: 18px; }

@media (max-width: 640px) {
  .wrap { width: min(100% - 28px, var(--max)); }
  .topbar .wrap { height: 56px; }
  .logo { --logo-size: 19px; }
  .nav-actions { gap: 12px; }
  .nav-link, .nav-cta { font-size: 12px; }
  .nav-cta { min-height: 32px; padding: 0 12px; }
  main { padding: clamp(28px, 9vw, 56px) 0; }
  .footer .wrap { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* ---------- dashboard app shell ---------- */
body.dashboard { background-image: linear-gradient(180deg, #060607 0%, #040405 48%, #030303 100%); }
body.dashboard::before { background: radial-gradient(1100px 540px at 18% -180px, rgba(159, 212, 255, .08), transparent 70%); }

body.dashboard .topbar .wrap {
  width: 100%;
  max-width: none;
  padding: 0 clamp(18px, 2.4vw, 28px);
  margin: 0;
}

body.dashboard main.app {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  place-items: stretch;
  padding: 0;
}

.app-sidebar {
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, .012);
  padding: 22px 14px;
  position: sticky;
  top: 62px;
  align-self: start;
  height: calc(100vh - 62px);
  overflow-y: auto;
}

.app-sidebar .nav-section {
  margin: 0 0 8px 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.app-main {
  min-width: 0;
  padding: clamp(22px, 3vw, 36px) clamp(22px, 4vw, 44px) 72px;
}

body.dashboard .sidenav {
  position: static;
  top: auto;
}

.welcome-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 14px 18px;
  border: 1px solid rgba(159, 212, 255, .22);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(159, 212, 255, .08), rgba(159, 212, 255, .02));
  color: var(--soft);
  font-size: 14px;
}

.welcome-banner strong { color: var(--text); }

.banner-x {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
}

.banner-x:hover { transform: none; box-shadow: none; }

.banner-x:hover { color: var(--text); border-color: var(--line-strong); }

.shell {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.sidenav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 84px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  text-align: left;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  min-height: 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
  transition: color .2s var(--ease), background .2s var(--ease);
}

.nav-item:hover { transform: none; box-shadow: none; }

.nav-item:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.nav-item.is-active { color: var(--text); background: rgba(159, 212, 255, .10); }

.nav-item .soon-dot {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ice);
  opacity: .7;
}

.content {
  min-width: 0;
  padding: 4px 0 0 6px;
}

/* user identity chip in the app topbar */
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.user-chip .who {
  color: var(--soft);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip .sep { color: rgba(255, 255, 255, .22); }

.user-chip button {
  background: transparent;
  border: 0;
  color: var(--soft);
  padding: 0;
  min-height: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  box-shadow: none;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}

.user-chip button:hover {
  color: var(--text);
  border-bottom-color: rgba(159, 212, 255, .4);
  transform: none;
  box-shadow: none;
}

.section-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.section-head h1 { font-size: clamp(28px, 3.6vw, 38px); }

.badge {
  color: var(--ice);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 4px 8px;
  border: 1px solid rgba(159, 212, 255, .26);
  border-radius: 999px;
  background: rgba(159, 212, 255, .07);
}

.section-lead {
  margin: 12px 0 0;
  max-width: 520px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

/* create studio (mockup) */
.studio {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 14px;
  margin-top: 22px;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: clamp(220px, 28vw, 320px);
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, .02);
  color: var(--muted);
  text-align: center;
  padding: 20px;
}

.dz-title { color: var(--soft); font-weight: 700; font-size: 15px; }
.dz-hint { font-size: 12px; }
.dz-plus { font-size: 24px; opacity: .5; margin-bottom: 2px; }

.studio-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
}

.quality {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.q-opt { padding: 9px 16px; font-size: 13px; font-weight: 700; color: var(--muted); }
.q-opt.is-on { background: rgba(255, 255, 255, .08); color: var(--text); }

.studio-bar .button { min-width: 150px; }

/* videos gallery (empty) */
.gallery-empty {
  margin-top: 22px;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 8px;
  padding: 52px 20px;
  border: 1px dashed var(--line);
  border-radius: 14px;
}

.ge-icon { font-size: 30px; opacity: .45; }
.ge-title { margin: 0; color: var(--text); font-weight: 700; font-size: 16px; }
.ge-sub { margin: 0; max-width: 340px; color: var(--muted); font-size: 14px; line-height: 1.5; }

/* account settings */
.setting {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.setting-title { margin: 0; font-weight: 700; }
.setting-sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.toggle {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
  color: var(--soft);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: color .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
}

.toggle:hover { color: var(--text); border-color: rgba(159, 212, 255, .4); }
.toggle[aria-checked="true"] {
  background: rgba(152, 245, 194, .12);
  border-color: rgba(152, 245, 194, .4);
  color: var(--green);
}

.account-actions { margin-top: 22px; }
.section .kv { margin-top: 20px; }

@media (max-width: 760px) {
  body.dashboard main.app { grid-template-columns: 1fr; }
  .app-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 12px 14px;
    overflow-x: auto;
  }
  .app-sidebar .nav-section { display: none; }
  body.dashboard .sidenav {
    flex-direction: row;
    gap: 6px;
  }
  .nav-item { white-space: nowrap; }
  .nav-item .soon-dot { display: none; }
  .app-main { padding: 22px 18px 60px; }
  .studio { grid-template-columns: 1fr; }
  .studio-bar { flex-direction: column; align-items: stretch; }
  .studio-bar .quality { justify-content: center; }
}

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