:root {
  --paper: #f7f1e5;
  --paper-deep: #efe6d4;
  --ink: #1a1714;
  --ink-soft: #4a433c;
  --forest: #0e3b34;
  --mint: #1f8a70;
  --leaf: #ddf3ea;
  --seal: #c23b22;
  --seal-deep: #8e2416;
  --sakura: #f6d5dc;
  --sakura-deep: #e7a8b6;
  --gold: #c4a574;
  --line: rgba(26, 23, 20, 0.12);
  --shadow: 0 18px 50px rgba(60, 36, 18, 0.12);
  --serif: "Be Vietnam Pro", "Times New Roman", sans-serif;
  --sans: "Be Vietnam Pro", "Hiragino Sans", sans-serif;
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(circle at 12% 8%, rgba(246, 213, 220, 0.7), transparent 32%),
    radial-gradient(circle at 90% 0%, rgba(221, 243, 234, 0.8), transparent 28%),
    var(--paper);
  line-height: 1.6;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.45;
  background-image:
    linear-gradient(rgba(26, 23, 20, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 23, 20, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 88%);
  z-index: 0;
}
img { max-width: 100%; display: block; }
a { color: var(--forest); }
button, a { -webkit-tap-highlight-color: transparent; }

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--ink);
  color: white;
  padding: 8px 12px;
  z-index: 20;
}
.skip:focus { top: 12px; }

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
  background: rgba(247, 241, 229, 0.78);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
}
.brand img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  box-shadow: 0 6px 16px rgba(47, 90, 160, 0.25);
}
.brand small {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  color: var(--seal);
  letter-spacing: 0.08em;
}
.nav {
  display: flex;
  gap: 18px;
  align-items: center;
}
.nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.95rem;
}
.nav a:hover { color: var(--forest); }

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
  padding: 54px 0 28px;
  position: relative;
}
.kicker {
  font-family: var(--serif);
  color: var(--seal);
  letter-spacing: 0.18em;
  margin: 0 0 8px;
}
h1 {
  font-size: clamp(3.2rem, 7vw, 6.2rem);
  line-height: 0.92;
  margin: 0;
  letter-spacing: -0.04em;
  font-weight: 700;
}
.ink-line {
  display: block;
  height: 14px;
  margin: 14px 0 18px;
  width: min(280px, 70%);
}
.ink-line path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 320;
  stroke-dashoffset: 320;
  animation: draw 1.4s ease forwards 0.25s;
}
.lede {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 38rem;
  margin: 0 0 22px;
}
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  background: var(--forest);
  color: white;
}
.btn.ghost {
  background: transparent;
  color: var(--forest);
  border-color: rgba(14, 59, 52, 0.35);
}
.ink-ripple {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: rgba(26, 23, 20, 0.28);
  transform: scale(1);
  animation: ripple 0.7s ease-out forwards;
  pointer-events: none;
}
.btn .ink-ripple { background: rgba(255, 255, 255, 0.35); }

.hero-stage {
  position: relative;
  min-height: 420px;
  display: grid;
  place-items: center;
}
.tanzaku {
  position: absolute;
  left: 8px;
  top: 18px;
  max-width: 9.5rem;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--forest);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  padding: 10px 12px;
  border-radius: 12px;
}
.notebook {
  width: min(320px, 78%);
  aspect-ratio: 1;
  border-radius: 36px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.7), transparent 40%),
    linear-gradient(160deg, #f8fbff, #e7eef8);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  position: relative;
  animation: floaty 6s ease-in-out infinite;
}
.notebook img { width: 78%; height: auto; }
.petal, .scrap {
  position: absolute;
  pointer-events: none;
  animation: drift 9s linear infinite;
}
.petal {
  width: 16px;
  height: 12px;
  background: var(--sakura-deep);
  border-radius: 12px 0 12px 0;
}
.scrap {
  width: 22px;
  height: 14px;
  background: #fffdf8;
  border: 1px solid var(--line);
  transform: rotate(12deg);
}
.hanko {
  position: absolute;
  right: 18px;
  bottom: 28px;
  width: 104px;
  height: 104px;
  border: 4px solid var(--seal);
  color: var(--seal);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0;
  transform: rotate(-16deg) scale(1.35);
  opacity: 0;
  animation: stamp 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) forwards 1.15s;
  background: rgba(255, 248, 244, 0.72);
  box-shadow: inset 0 0 0 2px rgba(194, 59, 34, 0.35);
}
.hanko span { line-height: 1.05; text-align: center; }

.marquee {
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.7);
  margin-top: 12px;
}
.marquee-track {
  display: flex;
  gap: 28px;
  width: max-content;
  padding: 12px 0;
  animation: ticker 22s linear infinite;
  font-family: var(--serif);
  letter-spacing: 0.08em;
}
.marquee-track span { white-space: nowrap; }

section { padding: 72px 0; position: relative; z-index: 1; }
section, [id] { scroll-margin-top: 88px; }
.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.section-title h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  letter-spacing: -0.03em;
}
.section-title em {
  font-family: var(--serif);
  font-style: normal;
  color: var(--seal);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.card {
  background: rgba(255, 252, 247, 0.86);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}
.card h3 { margin: 8px 0 6px; font-size: 1.15rem; }
.card p { margin: 0; color: var(--ink-soft); }
.mark {
  min-width: 46px;
  height: 46px;
  padding: 0 8px;
  width: max-content;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--leaf);
  color: var(--forest);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}

.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  animation: rise 0.8s ease forwards;
  animation-play-state: paused;
}
.js [data-reveal].is-in { animation-play-state: running; }
.js [data-reveal="1"] { animation-delay: 0.05s; }
.js [data-reveal="2"] { animation-delay: 0.12s; }
.js [data-reveal="3"] { animation-delay: 0.19s; }
.js [data-reveal="4"] { animation-delay: 0.26s; }
.js [data-reveal="5"] { animation-delay: 0.33s; }
.js [data-reveal="6"] { animation-delay: 0.4s; }

.stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: center;
}
.book {
  perspective: 1200px;
  height: 360px;
  position: relative;
}
.book-inner {
  position: relative;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.9s cubic-bezier(0.6, 0.05, 0.2, 1);
}
.book.is-flipped .book-inner { transform: rotateY(-180deg); }
.page {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 18px 28px 28px 18px;
  background: #fffdf8;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 22px 22px 22px 36px;
  overflow: hidden;
}
.page::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 18px;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0 18px,
    rgba(194, 59, 34, 0.35) 18px 20px
  );
  border-right: 1px solid var(--line);
}
.page.back { transform: rotateY(180deg); }
.page h3 { margin-top: 0; }
.row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.95rem;
}
.pill {
  font-size: 0.78rem;
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--leaf);
  color: var(--forest);
}
.pill.wait { background: #fff1d6; color: #8a5a10; }
.note { color: var(--ink-soft); font-size: 0.92rem; }

.stamps {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 18px;
}
.seal {
  width: 124px;
  height: 124px;
  border: 4px solid currentColor;
  border-radius: 12px;
  display: grid;
  place-items: center;
  text-align: center;
  transform: scale(1) rotate(-8deg);
  opacity: 0;
  padding: 8px;
}
.seal b { display: block; font-size: 1.05rem; font-weight: 700; line-height: 1.15; }
.seal small { letter-spacing: 0.04em; }
.seal.present { color: var(--mint); }
.seal.excused { color: #c4841d; }
.seal.absent { color: var(--seal); }
.is-in .seal { animation: stamp 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) forwards; }
.is-in .seal.excused { animation-delay: 0.35s; }
.is-in .seal.absent { animation-delay: 0.7s; }

.family {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 28px;
  align-items: center;
}
.code {
  display: flex;
  gap: 8px;
  margin: 16px 0;
}
.code i {
  flex: 1 1 0;
  min-width: 0;
  height: 48px;
  display: grid;
  place-items: center;
  font-style: normal;
  font-weight: 700;
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 0 var(--paper-deep);
  animation: pop 0.45s ease both;
  animation-play-state: paused;
}
.js .code i { opacity: 0; }
.js .is-in .code i { animation-play-state: running; }
.code i:nth-child(2) { animation-delay: 0.08s; }
.code i:nth-child(3) { animation-delay: 0.16s; }
.code i:nth-child(4) { animation-delay: 0.24s; }
.code i:nth-child(5) { animation-delay: 0.32s; }
.code i:nth-child(6) { animation-delay: 0.4s; }
.code i:nth-child(7) { animation-delay: 0.48s; }
.code i:nth-child(8) { animation-delay: 0.56s; }

.prices {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.price {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: rgba(255, 252, 247, 0.92);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 22px;
  color: inherit;
  text-decoration: none;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
a.price { cursor: pointer; }
.price:hover { transform: translateY(-10px); box-shadow: var(--shadow); }
.price.featured {
  background: var(--forest);
  color: #f6f3ec;
  border-color: var(--forest);
}
.price.featured p, .price.featured li { color: rgba(246, 243, 236, 0.86); }
.ribbon {
  position: absolute;
  top: 16px;
  right: -8px;
  background: var(--seal);
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 4px 12px;
  border-radius: 4px;
}
.price strong { font-size: 1.8rem; display: block; letter-spacing: -0.03em; }
.price ul { padding-left: 18px; margin: 12px 0 18px; }
.price li { margin: 4px 0; }
.buy {
  display: inline-flex;
  align-items: center;
  margin-top: auto;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--forest);
  color: white;
  font-weight: 700;
}
.price.featured .buy { background: white; color: var(--forest); }
.fine { color: var(--ink-soft); font-size: 0.92rem; }

.checkout {
  width: min(40rem, 100%);
  margin: 0 auto;
  padding: 28px 0 72px;
}
.checkout h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
}
.checkout .btn, .checkout .form-status, .checkout .field input {
  scroll-margin-top: 96px;
}
.checkout #send { width: 100%; }
.pay-card {
  background: rgba(255, 252, 247, 0.92);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 22px 22px 26px;
  box-shadow: var(--shadow);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 14px;
  font-weight: 500;
}
.field input, .field textarea {
  font: inherit;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
}
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field textarea:focus {
  outline: 2px solid var(--mint);
  border-color: transparent;
}
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] {
  border-color: var(--seal);
}
.hint, .field-error {
  font-weight: 400;
  font-size: 0.85rem;
}
.hint { color: var(--ink-soft); }
.field-error { min-height: 1.1em; color: var(--seal-deep); }
.order-sum {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin: 0 0 16px;
  padding: 12px 14px;
  background: var(--leaf);
  border-radius: 16px;
}
.order-sum strong { font-size: 1.35rem; }
.steps {
  display: flex;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
}
.steps li {
  flex: 1;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 4px;
  border-radius: 999px;
  background: white;
  color: var(--ink-soft);
}
.steps li[aria-current="step"], .steps li.is-done {
  background: var(--forest);
  color: white;
}
button:disabled { opacity: 0.65; }
.pay-status {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 14px;
  text-align: center;
  font-weight: 700;
}
.pay-status[data-state="waiting"] { background: #f6e7c1; color: #6a4b12; }
.pay-status[data-state="paid"] { background: var(--leaf); color: var(--forest); }
.pay-status[data-state="expired"] { background: var(--sakura); color: var(--seal-deep); }
.bank-list dd { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.copy {
  border: 0;
  background: var(--paper-deep);
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
}
.pay-howto { margin: 8px 0 0; padding-left: 18px; }
.pay-howto li { margin: 4px 0; }
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form-status { min-height: 1.4em; margin: 12px 0 0; }
.form-status.bad { color: var(--seal-deep); }
.qr-box {
  display: grid;
  place-items: center;
  background: white;
  border-radius: 18px;
  min-height: 240px;
  padding: 12px;
}
.qr-box img, .qr-box svg {
  width: min(280px, 100%);
  height: auto;
  max-width: 100%;
}
.bank-list {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 8px 12px;
  margin: 16px 0;
}
.bank-list dt { color: var(--ink-soft); }
.bank-list dd { margin: 0; font-weight: 700; }
.pick { display: flex; gap: 10px; flex-wrap: wrap; }
.guide { margin-top: 18px; }
.guide h2 { margin: 0 0 8px; font-size: 1.25rem; }
.guide p { margin: 0 0 10px; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  position: relative;
  z-index: 1;
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--ink-soft);
}
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--ink-soft); }

.doc {
  padding: 36px 0 64px;
  position: relative;
  z-index: 1;
}
.doc-sheet {
  background: rgba(255, 252, 247, 0.92);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 28px 28px 40px;
  box-shadow: var(--shadow);
}
.doc h1 { font-size: clamp(2.2rem, 4vw, 3.4rem); }
.doc h2 { margin-top: 1.6em; font-size: 1.25rem; }
.doc h3 { margin-bottom: 0.3em; }
.lang {
  margin-top: 48px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.seal-mini {
  float: right;
  width: 86px;
  height: 86px;
  border: 3px solid var(--seal);
  color: var(--seal);
  border-radius: 8px;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.15;
  padding: 6px;
  transform: rotate(-12deg);
  margin-left: 12px;
}
.steps { padding-left: 18px; }
.steps li { margin: 6px 0; }

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes stamp {
  0% { opacity: 0; transform: rotate(-16deg) scale(1.4); }
  70% { opacity: 1; transform: rotate(-14deg) scale(0.96); }
  100% { opacity: 1; transform: rotate(-12deg) scale(1); }
}
@keyframes drift {
  0% { transform: translate3d(0, -10px, 0) rotate(0deg); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate3d(40px, 220px, 0) rotate(180deg); opacity: 0; }
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@keyframes rise {
  to { opacity: 1; transform: none; }
}
@keyframes ripple {
  to { transform: scale(18); opacity: 0; }
}
@keyframes pop {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 1100px) {
  .prices { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .site-header .wrap { flex-wrap: wrap; padding: 8px 0 12px; }
  .nav { gap: 12px; }
  .hero, .stage, .family, .grid, .prices, .checkout { grid-template-columns: 1fr; }
  .hero { padding-top: 28px; }
  .hero-stage { min-height: 340px; }
  .tanzaku { display: none; }
  section { padding: 48px 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  [data-reveal], .code i { opacity: 1; transform: none; }
  .hanko, .seal { opacity: 1; transform: rotate(-12deg) scale(1); }
  html { scroll-behavior: auto; }
}
