:root {
  --bg: #f6f3ee;
  --card: #ffffff;
  --text: #171717;
  --muted: #68645f;
  --primary: #171717;
  --primary-soft: #ece7dd;
  --border: #ded7ca;
  --success: #167a3b;
  --danger: #b3261e;
  --shadow: 0 24px 70px rgba(20, 18, 15, .12);
}

* { 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;
  color: var(--text);
  background:
    radial-gradient(circle at top left, #fff7df 0, transparent 28rem),
    linear-gradient(180deg, #fbf8f1 0%, var(--bg) 100%);
  min-height: 100vh;
}

a { color: inherit; }
.site-header {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.brand {
  text-decoration: none;
  font-weight: 900;
  letter-spacing: -.04em;
  font-size: 1.35rem;
}
.brand span { color: var(--muted); }
nav { display: flex; gap: 18px; font-size: .95rem; color: var(--muted); }
nav a { text-decoration: none; }
main { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.hero {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 32px;
  align-items: center;
  padding: 64px 0 34px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .16em;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}
h1 {
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: .94;
  letter-spacing: -.07em;
  margin: 0;
}
.subtitle {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1.55;
}
.upload-card, .result-card {
  background: rgba(255,255,255,.82);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 24px;
  min-height: 270px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 28px;
  cursor: pointer;
  background: var(--primary-soft);
  transition: .2s ease;
}
.drop-zone:hover { transform: translateY(-2px); border-color: var(--primary); }
.drop-zone input { display: none; }
.icon { font-size: 3rem; }
.drop-zone strong { display: block; font-size: 1.35rem; margin-top: 8px; }
.drop-zone small { color: var(--muted); margin-top: 6px; }
button, .download-button {
  width: 100%;
  border: 0;
  background: var(--primary);
  color: white;
  border-radius: 18px;
  padding: 16px 20px;
  font-size: 1rem;
  font-weight: 800;
  margin-top: 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
}
button:hover, .download-button:hover { opacity: .9; }
.privacy-note { color: var(--muted); font-size: .9rem; text-align: center; }
.ad-slot {
  margin: 34px 0;
  min-height: 110px;
  border: 1px dashed var(--border);
  border-radius: 24px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(255,255,255,.55);
}
.steps, .faq { padding: 34px 0; }
h2 { font-size: 2rem; letter-spacing: -.04em; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
article, details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 22px;
}
article span {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 800;
}
article p, details p { color: var(--muted); line-height: 1.55; }
details { margin-bottom: 12px; }
summary { cursor: pointer; font-weight: 800; }
.footer { text-align: center; padding: 36px 16px; color: var(--muted); }
.messages { margin: 16px 0; }
.message { padding: 14px 16px; border-radius: 14px; background: white; border: 1px solid var(--border); }
.message.error { color: var(--danger); }
.result-card { max-width: 620px; margin: 70px auto 30px; text-align: center; }
.result-card h1 { font-size: clamp(2rem, 5vw, 4rem); }
.success-icon {
  width: 70px;
  height: 70px;
  border-radius: 999px;
  background: var(--success);
  color: white;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  font-size: 2rem;
  font-weight: 900;
}
.secondary-link { display: inline-block; margin-top: 16px; color: var(--muted); }

#loadingText {
    text-align: center;
    font-size: 1.1rem;
    margin-top: 20px;
    font-weight: bold;
}

.ad-slot {
    margin: 40px auto;
    max-width: 1000px;
    min-height: 120px;

    display: flex;
    justify-content: center;
    align-items: center;
}

.ad-placeholder {
    width: 100%;
    min-height: 120px;

    border: 2px dashed #ccc;
    border-radius: 16px;

    display: flex;
    justify-content: center;
    align-items: center;

    color: #888;
    font-size: 0.95rem;
}

@media (max-width: 800px) {
  .site-header { align-items: flex-start; }
  nav { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 32px; }
  .grid { grid-template-columns: 1fr; }
}
