:root {
  --bg0: #e8f0f2;
  --bg1: #d5e4e8;
  --ink: #14212b;
  --muted: #5a6d78;
  --line: rgba(20, 33, 43, 0.12);
  --panel: rgba(255, 255, 255, 0.72);
  --accent: #0b6e4f;
  --accent-ink: #063d2c;
  --warn: #9a3412;
  --radius: 18px;
  --shadow: 0 24px 60px rgba(20, 33, 43, 0.08);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Manrope", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #b7d8de 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #c8e0d4 0%, transparent 50%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  background-attachment: fixed;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(232, 240, 242, 0.82);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  width: min(920px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0.85rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.nav-link {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--accent-ink);
  background: rgba(11, 110, 79, 0.1);
}

.page {
  width: min(920px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.5rem 0 4rem;
}

.brand {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 0.95;
}

.brand-sm {
  font-size: clamp(2rem, 5vw, 3rem);
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.module-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .module-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.module-card {
  display: grid;
  gap: 0.45rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.module-card:hover {
  transform: translateY(-2px);
  border-color: rgba(11, 110, 79, 0.35);
}

.module-card strong {
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.module-card span:last-child {
  color: var(--muted);
  line-height: 1.45;
}

.module-kicker {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-inner {
  padding-top: 1rem !important;
  padding-bottom: 1.5rem !important;
}

.lede {
  margin: 0 0 2rem;
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding: 1.35rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 720px) {
  .grid.two {
    grid-template-columns: 1fr 1fr;
  }
}

label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.field-hint {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.5;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(11, 110, 79, 0.55);
  box-shadow: 0 0 0 4px rgba(11, 110, 79, 0.12);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.1rem;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.9rem 1.35rem;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.btn:hover {
  background: var(--accent-ink);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.7);
}

.status {
  min-height: 1.4rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.status.error {
  color: var(--warn);
}

.results {
  margin-top: 1.5rem;
  display: none;
}

.results.show {
  display: block;
  animation: rise 0.35s ease;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.results-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 0.85rem;
}

.results-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: -0.02em;
}

.meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.usage {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.usage:empty {
  display: none;
}

.usage-item {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(127, 127, 127, 0.12);
  font-size: 0.85rem;
}

.usage-item strong {
  font-variant-numeric: tabular-nums;
}

.output {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
  font-size: 0.98rem;
  max-height: 70vh;
  overflow: auto;
  padding: 1.1rem;
  border-radius: 14px;
  background: #0f1a22;
  color: #e7eef2;
}

.spinner {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  margin-right: 0.55rem;
  vertical-align: -2px;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.image-field {
  display: grid;
  gap: 0.6rem;
}

.image-field input[type="file"] {
  padding: 0.65rem;
  cursor: pointer;
}

.image-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.image-previews:empty {
  display: none;
}

.image-preview {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 26, 34, 0.75);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.image-remove:hover {
  background: var(--warn);
}

.hint {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}
