:root {
  --bg: #f5f7ff;
  --ink: #16181f;
  --muted: #5d6478;
  --line: rgba(22, 24, 31, 0.08);
  --accent: #ff3d6e;
  --lime: #d6ff4a;
  --cyan: #2ad4c4;
  --card: #ffffff;
  --shadow: 0 18px 50px rgba(47, 59, 120, 0.1);
  --serif: "Syne", "Avenir Next", sans-serif;
  --sans: "Manrope", "Avenir Next", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(820px 420px at 0% -10%, rgba(255, 61, 110, 0.18), transparent 60%),
    radial-gradient(720px 380px at 100% 0%, rgba(42, 212, 196, 0.22), transparent 55%),
    radial-gradient(640px 320px at 80% 100%, rgba(214, 255, 74, 0.28), transparent 50%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
img { max-width: 100%; }

.wrap { width: min(1100px, calc(100% - 2rem)); margin: 0 auto; }
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.15rem 0;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  font-weight: 750;
  letter-spacing: -0.04em;
}
.mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background:
    linear-gradient(#16181f 0 0) 5px 5px / 6px 6px no-repeat,
    linear-gradient(#16181f 0 0) 15px 5px / 6px 6px no-repeat,
    linear-gradient(#16181f 0 0) 25px 5px / 6px 6px no-repeat,
    linear-gradient(#16181f 0 0) 5px 15px / 6px 6px no-repeat,
    linear-gradient(#ff3d6e 0 0) 15px 15px / 6px 6px no-repeat,
    linear-gradient(#16181f 0 0) 25px 15px / 6px 6px no-repeat,
    linear-gradient(#16181f 0 0) 5px 25px / 6px 6px no-repeat,
    linear-gradient(#16181f 0 0) 15px 25px / 6px 6px no-repeat,
    linear-gradient(#16181f 0 0) 25px 25px / 6px 6px no-repeat,
    #fff;
  box-shadow: 0 8px 20px rgba(255, 61, 110, 0.18);
}
nav { display: flex; gap: 1.1rem; align-items: center; }
nav a { color: var(--muted); text-decoration: none; font-size: 0.94rem; font-weight: 650; }
nav a:hover { color: var(--ink); }

.btn, button.btn {
  border: 0;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.78rem 1.15rem;
  background: var(--ink);
  color: #fff;
  font-weight: 750;
}
.btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.lime { background: var(--lime); color: #172000; }
.btn.small { padding: 0.48rem 0.8rem; font-size: 0.86rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.hero { padding: 3.4rem 0 1.4rem; display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 2rem; align-items: end; }
h1, h2, h3 { font-family: var(--serif); font-weight: 750; letter-spacing: -0.045em; margin: 0; }
h1 { font-size: clamp(2.8rem, 6vw, 5.3rem); line-height: 0.9; }
.lede { font-size: 1.16rem; color: var(--muted); max-width: 38rem; }
.kicker { color: var(--accent); letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.74rem; font-weight: 800; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 1.15rem;
  box-shadow: var(--shadow);
}
.switch-demo { display: grid; gap: 0.7rem; }
.route {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  background: #f6f8ff;
  border: 1px solid var(--line);
}
.route strong { font-weight: 750; }
.route span { color: var(--muted); font-size: 0.88rem; }
.route.now { background: #f4ffe3; border-color: rgba(140, 190, 20, 0.45); }
.pill { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: #172000; background: var(--lime); border-radius: 999px; padding: 0.22rem 0.5rem; font-weight: 800; }
.pill.off { background: #fff; color: var(--muted); border: 1px solid var(--line); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem; margin: 1.4rem 0 0.4rem; }
.stat { background: #fff; border-radius: 22px; padding: 1rem 1rem 0.9rem; border: 1px solid var(--line); box-shadow: var(--shadow); }
.stat b { display: block; font-family: var(--serif); font-size: 2rem; letter-spacing: -0.04em; line-height: 1; }
.stat span { color: var(--muted); font-size: 0.88rem; }

.grid-3, .grid-2 { display: grid; gap: 1rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: 1fr 1fr; }
section { padding: 1.5rem 0 2rem; }
.step-no { font-family: var(--serif); font-size: 1.8rem; color: var(--accent); }
.note { color: var(--muted); font-size: 0.94rem; }
footer { padding: 2rem 0 3rem; color: var(--muted); font-size: 0.88rem; border-top: 1px solid var(--line); margin-top: 1rem; }

.app-shell { width: min(1120px, calc(100% - 1.4rem)); margin: 0 auto; padding-bottom: 3rem; }
.panel { display: grid; gap: 0.8rem; }
label { display: grid; gap: 0.3rem; font-size: 0.86rem; color: var(--muted); font-weight: 650; }
input, select {
  width: 100%;
  background: #f7f8fd;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.8rem;
}
input:focus, select:focus { outline: 2px solid rgba(255, 61, 110, 0.28); border-color: transparent; }
.row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.err { color: #c4234d; font-size: 0.9rem; }
.ok { color: #2d7a16; font-size: 0.9rem; }
.qr-list { display: grid; gap: 0.9rem; }
.qr-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
  padding: 1rem;
  border-radius: 22px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.qr-preview { position: relative; }
.welcome-thumb {
  width: 112px;
  height: 64px;
  object-fit: contain;
  background: transparent;
  border-radius: 10px;
  display: block;
  margin-top: 0.45rem;
  border: 1px solid var(--line);
}
.mini-upload {
  display: inline-flex;
  margin-top: 0.4rem;
  font-size: 0.78rem;
  font-weight: 750;
  color: var(--accent);
  cursor: pointer;
}
.qr-item canvas, .qr-item img {
  width: 112px !important;
  height: 112px !important;
  max-width: 112px;
  display: block;
  background: white;
}
.meta { display: grid; gap: 0.4rem; min-width: 0; }
.meta h3 { font-size: 1.25rem; overflow-wrap: anywhere; }
.slug, .history, .note { overflow-wrap: anywhere; }
.auth-grid { width: min(460px, 100%); margin: 8vh auto; display: grid; gap: 1rem; }
.split { display: grid; grid-template-columns: 320px 1fr; gap: 1rem; align-items: start; }
.tabs { display: flex; gap: 0.4rem; }
.tabs button { background: #fff; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0.4rem 0.75rem; cursor: pointer; font-weight: 700; }
.tabs button.on { color: #fff; background: var(--ink); border-color: var(--ink); }

@media (max-width: 860px) {
  .hero, .grid-3, .grid-2, .split, .stats { grid-template-columns: 1fr; }
  .qr-item { grid-template-columns: 96px minmax(0, 1fr); }
  h1 { font-size: 2.2rem; }
  nav a:not(.btn) { display: none; }
}

@media (max-width: 720px) {
  html, body { overflow-x: clip; max-width: 100%; }
  .wrap, .app-shell { width: calc(100% - 1rem); }
  .top { padding: 0.8rem 0; }
  .hero { padding: 1rem 0 0.3rem; gap: 0.9rem; }
  h1 { font-size: 1.85rem; line-height: 1; }
  h2 { font-size: 1.45rem !important; }
  .lede, .note { font-size: 0.95rem; }
  .stats { grid-template-columns: 1fr 1fr; gap: 0.55rem; }
  .stat b { font-size: 1.35rem; }
  .card, .qr-item { padding: 0.8rem; }
  .qr-item { grid-template-columns: 1fr; justify-items: start; }
  .qr-preview, .qr-item canvas, .qr-item img {
    width: 96px !important;
    height: 96px !important;
    max-width: 96px;
  }
  .meta h3 { font-size: 1.15rem; }
  .row .btn, .row select { flex: 1 1 calc(50% - 0.6rem); min-width: 0; }
  input, select, button { max-width: 100%; font-size: 16px; }
  .route { align-items: flex-start; }
}
