:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-muted: #f1f5f9;
  --text: #0f172a;
  --muted: #475569;
  --line: #dbe3ef;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success-bg: #dcfce7;
  --success-text: #166534;
  --warning-bg: #fef3c7;
  --warning-text: #92400e;
  --error-bg: #fee2e2;
  --error-text: #991b1b;
  --shadow: 0 18px 45px rgb(15 23 42 / 0.10);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #e0ecff 0, transparent 34rem), var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: inherit;
}

code {
  padding: 0.15rem 0.35rem;
  border-radius: 0.4rem;
  background: var(--surface-muted);
  color: #1e293b;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 10;
  transform: translateY(-200%);
  background: var(--text);
  color: #fff;
  padding: 0.65rem 0.9rem;
  border-radius: 0.7rem;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(16px);
  background: rgb(248 250 252 / 0.82);
  border-bottom: 1px solid rgb(219 227 239 / 0.72);
}

.nav {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
}

.brand,
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand {
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.brand-icon {
  display: inline-grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.9rem;
  background: var(--text);
  color: #fff;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 650;
}

.nav-links a:hover {
  color: var(--text);
}

main {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 2rem;
  align-items: center;
  padding: 6rem 0 4rem;
}

.hero-content,
.privacy-card,
.panel,
.info-card,
.deploy-section {
  border: 1px solid rgb(219 227 239 / 0.92);
  background: rgb(255 255 255 / 0.88);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.hero-content {
  padding: clamp(2rem, 5vw, 4rem);
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--primary);
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.11em;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 1.25rem;
  font-size: clamp(2.7rem, 7vw, 5.2rem);
  line-height: 0.96;
  letter-spacing: -0.065em;
}

h2 {
  margin-bottom: 0.75rem;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

h3 {
  margin-bottom: 0.75rem;
  font-size: 1.3rem;
  letter-spacing: -0.025em;
}

.lede,
.section-heading p,
.info-card p,
.deploy-section p,
.file-message,
.metadata-report,
.file-meta {
  color: var(--muted);
}

.lede {
  max-width: 720px;
  font-size: 1.18rem;
}

.hero-actions,
.button-row,
.file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}

.hero-actions {
  margin-top: 2rem;
}

.button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.8rem;
  padding: 0.72rem 1.1rem;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.button-primary {
  background: var(--primary);
  color: #fff;
}

.button-primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

.button-secondary {
  background: #eaf1ff;
  color: #1d4ed8;
  border-color: #bfd2ff;
}

.button-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}

.button-small {
  min-height: 2.35rem;
  padding: 0.48rem 0.85rem;
  font-size: 0.9rem;
}

.privacy-card {
  padding: 1.5rem;
}

.privacy-card ul {
  padding-left: 1.2rem;
  margin: 0;
  color: var(--muted);
}

.privacy-card li + li {
  margin-top: 0.6rem;
}

.app-section,
.info-section,
.deploy-section {
  margin: 2rem 0 4rem;
}

.section-heading {
  max-width: 800px;
  margin-bottom: 1.4rem;
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.88fr) minmax(0, 1.12fr);
  gap: 1.3rem;
  align-items: start;
}

.panel {
  padding: clamp(1.1rem, 3vw, 1.6rem);
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 250px;
  padding: 1.6rem;
  border: 2px dashed #adc2df;
  border-radius: 1.25rem;
  background: linear-gradient(180deg, #f8fbff, #eef5ff);
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragover,
.drop-zone:focus-visible {
  outline: none;
  border-color: var(--primary);
  background: #eaf1ff;
  transform: translateY(-1px);
}

.upload-icon {
  color: var(--primary);
  margin-bottom: 0.4rem;
}

.drop-title {
  margin: 0;
  font-weight: 850;
  font-size: 1.2rem;
}

.drop-copy {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.settings {
  display: grid;
  gap: 1rem;
  margin: 1.25rem 0;
}

.field label {
  display: block;
  margin-bottom: 0.35rem;
  color: #334155;
  font-weight: 750;
  font-size: 0.94rem;
}

.field select,
.field input[type="text"] {
  width: 100%;
  min-height: 2.65rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: var(--surface);
  color: var(--text);
  padding: 0 0.75rem;
  font: inherit;
}

.field input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

.results-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.results-header h3,
.results-header p {
  margin-bottom: 0.25rem;
}

.file-list {
  display: grid;
  gap: 0.9rem;
}

.empty-state {
  padding: 2rem;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 1rem;
  color: var(--muted);
  background: var(--surface-muted);
}

.file-item {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 1rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: var(--surface);
}

.thumb-wrap {
  overflow: hidden;
  min-height: 104px;
  border-radius: 0.9rem;
  background: var(--surface-muted);
}

.thumb {
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.file-title-row {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  justify-content: space-between;
}

.file-name {
  margin-bottom: 0.2rem;
  overflow-wrap: anywhere;
  font-size: 1rem;
}

.file-meta,
.metadata-report,
.file-message {
  margin-bottom: 0.35rem;
  font-size: 0.93rem;
}

.status-pill {
  flex: 0 0 auto;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 850;
  background: var(--surface-muted);
  color: var(--muted);
}

.status-ready {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.status-working {
  background: #dbeafe;
  color: #1e40af;
}

.status-done {
  background: var(--success-bg);
  color: var(--success-text);
}

.status-error {
  background: var(--error-bg);
  color: var(--error-text);
}

.progress {
  width: 100%;
  margin: 0.4rem 0;
}

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

.info-card,
.deploy-section {
  padding: 1.35rem;
}

.site-footer {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
  color: var(--muted);
}

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

  .nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 0.9rem 0;
  }
}

@media (max-width: 620px) {
  main,
  .nav,
  .site-footer {
    width: min(100% - 1rem, 1180px);
  }

  .hero {
    padding: 2rem 0 3rem;
  }

  .file-item {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .thumb-wrap {
    min-height: 78px;
  }

  .nav-links {
    flex-wrap: wrap;
  }
}

.field-help {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.note {
  max-width: 900px;
  margin: 1rem 0 0;
  padding: 1rem 1.2rem;
  border: 1px solid #fde68a;
  border-radius: 1rem;
  background: #fffbeb;
  color: #78350f;
}

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

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