:root {
  --bg: #0d1214;
  --bg-soft: #151c1f;
  --panel: linear-gradient(155deg, rgba(24, 34, 38, 0.96), rgba(16, 24, 27, 0.92));
  --panel-alt: linear-gradient(155deg, rgba(30, 43, 48, 0.9), rgba(16, 25, 28, 0.9));
  --text: #eef4ef;
  --muted: #9eb1ac;
  --line: rgba(189, 220, 208, 0.18);
  --brand: #f3be62;
  --brand-strong: #e59b37;
  --accent: #6ad0b2;
  --danger: #f17d7d;
  --radius: 1.1rem;
  --shadow: 0 14px 30px rgba(0, 0, 0, 0.25);
}

html {
  color-scheme: dark;
  -webkit-tap-highlight-color: rgba(243, 190, 98, 0.2);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Sora", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 15% -20%, #2a3f42 0, transparent 45%),
    radial-gradient(circle at 95% 0%, #5e3e1e 0, transparent 35%),
    radial-gradient(circle at 85% 95%, #1a4f46 0, transparent 33%), var(--bg);
  min-height: 100vh;
}

.bg-noise {
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  opacity: 0.05;
  background-image: radial-gradient(#ffffff 0.6px, transparent 0.6px);
  background-size: 3px 3px;
}

.bg-glow {
  position: fixed;
  width: 30rem;
  height: 30rem;
  border-radius: 50%;
  filter: blur(56px);
  z-index: -2;
  pointer-events: none;
}

.bg-glow-a {
  top: -15rem;
  right: -10rem;
  background: rgba(106, 208, 178, 0.28);
}

.bg-glow-b {
  bottom: -17rem;
  left: -8rem;
  background: rgba(243, 190, 98, 0.2);
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3.5rem;
  z-index: 30;
  padding: 0.55rem 0.8rem;
  border-radius: 0.6rem;
  color: #081010;
  background: var(--brand);
  text-decoration: none;
  font-weight: 700;
}

.skip-link:focus-visible {
  top: 0.8rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 14, 15, 0.74);
  backdrop-filter: blur(8px);
}

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

.brand-mark {
  width: 1rem;
  height: 1rem;
  border-radius: 0.35rem;
  background: linear-gradient(145deg, var(--brand), var(--accent));
  box-shadow: 0 0 16px rgba(243, 190, 98, 0.5);
}

.brand h1 {
  margin: 0;
  font-family: "Instrument Serif", serif;
  font-size: clamp(1.2rem, 2.4vw, 1.8rem);
  letter-spacing: 0.01em;
  line-height: 1.1;
}

.eyebrow {
  margin: 0;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.lang-select {
  min-height: 44px;
  border-radius: 0.82rem;
  border: 1px solid rgba(184, 215, 203, 0.24);
  background: rgba(23, 33, 36, 0.65);
  color: #d8e6e0;
  padding: 0.55rem 0.65rem;
  font-weight: 700;
}

.auth-chip {
  border: 1px solid rgba(243, 190, 98, 0.35);
  border-radius: 999px;
  padding: 0.45rem 0.7rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--brand);
  background: rgba(243, 190, 98, 0.12);
}

.auth-chip.is-authenticated {
  border-color: rgba(106, 208, 178, 0.5);
  color: #79e2c2;
  background: rgba(106, 208, 178, 0.14);
}

.stage {
  width: min(1400px, 95vw);
  margin: 1rem auto 1.9rem;
  display: grid;
  grid-template-columns: minmax(320px, 370px) minmax(0, 1fr);
  gap: 1rem;
}

.control-rail,
.workbench {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 1rem;
  animation: panel-in 0.45s ease-out both;
  will-change: transform, opacity;
}

@keyframes panel-in {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.intro-panel {
  padding: 1.25rem;
  background: linear-gradient(145deg, rgba(29, 43, 47, 0.96), rgba(15, 23, 26, 0.92));
}

.intro-panel h2 {
  margin: 0.45rem 0 0.7rem;
  font-family: "Instrument Serif", serif;
  font-size: clamp(1.5rem, 2.4vw, 2.05rem);
  line-height: 1.12;
}

.intro-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.panel h3 {
  margin: 0 0 0.75rem;
  font-family: "Instrument Serif", serif;
  font-size: 1.4rem;
  line-height: 1;
  letter-spacing: 0.01em;
}

.subcard {
  border: 1px solid rgba(188, 216, 205, 0.18);
  border-radius: 0.95rem;
  padding: 0.85rem;
  background: var(--panel-alt);
}

.subcard h4 {
  margin: 0 0 0.7rem;
  font-size: 0.93rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #cee5de;
}

.auth-grid,
.studio-grid {
  display: grid;
  gap: 0.75rem;
}

form {
  display: grid;
  gap: 0.7rem;
}

label {
  display: block;
  margin-bottom: 0.28rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #b2c5c0;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(193, 222, 209, 0.18);
  border-radius: 0.75rem;
  padding: 0.68rem 0.76rem;
  background: rgba(6, 10, 11, 0.45);
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

textarea {
  resize: vertical;
  min-height: 7.5rem;
}

input::placeholder,
textarea::placeholder {
  color: #71837f;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.lang-select:focus-visible {
  outline: none;
  border-color: rgba(243, 190, 98, 0.85);
  box-shadow: 0 0 0 3px rgba(243, 190, 98, 0.2);
  background: rgba(9, 14, 15, 0.65);
}

.btn {
  min-height: 44px;
  border-radius: 0.82rem;
  border: 1px solid transparent;
  padding: 0.6rem 0.9rem;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: transform 0.15s ease, filter 0.15s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-solid {
  color: #071113;
  background: linear-gradient(130deg, var(--brand), var(--brand-strong));
}

.btn-solid:hover {
  filter: brightness(1.05);
}

.btn-outline {
  color: var(--text);
  border-color: rgba(195, 223, 211, 0.34);
  background: rgba(28, 39, 43, 0.5);
}

.btn-ghost {
  color: #d8e6e0;
  border-color: rgba(184, 215, 203, 0.24);
  background: rgba(23, 33, 36, 0.65);
}

.btn:focus-visible,
a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.panel-head,
.studio-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.muted {
  color: var(--muted);
}

.range-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem;
  align-items: center;
}

.range-row output {
  min-width: 2.5rem;
  text-align: center;
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.3rem 0.48rem;
  color: var(--brand);
  border: 1px solid rgba(243, 190, 98, 0.4);
  background: rgba(243, 190, 98, 0.12);
}

.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.checkbox-row label {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
}

.checkbox-row input {
  width: auto;
}

.code-box {
  margin: 0;
  border: 1px solid rgba(173, 207, 194, 0.2);
  border-radius: 0.84rem;
  background: #0a1315;
  color: #b6d7cc;
  max-height: 240px;
  overflow: auto;
  padding: 0.7rem;
  font-size: 0.77rem;
  line-height: 1.4;
}

.credits-balance {
  margin: 0.8rem 0;
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
}

.credits-balance span {
  font-family: "Instrument Serif", serif;
  font-size: 2.15rem;
  line-height: 1;
  color: var(--brand);
}

.credits-balance small {
  color: var(--muted);
}

.list {
  display: grid;
  gap: 0.52rem;
}

.list-item {
  border: 1px solid rgba(181, 214, 201, 0.18);
  border-radius: 0.72rem;
  padding: 0.68rem;
  background: rgba(17, 26, 29, 0.8);
  color: #dce8e4;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.package-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.package-card {
  border: 1px solid rgba(194, 221, 209, 0.22);
  border-radius: 0.94rem;
  padding: 0.9rem;
  background: linear-gradient(170deg, rgba(31, 45, 50, 0.96), rgba(16, 24, 27, 0.9));
}

.package-card h4 {
  margin: 0;
  font-size: 1.1rem;
}

.package-card p {
  margin: 0.45rem 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.package-card p:nth-of-type(2) {
  color: var(--brand);
  font-size: 1.2rem;
  font-weight: 800;
}

.package-card .btn {
  width: 100%;
  margin-top: 0.45rem;
}

.progress-wrap {
  width: 100%;
  height: 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(177, 210, 198, 0.23);
  background: rgba(7, 12, 13, 0.55);
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #f1af41, #5fcbb1 65%, #7ee8ca);
  box-shadow: 0 0 10px rgba(126, 232, 202, 0.35);
  transition: width 0.24s ease;
}

.tracker {
  display: grid;
  gap: 0.55rem;
}

.results-grid {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.72rem;
}

.result-card {
  border: 1px solid rgba(188, 219, 207, 0.2);
  border-radius: 0.83rem;
  overflow: hidden;
  background: rgba(10, 15, 16, 0.84);
}

.result-card img,
.result-card video {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.result-card a {
  display: block;
  padding: 0.55rem 0.6rem;
  color: #8ce4ca;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
}

.result-card a:hover {
  text-decoration: underline;
}

button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}

@media (max-width: 1120px) {
  .stage {
    grid-template-columns: 1fr;
  }

  .control-rail {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

@media (max-width: 820px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .topbar-actions .btn,
  .topbar-actions .lang-select {
    flex: 1;
    min-width: 110px;
  }

  .studio-grid,
  .auth-grid {
    grid-template-columns: 1fr;
  }

  .panel-head,
  .studio-head {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
