:root {
  color-scheme: dark;
  --bg: #120c0b;
  --ink: #f2e5d7;
  --muted: #c8b5a6;
  --line: #edceb330;
  --field: #ffffff0b;
  --accent: #b84d2c;
  --highlight: #f5a277;
  --display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --body: Karla, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, Menlo, Consolas, "Courier New", monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}
main {
  width: 100%; max-width: 460px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: calc(28px + env(safe-area-inset-top, 0px)) calc(32px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 22px;
}
.intro-block { display: grid; justify-items: start; gap: 13px; }
.wordmark {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--muted); text-decoration: none; font: 500 11px/1 var(--mono);
  letter-spacing: .3em; text-transform: uppercase;
}
.leaf-mark {
  width: 15px; height: 17px; background: var(--highlight);
  clip-path: polygon(50% 0,64% 26%,74% 15%,76% 43%,100% 33%,91% 59%,100% 68%,59% 81%,55% 100%,46% 100%,47% 81%,4% 69%,16% 57%,0 34%,28% 44%,26% 18%,38% 27%);
}
h1 {
  margin: 0; font: 500 clamp(34px, 9vw, 44px)/1.04 var(--display);
  letter-spacing: -.01em; text-wrap: balance;
}
h1 em { color: var(--highlight); }
.intro { margin: 0; color: var(--muted); max-width: 40ch; }
.preview {
  position: relative; width: 100%; aspect-ratio: 4/5; max-height: 44svh;
  overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #9ed6f4;
}
.preview iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
.preview-label {
  position: absolute; left: 12px; bottom: 12px; margin: 0; padding: 6px 8px;
  border-radius: 999px; background: #142a38dd; color: #f2e5d7;
  font: 500 10px/1 var(--mono); letter-spacing: .22em; text-transform: uppercase;
}
form { display: flex; flex-direction: column; gap: 14px; }
label { display: grid; gap: 6px; font-weight: 700; font-size: 14px; letter-spacing: .01em; }
input, textarea {
  width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 14px; background: var(--field); color: var(--ink); font: 400 17px/1.35 var(--body);
}
textarea { resize: vertical; min-height: 84px; }
input::placeholder, textarea::placeholder { color: #c7b4a4aa; }
:focus-visible { outline: 2px solid var(--highlight); outline-offset: 2px; }
.count { align-self: flex-end; color: var(--muted); font: 400 12px/1 var(--mono); }
button, .button {
  -webkit-tap-highlight-color: transparent;
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  font: 700 16px/1 var(--body); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; cursor: pointer; text-decoration: none; text-align: center;
  background: var(--field); color: var(--ink);
  transition: transform .08s, background .2s;
}
button:active, .button:active { transform: scale(.98); }
button:hover, .button:hover { background: #ffffff18; }
button.primary { color: #fff7ef; background: var(--accent); border-color: var(--accent); }
button.primary:hover { background: #a23e23; }
.result {
  display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 16px;
  border: 1px solid #f5a27747; background: #b84d2c12;
}
.result h2 { margin: 0; font: italic 500 26px/1.1 var(--display); }
.card-url { font: 400 14px/1.4 var(--mono); background: #00000048; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions > * { min-width: 0; }
.qr {
  display: grid; justify-items: center; gap: 8px; padding-bottom: 12px;
  overflow: hidden;
  border-radius: 12px; background: #fff8eb; color: #401e16;
}
.qr canvas { display: block; width: 100%; height: auto; }
.qr-actions { padding-inline: 12px; }
.qr-actions button { color: #53291c; border-color: #8b4b363a; background: #6533210c; }
.qr-actions button:hover { background: #6533211c; }
@media (max-width: 480px) {
  .qr { margin-inline: -8px; }
}
.status { margin: 0; color: var(--highlight); font-size: .875rem; }
.status:empty { display: none; }
