:root {
  --bg: #fbf5ef;
  --bg-deep: #1f1711;
  --panel: rgba(255, 252, 248, 0.84);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --line: rgba(43, 29, 16, 0.09);
  --text: #22170f;
  --muted: #7b6759;
  --accent: #ff8f3f;
  --accent-strong: #ff5b2e;
  --accent-soft: #fff2e7;
  --success: #21775d;
  --shadow: 0 24px 80px rgba(76, 47, 21, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 143, 63, 0.15), transparent 34%),
    radial-gradient(circle at bottom right, rgba(255, 91, 46, 0.16), transparent 28%),
    linear-gradient(180deg, #fff9f4 0%, var(--bg) 100%);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

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

.page-shell {
  position: relative;
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.ambient {
  position: fixed;
  border-radius: 999px;
  filter: blur(70px);
  opacity: 0.34;
  pointer-events: none;
}

.ambient-a {
  top: 48px;
  right: 10vw;
  width: 260px;
  height: 260px;
  background: rgba(255, 166, 102, 0.5);
}

.ambient-b {
  bottom: 12vh;
  left: 7vw;
  width: 220px;
  height: 220px;
  background: rgba(255, 91, 46, 0.18);
}

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

.hero {
  display: grid;
  grid-template-columns: 1.35fr 0.8fr;
  gap: 24px;
  padding: 32px;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 auto;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle at center, rgba(255, 91, 46, 0.2), transparent 62%);
  pointer-events: none;
}

.eyebrow,
.section-kicker,
.mini-label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-strong);
  margin: 0 0 10px;
}

h1,
h2 {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  line-height: 0.98;
}

h1 {
  font-size: clamp(3rem, 8vw, 5.4rem);
}

h2 {
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.hero-tagline {
  margin: 16px 0 10px;
  font-size: clamp(1rem, 2.1vw, 1.32rem);
  font-weight: 600;
  max-width: 54ch;
}

.hero-description {
  margin: 0;
  max-width: 56ch;
  color: var(--muted);
  line-height: 1.65;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.chip,
.result-kind {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(43, 29, 16, 0.07);
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-note {
  display: grid;
  gap: 16px;
  align-content: end;
}

.mini-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 245, 234, 0.82));
  border: 1px solid rgba(43, 29, 16, 0.08);
}

.mini-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 20px;
  margin-top: 20px;
}

.uploader,
.result-panel,
.gallery-section {
  padding: 28px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 330px;
  text-align: center;
  padding: 30px;
  border-radius: calc(var(--radius-xl) - 6px);
  border: 1.6px dashed rgba(255, 91, 46, 0.38);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 244, 231, 0.92));
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  cursor: pointer;
}

.dropzone:hover,
.dropzone.dragover {
  transform: translateY(-2px);
  border-color: var(--accent-strong);
  box-shadow: 0 18px 44px rgba(255, 143, 63, 0.16);
}

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

.dropzone-icon {
  width: 94px;
  height: 94px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: 0 18px 40px rgba(255, 91, 46, 0.24);
}

.dropzone-icon svg {
  width: 42px;
  height: 42px;
  fill: white;
}

.dropzone strong {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  font-size: 1.3rem;
}

.dropzone span,
.gallery-status,
.result-meta,
.meta-label,
.empty-state,
.health-indicator {
  color: var(--muted);
}

kbd {
  font: inherit;
  font-size: 0.86rem;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(34, 23, 15, 0.06);
  border: 1px solid rgba(34, 23, 15, 0.12);
}

.upload-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
}

.meta-label {
  display: block;
  font-size: 0.86rem;
  margin-bottom: 6px;
}

.secondary-button,
.copy-button,
.ghost-link {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
  text-decoration: none;
}

.secondary-button {
  background: rgba(34, 23, 15, 0.06);
  color: var(--text);
}

.secondary-button:hover,
.copy-button:hover,
.ghost-link:hover {
  transform: translateY(-1px);
}

.health-indicator {
  align-self: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(34, 23, 15, 0.05);
  font-size: 0.88rem;
}

.health-indicator.ok {
  color: var(--success);
  background: rgba(33, 119, 93, 0.1);
}

.health-indicator.bad {
  color: #9a412a;
  background: rgba(255, 91, 46, 0.11);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 320px;
  padding: 30px;
  border-radius: calc(var(--radius-xl) - 8px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 248, 242, 0.88));
  border: 1px dashed rgba(43, 29, 16, 0.12);
  text-align: center;
  line-height: 1.7;
}

.hidden {
  display: none !important;
}

.result-card {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 22px;
}

.result-preview-wrap {
  padding: 14px;
  border-radius: calc(var(--radius-xl) - 8px);
  background: linear-gradient(180deg, rgba(255, 249, 243, 0.95), rgba(255, 255, 255, 0.86));
  border: 1px solid rgba(43, 29, 16, 0.07);
  min-height: 320px;
}

.result-preview-host,
.gallery-media-frame {
  width: 100%;
  height: 100%;
  min-height: 292px;
  display: grid;
  place-items: center;
  border-radius: calc(var(--radius-lg) - 4px);
  background: rgba(34, 23, 15, 0.04);
  overflow: hidden;
}

.gallery-media-frame {
  min-height: auto;
  aspect-ratio: 16 / 11;
  border-radius: 0;
}

.result-media,
.gallery-media {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: rgba(34, 23, 15, 0.04);
}

.result-media.video {
  max-height: 420px;
  object-fit: contain;
  background: #140f0a;
}

.gallery-media.video {
  object-fit: cover;
  background: #140f0a;
}

.result-info {
  display: grid;
  gap: 16px;
}

.result-topline {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.result-name,
.gallery-name {
  margin: 0;
  font-weight: 700;
  word-break: break-word;
}

.result-meta,
.gallery-meta {
  margin: 6px 0 0;
  font-size: 0.92rem;
}

.ghost-link {
  color: var(--accent-strong);
  background: rgba(255, 91, 46, 0.09);
}

.snippet-group {
  display: grid;
  gap: 8px;
}

.snippet-group label {
  font-size: 0.9rem;
  font-weight: 600;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.copy-row input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(43, 29, 16, 0.1);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

.copy-button {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: white;
  min-width: 88px;
}

.small-copy {
  padding: 8px 12px;
  min-width: auto;
}

.gallery-status {
  margin-bottom: 18px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.gallery-card {
  overflow: hidden;
  border-radius: calc(var(--radius-lg) + 2px);
  background: var(--panel-strong);
  border: 1px solid rgba(43, 29, 16, 0.08);
  box-shadow: 0 18px 44px rgba(41, 26, 14, 0.08);
  animation: float-up 360ms ease both;
}

.gallery-image-link {
  display: block;
  background: rgba(34, 23, 15, 0.05);
}

.gallery-copy {
  padding: 14px;
}

.gallery-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 16px);
  background: rgba(31, 23, 17, 0.92);
  color: white;
  padding: 12px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: reveal-in 640ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

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

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

.delay-3 {
  animation-delay: 250ms;
}

@keyframes reveal-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

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

@media (max-width: 1000px) {
  .hero,
  .main-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100vw - 20px, 100%);
    padding: 14px 0 36px;
  }

  .hero,
  .uploader,
  .result-panel,
  .gallery-section {
    padding: 20px;
  }

  .dropzone {
    min-height: 260px;
  }

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

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

  .upload-meta,
  .section-head,
  .gallery-bottom,
  .result-topline,
  .result-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .copy-row {
    grid-template-columns: 1fr;
  }
}
