:root {
  --paper: #f2ebde;
  --paper-deep: #e6dac7;
  --card: #fffaf1;
  --ink: #191510;
  --muted: #6d6255;
  --line: #2b241c;
  --soft-line: #d5c7b2;
  --accent: #e8542b;
  --accent-dark: #a72f12;
  --green: #1f6f5a;
  --shadow: 6px 6px 0 var(--ink);
  --radius: 18px;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-display: "Songti SC", "Noto Serif CJK SC", "STSong", serif;
  --font-mono: "SFMono-Regular", "Cascadia Mono", "Roboto Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(25, 21, 16, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25, 21, 16, .035) 1px, transparent 1px);
  background-size: 28px 28px;
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
svg, canvas { display: block; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 16px; top: -80px; z-index: 100; padding: 10px 16px;
  background: var(--ink); color: white; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { top: 16px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.site-header {
  position: relative; z-index: 10; padding: 22px 0; border-bottom: 1px solid rgba(43, 36, 28, .16);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  width: 40px; height: 40px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  padding: 4px; border: 2px solid var(--ink); border-radius: 9px; background: var(--accent);
  box-shadow: 2px 2px 0 var(--ink);
}
.brand-mark i { display: block; background: var(--ink); border-radius: 1px; }
.brand-mark i:nth-child(1) { border: 3px solid var(--ink); background: transparent; }
.brand-mark i:nth-child(4) { border: 3px solid var(--ink); background: transparent; }
.brand-mark.small { width: 34px; height: 34px; box-shadow: none; }
.brand-copy { display: grid; line-height: 1.15; }
.brand-copy strong { font-size: 18px; letter-spacing: .08em; }
.brand-copy small { margin-top: 4px; color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.top-nav { display: flex; gap: 26px; font-size: 14px; }
.top-nav a { text-decoration: none; position: relative; }
.top-nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -5px; height: 2px; background: var(--accent); transition: right .2s ease; }
.top-nav a:hover::after { right: 0; }

.hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: clamp(40px, 8vw, 110px); align-items: center; padding-block: clamp(54px, 8vw, 104px) 74px; }
.eyebrow { display: flex; align-items: center; gap: 12px; margin: 0 0 22px; color: var(--muted); font-size: 12px; letter-spacing: .08em; }
.eyebrow span { padding: 4px 8px; color: var(--card); background: var(--green); border-radius: 3px; font-family: var(--font-mono); font-size: 10px; }
.hero h1 { margin: 0; font-family: var(--font-display); font-size: clamp(58px, 8vw, 104px); font-weight: 700; line-height: .95; letter-spacing: -.06em; }
.hero h1 em { color: var(--accent); font-style: normal; position: relative; }
.hero h1 em::after { content: ""; position: absolute; left: 0; right: 2px; bottom: 1px; height: 6px; background: var(--accent); opacity: .18; border-radius: 50%; }
.hero-lead { max-width: 610px; margin: 30px 0 26px; color: #51483d; font-size: clamp(16px, 1.8vw, 19px); line-height: 1.85; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 9px; }
.hero-facts span { padding: 7px 11px; border: 1px solid var(--line); border-radius: 100px; font-family: var(--font-mono); font-size: 11px; background: rgba(255, 250, 241, .5); }
.hero-stamp {
  position: relative; width: min(100%, 386px); aspect-ratio: 1; padding: 24px; justify-self: end;
  border: 2px solid var(--ink); border-radius: 30px; background: var(--accent); box-shadow: 12px 12px 0 var(--ink);
  transform: rotate(2.5deg);
}
.stamp-grid { position: relative; height: calc(100% - 52px); overflow: hidden; background: var(--card); border: 2px solid var(--ink); border-radius: 15px; }
.stamp-grid::before {
  content: ""; position: absolute; inset: 37px; opacity: .92;
  background-image:
    linear-gradient(90deg, var(--ink) 50%, transparent 50%),
    linear-gradient(var(--ink) 50%, transparent 50%);
  background-size: 22px 22px; background-position: 0 0, 7px 9px;
  mask-image: linear-gradient(130deg, transparent 0 20%, #000 20% 82%, transparent 82%);
}
.finder { position: absolute; z-index: 2; width: 73px; height: 73px; border: 10px solid var(--ink); background: var(--card); }
.finder::after { content: ""; position: absolute; inset: 10px; background: var(--ink); }
.finder-a { left: 12px; top: 12px; }
.finder-b { right: 12px; top: 12px; }
.finder-c { left: 12px; bottom: 12px; }
.cell { position: absolute; z-index: 2; width: 14px; height: 14px; background: var(--ink); }
.c1 { right: 34px; bottom: 55px; }.c2 { right: 62px; bottom: 30px; }.c3 { right: 90px; bottom: 59px; }
.c4 { right: 22px; bottom: 91px; }.c5 { right: 122px; bottom: 30px; }.c6 { right: 150px; bottom: 76px; }
.stamp-caption { display: flex; justify-content: space-between; margin-top: 16px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; }
.stamp-caption strong { color: var(--card); }

.studio { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr); gap: 30px; align-items: start; scroll-margin-top: 28px; }
.card { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.maker-card { padding: clamp(24px, 4vw, 42px); }
.preview-card { padding: 22px; position: sticky; top: 24px; box-shadow: 5px 5px 0 var(--green); }
.card-heading, .settings-title, .batch-heading, .preview-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.card-heading h2, .batch-heading h2, .premium-map h2 { margin: 2px 0 0; font-size: clamp(24px, 3vw, 31px); line-height: 1.25; }
.section-index { margin: 0 0 3px; color: var(--accent-dark); font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.status-pill, .premium-chip { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 27px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 100px; font-family: var(--font-mono); font-size: 10px; }
.status-pill { background: var(--paper); }
.status-pill.is-over { color: white; background: #a92c18; }
.premium-chip { color: var(--card); background: var(--accent-dark); border-color: var(--accent-dark); }
.mode-tabs { display: inline-flex; margin: 30px 0 20px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.mode-tab { border: 0; padding: 8px 17px; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; font-size: 13px; }
.mode-tab.is-active { color: var(--card); background: var(--ink); box-shadow: 2px 2px 0 var(--accent); }
.field-label, .range-field > span, .color-field > span, .logo-field > div > span, .field > span { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; font-size: 13px; font-weight: 650; }
textarea, input[type="text"], select {
  width: 100%; color: var(--ink); background: #fffdf8; border: 1.5px solid #8a7b68; border-radius: 10px; padding: 13px 14px; outline: 0; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 122px; line-height: 1.7; }
textarea:focus, input[type="text"]:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232, 84, 43, .15); }
textarea:disabled, input:disabled, select:disabled, button:disabled { cursor: not-allowed; }
textarea:disabled { color: #8b8175; background: #eee6da; }
.field-help, .mini-note, .logo-filename { margin: 8px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.6; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.field { display: block; }
.field-wide { grid-column: 1 / -1; }
.check-row { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.check-row input { accent-color: var(--accent); width: 17px; height: 17px; }
.settings-block { margin-top: 30px; padding-top: 28px; border-top: 1px dashed var(--soft-line); }
.settings-title { align-items: center; margin-bottom: 19px; }
.settings-title h3 { margin: 1px 0 0; font-size: 18px; }
.range-field { display: block; }
.range-field > span { justify-content: space-between; margin-bottom: 6px; }
.range-field output { color: var(--accent-dark); font-family: var(--font-mono); font-size: 12px; }
input[type="range"] { width: 100%; height: 6px; accent-color: var(--accent); cursor: pointer; }
.color-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-top: 22px; }
.color-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--soft-line); border-radius: 10px; background: var(--paper); }
.color-field > span { margin: 0; }
.color-field input[type="color"] { width: 39px; height: 33px; border: 0; padding: 0; background: transparent; cursor: pointer; }
.lock-dot, .tiny-lock { display: inline-block; padding: 1px 5px; color: var(--card); background: var(--accent-dark); border-radius: 3px; font-size: 9px; font-weight: 500; line-height: 1.55; }
.contrast-warning { margin: 10px 0 0; padding: 9px 11px; color: #7a2514; background: #ffe2d8; border-left: 3px solid var(--accent); font-size: 12px; }
.logo-field { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; padding: 14px; border: 1px dashed #a89984; border-radius: 10px; }
.logo-field > div { display: grid; gap: 4px; }
.logo-field > div > span { margin: 0; }
.logo-field small { color: var(--muted); font-size: 11px; }
.logo-actions { display: flex !important; align-items: center; gap: 10px; }
.file-button { display: inline-flex; align-items: center; justify-content: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--card); font-size: 12px; cursor: pointer; white-space: nowrap; }
.file-button:has(+ input:disabled) { opacity: .48; cursor: not-allowed; }
.logo-actions input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.text-button { border: 0; color: var(--accent-dark); background: transparent; cursor: pointer; font-size: 12px; text-decoration: underline; }
.maker-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 17px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font-weight: 650; font-size: 13px; cursor: pointer; text-decoration: none; transition: transform .15s, box-shadow .15s, background .15s; }
.button:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.button:active:not(:disabled) { transform: translate(1px, 1px); box-shadow: none; }
.button-primary { color: var(--card); background: var(--accent); border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.button-primary span { font-size: 18px; line-height: 1; }
.button-quiet { background: var(--paper); }
.button-dark { color: var(--card); background: var(--ink); }
.button:disabled { opacity: .48; }
.button-small { min-height: 34px; margin-top: 10px; padding: 6px 11px; font-size: 11px; }
.form-error { margin: 13px 0 0; color: #9c2813; font-size: 12.5px; font-weight: 600; }

.preview-topline { align-items: center; color: var(--muted); font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.live-dot { width: 7px; height: 7px; margin-right: -12px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(31, 111, 90, .12); }
.preview-spec { margin-left: auto; }
.canvas-well { display: grid; place-items: center; min-height: 300px; margin: 18px 0; padding: 18px; border-radius: 12px; background: repeating-conic-gradient(#ded3c2 0 25%, #e9dfd0 0 50%) 0 / 20px 20px; overflow: hidden; }
.canvas-well canvas { width: min(100%, 440px); height: auto; border-radius: 4px; box-shadow: 0 8px 30px rgba(36, 27, 19, .16); }
.canvas-placeholder { display: grid; place-items: center; width: 100%; aspect-ratio: 1; border: 1px dashed #8f806c; border-radius: 8px; color: var(--muted); font-size: 13px; background: var(--card); }
.qr-meta { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border-top: 1px solid var(--soft-line); border-bottom: 1px solid var(--soft-line); }
.qr-meta div { padding: 12px; border-right: 1px solid var(--soft-line); text-align: center; }
.qr-meta div:last-child { border: 0; }
.qr-meta dt { color: var(--muted); font-size: 10px; }
.qr-meta dd { margin: 2px 0 0; font-family: var(--font-mono); font-size: 13px; font-weight: 700; }
.scan-note { display: flex; gap: 10px; margin-top: 16px; color: var(--muted); font-size: 11.5px; }
.scan-note span { color: var(--accent); font-size: 20px; line-height: 1.2; }
.scan-note p { margin: 0; }

.batch-shell { margin-top: 32px; }
.batch-card { padding: clamp(24px, 4vw, 38px); }
.batch-heading p:not(.section-index) { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.batch-lock-note { margin: 20px 0; padding: 11px 13px; border-left: 4px solid var(--accent); background: #ffe7dc; color: #7a2816; font-size: 12px; }
.batch-actions { display: flex; align-items: center; gap: 14px; margin-top: 13px; }
.batch-actions .mini-note { margin: 0; }
.batch-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 22px; }
.batch-item { display: grid; grid-template-columns: 94px minmax(0, 1fr); gap: 13px; padding: 12px; border: 1px solid var(--soft-line); border-radius: 10px; background: var(--paper); }
.batch-item canvas { width: 94px; height: 94px; border-radius: 4px; }
.batch-item-content { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.batch-number { font-family: var(--font-mono); font-size: 10px; color: var(--accent-dark); }
.batch-item p { margin: 4px 0; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.batch-item small { color: var(--muted); font-family: var(--font-mono); font-size: 9px; }

.unlock-section { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 30px; align-items: start; margin-block: 42px; scroll-margin-top: 28px; }
.premium-map { padding: clamp(24px, 4vw, 36px); box-shadow: 5px 5px 0 var(--accent); }
.premium-map ul { list-style: none; padding: 0; margin: 22px 0; display: grid; gap: 11px; }
.premium-map li { display: flex; gap: 12px; padding-bottom: 10px; border-bottom: 1px dashed var(--soft-line); font-size: 13px; }
.premium-map li span { color: var(--accent-dark); font-family: var(--font-mono); font-size: 10px; }
.premium-map > p:last-child { margin: 0; color: var(--muted); font-size: 11.5px; }

.site-footer { margin-top: 78px; padding: 36px 0 22px; color: #f4ecdf; background: var(--ink); }
.footer-main { display: flex; justify-content: space-between; align-items: flex-start; gap: 30px; }
.footer-brand { display: flex; gap: 13px; align-items: center; }
.footer-brand p { margin: 2px 0 0; color: #ad9f8d; font-size: 11px; }
.footer-brand strong { letter-spacing: .08em; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px 22px; font-size: 12px; }
.footer-links a { color: #d9cdbd; text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.footer-base { display: flex; justify-content: space-between; gap: 20px; margin-top: 30px; padding-top: 17px; border-top: 1px solid #3a332c; color: #84796d; font-family: var(--font-mono); font-size: 9.5px; }

/* Shared referral card, styled with each site's palette. */
.referral-card {
  position: relative; overflow: hidden; padding: clamp(24px, 4vw, 36px); color: #fff7eb;
  background: #17130f; border: 1.5px solid var(--ink); border-radius: var(--radius);
  box-shadow: 7px 7px 0 var(--accent);
}
.referral-card::after {
  content: ""; position: absolute; width: 190px; height: 190px; right: -75px; top: -100px;
  border: 30px solid var(--accent); border-radius: 50%; opacity: .22; pointer-events: none;
}
.referral-kicker { display: flex; align-items: center; gap: 8px; color: #cbbba7; font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; }
.referral-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(232, 84, 43, .18); }
.referral-heading { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-top: 16px; }
.referral-heading h2 { margin: 0; font-family: var(--font-display); font-size: clamp(25px, 3vw, 35px); line-height: 1.22; letter-spacing: -.03em; }
.referral-heading p { max-width: 560px; margin: 9px 0 0; color: #bfae9a; font-size: 12.5px; }
.referral-badge { flex: 0 0 auto; padding: 5px 9px; border: 1px solid #746353; border-radius: 100px; color: #cfbea9; font-family: var(--font-mono); font-size: 9px; }
.referral-badge.is-unlocked, .referral-badge.is-trial { color: #17130f; background: #d9f0c8; border-color: #d9f0c8; }
.referral-badge.is-trial { background: #ffd9c8; border-color: #ffd9c8; }
.referral-progress { display: flex; align-items: center; gap: 12px; margin-top: 21px; color: #d9cbbd; font-size: 12px; }
.referral-steps { display: flex; gap: 5px; }
.referral-steps i { width: 34px; height: 5px; border-radius: 10px; background: #493f35; }
.referral-steps i.is-filled { background: var(--accent); }
.referral-label { display: block; margin: 24px 0 7px; color: #ad9d8a; font-size: 10px; }
.referral-copy-row { display: flex; gap: 8px; }
.referral-link { min-width: 0; flex: 1; color: #efe4d6 !important; background: #2a241e !important; border-color: #51463b !important; font-family: var(--font-mono); font-size: 11px; }
.referral-copy { flex: 0 0 auto; padding: 9px 14px; color: #17130f; background: var(--accent); border: 1px solid var(--accent); border-radius: 8px; font-weight: 700; font-size: 12px; cursor: pointer; }
.referral-copy.is-copied { background: #d9f0c8; border-color: #d9f0c8; }
.referral-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-top: 12px; color: #918271; font-size: 10.5px; }
.referral-refresh { flex: 0 0 auto; padding: 0; color: #c8b8a6; background: transparent; border: 0; border-bottom: 1px solid #6a5b4d; font-size: 10px; cursor: pointer; }
.referral-trial { margin-top: 15px; padding: 9px 11px; color: #ffe1d3; background: rgba(232, 84, 43, .15); border: 1px solid rgba(232, 84, 43, .32); border-radius: 7px; font-size: 11px; }

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; padding-bottom: 54px; }
  .hero-stamp { justify-self: start; width: min(82vw, 330px); transform: rotate(1.5deg); }
  .studio, .unlock-section { grid-template-columns: 1fr; }
  .preview-card { position: static; }
  .card { box-shadow: 4px 4px 0 var(--ink); }
  .preview-card { box-shadow: 4px 4px 0 var(--green); }
}

@media (max-width: 600px) {
  .shell { width: min(100% - 24px, 1180px); }
  .site-header { padding: 15px 0; }
  .top-nav { gap: 15px; font-size: 12px; }
  .brand-copy small { display: none; }
  .hero { padding-top: 48px; gap: 34px; }
  .hero h1 { font-size: clamp(47px, 16vw, 70px); }
  .hero-lead { font-size: 15px; }
  .hero-stamp { width: min(85vw, 290px); padding: 17px; box-shadow: 7px 7px 0 var(--ink); }
  .stamp-grid { height: calc(100% - 45px); }
  .finder { width: 57px; height: 57px; border-width: 8px; }
  .finder::after { inset: 8px; }
  .cell { width: 10px; height: 10px; }
  .maker-card, .batch-card, .premium-map { padding: 21px; }
  .card-heading { align-items: center; }
  .mode-tabs { display: flex; width: 100%; }
  .mode-tab { flex: 1; padding-inline: 10px; }
  .field-grid, .color-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .logo-field { align-items: flex-start; flex-direction: column; }
  .maker-actions .button-primary { flex: 1 0 100%; }
  .maker-actions .button { flex: 1; }
  .canvas-well { min-height: 230px; padding: 12px; }
  .qr-meta div { padding: 10px 4px; }
  .batch-actions { align-items: flex-start; flex-direction: column; }
  .batch-item { grid-template-columns: 80px minmax(0, 1fr); }
  .batch-item canvas { width: 80px; height: 80px; }
  .footer-main, .footer-base { flex-direction: column; }
  .footer-links { justify-content: flex-start; }
  .referral-heading { flex-direction: column; }
  .referral-copy-row { flex-direction: column; }
  .referral-foot { flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
