:root {
  --bg: #f3efe6;
  --panel: rgba(255, 252, 247, 0.88);
  --panel-strong: #fffaf2;
  --ink: #181512;
  --muted: #675f56;
  --line: rgba(24, 21, 18, 0.12);
  --accent: #bf4f2d;
  --accent-deep: #8d381f;
  --shadow: 0 24px 80px rgba(58, 39, 25, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --space-1: 0.4rem;
  --space-2: 0.75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --space-6: 3rem;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(191, 79, 45, 0.18), transparent 24%),
    radial-gradient(circle at right 20%, rgba(45, 96, 118, 0.16), transparent 26%),
    linear-gradient(180deg, #efe6d8 0%, var(--bg) 42%, #ebe4d6 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(24, 21, 18, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 21, 18, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 90%);
}

.shell {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 64px;
}

.hero {
  max-width: 760px;
  padding: 0 0 var(--space-6);
}

.eyebrow,
.label {
  margin: 0 0 var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
  color: var(--muted);
}

.hero h1,
.panel-head h2 {
  margin: 0;
  font-family: "Source Serif 4", serif;
  letter-spacing: -0.03em;
  line-height: 0.94;
}

.hero h1 {
  font-size: clamp(2.8rem, 6vw, 5.8rem);
  max-width: 10.5ch;
}

.intro {
  max-width: 62ch;
  margin: var(--space-4) 0 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.panel {
  background: var(--panel);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  padding: 24px 24px 0;
}

.panel-head h2 {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
}

.upload-form {
  padding: 24px;
}

.dropzone {
  display: grid;
  gap: var(--space-2);
  padding: 28px;
  border: 1.5px dashed rgba(24, 21, 18, 0.22);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 250, 242, 0.72)),
    var(--panel-strong);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.dropzone:hover,
.dropzone.is-dragover {
  transform: translateY(-2px);
  border-color: rgba(191, 79, 45, 0.55);
}

.dropzone:focus-within {
  outline: 3px solid rgba(191, 79, 45, 0.2);
  outline-offset: 4px;
}

.dropzone input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.dropzone-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.dropzone-copy,
.status,
.file-info {
  color: var(--muted);
  line-height: 1.5;
}

.pending {
  margin-top: 18px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 250, 242, 0.9);
  border: 1px solid var(--line);
}

.pending-head,
.actions,
.link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.actions {
  margin-top: 18px;
  justify-content: flex-start;
}

.primary-button,
.ghost-button,
.copy-button {
  border: 0;
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
  transition: transform 150ms ease, background-color 150ms ease, opacity 150ms ease;
}

.primary-button {
  padding: 0.9rem 1.4rem;
  background: var(--accent);
  color: #fff9f4;
  font-weight: 700;
}

.primary-button:hover,
.copy-button:hover {
  transform: translateY(-1px);
  background: var(--accent-deep);
}

.primary-button:disabled {
  opacity: 0.5;
  cursor: progress;
}

.ghost-button {
  padding: 0.55rem 0.95rem;
  background: transparent;
  color: var(--muted);
}

.ghost-button:hover {
  color: var(--ink);
}

.panel-library {
  min-height: 420px;
}

.empty-state {
  padding: 24px;
  color: var(--muted);
}

.gallery {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.card {
  display: grid;
  grid-template-columns: minmax(150px, 240px) minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 249, 0.9);
  border: 1px solid var(--line);
  transform: translateY(8px);
  opacity: 0;
  animation: rise 260ms ease forwards;
}

.media-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 16px;
  background: rgba(24, 21, 18, 0.06);
}

.media-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 16px;
  background: rgba(24, 21, 18, 0.12);
}

.audio-badge {
  display: grid;
  place-items: center;
  min-height: 156px;
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(191, 79, 45, 0.9), rgba(45, 96, 118, 0.88));
  color: white;
  font-family: "Source Serif 4", serif;
  font-size: 1.8rem;
  letter-spacing: -0.03em;
}

.card-meta {
  display: grid;
  gap: 10px;
  align-content: start;
}

.file-name {
  margin: 0;
  font-weight: 700;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.media-audio {
  width: 100%;
}

.link-input {
  flex: 1;
  min-width: 0;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--ink);
  font: inherit;
}

.copy-button {
  padding: 0.8rem 1rem;
  background: var(--accent);
  color: white;
  white-space: nowrap;
}

.pending-media {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: 14px;
  display: block;
  background: rgba(24, 21, 18, 0.08);
}

.pending-audio {
  width: 100%;
}

.pending-video {
  width: 100%;
  max-height: 260px;
  border-radius: 14px;
  background: rgba(24, 21, 18, 0.12);
}

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

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

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

  .hero h1 {
    max-width: 12ch;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 1160px);
    padding-top: 28px;
  }

  .panel-head,
  .upload-form,
  .gallery,
  .empty-state {
    padding-left: 18px;
    padding-right: 18px;
  }

  .card {
    grid-template-columns: 1fr;
  }

  .actions,
  .link-row {
    flex-direction: column;
    align-items: stretch;
  }
}
