/* ---------------------------------- */
/*  QR Studio                          */
/*  A warm, local-first QR generator.  */
/* ---------------------------------- */

:root {
  color-scheme: light;
  --paper: #f3f0e6;
  --paper-deep: #eae5d8;
  --card: #fffdf8;
  --ink: #171a14;
  --ink-soft: #5f6358;
  --ink-faint: #696d60;
  --line: #dfdacd;
  --line-strong: #cbc5b5;
  --forest: #16231a;
  --forest-deep: #101a12;
  --forest-soft: #223427;
  --lime: #c9f36a;
  --lime-bright: #d9ff86;
  --lime-soft: #ecfad0;
  --amber: #f5bd6a;
  --red: #d96b55;
  --white: #ffffff;
  --shadow-lg: 0 28px 70px -24px rgba(30, 38, 22, 0.28);
  --shadow-md: 0 16px 38px -18px rgba(30, 38, 22, 0.22);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-sans: "Inter", "Aptos", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(900px 520px at 88% -8%, rgba(201, 243, 106, 0.38), transparent 62%),
    radial-gradient(760px 450px at -8% 18%, rgba(238, 188, 154, 0.17), transparent 64%),
    var(--paper);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--lime);
  color: var(--forest);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

svg {
  flex: 0 0 auto;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid rgba(91, 125, 33, 0.32);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--forest);
  color: var(--lime);
  font-size: 13px;
  font-weight: 700;
  transform: translateY(-150%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.page-shell {
  width: min(1240px, calc(100% - 64px));
  margin: 0 auto;
}

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 4px 10px rgba(22, 35, 26, 0.16));
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.brand:hover .brand-mark {
  transform: rotate(-5deg) scale(1.04);
}

.brand-name {
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.035em;
}

.brand-name span {
  font-weight: 450;
  color: var(--ink-soft);
}

.header-note {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 550;
}

.header-subtle {
  color: var(--ink-faint);
  font-weight: 450;
}

.header-divider {
  width: 1px;
  height: 13px;
  background: var(--line-strong);
}

.live-dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5d8d28;
  box-shadow: 0 0 0 4px rgba(93, 141, 40, 0.12);
}

.live-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(93, 141, 40, 0.38);
  border-radius: inherit;
  animation: ping 2.8s ease-out infinite;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  padding: 68px 0 58px;
}

.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 20px;
  left: -140px;
  width: 440px;
  height: 270px;
  background-image: radial-gradient(rgba(23, 26, 20, 0.11) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
  opacity: 0.55;
  pointer-events: none;
}

.hero-copy {
  max-width: 880px;
  animation: enter-up 650ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 19px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow-line {
  width: 30px;
  height: 1px;
  background: var(--ink);
  opacity: 0.45;
}

h1 {
  margin: 0;
  font-size: clamp(3.3rem, 6.6vw, 5.75rem);
  font-weight: 760;
  letter-spacing: -0.062em;
  line-height: 0.96;
}

h1 em {
  position: relative;
  display: inline-block;
  padding-right: 0.035em;
  color: var(--forest);
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -0.045em;
}

h1 em::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -0.02em;
  bottom: 0.02em;
  left: -0.02em;
  height: 0.29em;
  border-radius: 2px;
  background: var(--lime);
  transform: rotate(-1.2deg);
}

.lede {
  max-width: 645px;
  margin: 26px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.65;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 27px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px 7px 8px;
  border: 1px solid rgba(23, 26, 20, 0.12);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.52);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(5px);
}

.tag-check {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: var(--lime);
  color: var(--forest);
  font-size: 10px;
  font-weight: 900;
}

.hero-stamp {
  position: relative;
  flex: 0 0 164px;
  width: 164px;
  height: 164px;
  margin: 0 6px 11px 0;
  border: 1px solid rgba(23, 26, 20, 0.17);
  border-radius: 50%;
  box-shadow: inset 0 0 0 18px rgba(255, 253, 248, 0.24);
}

.hero-stamp::before,
.hero-stamp::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.hero-stamp::before {
  inset: 9px;
  border: 1px dashed rgba(23, 26, 20, 0.2);
}

.hero-stamp::after {
  inset: 24px;
  background: rgba(255, 253, 248, 0.48);
}

.stamp-ring span {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.18em;
}

.stamp-ring span:nth-child(1) {
  transform: translate(-50%, -72px);
}

.stamp-ring span:nth-child(2) {
  transform: translate(6px, -50%) rotate(90deg);
  transform-origin: center;
}

.stamp-ring span:nth-child(3) {
  transform: translate(-50%, 68px) rotate(180deg);
}

.stamp-ring span:nth-child(4) {
  transform: translate(-66px, -50%) rotate(-90deg);
}

.stamp-center {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  display: grid;
  width: 65px;
  height: 65px;
  place-items: center;
  border-radius: 50%;
  background: var(--forest);
  color: var(--lime);
  transform: translate(-50%, -50%);
  box-shadow: 0 8px 22px -8px rgba(22, 35, 26, 0.5);
}

/* ---------- Studio layout ---------- */

.studio {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(372px, 0.88fr);
  align-items: start;
  gap: 22px;
  animation: enter-up 750ms 90ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.studio:focus {
  outline: none;
}

.studio:focus-visible {
  outline: 3px solid rgba(91, 125, 33, 0.32);
  outline-offset: 8px;
  border-radius: 34px;
}

.editor-card,
.preview-card {
  border-radius: var(--radius-xl);
}

.editor-card {
  padding: 31px;
  border: 1px solid rgba(23, 26, 20, 0.1);
  background: var(--card);
  box-shadow: var(--shadow-lg);
}

.preview-card {
  position: sticky;
  top: 24px;
  overflow: hidden;
  padding: 22px;
  background:
    radial-gradient(700px 260px at 50% -6%, rgba(201, 243, 106, 0.1), transparent 65%),
    linear-gradient(150deg, #1b2b1e 0%, var(--forest-deep) 72%);
  box-shadow: 0 30px 70px -26px rgba(15, 25, 17, 0.7);
  color: #f7f8f1;
}

.preview-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.085) 1px, transparent 1px);
  background-size: 17px 17px;
  mask-image: linear-gradient(to bottom, transparent 2%, black 44%, transparent 100%);
  pointer-events: none;
}

.preview-card > * {
  position: relative;
  z-index: 1;
}

/* ---------- Editor content ---------- */

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.step-label {
  margin: 0 0 5px;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 720;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.character-count {
  flex: 0 0 auto;
  margin-top: 18px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-faint);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease;
}

.character-count.is-near-limit {
  border-color: rgba(172, 112, 22, 0.35);
  background: rgba(245, 189, 106, 0.16);
  color: #895c17;
}

.type-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #f4f1e8;
}

.type-tab {
  display: flex;
  min-width: 0;
  height: 61px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
  transition: background 170ms ease, color 170ms ease, box-shadow 170ms ease, transform 170ms ease;
}

.type-tab svg {
  width: 19px;
  height: 19px;
  transition: color 170ms ease, transform 170ms ease;
}

.type-tab:hover {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.type-tab.is-active {
  background: var(--forest);
  color: #f5f7ef;
  box-shadow: 0 8px 18px -9px rgba(22, 35, 26, 0.65);
}

.type-tab.is-active svg {
  color: var(--lime);
  transform: translateY(-1px);
}

.type-panels {
  padding-top: 22px;
}

.type-panel {
  display: grid;
  gap: 13px;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field-label {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: -0.005em;
}

.optional {
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

input[type="text"],
input[type="url"],
input[type="email"],
input[type="tel"],
input[type="password"],
textarea,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfaf5;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 450;
  outline: none;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

input[type="text"],
input[type="url"],
input[type="email"],
input[type="tel"],
input[type="password"],
select {
  height: 46px;
  padding: 0 14px;
}

textarea {
  min-height: 108px;
  padding: 13px 14px;
  line-height: 1.55;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #a6a79c;
}

input:hover,
textarea:hover,
select:hover {
  border-color: var(--line-strong);
}

input:disabled,
textarea:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  background: #f1eee5;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #758e4a;
  background: #fffefa;
  box-shadow: 0 0 0 4px rgba(145, 180, 77, 0.15);
}

.input-shell {
  position: relative;
  display: block;
}

.field-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 17px;
  height: 17px;
  color: var(--ink-faint);
  transform: translateY(-50%);
  pointer-events: none;
  transition: color 160ms ease;
}

.input-shell:focus-within .field-icon {
  color: #627a38;
}

.input-shell input {
  padding-left: 40px;
}

.input-shell.has-action input {
  padding-right: 46px;
}

.input-action {
  position: absolute;
  top: 50%;
  right: 7px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-faint);
  transform: translateY(-50%);
  transition: color 160ms ease, background 160ms ease;
}

.input-action:hover,
.input-action.is-visible {
  background: var(--paper-deep);
  color: var(--ink);
}

.input-action:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.input-action svg {
  width: 16px;
  height: 16px;
}

.field-hint {
  margin: -2px 0 0;
  color: var(--ink-faint);
  font-size: 11.5px;
  line-height: 1.55;
}

.field-hint code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--paper-deep);
  color: var(--ink-soft);
  font-size: 10.5px;
}

.field-hint-warn {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: #8a5c19;
}

.field-hint-warn svg {
  width: 14px;
  height: 14px;
  margin-top: 1px;
}

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

.select-shell {
  position: relative;
  display: block;
}

.select-shell::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--ink-soft);
  border-bottom: 1.5px solid var(--ink-soft);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
}

.check-row {
  position: relative;
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.check-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.check-box {
  display: grid;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fbfaf5;
  transition: background 160ms ease, border-color 160ms ease;
}

.check-box::after {
  content: "";
  width: 8px;
  height: 4px;
  border-bottom: 1.8px solid var(--forest);
  border-left: 1.8px solid var(--forest);
  opacity: 0;
  transform: translateY(-1px) rotate(-45deg) scale(0.6);
  transition: opacity 150ms ease, transform 150ms ease;
}

.check-row input:checked + .check-box {
  border-color: var(--lime);
  background: var(--lime);
}

.check-row input:checked + .check-box::after {
  opacity: 1;
  transform: translateY(-1px) rotate(-45deg) scale(1);
}

.check-row input:focus-visible + .check-box {
  outline: 3px solid rgba(91, 125, 33, 0.3);
  outline-offset: 2px;
}

.section-rule {
  height: 1px;
  margin: 27px 0 23px;
  background: var(--line);
}

.section-heading-design {
  margin-bottom: 19px;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 16px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--ink-faint);
  font-size: 11.5px;
  font-weight: 600;
  transition: color 160ms ease;
}

.text-button:hover {
  color: var(--ink);
}

.text-button svg {
  width: 13px;
  height: 13px;
}

.design-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 24px;
}

.design-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.design-group legend {
  padding: 0;
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 650;
}

.palette-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 13px;
}

.palette-swatch {
  width: 38px;
  height: 38px;
  padding: 3px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  transition: border-color 160ms ease, transform 160ms ease;
}

.palette-swatch:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.palette-swatch.is-active {
  border-color: var(--forest);
}

.palette-swatch span {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(23, 26, 20, 0.1);
  border-radius: 7px;
  background: linear-gradient(135deg, var(--swatch-fg) 0 50%, var(--swatch-bg) 50% 100%);
}

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

.colour-control {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.colour-label {
  color: var(--ink-faint);
  font-size: 10.5px;
  font-weight: 550;
}

.colour-value-wrap {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfaf5;
}

.colour-input {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.colour-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.colour-input::-webkit-color-swatch {
  border: 1px solid rgba(23, 26, 20, 0.16);
  border-radius: 6px;
}

.colour-input::-moz-color-swatch {
  border: 1px solid rgba(23, 26, 20, 0.16);
  border-radius: 6px;
}

.colour-value {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.colour-control.is-disabled {
  opacity: 0.42;
  pointer-events: none;
}

.detail-block {
  margin-bottom: 13px;
}

.detail-label {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-faint);
  font-size: 10.5px;
  font-weight: 550;
}

.shape-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #f4f1e8;
}

.shape-option {
  display: flex;
  height: 39px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.shape-option:hover {
  background: rgba(255, 255, 255, 0.7);
}

.shape-option.is-active {
  background: var(--forest);
  color: #f7f8f1;
  box-shadow: 0 5px 12px -7px rgba(22, 35, 26, 0.6);
}

.shape-icon {
  display: grid;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
}

.shape-icon i {
  display: block;
  background: currentColor;
}

.shape-option.is-active .shape-icon {
  color: var(--lime);
}

.shape-soft i {
  border-radius: 2px;
}

.shape-dots i {
  border-radius: 50%;
}

.field-compact {
  gap: 5px;
}

.field-compact input,
.field-compact select {
  height: 41px;
  font-size: 12.5px;
}

.design-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 23px;
  padding-top: 19px;
  border-top: 1px solid var(--line);
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.toggle-track {
  position: relative;
  display: block;
  width: 38px;
  height: 22px;
  flex: 0 0 38px;
  border-radius: 999px;
  background: #d8d4c8;
  transition: background 180ms ease;
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 2px 5px rgba(23, 26, 20, 0.22);
  transition: transform 180ms ease, background 180ms ease;
}

.toggle-row input:checked + .toggle-track {
  background: var(--forest);
}

.toggle-row input:checked + .toggle-track .toggle-thumb {
  background: var(--lime);
  transform: translateX(16px);
}

.toggle-row input:focus-visible + .toggle-track {
  outline: 3px solid rgba(91, 125, 33, 0.3);
  outline-offset: 2px;
}

.toggle-title {
  display: block;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.35;
}

.toggle-sub {
  display: block;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.35;
}

.local-note {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: var(--ink-faint);
  font-size: 10.5px;
  white-space: nowrap;
}

.local-note svg {
  width: 13px;
  height: 13px;
}

/* ---------- Preview panel ---------- */

.preview-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.preview-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #dfe5d8;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.preview-dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(201, 243, 106, 0.1), 0 0 12px rgba(201, 243, 106, 0.6);
}

.preview-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(201, 243, 106, 0.4);
  border-radius: inherit;
  animation: ping 2.8s 0.7s ease-out infinite;
}

.preview-dot.is-warning {
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(245, 189, 106, 0.1), 0 0 12px rgba(245, 189, 106, 0.5);
}

.preview-dot.is-error {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(217, 107, 85, 0.1), 0 0 12px rgba(217, 107, 85, 0.45);
}

.preview-dot.is-idle {
  background: #899180;
  box-shadow: 0 0 0 4px rgba(137, 145, 128, 0.1);
}

.preview-dot.is-warning::after,
.preview-dot.is-error::after,
.preview-dot.is-idle::after {
  display: none;
}

.copy-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: #dbe1d5;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.copy-button:hover {
  border-color: rgba(201, 243, 106, 0.45);
  background: rgba(201, 243, 106, 0.1);
  color: var(--lime);
}

.copy-button:disabled {
  cursor: not-allowed;
  opacity: 0.32;
}

.copy-button svg {
  width: 16px;
  height: 16px;
}

.qr-stage {
  position: relative;
  margin: 17px 0;
  padding: 13px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.045);
}

.qr-frame {
  position: relative;
  overflow: hidden;
  border-radius: 15px;
  background-color: #ffffff;
  background-image:
    linear-gradient(45deg, #ececec 25%, transparent 25%),
    linear-gradient(-45deg, #ececec 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ececec 75%),
    linear-gradient(-45deg, transparent 75%, #ececec 75%);
  background-position: 0 0, 0 7px, 7px -7px, -7px 0;
  background-size: 14px 14px;
  box-shadow: 0 18px 38px -18px rgba(0, 0, 0, 0.55);
}

#qr-canvas {
  display: block;
  width: 100%;
  height: auto;
  background: transparent;
}

.qr-empty {
  position: absolute;
  inset: 0;
  display: flex;
  min-height: 300px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 30px;
  background: #fbfaf5;
  color: var(--ink-soft);
  text-align: center;
}

.empty-icon {
  display: grid;
  width: 56px;
  height: 56px;
  margin-bottom: 11px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--paper);
  color: var(--ink-faint);
}

.empty-icon svg {
  width: 27px;
  height: 27px;
}

.qr-empty p {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.qr-empty > span:last-child {
  max-width: 230px;
  color: var(--ink-faint);
  font-size: 11.5px;
  line-height: 1.5;
}

.scan-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--lime);
  border-style: solid;
  opacity: 0.85;
  pointer-events: none;
}

.scan-tl {
  top: 3px;
  left: 3px;
  border-width: 1.5px 0 0 1.5px;
  border-radius: 6px 0 0;
}

.scan-tr {
  top: 3px;
  right: 3px;
  border-width: 1.5px 1.5px 0 0;
  border-radius: 0 6px 0 0;
}

.scan-bl {
  bottom: 3px;
  left: 3px;
  border-width: 0 0 1.5px 1.5px;
  border-radius: 0 0 0 6px;
}

.scan-br {
  right: 3px;
  bottom: 3px;
  border-width: 0 1.5px 1.5px 0;
  border-radius: 0 0 6px;
}

.preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 1px 2px;
}

.preview-label {
  margin: 0 0 3px;
  color: #f3f6ed;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.preview-sub {
  margin: 0;
  color: #8f9a8a;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.ready-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px 5px 7px;
  border-radius: 999px;
  background: rgba(201, 243, 106, 0.12);
  color: var(--lime);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background 180ms ease, color 180ms ease;
}

.ready-badge svg {
  width: 11px;
  height: 11px;
}

.ready-badge.is-warning {
  background: rgba(245, 189, 106, 0.13);
  color: #ffd392;
}

.preview-notice {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 12px;
  padding: 9px 10px;
  border: 1px solid rgba(245, 189, 106, 0.22);
  border-radius: 9px;
  background: rgba(245, 189, 106, 0.09);
  color: #ffd9a0;
  font-size: 10.5px;
  line-height: 1.45;
}

.preview-notice svg {
  width: 13px;
  height: 13px;
  margin-top: 1px;
}

.download-row {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.75fr);
  gap: 8px;
  margin-top: 15px;
}

.button {
  display: inline-flex;
  height: 46px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -0.005em;
  transition: transform 170ms ease, background 170ms ease, border-color 170ms ease, color 170ms ease, box-shadow 170ms ease;
}

.button svg {
  width: 16px;
  height: 16px;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
  transform: none;
}

.button-primary {
  border: 1px solid var(--lime);
  background: var(--lime);
  color: var(--forest);
  box-shadow: 0 8px 20px -10px rgba(201, 243, 106, 0.6);
}

.button-primary:hover {
  border-color: var(--lime-bright);
  background: var(--lime-bright);
}

.button-secondary {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.055);
  color: #f3f6ed;
}

.button-secondary:hover {
  border-color: rgba(201, 243, 106, 0.45);
  background: rgba(201, 243, 106, 0.08);
  color: var(--lime);
}

.export-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 11px;
  padding: 0 2px;
  color: #8f9a8a;
  font-size: 10px;
}

.export-size {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-select {
  position: relative;
  display: inline-block;
}

.mini-select::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 9px;
  width: 5px;
  height: 5px;
  border-right: 1px solid #b9c2b3;
  border-bottom: 1px solid #b9c2b3;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.mini-select select {
  width: auto;
  height: 26px;
  padding: 0 24px 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: #dfe5d8;
  font-size: 10px;
  font-weight: 600;
}

.mini-select select:focus {
  border-color: var(--lime);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 3px rgba(201, 243, 106, 0.12);
}

.export-format {
  color: #8f9a8a;
  font-size: 9.5px;
}

/* ---------- Features ---------- */

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 72px;
  border-top: 1px solid rgba(23, 26, 20, 0.15);
  border-bottom: 1px solid rgba(23, 26, 20, 0.15);
}

.feature {
  display: flex;
  gap: 13px;
  padding: 28px 27px;
}

.feature + .feature {
  border-left: 1px solid rgba(23, 26, 20, 0.15);
}

.feature-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 11px;
  background: var(--lime);
  color: var(--forest);
}

.feature-icon svg {
  width: 19px;
  height: 19px;
}

.feature h3 {
  margin: 1px 0 5px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.feature p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.55;
}

/* ---------- Footer ---------- */

.site-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 2px 50px;
  color: var(--ink-faint);
  font-size: 11px;
}

.site-footer p {
  margin: 0;
}

.footer-meta {
  max-width: 460px;
  text-align: right;
  line-height: 1.6;
}

.footer-meta a {
  color: var(--ink-soft);
  text-decoration-color: rgba(95, 99, 88, 0.4);
  text-underline-offset: 2px;
}

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

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  z-index: 50;
  bottom: 26px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(460px, calc(100vw - 36px));
  padding: 11px 16px;
  border: 1px solid rgba(201, 243, 106, 0.32);
  border-radius: 999px;
  background: rgba(22, 35, 26, 0.96);
  box-shadow: 0 16px 40px -12px rgba(15, 25, 17, 0.6);
  color: #f4f7ef;
  font-size: 12px;
  font-weight: 550;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.toast::before {
  content: "✓";
  display: grid;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  place-items: center;
  border-radius: 50%;
  background: var(--lime);
  color: var(--forest);
  font-size: 10px;
  font-weight: 900;
}

.toast.is-error::before {
  content: "!";
  background: var(--red);
  color: #fff;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.noscript {
  position: fixed;
  inset: auto 20px 20px;
  z-index: 80;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--forest);
  color: #fff;
  font-size: 13px;
  text-align: center;
}

/* ---------- Animations ---------- */

@keyframes enter-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ping {
  0% {
    opacity: 0.7;
    transform: scale(0.7);
  }
  65%,
  100% {
    opacity: 0;
    transform: scale(1.8);
  }
}

@keyframes draw-in {
  from {
    opacity: 0.35;
    transform: scale(0.985);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

#qr-canvas.is-drawing {
  animation: draw-in 240ms ease both;
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .studio {
    grid-template-columns: minmax(0, 1.06fr) minmax(350px, 0.94fr);
  }

  .editor-card {
    padding: 27px;
  }

  .preview-card {
    padding: 19px;
  }

  .design-grid {
    grid-template-columns: 1fr;
    gap: 19px;
  }

  .shape-options {
    max-width: 270px;
  }

  .feature {
    padding: 25px 20px;
  }
}

@media (max-width: 920px) {
  .page-shell {
    width: min(720px, calc(100% - 44px));
  }

  .site-header {
    padding-top: 22px;
  }

  .header-subtle,
  .header-divider {
    display: none;
  }

  .hero {
    padding: 52px 0 42px;
  }

  h1 {
    font-size: clamp(3.2rem, 9vw, 4.7rem);
  }

  .hero-stamp {
    display: none;
  }

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

  .preview-card {
    position: relative;
    top: auto;
  }

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

  .feature + .feature {
    border-top: 1px solid rgba(23, 26, 20, 0.15);
    border-left: 0;
  }

  .feature {
    padding: 22px 18px;
  }
}

@media (max-width: 620px) {
  .page-shell {
    width: calc(100% - 32px);
  }

  .site-header {
    padding: 18px 0 6px;
  }

  .brand-name {
    font-size: 16.5px;
  }

  .brand-mark,
  .brand-mark svg {
    width: 33px;
    height: 33px;
  }

  .header-note {
    font-size: 11px;
  }

  .hero {
    padding: 42px 0 32px;
  }

  .hero::before {
    display: none;
  }

  h1 {
    font-size: clamp(2.8rem, 13vw, 3.8rem);
    line-height: 0.99;
  }

  .eyebrow {
    margin-bottom: 15px;
    font-size: 9.5px;
  }

  .eyebrow-line {
    width: 22px;
  }

  .lede {
    margin-top: 20px;
    font-size: 14.5px;
    line-height: 1.6;
  }

  .hero-tags {
    gap: 6px;
    margin-top: 21px;
  }

  .hero-tag {
    padding: 6px 10px 6px 6px;
    font-size: 10.5px;
  }

  .tag-check {
    width: 16px;
    height: 16px;
    font-size: 9px;
  }

  .editor-card {
    padding: 21px 18px;
    border-radius: 25px;
  }

  .preview-card {
    padding: 15px;
    border-radius: 25px;
  }

  h2 {
    font-size: 21px;
  }

  .character-count {
    margin-top: 14px;
  }

  .type-tabs {
    border-radius: 14px;
  }

  .type-tab {
    height: 55px;
    gap: 4px;
    font-size: 10.5px;
  }

  .type-tab svg {
    width: 17px;
    height: 17px;
  }

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

  .section-rule {
    margin: 23px 0 20px;
  }

  .design-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }

  .local-note {
    align-self: flex-end;
  }

  .qr-stage {
    padding: 10px;
  }

  .qr-empty {
    min-height: 250px;
  }

  .download-row {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.8fr);
  }

  .button {
    height: 44px;
    font-size: 11.5px;
  }

  .export-format {
    display: none;
  }

  .features {
    margin-top: 48px;
  }

  .site-footer {
    flex-direction: column;
    gap: 8px;
    padding: 24px 2px 36px;
  }

  .footer-meta {
    text-align: left;
  }
}

@media (max-width: 380px) {
  h1 {
    font-size: 2.55rem;
  }

  .colour-inputs {
    grid-template-columns: 1fr;
  }

  .header-note span:last-child {
    display: none;
  }

  .qr-empty {
    min-height: 220px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
