:root {
  color-scheme: light;
  --bg: #f5f1e8;
  --bg-alt: #dce8f5;
  --paper: rgba(255, 255, 255, 0.82);
  --text: #1f2937;
  --muted: #5e6a78;
  --line: rgba(31, 41, 55, 0.12);
  --accent: #165d55;
  --accent-2: #174977;
  --accent-soft: rgba(22, 93, 85, 0.1);
  --shadow: 0 24px 80px rgba(25, 39, 52, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --font-sans: "Avenir Next", "Segoe UI", "Trebuchet MS", "Helvetica Neue", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: var(--font-sans);
  background:
    radial-gradient(circle at top left, rgba(22, 93, 85, 0.14), transparent 28%),
    radial-gradient(circle at top right, rgba(23, 73, 119, 0.12), transparent 24%),
    linear-gradient(135deg, var(--bg), var(--bg-alt));
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.site-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.topbar,
.footer,
.hero,
.panel,
.tool-surface,
.tool-card,
.page-hero,
.mini-card,
.result-box {
  border: 1px solid var(--line);
  background: var(--paper);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.topbar,
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  border-radius: 999px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 0.82rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav a {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
}

.nav a:hover,
.nav a.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.78);
}

main {
  padding: 26px 0 36px;
}

.hero,
.page-hero {
  border-radius: var(--radius-lg);
  padding: 32px;
}

.hero {
  display: grid;
  grid-template-columns: 1.5fr 0.9fr;
  gap: 24px;
}

.hero h1,
.page-hero h1,
.tool-main h1 {
  margin: 14px 0;
  font-size: clamp(2.5rem, 6vw, 5.4rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.tool-main h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.lead {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.eyebrow-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.eyebrow,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.eyebrow {
  background: var(--accent-soft);
  color: var(--accent);
}

.eyebrow.subtle,
.badge {
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  border: 1px solid var(--line);
}

.badge-popular {
  background: rgba(201, 112, 40, 0.12);
  color: #a24e12;
}

.badge-new {
  background: rgba(37, 99, 235, 0.12);
  color: #1849b0;
}

.hero-actions,
.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.76);
  color: var(--text);
  border: 1px solid var(--line);
}

.text-link {
  color: var(--accent-2);
  font-weight: 700;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 28px 0 0;
}

.stats div {
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid var(--line);
}

.stats dt {
  margin-bottom: 6px;
  font-size: 1.8rem;
  font-weight: 800;
}

.stats dd {
  margin: 0;
  color: var(--muted);
}

.hero-panel,
.updates {
  display: grid;
  gap: 14px;
}

.mini-card,
.tool-card,
.panel,
.tool-surface,
.result-box {
  border-radius: var(--radius-lg);
  padding: 22px;
}

.mini-card p,
.tool-card p,
.panel p,
.result-box p,
.footer p,
.meta-line {
  color: var(--muted);
  line-height: 1.65;
}

.section {
  margin-top: 28px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.section-head h2,
.panel h2,
.tool-card h2,
.tool-card h3 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.tool-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.tool-card a {
  color: var(--accent-2);
  font-weight: 700;
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.feature-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.feature-list li + li {
  margin-top: 10px;
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 18px;
}

.tool-layout-wide {
  grid-template-columns: 1fr;
}

.field {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.field span {
  font-weight: 700;
}

input[type="text"],
input[type="number"],
input[type="datetime-local"],
textarea,
.output-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

textarea,
.output-input {
  font-family: var(--font-mono);
}

textarea {
  resize: vertical;
}

input[type="range"] {
  width: 100%;
}

.inline-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  color: var(--muted);
}

.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
}

.status-line {
  margin: 8px 0 0;
  color: var(--muted);
}

.editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.result-box p {
  margin: 0 0 10px;
}

.qr-preview {
  display: grid;
  place-items: center;
  min-height: 280px;
  border: 1px dashed rgba(22, 93, 85, 0.24);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.58);
}

#qr-canvas {
  max-width: 100%;
  height: auto;
  background: #fff;
  padding: 12px;
  border-radius: 18px;
}

.footer {
  margin: 12px 0 20px;
}

.footer p {
  margin: 6px 0 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
}

@media (max-width: 960px) {
  .hero,
  .tool-layout,
  .split,
  .card-grid,
  .editor-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .footer,
  .section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .site-shell {
    padding: 16px;
  }

  .topbar,
  .footer,
  .hero,
  .page-hero,
  .panel,
  .tool-surface,
  .tool-card,
  .mini-card,
  .result-box {
    padding: 18px;
    border-radius: 22px;
  }

  .hero h1,
  .page-hero h1,
  .tool-main h1 {
    font-size: 2.4rem;
  }

  .checkbox-grid,
  .inline-field {
    grid-template-columns: 1fr;
  }
}
