/* そら＆なつこ 結婚式のご案内 — v8
   コンセプト: ふたりが書いた招待状を、羊が届けにくる。
   トーン: ポップでかわいい。ただし手作り感は出さない。
   - 太い黒フチ・ずらした黒い影は使わない（v6 が安っぽく見えた原因）
   - ポップさは「パステルの色・まるい形・はずむ動き」で出す
   - 封筒は写実的な質感（v7 から継承）、色だけかわいく */

/* ---------- tokens ---------- */
:root {
  --paper: #FFFBF5;
  --cream: #FFF4E6;
  --wall: #ECE3D9;
  --floor: #D2C4B5;
  --ink: #3B3330;
  --ink-2: #6A5F58;
  --mute: #A0948A;
  --hair: #F0E4D6;

  /* パステル（役割つき）：ピンク＝新婦・バター＝新郎・空＝ふたり・ミント＝ご案内 */
  --pink: #F8B9C8;
  --pink-d: #E98AA2;
  --butter: #FFE08A;
  --butter-d: #F2C24E;
  --sky: #AFDBF2;
  --sky-d: #6FB8E0;
  --mint: #BDE6D2;
  --mint-d: #7CC9A6;
  --coral: #F07A62;
  --coral-d: #D35E47;

  --f-head: "Zen Maru Gothic", sans-serif;
  --f-body: "Zen Kaku Gothic New", sans-serif;
  --f-pop: "Fredoka", "Zen Maru Gothic", sans-serif;

  /* 文字の大きさ（7段階） */
  --fs-1: 11px; --fs-2: 13px; --fs-3: 15px; --fs-4: 18px; --fs-5: 24px; --fs-6: 34px; --fs-7: 56px;
  /* 余白（8の倍数） */
  --s-1: 8px; --s-2: 16px; --s-3: 24px; --s-4: 32px; --s-5: 48px; --s-6: 64px; --s-7: 96px;

  --r: 22px;
  /* 舞台は「アドレスバーが隠れたときの高さ（lvh）」で作り、中身は画面の上から svh で置く。
     svh で作るとスクロールでアドレスバーが隠れた瞬間に下に余白が出て、羊が上にずれて見える */
  --stage-h: 100vh;
  --lift: 0px;   /* 舞台の下端のうち、アドレスバーに隠れている分 */
  --floor-h: 24vh;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --bounce: cubic-bezier(.34, 1.56, .64, 1);
  --col: 560px;
  --shadow-soft: 0 2px 4px rgba(120,80,60,.05), 0 14px 30px -14px rgba(120,80,60,.28);
  --shadow-deep: 0 2px 4px rgba(90,60,40,.08), 0 30px 60px -24px rgba(90,60,40,.42);
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.35  0 0 0 0 0.3  0 0 0 0 0.25  0 0 0 .06 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --grain-strong: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.4  0 0 0 0 0.35  0 0 0 0 0.3  0 0 0 .16 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
@supports (height: 1lvh) {
  :root { --stage-h: 100lvh; --lift: calc(100lvh - 100svh); --floor-h: calc(100lvh - 76svh); }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-weight: 400;
  font-size: var(--fs-3);
  line-height: 1.95;
  letter-spacing: .05em;
  font-feature-settings: "palt";
  -webkit-font-smoothing: antialiased;
  /* hidden だと Android の Chrome で sticky（オープニング・エンディングの舞台）が効かず、上へ流れてしまう。clip なら効く */
  overflow-x: hidden;
  overflow-x: clip;
}
p { margin: 0; }
img { max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--coral-d); text-decoration-thickness: 1px; text-underline-offset: 4px; }
.en { font-family: var(--f-pop); font-weight: 500; font-style: normal; letter-spacing: .04em; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.ico { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 撮影スタジオ（オープニング・エンディング） ---------- */
.opening { position: relative; height: 320svh; }
.ending { position: relative; height: 300svh; }
.op-stage, .ed-stage { position: sticky; top: 0; height: var(--stage-h); overflow: hidden; background: var(--wall); }
.studio { position: absolute; inset: 0; }
.wall { position: absolute; left: 0; right: 0; top: 0; bottom: var(--floor-h); background: var(--grain), radial-gradient(130% 90% at 50% 38%, #F2EBE2 0%, var(--wall) 55%, #E2D7CA 100%); }
.floor { position: absolute; left: 0; right: 0; bottom: 0; height: var(--floor-h); background: var(--grain-strong), linear-gradient(180deg, #D8CBBD 0%, var(--floor) 30%, #C9BAA9 100%); }
.floor::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: rgba(110,90,70,.18); }
/* 壁にふわっと浮かぶ、パステルの丸（ポップさの下地） */
.studio::before, .studio::after { content: ""; position: absolute; border-radius: 50%; filter: blur(2px); opacity: .55; }
.studio::before { width: 46vmin; height: 46vmin; left: -12vmin; top: 8svh; background: radial-gradient(circle at 40% 40%, var(--pink), transparent 70%); }
.studio::after { width: 40vmin; height: 40vmin; right: -10vmin; top: 30svh; background: radial-gradient(circle at 50% 50%, var(--sky), transparent 70%); }

/* ---------- オープニング ---------- */
/* 羊の幅は、横幅だけでなく画面の高さでも決める（羊の画像は 幅:高さ = 1:2.15）。
   高さの低いノートPCでも、羊＋吹き出し（約150px）が画面に収まるようにする */
.courier { position: absolute; left: 50%; bottom: calc(var(--lift) + 7svh); transform: translateX(-50%); width: min(50vw, 240px, calc((91svh - 150px) / 2.15)); z-index: 3; }
.courier-body { position: relative; }
.sheep { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; filter: drop-shadow(0 18px 14px rgba(70,50,30,.18)); }
.mail-in-mouth { position: absolute; left: 25%; top: 21%; width: 50%; height: auto; aspect-ratio: 3 / 2; transform: rotate(-7deg); filter: drop-shadow(0 3px 3px rgba(50,35,20,.28)); }

.speech {
  position: absolute; left: 50%; bottom: calc(100% + 22px); transform: translateX(-50%);
  width: max-content; max-width: 86vw;
  padding: 16px 24px 17px;
  background: #fff;
  border-radius: 28px;
  box-shadow: 0 0 0 6px rgba(255,255,255,.5), var(--shadow-soft);
  font-family: var(--f-head); font-weight: 700; font-size: var(--fs-4); line-height: 1.6; letter-spacing: .06em;
  text-align: center; color: var(--ink);
}
.speech::after { content: ""; position: absolute; left: 50%; bottom: -9px; width: 18px; height: 18px; margin-left: -9px; background: #fff; transform: rotate(45deg); border-radius: 3px; }
.speech .to { display: block; margin-bottom: 2px; font-size: var(--fs-2); color: var(--pink-d); }
.speech .to:empty { display: none; }
.scroll-hint {
  position: absolute; right: 18px; bottom: calc(var(--lift) + 3svh); z-index: 4;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  writing-mode: vertical-rl;
  font-family: var(--f-pop); font-weight: 600; font-size: 11px; letter-spacing: .3em; color: var(--ink-2);
}
.scroll-hint i { writing-mode: horizontal-tb; width: 10px; height: 10px; border-radius: 50%; background: var(--coral); animation: hop 1.4s var(--bounce) infinite; }
@keyframes hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(10px); } }

.paper-cover { position: absolute; inset: 0; z-index: 6; background: var(--grain), var(--paper); opacity: 0; pointer-events: none; }

/* ---------- 封筒（写実的な質感 × かわいい色） ---------- */
.envelope {
  position: absolute; left: 50%; top: 48svh; z-index: 5;
  width: min(84vw, 440px); aspect-ratio: 1.55;
  transform: translate(-50%, -50%);
  perspective: 1200px;
  visibility: hidden;
}
.env-back { position: absolute; inset: 0; border-radius: 10px; background: var(--grain), linear-gradient(180deg, #F2C7CF, #E9B3BE); box-shadow: var(--shadow-deep); }
.env-letter {
  position: absolute; z-index: 1; left: 5%; right: 5%; top: 6%; height: 86%;
  border-radius: 8px;
  background: var(--grain), linear-gradient(180deg, #FFFFFF, #FFF8EE);
  box-shadow: 0 1px 2px rgba(90,60,40,.08), 0 6px 16px -8px rgba(90,60,40,.25);
  display: grid; place-items: center;
}
.el-inner { position: absolute; inset: 8%; border: 2px dashed var(--pink); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; }
.el-label { font-family: var(--f-pop); font-weight: 600; font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--pink-d); }
.el-mono { font-family: var(--f-pop); font-weight: 600; font-size: clamp(30px, 9vw, 46px); line-height: 1.1; letter-spacing: .04em; color: var(--ink); }
.el-mono em { font-style: normal; color: var(--coral); margin: 0 .1em; }
.el-date { font-family: var(--f-pop); font-weight: 500; font-size: var(--fs-2); letter-spacing: .2em; color: var(--ink-2); }

.env-front { position: absolute; inset: 0; z-index: 2; filter: drop-shadow(0 -2px 3px rgba(150,70,80,.12)); pointer-events: none; }
.env-front i {
  position: absolute; inset: 0; border-radius: 0 0 10px 10px;
  clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%);
  background:
    linear-gradient(to top right, transparent calc(50% - .5px), rgba(160,80,95,.16) 50%, transparent calc(50% + .5px)) left bottom / 50% 100% no-repeat,
    linear-gradient(to top left, transparent calc(50% - .5px), rgba(160,80,95,.16) 50%, transparent calc(50% + .5px)) right bottom / 50% 100% no-repeat,
    var(--grain),
    linear-gradient(180deg, #FAD9DF 0%, #F3C2CC 100%);
}
.env-flap { position: absolute; left: 0; right: 0; top: 0; height: 58%; z-index: 3; transform-origin: 50% 0; filter: drop-shadow(0 4px 5px rgba(150,70,80,.18)); }
.flap-shape { position: absolute; inset: 0; border-radius: 10px 10px 0 0; clip-path: polygon(0 0, 100% 0, 50% 100%); background: var(--grain), linear-gradient(180deg, #F9D3DA 0%, #F0B9C5 100%); }
.seal {
  position: absolute; left: 50%; bottom: -26px; transform: translateX(-50%);
  display: grid; place-items: center;
  width: 58px; height: 58px;
  background: radial-gradient(circle at 36% 30%, #FFA08C 0%, var(--coral) 50%, var(--coral-d) 100%);
  box-shadow: inset 0 2px 3px rgba(255,230,220,.45), inset 0 -3px 5px rgba(120,30,15,.35), 0 3px 6px rgba(150,60,40,.3);
  border-radius: 52% 48% 50% 50% / 50% 52% 48% 50%;
}
.seal::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; box-shadow: inset 0 1px 2px rgba(120,30,15,.45), 0 1px 0 rgba(255,230,220,.35); }
.seal svg { position: relative; width: 22px; height: 22px; fill: #D9604B; filter: drop-shadow(0 1px 0 rgba(255,220,210,.5)) drop-shadow(0 -1px 0 rgba(120,30,15,.45)); }
.env-flap.open { z-index: 0; }
.env-flap.open .seal { opacity: 0; }

/* ---------- 便箋（本文） ---------- */
.letter { position: relative; max-width: var(--col); margin: 0 auto; padding: 0 var(--s-3); background: var(--grain), var(--paper); counter-reset: sec; }
.sec { position: relative; padding: var(--s-7) 0 var(--s-6); text-align: center; }
/* 章のあいだは、羊の足あと */
.sec + .sec::before {
  content: ""; position: absolute; left: 50%; top: 0; width: 96px; height: 20px; margin-left: -48px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 20'><g fill='%23F8B9C8'><ellipse cx='12' cy='10' rx='3' ry='5' transform='rotate(-12 12 10)'/><ellipse cx='19' cy='10' rx='3' ry='5' transform='rotate(12 19 10)'/></g><g fill='%23FFE08A'><ellipse cx='45' cy='10' rx='3' ry='5' transform='rotate(-12 45 10)'/><ellipse cx='52' cy='10' rx='3' ry='5' transform='rotate(12 52 10)'/></g><g fill='%23AFDBF2'><ellipse cx='78' cy='10' rx='3' ry='5' transform='rotate(-12 78 10)'/><ellipse cx='85' cy='10' rx='3' ry='5' transform='rotate(12 85 10)'/></g></svg>") center / contain no-repeat;
}
.sec-head { margin-bottom: var(--s-5); counter-increment: sec; }
.sec-head .en {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 16px 4px 6px; border-radius: 999px;
  background: var(--c, var(--pink));
  font-family: var(--f-pop); font-weight: 600; font-size: var(--fs-2); letter-spacing: .14em; text-transform: uppercase; color: var(--ink);
}
.sec-head .en::before {
  content: counter(sec, decimal-leading-zero);
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; font-size: var(--fs-1); letter-spacing: 0;
}
.sec-head h2 { margin: var(--s-2) 0 0; font-family: var(--f-head); font-weight: 900; font-size: var(--fs-5); line-height: 1.5; letter-spacing: .1em; }
.p2 { --c: var(--pink); } .p3 { --c: var(--butter); } .p4 { --c: var(--sky); } .p5 { --c: var(--mint); }
.p6 { --c: var(--pink); } .p7 { --c: var(--butter); } .p8 { --c: var(--sky); }
.ruled { font-family: var(--f-head); font-weight: 500; font-size: var(--fs-3); line-height: 2.2; letter-spacing: .08em; text-align: center; line-break: strict; }
.ruled p { text-wrap: balance; }
.greeting p + p { margin-top: var(--s-2); }
.greeting span { display: block; white-space: nowrap; }
/* いちばん長い行（16字）が、画面の幅に収まる文字の大きさ */
.greeting { font-size: min(var(--fs-3), calc((100vw - 100px) / 17.5)); }
.greeting .opening-word { text-align: left; }
.greeting .closing-word { text-align: right; }

/* ボタン：ぷっくり */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-1);
  min-height: 54px; padding: 0 var(--s-4);
  border: 0; border-radius: 999px;
  background: var(--coral); color: #fff;
  font-family: var(--f-head); font-weight: 700; font-size: var(--fs-3); letter-spacing: .1em;
  text-decoration: none;
  box-shadow: 0 4px 0 var(--coral-d), 0 10px 20px -8px rgba(211,94,71,.55);
  transition: transform .2s var(--bounce), box-shadow .2s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--coral-d), 0 4px 10px -6px rgba(211,94,71,.55); }
.btn-line { background: #fff; color: var(--ink); box-shadow: 0 4px 0 var(--hair), 0 10px 20px -10px rgba(120,80,60,.3); }
.btn-line:active { box-shadow: 0 1px 0 var(--hair); }
.btn-s { min-height: 44px; padding: 0 var(--s-3); font-size: var(--fs-2); }
.btn-l { width: 100%; min-height: 60px; font-size: var(--fs-4); }
.btn[disabled] { opacity: .6; pointer-events: none; }

/* 写真の置き場所 */
.ph { display: grid; place-items: center; width: 100%; height: 100%; background: var(--cream); color: var(--mute); font-family: var(--f-pop); font-weight: 500; font-size: var(--fs-1); letter-spacing: .24em; background-size: cover; background-position: center; }
.filled .ph { color: transparent; background: var(--img) center / cover no-repeat; }

/* ---------- P1 ---------- */
.p1 { padding-top: var(--s-6); padding-bottom: var(--s-7); }
.kicker { display: inline-block; padding: 4px 16px; border-radius: 999px; background: var(--butter); font-size: var(--fs-3); font-weight: 600; letter-spacing: .08em; transform: rotate(-3deg); }
.p1-title { margin: var(--s-3) 0 var(--s-5); font-family: var(--f-head); font-weight: 900; font-size: var(--fs-6); line-height: 1.45; letter-spacing: .1em; }
.p1-title::after { content: ""; display: block; width: 120px; height: 10px; margin: 10px auto 0; background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 10'><path d='M2 5 q7.5 -6 15 0 t15 0 t15 0 t15 0 t15 0 t15 0 t15 0 t13 0' fill='none' stroke='%23F8B9C8' stroke-width='3' stroke-linecap='round'/></svg>") center / contain no-repeat; }
/* P1 ふたりのツーショット（1枚の写真を、白フチ＋アーチ型で） */
.twoshot { position: relative; width: min(76vw, 320px); margin: 0 auto; }
.couple-photo { position: relative; margin: 0; aspect-ratio: 1; overflow: hidden; border-radius: 999px 999px 32px 32px; border: 8px solid #fff; background: var(--pink); box-shadow: var(--shadow-soft); transform: rotate(-2deg); }
.couple-photo .ph { background: transparent; color: var(--ink-2); }
.twoshot-heart { position: absolute; right: -6px; top: 8%; z-index: 2; width: 52px; height: 52px; transform: rotate(12deg); }
.twoshot-heart svg { width: 100%; height: 100%; fill: var(--coral); stroke: #fff; stroke-width: 2; filter: drop-shadow(0 4px 6px rgba(211,94,71,.35)); }
.p1-names { margin-top: var(--s-5); font-family: var(--f-head); font-weight: 900; font-size: var(--fs-4); letter-spacing: .14em; }
.p1-names i { font-family: var(--f-pop); font-style: normal; font-weight: 600; font-size: var(--fs-5); color: var(--coral); margin: 0 var(--s-2); }
.p1-date { margin-top: var(--s-1); font-family: var(--f-pop); font-weight: 600; font-size: var(--fs-5); letter-spacing: .12em; }
.p1-date small { font-size: var(--fs-2); letter-spacing: .2em; color: var(--mute); margin-left: 6px; }

/* ---------- P2 HOST ---------- */
.greeting { max-width: 26em; margin: 0 auto var(--s-6); padding: var(--s-4) var(--s-3); border-radius: var(--r); background: var(--cream); }
.hosts { display: grid; gap: var(--s-5); }
.host { text-align: center; }
.host-pic { width: 128px; height: 160px; margin: 0 auto var(--s-2); overflow: hidden; border-radius: 64px 64px 22px 22px; border: 5px solid #fff; box-shadow: var(--shadow-soft); }
.host.groom .host-pic { background: var(--butter); }
.host.bride .host-pic { background: var(--pink); }
.host-pic .ph { background: transparent; }
.host-role { display: inline-block; padding: 2px 12px; border-radius: 999px; font-family: var(--f-pop); font-weight: 600; font-size: var(--fs-1); letter-spacing: .2em; text-transform: uppercase; }
.host.groom .host-role { background: var(--butter); }
.host.bride .host-role { background: var(--pink); }
.host h3 { margin: var(--s-1) 0 var(--s-2); font-family: var(--f-head); font-weight: 900; font-size: var(--fs-4); letter-spacing: .14em; }
.host-text { max-width: 22em; margin: 0 auto; padding: var(--s-3) var(--s-3); border-radius: var(--r); background: var(--cream); text-align: left; font-size: var(--fs-2); line-height: 1.9; letter-spacing: .06em; color: var(--ink-2); word-break: keep-all; overflow-wrap: anywhere; line-break: strict; text-wrap: pretty; }
.host-text p + p { margin-top: .7em; }

/* ---------- P3 カウントダウン ---------- */
.cd { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cd-cell { padding: var(--s-2) 0 12px; border-radius: 20px; background: var(--c); box-shadow: inset 0 -4px 0 rgba(0,0,0,.04); }
.cd-cell:nth-child(1) { --c: var(--pink); } .cd-cell:nth-child(2) { --c: var(--butter); } .cd-cell:nth-child(3) { --c: var(--sky); } .cd-cell:nth-child(4) { --c: var(--mint); }
.cd-cell b { display: block; font-family: var(--f-pop); font-weight: 600; font-size: 34px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.cd-cell span { font-size: var(--fs-1); font-weight: 700; color: var(--ink-2); }
.cd-note { margin-top: var(--s-3); font-size: var(--fs-2); color: var(--mute); }

/* ---------- P4 ギャラリー ---------- */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-3) var(--s-2); }
.gallery .snap { position: relative; display: block; width: 100%; padding: 6px; border: 0; border-radius: 20px; background: #fff; box-shadow: var(--shadow-soft); cursor: zoom-in; transition: transform .3s var(--bounce); }
.gallery .snap:hover { transform: rotate(0) scale(1.03) !important; }
.gallery .snap .ph { aspect-ratio: 1; height: auto; border-radius: 15px; }
.gallery .snap:nth-child(4n+1) .ph { background-color: #FDE8EE; }
.gallery .snap:nth-child(4n+2) .ph { background-color: #FFF4CC; }
.gallery .snap:nth-child(4n+3) .ph { background-color: #E3F3FB; }
.gallery .snap:nth-child(4n) .ph { background-color: #E6F6EE; }
.gallery .snap::after { content: ""; position: absolute; right: -6px; top: -6px; width: 22px; height: 22px; background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 21s-8-5.2-8-11a4.6 4.6 0 0 1 8-3 4.6 4.6 0 0 1 8 3c0 5.8-8 11-8 11z' fill='%23F07A62' stroke='white' stroke-width='2'/></svg>") center / contain no-repeat; }
.gallery .snap:nth-child(even)::after { display: none; }

/* ---------- P5 スケジュール ---------- */
.timeline { list-style: none; margin: 0 auto; padding: 0; max-width: 340px; text-align: left; position: relative; }
.timeline::before { content: ""; position: absolute; left: 27px; top: 28px; bottom: 28px; width: 3px; border-radius: 3px; background: repeating-linear-gradient(var(--hair) 0 8px, transparent 8px 14px); }
.timeline li { position: relative; display: grid; grid-template-columns: 56px 1fr; gap: var(--s-2); align-items: center; padding: 12px 0; }
.timeline time { position: relative; z-index: 1; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--c); font-family: var(--f-pop); font-weight: 600; font-size: var(--fs-2); }
.timeline li:nth-child(1) { --c: var(--pink); } .timeline li:nth-child(2) { --c: var(--butter); } .timeline li:nth-child(3) { --c: var(--sky); } .timeline li:nth-child(4) { --c: var(--mint); }
.timeline div { padding: 12px 18px; border-radius: 18px; background: #fff; box-shadow: var(--shadow-soft); }
.timeline b { display: block; font-family: var(--f-head); font-weight: 900; font-size: var(--fs-4); line-height: 1.4; letter-spacing: .1em; }
.timeline span { font-size: var(--fs-1); color: var(--mute); }

/* ---------- P6 会場 ---------- */
.venue { padding: var(--s-4) var(--s-3); border-radius: var(--r); background: #fff; box-shadow: var(--shadow-soft); }
.venue-name { margin: 0; font-family: var(--f-head); font-weight: 900; font-size: var(--fs-4); letter-spacing: .08em; }
.venue-sub { margin-top: 2px; font-size: var(--fs-2); color: var(--mute); }
.venue-addr { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: var(--s-2); font-size: var(--fs-2); }
.venue-addr .ico { width: 18px; height: 18px; color: var(--coral); }
.venue-tel { font-size: var(--fs-2); }
.map { margin: var(--s-3) 0; overflow: hidden; border-radius: 18px; aspect-ratio: 4 / 3; background: var(--cream); }
.map iframe { display: block; width: 100%; height: 100%; border: 0; filter: saturate(.75) brightness(1.03); }
.btns { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2); }

/* ---------- P7 ご案内 ---------- */
.details { list-style: none; margin: 0 0 var(--s-5); padding: 0; display: grid; gap: 12px; text-align: left; }
.details li { display: flex; gap: var(--s-2); align-items: flex-start; padding: 18px; border-radius: var(--r); background: #fff; box-shadow: var(--shadow-soft); }
.details .ico { width: 46px; height: 46px; padding: 11px; border-radius: 50%; background: var(--c); color: var(--ink); stroke-width: 1.8; }
.details li:nth-child(1) { --c: var(--sky); } .details li:nth-child(2) { --c: var(--butter); } .details li:nth-child(3) { --c: var(--pink); } .details li:nth-child(4) { --c: var(--mint); }
.details b { display: block; font-family: var(--f-head); font-weight: 900; font-size: var(--fs-3); letter-spacing: .08em; }
.details p { margin-top: 2px; font-size: var(--fs-2); line-height: 1.9; color: var(--ink-2); }
.details small { display: block; margin-top: 4px; font-size: var(--fs-1); color: var(--mute); }
.details .bus-item { grid-column: 1 / -1; }
.details .bus-item > div { flex: 1; min-width: 0; }
.bus { display: grid; gap: 10px; margin: 12px 0 4px; }
.stop { padding: 12px 14px; border-radius: 16px; background: var(--cream); }
.stop h4 { margin: 0; font-family: var(--f-head); font-weight: 900; font-size: var(--fs-3); }
.stop .where { margin-top: 2px; font-size: var(--fs-2); line-height: 1.6; color: var(--ink); }
.stop .where small { margin-top: 0; }
.stop dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; margin: 10px 0 0; }
.stop dt { padding: 0 10px; border-radius: 999px; background: var(--sky); font-family: var(--f-head); font-weight: 700; font-size: var(--fs-1); line-height: 22px; }
.stop dt:nth-of-type(2) { background: var(--pink); }
.stop dd { margin: 0; font-family: var(--f-pop); font-weight: 600; font-size: var(--fs-3); letter-spacing: .04em; }
.stop dd i { font-style: normal; margin-left: 12px; }
.message { max-width: 26em; margin: 0 auto; }

/* ---------- P8 フォーム ---------- */
.deadline { margin-bottom: var(--s-4); font-size: var(--fs-2); color: var(--ink-2); }
.deadline b { font-weight: 700; color: var(--ink); background: linear-gradient(transparent 60%, var(--butter) 60%); }
#rsvp { display: grid; gap: var(--s-3); text-align: left; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend, .f > span, .f-label { display: flex; align-items: center; gap: var(--s-1); margin-bottom: 6px; font-family: var(--f-head); font-weight: 700; font-size: var(--fs-2); letter-spacing: .08em; }
.req::after { content: "必須"; padding: 0 8px; border-radius: 999px; background: var(--pink); color: var(--ink); font-size: 10px; line-height: 18px; }
.f { display: block; }
.f input:not([type=radio]):not([type=file]), .f textarea {
  width: 100%; height: 54px; padding: 0 18px;
  border: 2px solid var(--hair); border-radius: 16px; background: #fff;
  font: inherit; font-size: 16px; color: var(--ink);
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.f textarea { height: auto; padding: 14px 18px; resize: vertical; line-height: 1.8; }
.f input:focus, .f textarea:focus { outline: none; border-color: var(--pink-d); box-shadow: 0 0 0 4px rgba(248,185,200,.35); }
.f input::placeholder, .f textarea::placeholder { color: #C9BDB2; }
.f input[aria-invalid=true], .f textarea[aria-invalid=true] { border-color: var(--coral); background: #FFF5F2; }
.f small { display: block; margin-top: 6px; font-size: var(--fs-1); color: var(--mute); }
.f input[type=file] { font-size: var(--fs-2); }
.row.two { display: grid; gap: var(--s-3); grid-template-columns: 1fr 1fr; align-items: end; }
.zip-note { font-size: var(--fs-1); color: var(--mute); padding-bottom: 16px; }
.attend { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.attend legend { grid-column: 1 / -1; }
.choice {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 96px; border-radius: var(--r); background: #fff; border: 2px solid var(--hair);
  cursor: pointer; transition: transform .3s var(--bounce), background .25s, border-color .25s;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { font-family: var(--f-head); font-weight: 900; font-size: var(--fs-4); letter-spacing: .1em; }
.choice small { font-family: var(--f-pop); font-weight: 500; font-size: var(--fs-2); color: var(--mute); }
.choice:has(input:checked) { background: var(--pink); border-color: var(--pink); transform: scale(1.03); }
.choice:has(input[value=欠席]:checked) { background: var(--sky); border-color: var(--sky); }
.choice:has(input:checked) small { color: var(--ink-2); }
.choice:has(input:checked)::after {
  content: ""; position: absolute; right: -8px; top: -10px; width: 36px; height: 36px; border-radius: 50%;
  background: var(--coral) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / 20px no-repeat;
  box-shadow: 0 0 0 4px #fff, 0 6px 12px -4px rgba(211,94,71,.5);
  animation: pop .45s var(--bounce);
}
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
.choice:has(input:focus-visible) { outline: 3px solid var(--sky); outline-offset: 3px; }
.attend.invalid .choice, .pills.invalid label span { border-color: var(--coral); }
.pills { display: flex; flex-wrap: wrap; gap: var(--s-1); }
.pills legend { width: 100%; }
.pills label { cursor: pointer; }
.pills input { position: absolute; opacity: 0; pointer-events: none; }
.pills label span { display: inline-flex; align-items: center; height: 44px; padding: 0 20px; border: 2px solid var(--hair); border-radius: 999px; background: #fff; font-size: var(--fs-2); font-weight: 500; transition: all .25s var(--ease); }
.pills input:checked + span { background: var(--butter); border-color: var(--butter); font-weight: 700; }
.pills input:focus-visible + span { outline: 3px solid var(--sky); outline-offset: 2px; }
.only-attend { display: grid; gap: var(--s-3); }
/* 公共交通機関のときに出る、バスの選択（駅 → 行き → 帰り。ひとつ上の質問にぶら下がる見た目） */
.bus-flow { display: grid; gap: var(--s-3); margin-top: calc(var(--s-2) * -1); padding: var(--s-3) var(--s-2); border-radius: var(--r); background: var(--cream); }
.bus-flow[hidden], .bus-flow .step[hidden] { display: none; }
.bus-flow .step legend { float: left; margin-bottom: 4px; }
.bus-flow .step legend i { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--coral); color: #fff; font-family: var(--f-pop); font-style: normal; font-size: 12px; letter-spacing: 0; }
.bus-flow .opts { display: flex; flex-wrap: wrap; gap: var(--s-1); width: 100%; }
.bus-flow .opts label span { padding: 0 16px; font-family: var(--f-pop); letter-spacing: .04em; }
.bus-flow .sub-note { width: 100%; font-size: var(--fs-1); color: var(--mute); }
/* 披露宴で使う写真（最大3枚） */
.photo-field { display: grid; gap: var(--s-1); }
.photo-field > span { margin-bottom: 0; }
.photo-lead { font-size: var(--fs-1); color: var(--mute); line-height: 1.7; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-1); }
.thumbs:empty { display: none; }
.thumb { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 14px; background: var(--cream); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; right: 6px; top: 6px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(59,51,48,.72); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }
.photo-add { position: relative; justify-self: start; cursor: pointer; }
.photo-add[hidden] { display: none; }
.photo-add input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.photo-field.invalid .photo-add { box-shadow: 0 0 0 2px var(--coral), 0 4px 0 var(--hair); }
.companion { position: relative; display: grid; gap: var(--s-2); padding: var(--s-3) var(--s-2) var(--s-2); margin-bottom: var(--s-2); border-radius: var(--r); background: var(--cream); }
.companion .c-title { font-family: var(--f-head); font-weight: 900; font-size: var(--fs-2); }
.companion .c-del { position: absolute; right: var(--s-2); top: var(--s-2); border: 0; background: none; font-size: var(--fs-1); color: var(--mute); text-decoration: underline; text-underline-offset: 3px; }
.form-error { padding: var(--s-2); border-radius: 16px; background: #FFF0EC; color: var(--coral-d); font-size: var(--fs-2); white-space: pre-line; }
.done, .closed { padding: var(--s-5) 0; }
.done-en { display: inline-block; padding: 4px 18px; border-radius: 999px; background: var(--butter); font-size: var(--fs-4); font-weight: 600; transform: rotate(-3deg); }
.done-title { margin: var(--s-2) 0 var(--s-1); font-family: var(--f-head); font-weight: 900; font-size: var(--fs-5); letter-spacing: .08em; }
.done .btn { margin-top: var(--s-4); }
.sign { margin-top: var(--s-6); text-align: right; font-family: var(--f-head); font-weight: 900; font-size: var(--fs-4); letter-spacing: .14em; }
.sign::after { content: ""; display: inline-block; width: 20px; height: 20px; margin-left: 8px; vertical-align: -3px; background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 21s-8-5.2-8-11a4.6 4.6 0 0 1 8-3 4.6 4.6 0 0 1 8 3c0 5.8-8 11-8 11z' fill='%23F07A62'/></svg>") center / contain no-repeat; }

/* ---------- エンディング ---------- */
.envelope.small { width: min(62vw, 300px); top: 46svh; }
.envelope.small .env-letter { top: -62%; }
.envelope.small .seal { width: 46px; height: 46px; bottom: -20px; }
.envelope.small .seal svg { width: 18px; height: 18px; }
.leaver { --w: min(46vw, 220px, calc((91svh - 110px) / 2.15)); position: absolute; left: 50%; bottom: calc(var(--lift) + 7svh); width: var(--w); margin-left: calc(var(--w) / -2); z-index: 6; }
.leaver-body { position: relative; }
.leaver-front { position: relative; }
/* 後ろ姿は正面と同じ足元の位置に重ねる（幅は正面の 0.92 倍で体の大きさをそろえる） */
.leaver-back { position: absolute; left: 4%; bottom: 0; width: 92%; opacity: 0; }
.munch {
  position: absolute; right: -10px; top: -46px;
  padding: 8px 16px; background: #fff; border-radius: 18px; box-shadow: var(--shadow-soft);
  font-family: var(--f-head); font-weight: 900; font-size: var(--fs-2); line-height: 1.4; text-align: center; color: var(--coral-d);
  opacity: 0; transform: rotate(6deg);
}
.ed-text { position: absolute; left: 0; right: 0; top: 14svh; z-index: 7; text-align: center; padding: 0 var(--s-3); opacity: 0; }
.ed-text .en { display: inline-block; padding: 4px 16px; border-radius: 999px; background: var(--butter); font-size: var(--fs-3); font-weight: 600; transform: rotate(-3deg); }
.ed-title { margin: var(--s-2) 0 var(--s-1); font-family: var(--f-head); font-weight: 900; font-size: var(--fs-5); line-height: 1.6; letter-spacing: .1em; }
.ed-ps { font-size: var(--fs-2); color: var(--ink-2); margin-bottom: var(--s-4); }

/* 写真が入ったら、枠の色ではなく写真を見せる（顔が切れないよう少し上寄せ） */
.couple-photo.filled .ph, .host-pic.filled .ph { color: transparent; background: var(--img) center 28% / cover no-repeat; }
/* 枚数が奇数のとき、最後の1枚は中央に */
.gallery .snap:last-child:nth-child(odd) { grid-column: 1 / -1; width: calc(50% - 8px); justify-self: center; }

/* ---------- 拡大表示 ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: var(--s-3); background: rgba(59,51,48,.75); backdrop-filter: blur(6px); }
.lb-inner .snap { display: block; width: min(88vw, 540px); padding: 8px; border: 0; border-radius: 26px; background: #fff; transform: none !important; }
.lb-inner .snap .ph { aspect-ratio: 1; height: auto; border-radius: 20px; }
.lb-inner .snap::after { display: none; }

/* ---------- 広い画面：便箋は壁の前の1枚 ---------- */
@media (min-width: 720px) {
  body { background: var(--grain), var(--wall); }
  .letter { margin: var(--s-6) auto; padding: 0 var(--s-6); border-radius: 28px; box-shadow: var(--shadow-deep); }
  .hosts { grid-template-columns: 1fr 1fr; gap: var(--s-4); }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .details { grid-template-columns: 1fr 1fr; }
  .speech { font-size: var(--fs-5); }
}
@media (max-width: 380px) {
  .row.two { grid-template-columns: 1fr; }
  .zip-note { padding: 0; margin-top: calc(var(--s-3) * -1); }
  .p1-title { font-size: var(--fs-5); }
  .cd-cell b { font-size: var(--fs-5); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
