:root {
  color-scheme: light;
  --bg: #f7f7f2;
  --ink: #171717;
  --muted: #66675f;
  --panel: #ffffff;
  --line: #dcd9cf;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-soft: #d7f4ef;
  --rose: #b4235f;
  --shadow: 0 24px 80px rgba(23, 23, 23, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(180, 35, 95, 0.1), transparent 30%),
    var(--bg);
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
  gap: 32px;
  align-items: end;
  min-height: 430px;
}

.hero-copy {
  padding-bottom: 18px;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.7rem, 7vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.lede {
  max-width: 620px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.7;
}

.download-form {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.download-form label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.9rem;
  font-weight: 800;
}

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

input {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.15);
}

button,
.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    opacity 160ms ease;
}

button:hover,
.download-link:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.button-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.helper {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.status-panel {
  margin-top: 30px;
}

.status {
  border-left: 4px solid var(--accent);
  padding: 14px 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
}

.status.error {
  border-left-color: var(--rose);
  color: #7b1d42;
}

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

.result-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(23, 23, 23, 0.08);
}

.image-frame {
  aspect-ratio: 1 / 1;
  background: #ededde;
}

.image-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.link-card {
  max-width: 760px;
}

.card-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.card-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
}

.meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.card-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

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

.secondary-link {
  border: 1px solid var(--line);
  color: var(--accent-strong);
  background: #fff;
}

.secondary-link:hover {
  color: #fff;
  background: var(--accent-strong);
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 24px, 620px);
    padding: 32px 0;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  h1 {
    font-size: clamp(2.55rem, 15vw, 4.25rem);
  }

  .download-form {
    padding: 18px;
  }

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

  button,
  .download-link {
    width: 100%;
  }
}
