:root {
  color-scheme: light;
  --bg: #f6efe4;
  --ink: #1b1b16;
  --ink-soft: #5c564c;
  --accent: #ff6b35;
  --accent-2: #1b9aaa;
  --card: #fff8f0;
  --border: #e3d9c8;
  --shadow: 0 24px 60px rgba(27, 27, 22, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background: linear-gradient(150deg, #f7f1e6 0%, #f3dcc7 40%, #fef7ed 100%);
  color: var(--ink);
  min-height: 100vh;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  z-index: -1;
  opacity: 0.25;
  filter: blur(0.5px);
}

body::before {
  top: -180px;
  right: -120px;
  background: radial-gradient(circle, #ffb086, transparent 70%);
}

body::after {
  bottom: -200px;
  left: -160px;
  background: radial-gradient(circle, #7bdff2, transparent 70%);
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

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

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

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--ink);
  color: #fffaf3;
  font-weight: 700;
  letter-spacing: 1px;
}

.brand-title {
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: 1.4rem;
  margin: 0;
}

.brand-sub {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-select {
  padding-right: 36px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%),
    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 2px),
    calc(100% - 13px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 32px;
  margin-top: 48px;
  align-items: stretch;
}

.hero-text h1 {
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: clamp(2.4rem, 3vw, 3.4rem);
  margin: 8px 0 16px;
}

.kicker {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--accent-2);
  font-weight: 700;
}

.lede {
  color: var(--ink-soft);
  max-width: 520px;
  line-height: 1.6;
}

.extract-form {
  display: flex;
  gap: 16px;
  margin: 24px 0 16px;
  flex-wrap: wrap;
}

.input-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 320px;
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 12px 16px 14px;
  box-shadow: var(--shadow);
}

.input-card span {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-soft);
}

.input-card input {
  border: none;
  background: transparent;
  font-size: 1rem;
  outline: none;
  color: var(--ink);
}

.primary {
  background: var(--accent);
  color: #fffaf3;
  border: none;
  padding: 14px 24px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  align-self: flex-end;
  box-shadow: 0 14px 24px rgba(255, 107, 53, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(255, 107, 53, 0.3);
}

.ghost {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
}

.chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chip {
  border: 1px dashed var(--accent-2);
  background: rgba(27, 154, 170, 0.08);
  color: var(--accent-2);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.note {
  margin-top: 16px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.mono {
  font-family: "Courier New", monospace;
}

.hero-card {
  background: var(--card);
  border-radius: 24px;
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.status {
  font-size: 1rem;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(27, 27, 22, 0.05);
}

.status.loading {
  background: rgba(27, 154, 170, 0.12);
  color: var(--accent-2);
}

.status.error {
  background: rgba(255, 107, 53, 0.12);
  color: #b23a1c;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  text-align: center;
}

.stat-label {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.stat-value {
  margin: 4px 0 0;
  font-size: 1.4rem;
  font-weight: 700;
}

.meta {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.results {
  margin-top: 56px;
  animation: fadeUp 0.7s ease;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.panel {
  background: rgba(255, 248, 240, 0.8);
  border-radius: 20px;
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.panel-grid {
  display: grid;
  gap: 16px;
}

.asset {
  background: #fffaf3;
  border-radius: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  display: grid;
  gap: 10px;
}

.asset-media {
  width: 100%;
  border-radius: 12px;
  background: #f1e7d8;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.asset-title {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
}

.asset-meta {
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.asset-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.asset-actions button,
.asset-actions a {
  flex: 1 1 auto;
  text-align: center;
  font-size: 0.85rem;
}

.text-block {
  background: #fffaf3;
  border-radius: 16px;
  padding: 14px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
  line-height: 1.5;
}

.how {
  margin-top: 72px;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.how article {
  background: #fffaf3;
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--border);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .top {
    flex-direction: column;
    align-items: flex-start;
  }

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

@media (max-width: 600px) {
  .extract-form {
    flex-direction: column;
    align-items: stretch;
  }

  .primary {
    width: 100%;
  }

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