:root {
  --bg: #edeae3;
  --paper: #fdfaf5;
  --ink: #1a1a1a;
  --muted: #736e66;
  --line: #ddd8ce;
  --accent: #2a4a3f;
  --shadow: 0 1px 2px rgba(26, 26, 26, 0.04), 0 16px 48px rgba(26, 26, 26, 0.07);
  --radius: 4px;
  --font-sans: "Inter", system-ui, sans-serif;
  --font-serif: "Libre Baskerville", Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% -20%, rgba(42, 74, 63, 0.07), transparent),
    radial-gradient(ellipse 40% 30% at 100% 100%, rgba(42, 74, 63, 0.04), transparent);
  pointer-events: none;
  z-index: -1;
}

a { color: inherit; }

.page {
  max-width: 700px;
  margin: 0 auto;
  padding: 56px 20px 72px;
  animation: fadeUp 0.5s ease-out both;
}

.page--wide { max-width: 920px; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  margin-bottom: 32px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.card::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), #3d6b5c);
}

.card-body { padding: 40px 38px 36px; }

.intro {
  text-align: center;
  padding-bottom: 32px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.intro h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 5vw, 2.05rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.015em;
}

.intro .role {
  margin-top: 10px;
  font-size: 15px;
  color: var(--muted);
}

.intro .firm {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.intro .rule {
  width: 28px;
  height: 2px;
  background: var(--accent);
  margin: 14px auto 0;
  opacity: 0.5;
}

.split {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: start;
}

.fields { display: grid; gap: 22px; }

.field dt {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}

.field dd { font-size: 15px; }

.field dd a {
  text-decoration: none;
  transition: color 0.15s;
}

.field dd a:hover { color: var(--accent); }

.field dd .alt {
  margin-top: 3px;
  color: var(--muted);
  font-size: 14px;
}

.qr-side { text-align: center; }

.qr-side p {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.qr-hint {
  margin-top: 10px !important;
  font-size: 11px !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  font-weight: 400 !important;
  color: var(--muted);
  max-width: 10rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.4;
}

.qr-side img {
  display: block !important;
  margin: 0 auto;
  background: #fff;
}

#qrContainer table,
#qrContainer tbody,
#qrContainer tr,
#qrContainer td {
  border: 0;
  padding: 0;
  margin: 0;
  line-height: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.btn {
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 11px 20px;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-fill {
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
}

.btn-fill:hover { background: #2e2e2e; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  border-color: var(--ink);
  background: rgba(0, 0, 0, 0.025);
}

.site-footer {
  margin-top: 32px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.site-footer a:hover { text-decoration: underline; }

/* Toolbar (print page) */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  padding: 14px 20px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.toolbar-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 8px;
}

.toolbar .btn { padding: 9px 16px; font-size: 13px; }

.workspace {
  display: grid;
  gap: 40px;
  justify-items: center;
  padding: 40px 20px 64px;
}

.lead {
  max-width: 32rem;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
}

.lead strong { color: var(--ink); font-weight: 600; }

/* Business card — ISO 85 × 55 mm */
.bizcard {
  width: 85mm;
  height: 55mm;
  background: var(--paper);
  border: 0.25mm solid var(--line);
  border-radius: 2px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr 30mm;
  overflow: hidden;
  position: relative;
}

.bizcard::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1.2mm;
  background: var(--accent);
}

.bizcard-text {
  padding: 5.5mm 5mm 4mm 6mm;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.bizcard-brand {
  font-size: 6.5pt;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.bizcard-name {
  font-family: var(--font-serif);
  font-size: 10.5pt;
  font-weight: 700;
  line-height: 1.2;
  margin-top: 1.5mm;
}

.bizcard-role {
  font-size: 8pt;
  color: var(--muted);
  margin-top: 0.8mm;
}

.bizcard-contact {
  font-size: 7pt;
  line-height: 1.5;
  color: var(--ink);
}

.bizcard-contact span {
  display: block;
  font-size: 6pt;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5mm;
}

.bizcard-qr {
  border-left: 0.25mm solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3mm 2mm;
  background: #fff;
}

.bizcard-qr p {
  font-size: 5pt;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5mm;
  text-align: center;
}

.bizcard-qr img,
.bizcard-qr canvas {
  display: block;
  width: 25mm !important;
  height: 25mm !important;
}

/* Large QR sheet */
.poster {
  width: min(100%, 210mm);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 48px 40px;
  text-align: center;
}

.poster h2 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.poster > p {
  font-size: 14px;
  color: var(--muted);
  max-width: 28rem;
  margin: 0 auto 28px;
  line-height: 1.55;
}

.poster-qr {
  display: inline-block;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--line);
  margin-bottom: 28px;
}

.poster-qr img,
.poster-qr canvas {
  display: block;
  width: 56mm !important;
  height: 56mm !important;
}

.specs {
  list-style: none;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  text-align: left;
  max-width: 28rem;
  margin: 0 auto;
}

.specs li {
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.specs li:last-child { border-bottom: none; }

.specs code {
  font-size: 11px;
  word-break: break-all;
  color: var(--ink);
}

/* 404 */
.error-page {
  text-align: center;
  padding-top: 80px;
}

.error-page h1 {
  font-family: var(--font-serif);
  font-size: 4rem;
  font-weight: 700;
  color: var(--line);
  line-height: 1;
}

.error-page p {
  margin-top: 16px;
  color: var(--muted);
  font-size: 15px;
}

.error-page .btn { display: inline-block; margin-top: 28px; }

@media (max-width: 580px) {
  .page { padding: 36px 16px 56px; }
  .card-body { padding: 28px 22px 24px; }
  .split {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .qr-side {
    padding-top: 28px;
    border-top: 1px solid var(--line);
  }
}

@media print {
  body { background: #fff; }
  body::before { display: none; }
  .toolbar, .lead { display: none !important; }
  .workspace { padding: 0; gap: 0; }
  .bizcard, .poster {
    box-shadow: none;
    page-break-inside: avoid;
  }
  .poster { border: none; padding: 0; }
}

@page { size: A4; margin: 15mm; }
