:root {
  color-scheme: dark;
  --ink: #f2f7ff;
  --muted: #a8b0bf;
  --button: #2a2f39;
  --button-hover: #353b47;
  --glass: rgba(7, 11, 24, 0.78);
  --line: rgba(135, 145, 162, 0.24);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background: #050505;
  min-height: 100vh;
  overflow: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(rgba(165, 175, 192, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(165, 175, 192, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at 48% 45%, black 35%, transparent 98%);
}

.layout {
  width: min(980px, 92vw);
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.layout.app-mode {
  display: block;
  min-height: auto;
  padding: 1.2rem 0;
}

.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(1, 3, 10, 0.65);
  backdrop-filter: blur(12px);
}

.hidden {
  display: none !important;
}

.hero {
  padding: 2rem 2.1rem;
  margin-bottom: 1rem;
}

.auth {
  max-width: 520px;
  width: min(520px, 100%);
  margin: 0;
  padding: 2rem 2.1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth form button {
  display: block;
  margin: 0.6rem 0 0;
  width: 100%;
}

.auth form {
  display: grid;
  gap: 1rem;
  width: 100%;
}

#app-shell {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

#app-shell .hero {
  grid-column: span 2;
}

h1,
h2,
h3 {
  font-family: "Sora", sans-serif;
  margin: 0;
}

h1 {
  margin-top: 0.8rem;
  font-size: clamp(2.1rem, 4.2vw, 3.5rem);
  letter-spacing: -0.02em;
}

.hero-copy {
  max-width: 68ch;
  line-height: 1.6;
  color: var(--muted);
}

.stats {
  margin-top: 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.stats article {
  min-width: 150px;
  padding: 1.05rem;
  background: linear-gradient(160deg, rgba(16, 23, 45, 0.95), rgba(8, 13, 28, 0.95));
  border: 1px solid var(--line);
  border-radius: 14px;
}

.panel {
  margin-bottom: 1rem;
  padding: 1.5rem;
}

.panel p {
  margin-top: 0.4rem;
  margin-bottom: 1rem;
  color: var(--muted);
}

.upload-subtitle {
  margin-top: 0.4rem;
}

label {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 0.8rem;
}

input {
  width: 100%;
  margin-top: 0.35rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(3, 8, 20, 0.9);
  color: var(--ink);
  padding: 0.75rem;
  font: inherit;
  outline: none;
}

input:focus {
  border-color: rgba(135, 145, 162, 0.85);
  box-shadow: 0 0 0 3px rgba(135, 145, 162, 0.18);
}

input::placeholder {
  color: #7d92b2;
}

.upload-form {
  display: grid;
  gap: 0.8rem;
}

.upload-area {
  display: grid;
  place-items: center;
  gap: 0.45rem;
  min-height: 170px;
  width: 100%;
  padding: 1.1rem;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: rgba(6, 12, 24, 0.65);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
  margin-bottom: 0.2rem;
}

.upload-area:hover {
  border-color: rgba(175, 185, 204, 0.55);
  background: rgba(10, 16, 30, 0.72);
}

.upload-area:focus-within {
  border-color: rgba(175, 185, 204, 0.75);
  box-shadow: 0 0 0 3px rgba(135, 145, 162, 0.16);
}

.upload-icon {
  width: 64px;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #d2d9e6;
  background: rgba(12, 18, 32, 0.92);
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.file-name {
  color: #d2d9e6;
  font-size: 0.96rem;
  font-weight: 600;
  overflow-wrap: anywhere;
  text-align: center;
}

button {
  background: var(--button);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.7rem 1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  transform: translateY(-1px);
  background: var(--button-hover);
}

.ghost {
  background: rgba(9, 15, 33, 0.9);
  color: var(--ink);
  border: 1px solid var(--line);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.panel-head .actions {
  display: flex;
  gap: 0.5rem;
}

.breadcrumb h2 {
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}

.breadcrumb span {
  color: var(--muted);
  font-weight: 500;
}

.status {
  min-height: 1.2rem;
  font-size: 0.9rem;
}

.asset-list {
  display: grid;
  gap: 0.7rem;
}

.asset-row {
  padding: 0.8rem;
  background: linear-gradient(150deg, rgba(10, 17, 33, 0.92), rgba(7, 12, 24, 0.92));
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.asset-meta {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.asset-name {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.asset-meta small {
  color: var(--muted);
}

.asset-actions {
  display: flex;
  gap: 0.5rem;
}

.asset-actions button {
  font-size: 0.85rem;
  padding: 0.45rem 0.7rem;
  border-radius: 9px;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  animation: rise 600ms ease forwards;
}

.delay-1 {
  animation-delay: 140ms;
}

.delay-2 {
  animation-delay: 240ms;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  #app-shell {
    grid-template-columns: 1fr;
  }

  #app-shell .hero {
    grid-column: span 1;
  }

  .layout {
    padding: 1rem;
  }

  .auth {
    margin-top: 0;
  }
}
