@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600&family=Lora:wght@700&display=swap');

:root {
  --paper: #fff9fa;
  --surface: #ffffff;
  --soft: #fdecef;
  --ink: #23191d;
  --muted: #6e5a60;
  --line: #f3d5dc;
  --accent: #e06d88;
  --accent-hover: #c95672;
  --accent-ink: #963951;
  --frame: #e8b4c0;
  --step: #f3c6d1;
  --live: #5c8d76;
  --shadow: 0 12px 32px -8px rgba(224, 109, 136, .12);
  --ring: rgba(224, 109, 136, .2);
  --mono: 'JetBrains Mono', Consolas, monospace;
  --display: 'Lora', Georgia, 'Times New Roman', serif;
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 104px; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: wait; opacity: .7; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 3px; }
.wrap { width: min(1184px, calc(100% - 72px)); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(255, 249, 250, .85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { min-height: 76px; display: flex; align-items: center; gap: 30px; }
.wordmark { display: inline-flex; align-items: center; gap: 9px; color: var(--brand-ink, var(--ink)); font: 700 24px/1.1 var(--display); text-decoration: none; }
.mark { display: grid; place-items: center; color: var(--brand-accent, var(--accent-hover)); }
.sakura-icon { display: block; width: 32px; height: 32px; }
.header-inner nav { display: flex; align-items: center; gap: clamp(18px, 3vw, 35px); margin-left: auto; }
.header-inner nav a { color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; }
.header-inner nav a:hover { color: var(--accent-ink); }
.header-inner nav .pdf-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid var(--frame);
  border-radius: 9999px;
  background: var(--soft);
  color: var(--accent-ink);
  font-weight: 700;
  white-space: nowrap;
  transition: background-color .2s, border-color .2s, color .2s;
}
.header-inner nav .pdf-nav-link:hover { color: #fff; background: var(--accent-ink); border-color: var(--accent-ink); }
.pdf-nav-link svg { width: 16px; height: 16px; flex: none; }
.header-link, .intro-cta, .primary, .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 9999px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition: background-color .2s, border-color .2s, color .2s;
}
.header-link, .intro-cta, .primary, #download { color: #fff; background: var(--accent); }
.header-link:hover, .intro-cta:hover, .primary:not(:disabled):hover, #download:hover { background: var(--accent-hover); }

.intro { position: relative; display: grid; align-items: center; min-height: 350px; padding-block: 41px 35px; }
.intro-copy { position: relative; z-index: 1; width: min(100%, 650px); }
.kicker, .panel-index { font: 600 11px/1.5 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--accent-ink); }
.kicker { margin: 0 0 13px; }
.intro h1 { margin: 0; font: 700 clamp(49px, 5.6vw, 76px)/1.08 var(--display); letter-spacing: -.045em; }
.intro h1 span { color: var(--accent-ink); }
.intro-lede { max-width: 475px; margin: 16px 0 20px; font-size: 15px; line-height: 1.7; color: var(--muted); }
.intro-cta { padding-inline: 21px; }
.hero-badge { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 12px; margin-top: 20px; font: 500 10px/1.5 var(--mono); color: var(--muted); }
.hero-badge > span { display: inline-flex; align-items: center; gap: 8px; }
.hero-badge > span + span::before { content: '•'; color: var(--frame); }
.live-label::after { content: ''; order: -1; background: var(--live); width: 7px; height: 7px; border-radius: 50%; }
.live-label::before { order: -2; }
.intro-art { position: absolute; inset: 0 -35px 0 46%; overflow: hidden; pointer-events: none; }
.sakura-halo { position: absolute; inset: 4% 3% 2% 3%; background: radial-gradient(ellipse at 63% 54%, #f9dbe3 0, #fcedf0 43%, transparent 72%); }
.sakura-branch { position: absolute; width: min(100%, 610px); height: auto; top: -5%; right: 0; }
.sakura-petals { position: absolute; inset: 0; pointer-events: none; }
.sakura-petals i { position: absolute; top: var(--top); left: var(--left); width: 16px; height: 10px; background: linear-gradient(150deg, #eeb0bf, #f8dce3); border-radius: 85% 12% 80% 32%; opacity: .65; animation: petal-drift var(--duration) ease-in-out var(--delay) infinite alternate; }
.sakura-petals i:nth-child(1) { --top: 24%; --left: 18%; --duration: 8s; --delay: -2s; }
.sakura-petals i:nth-child(2) { --top: 46%; --left: 30%; --duration: 11s; --delay: -5s; }
.sakura-petals i:nth-child(3) { --top: 59%; --left: 48%; --duration: 7s; --delay: -4s; }
.sakura-petals i:nth-child(4) { --top: 36%; --left: 7%; --duration: 10s; --delay: -6s; }
.sakura-petals i:nth-child(5) { --top: 69%; --left: 61%; --duration: 9s; --delay: -1s; }
.sakura-petals i:nth-child(6) { --top: 58%; --left: 83%; --duration: 12s; --delay: -6s; }
@keyframes petal-drift { from { transform: translate(13px, -12px) rotate(-22deg); } to { transform: translate(-26px, 37px) rotate(83deg); } }

.studio-section { padding-block: 17px 48px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 15px 26px; margin-bottom: 22px; }
.section-head h2, .faq h2 { margin: 0; font: 700 clamp(28px, 4vw, 43px)/1.1 var(--display); letter-spacing: -.04em; }
.section-head > p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.workspace { display: grid; grid-template-columns: 1.18fr .92fr 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.panel { min-width: 0; padding: clamp(19px, 2.35vw, 32px); }
.panel + .panel { border-inline-start: 1px solid var(--line); }
.panel-title { margin-bottom: 20px; }
.panel-title h3 { margin: 4px 0 0; font: 700 clamp(22px, 2vw, 28px)/1.15 var(--display); letter-spacing: -.025em; }

.tabs, .size-options { display: flex; flex-wrap: wrap; gap: 5px; }
.tabs { padding: 5px; background: var(--soft); border-radius: 20px; margin-bottom: 18px; }
.tab, .size-options span {
  display: inline-flex; align-items: center; justify-content: center; min-height: 36px;
  border: 1px solid transparent; border-radius: 9999px; padding: 6px 10px; color: var(--muted);
  background: transparent; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.tab:hover, .size-options label:hover span { background: #f8dce4; color: var(--ink); }
.tab.active, .size-options input:checked + span { background: var(--accent); color: #fff; }
.size-options label { position: relative; margin: 0; cursor: pointer; }
.size-options span { background: var(--soft); }
.size-options input, .drop input { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.size-options input:focus-visible + span { outline: 2px solid var(--accent-hover); outline-offset: 2px; }

label, legend { color: var(--ink); font-size: 13px; font-weight: 600; }
label { display: block; margin-bottom: 13px; }
fieldset { border: 0; padding: 0; margin: 0 0 15px; min-width: 0; }
legend { padding: 0; margin-bottom: 8px; }
input:not([type]), input:is([type=text], [type=url], [type=email], [type=tel]), select, textarea {
  display: block; width: 100%; padding: 10px 12px; min-height: 43px; margin-top: 7px;
  color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 11px;
  font-size: 14px; font-weight: 400;
}
input:not([type]):focus, input:is([type=text], [type=url], [type=email], [type=tel], [type=color]):focus, select:focus, textarea:focus {
  border-color: var(--accent); outline: 0; box-shadow: 0 0 0 3px var(--ring);
}
input::placeholder, textarea::placeholder { color: #79636b; opacity: 1; }
textarea { min-height: 100px; resize: vertical; }
input:is([type=checkbox], [type=radio]) { accent-color: var(--accent-hover); }
.row, .options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.options input[type=color] { display: block; width: 100%; height: 43px; margin-top: 7px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); cursor: pointer; }
.options input[type=color]::-webkit-color-swatch-wrapper { padding: 1px; }
.options input[type=color]::-webkit-color-swatch { border: 1px solid var(--line); border-radius: 6px; }
.hint, .preview-foot { color: var(--muted); font-size: 12px; line-height: 1.6; }
.hint { margin: 8px 0; }
.drop { position: relative; padding: 17px 12px; text-align: center; border: 1px dashed var(--frame); border-radius: 13px; background: var(--paper); cursor: pointer; }
.drop:hover, .drop.drag, .drop:focus-within { border-color: var(--accent); background: var(--soft); }
.drop strong, .drop small { display: block; margin-top: 4px; }
.drop small, .file-info { color: var(--muted); font-size: 11px; line-height: 1.5; }
.file-info { overflow-wrap: anywhere; margin-block: 8px; }
.file-choice { display: flex; flex-wrap: wrap; gap: 7px 12px; margin-bottom: 12px; }
.file-choice label { display: flex; align-items: center; gap: 5px; margin: 0; font-size: 11px; cursor: pointer; }
.file-choice input { margin: 0; }
.upload-note { padding: 12px; margin-bottom: 10px; background: var(--soft); border-radius: 12px; }
.upload-note p { margin: 5px 0 0; font-size: 12px; color: var(--muted); }
.palettes { display: flex; flex-wrap: wrap; gap: 6px; }
.palette { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 9999px; color: var(--ink); background: var(--surface); font-size: 10px; font-weight: 600; }
.palette:hover, .palette[aria-pressed=true] { border-color: var(--accent); background: var(--soft); }
.palette > span { width: 15px; height: 15px; border: 1px solid var(--line); border-radius: 50%; background: linear-gradient(135deg, var(--swatch-dark) 50%, var(--swatch-light) 50%); }
.qr-frames { margin: 14px 0; padding: 11px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.qr-frames summary { cursor: pointer; color: var(--ink); font-size: 13px; font-weight: 700; }
.frame-group { margin: 12px 0 0; padding: 0; border: 0; min-width: 0; }
.frame-group legend { padding: 0; margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 600; }
.frame-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.frame-option {
  --frame-ink: #883850; --frame-paper: #fff9fa; display: grid; justify-items: center; align-content: center; gap: 5px;
  min-height: 62px; padding: 5px 2px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--ink); font-size: 10px; line-height: 1.25; text-align: center;
}
.frame-option:hover, .frame-option[aria-pressed=true] { border-color: var(--accent); background: var(--soft); }
.frame-option[aria-pressed=true] { box-shadow: inset 0 0 0 1px var(--accent); }
.frame-option[data-frame=sakura] { --frame-ink: #9e2a47; --frame-paper: #fff1f4; }
.frame-option[data-frame=matcha] { --frame-ink: #2d4f3e; --frame-paper: #edf5ef; }
.frame-option[data-frame=sumi] { --frame-ink: #23191d; --frame-paper: #f7f2f0; }
.frame-thumb { position: relative; display: grid; place-items: center; width: 27px; height: 29px; border: 1px solid var(--frame-ink); border-radius: 5px; background: var(--frame-paper); }
.frame-thumb::before {
  content: ''; width: 13px; height: 13px; color: var(--frame-ink);
  background: linear-gradient(currentColor 0 0) top left / 5px 5px no-repeat,
    linear-gradient(currentColor 0 0) top right / 5px 5px no-repeat,
    linear-gradient(currentColor 0 0) bottom left / 5px 5px no-repeat,
    repeating-conic-gradient(currentColor 0% 25%, transparent 0% 50%) bottom right / 4px 4px no-repeat;
}
.frame-option:not([data-frame=none], [data-frame=outline]) .frame-thumb::after { content: ''; position: absolute; inset: auto 3px 2px; height: 4px; border-radius: 2px; background: var(--frame-ink); }
.frame-option[data-frame=top] .frame-thumb::after { top: 2px; bottom: auto; }
.frame-option[data-frame=none] .frame-thumb { border-color: transparent; background: transparent; }
.frame-caption { margin-top: 10px; }
.primary { width: 100%; margin-top: 2px; }
.error { color: #9e2a47; font-size: 12px; line-height: 1.55; margin: 9px 0 0; }
.error:empty { display: none; }

.qr-display { position: relative; }
.qr-stage {
  display: grid; place-items: center; aspect-ratio: 1; padding: clamp(13px, 2vw, 25px);
  border: 1px dashed var(--frame); background: var(--soft); border-radius: 16px; text-align: center;
}
.frame-blossom { position: absolute; z-index: 1; right: -9px; top: -11px; color: var(--accent); background: var(--surface); border-radius: 50%; pointer-events: none; }
.frame-blossom .sakura-icon { width: 24px; height: 24px; }
.qr-placeholder { display: grid; justify-items: center; gap: 7px; color: var(--muted); }
.placeholder-shape { font-size: 61px; line-height: 1; color: var(--accent); }
.qr-placeholder strong { font-size: 13px; color: var(--ink); }
.qr-placeholder small { font-size: 11px; }
#qr-image { width: min(100%, 315px); height: auto; display: block; }
.qr-ready #qr-image { animation: qr-in .25s ease-out both; }
@keyframes qr-in { from { opacity: .2; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }
.result p { color: var(--muted); overflow-wrap: anywhere; font-size: 11px; }
.actions { display: grid; gap: 7px; }
.secondary { color: var(--ink); background: var(--surface); border-color: var(--line); }
.secondary:hover { background: var(--soft); }
.preview-foot { margin: 13px 0 0; }
.ad-slot { margin-top: 26px; min-height: 90px; text-align: center; color: var(--muted); font-size: 11px; }

.info-section { padding-block: 28px 56px; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.steps article, .faq-list details { border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.steps article { padding: 19px 22px 20px; }
.steps span { display: block; color: var(--step); font: 600 37px/1 var(--mono); }
.steps h3 { margin: 10px 0 4px; font: 700 21px/1.2 var(--display); }
.steps p, .faq-list p { color: var(--muted); font-size: 13px; line-height: 1.65; margin: 7px 0 0; }
.faq { display: grid; grid-template-columns: .85fr 1.15fr; align-items: start; gap: 20px 35px; padding-block: 24px 64px; }
.faq-list details { padding: 13px 17px; margin-bottom: 8px; }
.faq-list summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 600; list-style: none; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: '+'; color: var(--accent-ink); font: 500 17px/1 var(--mono); }
.faq-list details[open] summary::after { content: '−'; }
.qr-guides { line-height: 1.65; }
.qr-guides section { max-width: 72ch; margin-bottom: 1.5rem; }
.qr-guides h2 { font-size: clamp(1.25rem, 3vw, 1.65rem); margin: 0 0 .5rem; }
.qr-guides p { margin: 0; color: var(--muted); }
.qr-guides ul { padding-inline-start: 1.25rem; }
.qr-guides a { color: var(--accent-ink); text-underline-offset: .2em; }
footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-block: 20px; color: var(--muted); font-size: 12px; }
.footer-brand { display: inline-flex; align-items: center; gap: 5px; }
.footer-brand .sakura-icon { color: var(--accent-hover); width: 18px; height: 18px; }
body.mobile-app .site-header { padding-top: max(28px, env(safe-area-inset-top)); }

@media (max-width: 940px) { .wrap { width: min(1184px, calc(100% - 44px)); } }
@media (max-width: 800px) {
  .workspace, .faq, .steps { grid-template-columns: 1fr; }
  .panel + .panel { border-inline-start: 0; border-top: 1px solid var(--line); }
  .qr-display { width: min(100%, 340px); margin-inline: auto; }
  .preview .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .header-inner nav a:not(.pdf-nav-link) { display: none; }
  .intro-art { inset: 0 -22px 0 40%; opacity: .65; }
}
@media (max-width: 520px) {
  html { scroll-padding-top: 114px; }
  .wrap { width: calc(100% - 32px); }
  .header-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding-block: 8px; }
  .wordmark { font-size: 21px; }
  .header-inner .wordmark { grid-column: 1 / -1; justify-self: start; }
  .header-inner nav { margin-left: 0; }
  .header-link { padding-inline: 11px; font-size: 12px; }
  .intro { min-height: 0; padding-block: 43px 29px; }
  .intro h1 { font-size: clamp(40px, 10.8vw, 60px); }
  .intro-lede { font-size: 13px; max-width: 38ch; }
  .hero-badge { gap: 5px 8px; font-size: 9px; }
  .intro-art { inset: 0 -16px 0 39%; opacity: .42; }
  .sakura-branch { min-width: 232px; }
  .section-head { align-items: start; flex-direction: column; }
  .section-head > p { font-size: 12px; }
  .studio-section { padding-bottom: 28px; }
  .info-section { padding-block: 19px 37px; }
  .faq { padding-bottom: 36px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sakura-petals i, .qr-ready #qr-image { animation: none; }
  .header-link, .intro-cta, .primary, .secondary, .header-inner nav .pdf-nav-link { transition: none; }
}
