:root {
  --bg: #f6f2ea;
  --bg-alt: #f1e5d5;
  --ink: #1c1c1c;
  --muted: #5a5a5a;
  --panel: #ffffff;
  --panel-strong: #fff7ed;
  --accent: #ff6b35;
  --accent-deep: #d94f1c;
  --accent-2: #1b998b;
  --line: rgba(20, 20, 20, 0.08);
  --shadow: 0 30px 60px rgba(16, 24, 32, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Archivo", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #ffe6d6, transparent 55%),
    radial-gradient(circle at 80% 10%, #d9f5ee, transparent 45%),
    linear-gradient(135deg, var(--bg), var(--bg-alt));
  min-height: 100vh;
  overflow-x: hidden;
}

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

.ambient-orb {
  position: absolute;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  z-index: 1;
}

.orb-one {
  background: #ffd7b5;
  top: -120px;
  right: 5%;
}

.orb-two {
  background: #bff0e6;
  bottom: -160px;
  left: 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 0.9fr);
  gap: 32px;
  align-items: stretch;
  margin-bottom: 40px;
  animation: rise 0.7s ease-out both;
}

.hero-copy h1 {
  font-size: clamp(2.3rem, 4vw, 3.4rem);
  margin: 12px 0 12px;
  letter-spacing: -0.02em;
}

.hero-copy p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

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

.hero-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.meta-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: "Archivo", sans-serif;
}

.meta-card span {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
}

.hero-panel {
  background: var(--panel);
  border-radius: 24px;
  padding: 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

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

.panel-title {
  font-weight: 600;
  font-size: 1rem;
}

.panel-subtitle {
  color: var(--muted);
  font-size: 0.9rem;
}

.preview-frame {
  position: relative;
  border-radius: 20px;
  background: linear-gradient(135deg, #fff, #fff6ed);
  border: 1px dashed rgba(20, 20, 20, 0.2);
  height: 260px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.preview-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(transparent 87%, rgba(0, 0, 0, 0.04) 88%),
    linear-gradient(90deg, transparent 87%, rgba(0, 0, 0, 0.04) 88%);
  background-size: 24px 24px;
  opacity: 0.5;
}

.preview-image {
  width: 160px;
  height: 160px;
  object-fit: contain;
  border-radius: 24px;
  box-shadow: 0 16px 32px rgba(12, 12, 12, 0.22);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 2;
}

.preview-image.is-visible {
  opacity: 1;
  transform: scale(1);
}

.preview-placeholder {
  color: var(--muted);
  z-index: 2;
  font-size: 0.95rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  gap: 24px;
  animation: rise 0.9s ease-out both;
  animation-delay: 0.1s;
}

.panel {
  background: var(--panel);
  border-radius: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.form-panel {
  display: grid;
  gap: 20px;
}

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

.field input,
.field textarea,
.field select {
  font-family: "Archivo", sans-serif;
  font-size: 0.95rem;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(255, 107, 53, 0.7);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}

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

.btn {
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-family: "Archivo", sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  box-shadow: 0 14px 24px rgba(255, 107, 53, 0.25);
}

.btn.secondary {
  background: var(--panel-strong);
  border: 1px solid rgba(255, 107, 53, 0.3);
  color: var(--accent-deep);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.btn.ready {
  background: linear-gradient(120deg, #ff6b35, #ffb703, #1b998b);
  color: #fff;
  border: none;
  box-shadow: 0 18px 34px rgba(255, 107, 53, 0.25);
  background-size: 200% 200%;
  animation: glowShift 2.4s ease infinite;
}

.btn.ready::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.35), transparent 60%);
  opacity: 0.6;
  mix-blend-mode: screen;
  pointer-events: none;
}

.btn.ready {
  position: relative;
  overflow: hidden;
}

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

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

.btn.disabled,
.btn[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

.status {
  font-size: 0.9rem;
  color: var(--muted);
  min-height: 20px;
}

.status.error {
  color: #c2410c;
}

.tip-card {
  background: var(--panel-strong);
  border-radius: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 107, 53, 0.2);
}

.tip-card ul {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.output-panel {
  display: grid;
  gap: 18px;
}

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

.icon-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
  gap: 10px;
}

.icon-cell {
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--line);
  height: 64px;
  display: grid;
  place-items: center;
  font-weight: 600;
  color: var(--muted);
}

.icon-cell img {
  width: 38px;
  height: 38px;
}

.snippet-card {
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--line);
  padding: 16px;
  display: grid;
  gap: 12px;
}

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

.snippet-card textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 12px;
  font-family: "Archivo", sans-serif;
  font-size: 0.9rem;
  background: #fdfaf7;
  resize: none;
  min-height: 140px;
}

#snippet {
  min-height: 180px;
}

.api-note {
  font-size: 0.85rem;
  color: var(--muted);
}

.legal-page {
  padding-bottom: 96px;
}

.legal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  animation: rise 0.6s ease-out both;
}

.legal-hero h1 {
  margin: 8px 0 12px;
  font-size: clamp(2rem, 3.5vw, 2.8rem);
}

.legal-hero p {
  color: var(--muted);
  margin: 0 0 18px;
  line-height: 1.6;
}

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

.legal-grid {
  display: grid;
  gap: 24px;
  margin-top: 24px;
  animation: rise 0.8s ease-out both;
}

.legal-card h2 {
  margin-top: 0;
  font-size: 1.4rem;
}

.legal-card h3 {
  margin: 18px 0 6px;
  font-size: 1.05rem;
}

.legal-card p {
  color: var(--muted);
  line-height: 1.65;
  margin: 0 0 12px;
}

.legal-list {
  margin: 0 0 12px;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 6px;
}

.site-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer-brand {
  font-weight: 600;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-link:hover {
  color: var(--ink);
}

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

@keyframes glowShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.processing-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.75), rgba(246, 242, 234, 0.94)),
    linear-gradient(145deg, rgba(255, 214, 185, 0.4), rgba(191, 240, 230, 0.4));
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 10;
}

.processing-overlay.is-active {
  opacity: 1;
  pointer-events: all;
}

.processing-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 28px 32px;
  box-shadow: 0 30px 70px rgba(16, 24, 32, 0.2);
  border: 1px solid rgba(255, 107, 53, 0.2);
  text-align: center;
  min-width: min(360px, 90vw);
}

.processing-title {
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.processing-subtitle {
  color: var(--muted);
  font-size: 0.95rem;
}

.processing-dots {
  margin-top: 16px;
  display: inline-flex;
  gap: 8px;
}

.processing-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  animation: bounce 1s infinite ease-in-out;
}

.processing-dots span:nth-child(2) {
  animation-delay: 0.15s;
  background: var(--accent-2);
}

.processing-dots span:nth-child(3) {
  animation-delay: 0.3s;
  background: var(--accent-deep);
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.6;
  }
  50% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

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

@media (max-width: 640px) {
  .page {
    padding: 32px 18px 48px;
  }
  .hero-meta {
    grid-template-columns: 1fr;
  }
  .output-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .legal-topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}
