:root {
  --bg: #f3efe6;
  --paper: rgba(255, 251, 245, 0.82);
  --ink: #182028;
  --muted: #5f6b78;
  --accent: #ff6a3d;
  --accent-deep: #d64f28;
  --line: rgba(24, 32, 40, 0.12);
  --shadow: 0 24px 80px rgba(34, 37, 41, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 106, 61, 0.18), transparent 30%),
    radial-gradient(circle at bottom right, rgba(21, 112, 239, 0.15), transparent 28%),
    linear-gradient(160deg, #f8f1e6 0%, #eef4f3 100%);
}

.page-shell {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

.hero {
  max-width: 700px;
  margin-bottom: 2rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.76rem;
  color: var(--accent-deep);
}

.hero h1 {
  margin: 0;
  font: 400 clamp(2.8rem, 5vw, 5.8rem) / 0.95 "Instrument Serif", serif;
}

.lede {
  max-width: 620px;
  margin: 1rem 0 0;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--muted);
}

.app-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 28px;
  background: var(--paper);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.qr-form,
.preview-panel {
  padding: 1.5rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
}

.qr-form {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field span,
.preview-label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.field input,
.field select {
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  font: inherit;
  color: var(--ink);
  background: white;
}

.field input:focus,
.field select:focus,
.primary-button:focus,
.ghost-button:focus,
.text-button:focus,
.download-link:focus {
  outline: 3px solid rgba(255, 106, 61, 0.22);
  outline-offset: 2px;
}

.actions,
.secondary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.primary-button,
.ghost-button,
.text-button,
.download-link {
  font: inherit;
  border-radius: 999px;
  transition:
    transform 160ms ease,
    background 160ms ease,
    color 160ms ease,
    border-color 160ms ease;
}

.primary-button,
.ghost-button,
.text-button {
  cursor: pointer;
}

.primary-button {
  border: none;
  padding: 0.9rem 1.3rem;
  color: white;
  background: linear-gradient(135deg, var(--accent) 0%, #ff8858 100%);
}

.primary-button:hover,
.ghost-button:hover,
.text-button:hover,
.download-link:hover {
  transform: translateY(-1px);
}

.ghost-button {
  padding: 0.9rem 1.3rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

.preview-panel {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.dial-link {
  margin: 0.35rem 0 0.4rem;
  font-size: clamp(1rem, 2vw, 1.35rem);
  font-weight: 700;
  word-break: break-word;
}

.status-message {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.qr-frame {
  display: grid;
  place-items: center;
  min-height: 360px;
  padding: 1.5rem;
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(244, 237, 231, 0.95));
  border: 1px dashed rgba(24, 32, 40, 0.16);
}

#qr-image {
  width: min(100%, 320px);
  height: auto;
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.12);
}

.qr-placeholder {
  display: grid;
  place-items: center;
  width: min(100%, 320px);
  aspect-ratio: 1 / 1;
  padding: 1rem;
  text-align: center;
  border-radius: 18px;
  color: var(--muted);
  background:
    linear-gradient(135deg, rgba(255, 106, 61, 0.08), rgba(21, 112, 239, 0.08));
}

.download-link,
.text-button {
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  text-decoration: none;
}

.disabled {
  opacity: 0.5;
  pointer-events: none;
}

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

  .hero h1 {
    line-height: 1.02;
  }

  .qr-frame {
    min-height: 280px;
  }
}
