:root {
  --ink: #14201b;
  --muted: #5b6c64;
  --paper: #edf2ee;
  --surface: rgba(255, 255, 255, 0.78);
  --line: rgba(20, 32, 27, 0.12);
  --accent: #0d7a58;
  --accent-deep: #085c42;
  --glow: #c6e86a;
  --danger: #b42318;
  --ok: #0d7a58;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --content: min(680px, calc(100% - 2.5rem));
  --radius: 20px;
}

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

html, body { margin: 0; min-height: 100%; }

body.page,
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1100px 620px at 8% -8%, rgba(198, 232, 106, 0.38), transparent 55%),
    radial-gradient(900px 520px at 100% 12%, rgba(13, 122, 88, 0.16), transparent 50%),
    linear-gradient(165deg, #e7efe9 0%, #f3f7f4 48%, #e9efeb 100%);
  animation: drift 16s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: scale(1); filter: saturate(1); }
  to { transform: scale(1.04); filter: saturate(1.08); }
}

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

/* ——— Top bar ——— */
.topbar {
  width: 100%;
  padding: 1.1rem 0 0;
}

.topbar-inner,
.nav {
  width: var(--content);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.nav-right { display: flex; gap: 1rem; align-items: center; }

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
}

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

/* ——— Main stage ——— */
.stage {
  flex: 1;
  display: flex;
  align-items: center;
  width: 100%;
  padding: 1.5rem 0 2rem;
}

.stage-inner,
.shell {
  width: var(--content);
  margin: 0 auto;
  display: grid;
  gap: 1.75rem;
  animation: rise 0.55s ease both;
}

.shell { padding: 2rem 0 3rem; }
.shell.narrow { width: min(460px, calc(100% - 2.5rem)); }
.shell.docs { width: min(740px, calc(100% - 2.5rem)); }

.intro,
.hero {
  display: grid;
  gap: 0.55rem;
  max-width: 22rem;
}

.brand {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 8vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 0;
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
}

.file-title { word-break: break-word; font-size: 1.35rem; }

.lede {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 34ch;
}

.lede a {
  color: var(--accent-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ——— Drop zone ——— */
.drop,
.box {
  background: var(--surface);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.drop {
  min-height: 320px;
  padding: 1.75rem;
  display: grid;
  align-items: center;
  animation: rise 0.7s ease both 0.06s;
}

.box {
  border-style: solid;
  padding: 1.5rem;
  display: grid;
  gap: 0.9rem;
}

.drop.is-drag,
.box.is-drag {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--glow) 28%, white);
  transform: translateY(-2px);
}

.drop-idle {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 0.45rem;
}

.drop-mark {
  width: 56px;
  height: 56px;
  margin-bottom: 0.55rem;
  border-radius: 50%;
  border: 2px solid var(--accent);
  position: relative;
  animation: pulse 2.4s ease-out infinite;
}

.drop-mark::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: var(--glow);
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(13, 122, 88, 0.28); }
  70% { box-shadow: 0 0 0 16px rgba(13, 122, 88, 0); }
  100% { box-shadow: 0 0 0 0 rgba(13, 122, 88, 0); }
}

.drop-title,
.box-title {
  margin: 0;
  font-weight: 700;
  font-size: 1.15rem;
}

.drop-sub {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.drop-form,
.drop-result {
  display: grid;
  gap: 1rem;
  width: min(100%, 420px);
  margin: 0 auto;
}

.drop-idle[hidden],
.drop-form[hidden],
.drop-result[hidden],
.error[hidden],
.progress[hidden],
.progress-wrap[hidden] {
  display: none !important;
}

.file-chip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  word-break: break-all;
}

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

.field-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

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

.select:focus,
.input:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-color: var(--accent);
}

.actions,
.link-row,
.row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.actions { justify-content: flex-end; }
.link-row .input,
.row .input { flex: 1; min-width: 0; }

.hint { margin: 0; color: var(--muted); font-size: 0.92rem; }
.muted { color: var(--muted); }
.file-line { margin: 0; word-break: break-all; }

.btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn:hover { background: var(--accent-deep); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

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

.btn.ghost:hover { background: rgba(20, 32, 27, 0.04); }
.btn.download { width: 100%; border-radius: 12px; }

.progress {
  height: 5px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.progress-wrap {
  display: grid;
  gap: 0.4rem;
}

.progress-wrap[hidden],
.progress[hidden] {
  display: none !important;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--glow));
  transition: width 0.15s ease;
}

.error {
  margin: 0;
  color: var(--danger);
  background: rgba(180, 35, 24, 0.08);
  border-radius: 12px;
  padding: 0.85rem 1rem;
}

.ok { color: var(--ok); margin: 0; font-weight: 600; }
.price { font-size: 1.75rem; font-weight: 700; margin: 0; }
.mono { font-family: var(--font-mono); font-size: 0.8rem; word-break: break-all; }

/* ——— Docs / legal ——— */
.docs h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 1.25rem 0 0.5rem;
}

.markdown-body h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
}

.markdown-body h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 1.75rem 0 0.55rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--line);
}

.markdown-body h3 {
  font-size: 1.05rem;
  margin: 1.15rem 0 0.4rem;
}

.markdown-body p,
.markdown-body li {
  color: var(--ink);
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.2rem;
}

.markdown-body hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 1.5rem 0;
}

.markdown-body a { color: var(--accent-deep); }

.docs pre,
.markdown-body pre {
  margin: 0.6rem 0 1rem;
  padding: 1rem;
  overflow-x: auto;
  background: #15201c;
  color: #e8f0ea;
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.55;
}

.docs code,
.markdown-body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.docs p code,
.docs li code,
.docs td code,
.markdown-body p code,
.markdown-body li code,
.markdown-body td code {
  background: #e5ece8;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

.docs pre code,
.markdown-body pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.table,
.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 0.75rem 0 1rem;
}

.table th,
.table td,
.markdown-body th,
.markdown-body td {
  text-align: left;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--line);
}

.api-list { padding-left: 1.1rem; margin: 0; }
.api-list li { margin: 0.35rem 0; }

.legal p { color: var(--ink); }
.legal ul { margin: 0.25rem 0 0.75rem; padding-left: 1.2rem; }
.legal li { margin: 0.3rem 0; }

/* ——— Footer ——— */
.site-footer {
  width: 100%;
  margin-top: auto;
  padding: 1.25rem 0 1.75rem;
  border-top: 1px solid var(--line);
}

.footer-inner {
  width: var(--content);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-brand {
  display: grid;
  gap: 0.15rem;
}

.footer-copy {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
}

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

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

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.15rem;
}

.footer-links a,
.site-footer a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-links a:hover,
.site-footer a:hover { color: var(--ink); }

/* ——— Cookie banner ——— */
.cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 50;
  width: min(520px, calc(100% - 2rem));
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  box-shadow: 0 12px 36px rgba(20, 32, 27, 0.14);
  display: grid;
  gap: 0.85rem;
}

.cookie-banner[hidden] { display: none !important; }

.cookie-banner p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.cookie-banner a { color: var(--accent-deep); }

.cookie-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

a { color: var(--accent-deep); }

@media (max-width: 560px) {
  :root { --content: min(680px, calc(100% - 1.5rem)); }

  .drop { min-height: 280px; padding: 1.25rem; }

  .actions,
  .link-row {
    flex-direction: column;
    align-items: stretch;
  }

  .actions .btn,
  .link-row .btn { width: 100%; }

  .footer-inner { flex-direction: column; align-items: flex-start; }
}
