:root {
  color-scheme: light;
  --ink: #15231f;
  --muted: #60736c;
  --line: #cbd8d2;
  --panel: #fffffb;
  --page: #edf5f1;
  --accent: #11776b;
  --accent-strong: #0a3f3a;
  --amber: #d88a22;
  --soft: #dcf7f1;
  --shadow: 0 18px 55px rgba(17, 119, 107, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(17, 119, 107, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(17, 119, 107, 0.08) 1px, transparent 1px),
    var(--page);
  background-size: 42px 42px;
}

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

.topbar,
main,
footer {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
}

.topbar {
  padding: 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(10, 63, 58, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 251, 0.78);
  font-weight: 800;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background:
    linear-gradient(90deg, transparent 34%, #fff 34% 51%, transparent 51%),
    linear-gradient(0deg, transparent 34%, #fff 34% 51%, transparent 51%),
    var(--accent);
  box-shadow: inset 0 0 0 6px var(--accent-strong);
}

.nav {
  display: flex;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.nav a {
  padding: 8px 10px;
  border-radius: 7px;
}

.nav a:hover {
  background: rgba(255, 255, 251, 0.8);
}

.hero {
  min-height: 300px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: center;
  gap: 32px;
  padding: 24px 0 30px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(38px, 7vw, 72px);
  line-height: 0.98;
  letter-spacing: 0;
}

.lead {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.58;
}

.hero-panel {
  min-height: 250px;
  border: 1px solid rgba(10, 63, 58, 0.16);
  border-radius: 8px;
  background: var(--panel);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
}

.mini-qr {
  width: 172px;
  height: 172px;
  padding: 16px;
  background: #fff;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
  border: 1px solid var(--line);
}

.mini-qr span {
  background: #13251f;
}

.mini-qr span:nth-child(3n),
.mini-qr span:nth-child(5n) {
  background: transparent;
}

.workspace {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.controls,
.preview,
.info-grid article {
  background: rgba(255, 255, 251, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(21, 35, 31, 0.05);
}

.controls {
  padding: 18px;
  position: sticky;
  top: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

label {
  color: #315149;
  font-size: 13px;
  font-weight: 800;
}

textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

textarea {
  min-height: 220px;
  resize: vertical;
  line-height: 1.5;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.grid-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 13px;
  margin-top: 15px;
}

.color-row {
  margin-top: 15px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.color-row label {
  display: grid;
  gap: 8px;
}

input[type="color"] {
  width: 100%;
  height: 38px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
}

.preview {
  min-height: 650px;
  padding: 24px;
}

.preview-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.preview-head h2,
.info-grid h2 {
  margin: 0;
  font-size: 24px;
}

#status {
  padding: 7px 12px;
  border-radius: 7px;
  color: #5b3508;
  background: #fff1d6;
  font-size: 13px;
  font-weight: 850;
}

.qr-stage {
  margin: 22px 0;
  min-height: 460px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(90deg, rgba(96, 115, 108, 0.1) 1px, transparent 1px),
    linear-gradient(0deg, rgba(96, 115, 108, 0.1) 1px, transparent 1px),
    #f9fbf8;
  background-size: 28px 28px;
  border: 1px solid #d8e5df;
  border-radius: 8px;
}

canvas {
  width: min(100%, 430px);
  height: auto;
  border: 10px solid #fff;
  box-shadow: 0 12px 32px rgba(21, 35, 31, 0.12);
}

.actions {
  display: flex;
  gap: 10px;
}

button {
  border: 0;
  border-radius: 7px;
  padding: 12px 15px;
  color: #fff;
  background: var(--accent);
  font: inherit;
  font-weight: 820;
  cursor: pointer;
}

button.secondary {
  color: #5b3508;
  background: #fff1d6;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 18px 0 46px;
}

.info-grid article {
  padding: 18px;
}

.info-grid p {
  margin: 9px 0 0;
  color: var(--muted);
  line-height: 1.58;
}

footer {
  padding: 22px 0 34px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 880px) {
  .nav {
    display: none;
  }

  .hero,
  .workspace,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .controls {
    position: static;
  }

  .hero-panel {
    min-height: 220px;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
