:root {
  color-scheme: light;
  --bg: #f7f1e6;
  --bg-alt: #e8f2ee;
  --card: #fff9f0;
  --surface: #ffffff;
  --surface-muted: rgba(255, 255, 255, 0.8);
  --ink: #1d1a16;
  --muted: #5b554b;
  --accent: #0f766e;
  --accent-strong: #0b5c55;
  --accent-warm: #f97316;
  --accent-gold: #eab308;
  --accent-soft: rgba(15, 118, 110, 0.08);
  --accent-soft-strong: rgba(15, 118, 110, 0.12);
  --accent-border: rgba(15, 118, 110, 0.4);
  --accent-focus: rgba(15, 118, 110, 0.45);
  --accent-focus-ring: rgba(15, 118, 110, 0.25);
  --accent-shadow: 0 10px 20px rgba(15, 118, 110, 0.22);
  --accent-shadow-strong: 0 12px 26px rgba(15, 118, 110, 0.3);
  --accent-shadow-table: 0 12px 26px rgba(15, 118, 110, 0.18);
  --stroke-subtle: rgba(29, 26, 22, 0.08);
  --stroke: rgba(29, 26, 22, 0.15);
  --stroke-strong: rgba(29, 26, 22, 0.25);
  --surface-soft: rgba(29, 26, 22, 0.06);
  --grid: rgba(29, 26, 22, 0.05);
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 12px 22px rgba(15, 23, 42, 0.08);
  --shadow-table: 0 8px 20px rgba(15, 23, 42, 0.08);
  --btn-ghost-shadow: 0 10px 18px rgba(29, 26, 22, 0.12);
  --glow-1: rgba(15, 118, 110, 0.12);
  --glow-2: rgba(249, 115, 22, 0.18);
  --orb-one: rgba(15, 118, 110, 0.25);
  --orb-two: rgba(234, 179, 8, 0.28);
  --orb-three: rgba(249, 115, 22, 0.22);
  --radius: 18px;
  --mono: "IBM Plex Mono", monospace;
  --sans: "IBM Plex Sans", sans-serif;
  --serif: "Fraunces", serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1017;
  --bg-alt: #111822;
  --card: #121a25;
  --surface: #0f141b;
  --surface-muted: rgba(15, 20, 27, 0.85);
  --ink: #e6edf3;
  --muted: #9aa4b2;
  --accent: #2dd4bf;
  --accent-strong: #5eead4;
  --accent-warm: #fb923c;
  --accent-gold: #facc15;
  --accent-soft: rgba(45, 212, 191, 0.14);
  --accent-soft-strong: rgba(45, 212, 191, 0.2);
  --accent-border: rgba(94, 234, 212, 0.5);
  --accent-focus: rgba(45, 212, 191, 0.6);
  --accent-focus-ring: rgba(45, 212, 191, 0.3);
  --accent-shadow: 0 10px 24px rgba(45, 212, 191, 0.22);
  --accent-shadow-strong: 0 14px 30px rgba(45, 212, 191, 0.3);
  --accent-shadow-table: 0 14px 28px rgba(45, 212, 191, 0.25);
  --stroke-subtle: rgba(226, 232, 240, 0.12);
  --stroke: rgba(226, 232, 240, 0.22);
  --stroke-strong: rgba(226, 232, 240, 0.32);
  --surface-soft: rgba(226, 232, 240, 0.08);
  --grid: rgba(226, 232, 240, 0.08);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 12px 26px rgba(0, 0, 0, 0.35);
  --shadow-table: 0 10px 24px rgba(0, 0, 0, 0.35);
  --btn-ghost-shadow: 0 12px 20px rgba(0, 0, 0, 0.35);
  --glow-1: rgba(45, 212, 191, 0.18);
  --glow-2: rgba(251, 146, 60, 0.2);
  --orb-one: rgba(45, 212, 191, 0.35);
  --orb-two: rgba(250, 204, 21, 0.3);
  --orb-three: rgba(251, 146, 60, 0.3);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(circle at top right, var(--glow-1), transparent 45%),
    radial-gradient(circle at 15% 20%, var(--glow-2), transparent 45%),
    linear-gradient(140deg, var(--bg), var(--bg-alt));
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 120px 120px;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  opacity: 0.6;
  z-index: 0;
  animation: float 12s ease-in-out infinite;
}

.theme-toggle {
  position: fixed;
  top: 22px;
  right: 22px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--card);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  z-index: 10;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.theme-toggle .icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}

.theme-toggle .icon-moon {
  display: none;
  fill: currentColor;
  stroke: none;
}

html[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

.orb-one {
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, var(--orb-one), transparent 70%);
  top: 6%;
  left: 4%;
}

.orb-two {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, var(--orb-two), transparent 70%);
  bottom: 10%;
  right: 8%;
  animation-delay: -3s;
}

.orb-three {
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, var(--orb-three), transparent 70%);
  bottom: 40%;
  left: 48%;
  animation-delay: -6s;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 64px;
}

.hero {
  text-align: left;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--stroke-subtle);
}

.eyebrow {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 12px;
  color: var(--accent-strong);
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 4vw, 4.4rem);
  margin: 12px 0 16px;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 680px;
}

.hero-actions {
  margin-top: 22px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-note {
  margin-top: 18px;
  padding: 12px 16px;
  background: var(--accent-soft);
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.95rem;
  color: var(--accent-strong);
}

.grid {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--stroke-subtle);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: rise 0.7s ease-out both;
  animation-delay: var(--delay, 0s);
}

.card-wide {
  grid-column: 1 / -1;
}

.card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.card-header h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.7rem;
}

.card-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.badge {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft-strong);
  color: var(--accent-strong);
  font-weight: 600;
  white-space: nowrap;
}

.badge-outline {
  background: transparent;
  border: 1px solid var(--accent-border);
}

.badge-soft {
  background: rgba(249, 115, 22, 0.12);
  color: #c2410c;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.95rem;
}

.field span {
  font-weight: 600;
  color: var(--muted);
}

.field-note {
  font-size: 0.85rem;
  color: var(--accent-strong);
}

.fine-print {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

input,
select {
  font-family: var(--sans);
  font-size: 0.95rem;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  color: var(--ink);
}

input:focus,
select:focus {
  outline: 2px solid var(--accent-focus-ring);
  border-color: var(--accent-focus);
}

.input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--stroke);
  padding: 0 10px 0 12px;
  width: 100%;
}

.input-wrap input {
  border: none;
  padding: 10px 0;
  width: 100%;
  background: transparent;
}

.prefix {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.9rem;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--muted);
}

.toggle-row input {
  width: 18px;
  height: 18px;
}

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

.upload-zone {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 14px;
  border: 1px dashed var(--stroke-strong);
  background: var(--surface-muted);
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.upload-zone:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-soft);
}

.upload-zone.is-dragover {
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

.upload-title {
  font-weight: 600;
}

.upload-meta {
  font-size: 0.9rem;
  color: var(--accent-strong);
}

.upload-hint {
  font-size: 0.8rem;
  color: var(--muted);
}

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

.upload-actions {
  display: flex;
  justify-content: flex-end;
}

.status {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-soft);
  font-size: 0.9rem;
  color: var(--muted);
}

.status-title {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--ink);
}

.status-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.strategy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.radio-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  cursor: pointer;
  font-weight: 600;
  justify-content: center;
}

.radio-pill input {
  accent-color: var(--accent);
}

.btn {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--accent-shadow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--accent-shadow-strong);
}

.btn-ghost {
  background: transparent;
  border-color: var(--stroke);
  color: var(--ink);
}

.btn-ghost:hover {
  transform: translateY(-1px);
  box-shadow: var(--btn-ghost-shadow);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.metric {
  background: var(--accent-soft);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.metric:nth-child(2) {
  background: rgba(249, 115, 22, 0.1);
}

.metric:nth-child(3) {
  background: rgba(234, 179, 8, 0.12);
}

.metric:nth-child(4) {
  background: rgba(29, 78, 216, 0.08);
}

.metric:nth-child(5) {
  background: rgba(79, 70, 229, 0.1);
}

.metric-value {
  font-size: 1.4rem;
  font-family: var(--mono);
}

.metric-label {
  font-weight: 600;
}

.metric-hint {
  font-size: 0.85rem;
  color: var(--muted);
}

.callout {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-soft);
  font-size: 0.95rem;
  color: var(--muted);
}

.table-scroll {
  overflow-x: auto;
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 10px;
  min-width: 760px;
}

thead th {
  text-align: left;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 8px;
}

tbody tr {
  background: var(--surface);
  box-shadow: var(--shadow-table);
}

tbody tr.best {
  border: 1px solid var(--accent-border);
  box-shadow: var(--accent-shadow-table);
}

tbody td {
  padding: 8px 10px;
}

tbody td:first-child {
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
}

tbody td:last-child {
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
}

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

.footer {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer a {
  color: var(--accent-strong);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.footer-meta {
  max-width: 560px;
}

.is-hidden {
  display: none;
}

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

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-14px);
  }
}

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

  .card-wide {
    grid-column: auto;
  }

  .form-grid,
  .upload-grid,
  .strategy-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  table {
    min-width: 640px;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 36px 18px 56px;
  }

  .theme-toggle {
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
  }

  .card {
    padding: 20px;
  }

  .hero h1 {
    font-size: clamp(2.2rem, 9vw, 3rem);
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .hero-note {
    border-radius: 16px;
  }

  .asset-actions,
  .upload-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .asset-actions .btn,
  .upload-actions .btn {
    width: 100%;
    justify-content: center;
  }

  table {
    min-width: 520px;
  }

  .metric-value {
    font-size: 1.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
