/* Syukur — template ucapan terima kasih: seikat bunga (matahari, gerbera, aster, atau daisy sesuai tone), kertas hangat, tulisan tangan. */
@font-face { font-family: "Fraunces"; font-weight: 300 700; src: url("fonts/fraunces.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Fraunces"; font-style: italic; font-weight: 300 600; src: url("fonts/fraunces-italic.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Caveat"; font-weight: 400 700; src: url("fonts/caveat.woff2") format("woff2"); font-display: swap; }

:root { --paper: #fbf3df; --card: #fffaf0; --sun: #f7c534; --ochre: #a8690f; --brown: #3b2614; --soft: #6e5236; --leaf: #4f6d2f; --terra: #b8572b;
  /* latar & sinar */ --bg: #f4d980; --ray1: #f6dc8c; --ray2: #f3d47f; --glow: #fff4cd; --foot: #f6ecd2;
  /* bunga: kelopak gelap/utama/terang, piringan */ --pk: #e09a12; --pm: #f7c534; --pl: #fde17a; --d1: #7a4a1f; --d2: #4f2e12; --d3: #a06a32;
  /* daun & kertas buket */ --lf: #6f8f43; --lf2: #7f9f4f; --stem: #5f7d3a; --w1: #e2c193; --w2: #c99e6b; --w3: #b88a55;
  /* amplop */ --env: #d9b583; --env2: #cca371; --env3: #e5c595; }

/* Tone warna (field "tone"): matahari = bawaan di atas. Tiap tone mengganti bunga, latar, dan aksen. */
:root[data-tone="mawar"] { --paper: #fdf1f1; --card: #fffafa; --sun: #f27a9b; --ochre: #c23a66; --brown: #45212c; --soft: #7d5560; --leaf: #4f7a52; --terra: #c23a66; --bg: #f6c9d0; --ray1: #f8d5da; --ray2: #f3c1ca; --glow: #fff1f3; --foot: #f9e3e6; --pk: #d94f78; --pm: #f27a9b; --pl: #ffc2d1; --d1: #e0a315; --d2: #f6c343; --d3: #fde49a; --lf: #5f9163; --lf2: #78a67a; --stem: #4f7a52; --w1: #f6e6d6; --w2: #e6cdb6; --w3: #d6b89c; --env: #f0bcc8; --env2: #e7a9b8; --env3: #f6cfd8; }
:root[data-tone="lavender"] { --paper: #f6f1fc; --card: #fdfbff; --sun: #a98be0; --ochre: #6a47b8; --brown: #2f2445; --soft: #655a80; --leaf: #5f7d4a; --terra: #6a47b8; --bg: #d8cdf0; --ray1: #e0d6f4; --ray2: #d2c5ee; --glow: #f6f1ff; --foot: #ebe3f8; --pk: #7f5fc4; --pm: #a98be0; --pl: #d9c8f7; --d1: #d9a016; --d2: #f2c94c; --d3: #fbe59a; --lf: #6f9158; --lf2: #86a76e; --stem: #5f7d4a; --w1: #efe6f6; --w2: #dccdea; --w3: #c7b4dc; --env: #c9b8ea; --env2: #bba7e2; --env3: #d9cbf2; }
:root[data-tone="aster"] { --paper: #f4f7ee; --card: #fcfdf9; --sun: #f2b632; --ochre: #b87708; --brown: #26331f; --soft: #5c6b52; --leaf: #4f6d2f; --terra: #c9820a; --bg: #cfdcc2; --ray1: #d7e2cb; --ray2: #c8d6ba; --glow: #f3f8ea; --foot: #e6eedb; --pk: #dfe6d5; --pm: #ffffff; --pl: #ffffff; --d1: #d9920f; --d2: #f2b632; --d3: #fbdc8a; --lf: #6f8f43; --lf2: #86a45c; --stem: #5f7d3a; --w1: #efe6d2; --w2: #dccbaa; --w3: #c8b48c; --env: #dfe8d2; --env2: #cfdbbf; --env3: #eaf0e0; }
/* Warna bunga dan buket (dipakai <symbol>/<svg> di index.html). */
.pk { fill: var(--pk); } .pm { fill: var(--pm); } .pl { fill: var(--pl); } .d1 { fill: var(--d1); } .d2 { fill: var(--d2); } .d3 { fill: var(--d3); }
.lf { fill: var(--lf); } .lf2 { fill: var(--lf2); } .stem { stroke: var(--stem); } .w1 { fill: var(--w1); } .w2 { fill: var(--w2); } .w3 { fill: var(--w3); } .w2s { stroke: var(--w2); } .rb { fill: var(--terra); } .rb2 { fill: color-mix(in srgb, var(--terra) 78%, #000); }
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; color: var(--brown); font: 400 17px/1.7 "Fraunces", Georgia, serif; font-optical-sizing: auto; -webkit-font-smoothing: antialiased;
  background: radial-gradient(ellipse at 50% 22%, color-mix(in srgb, var(--glow) 70%, transparent), transparent 60%) fixed, repeating-conic-gradient(from 0deg at 50% 22%, var(--ray1) 0 5deg, var(--ray2) 5deg 10deg) fixed, var(--bg);
}
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
main { max-width: 480px; margin: 0 auto; position: relative; overflow: hidden;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .3 0 0 0 0 .1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"), var(--paper); }
@media (min-width: 560px) { main { box-shadow: 0 30px 90px rgba(120, 70, 10, 0.28); } }
section { min-height: 100vh; min-height: 100svh; padding: 60px 28px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 14px; text-align: center; position: relative; }
h1, h2 { margin: 0; font-family: "Fraunces", Georgia, serif; font-weight: 500; letter-spacing: -0.5px; }
p { margin: 0; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 3.5px; text-transform: uppercase; color: var(--leaf); font-family: "Fraunces", serif; }
.hint { font-size: 14px; color: var(--soft); font-style: italic; }
.js-only { display: none; }

/* Hero */
.hero { background: radial-gradient(closest-side circle at 50% 62%, color-mix(in srgb, var(--sun) 38%, transparent), transparent 100%); }
.hero h1 { font-size: 40px; line-height: 1.05; font-weight: 400; font-variation-settings: "SOFT" 100, "WONK" 1; }
.hero h1 .name { display: block; font: 700 58px/1.05 "Caveat", cursive; color: var(--ochre); margin-top: 6px; transform: rotate(-3deg); overflow-wrap: anywhere; }
.bouquet { width: min(100%, 340px); height: auto; margin: 4px 0 -4px; overflow: visible; filter: drop-shadow(0 18px 22px rgba(120, 70, 10, 0.18)); }
.sway { transform-box: view-box; animation: goyang 5s ease-in-out infinite; }
.s1 { transform-origin: 176px 300px; animation-delay: -1.5s; }
.s2 { transform-origin: 184px 300px; animation-duration: 6s; animation-delay: -3s; }
.s3 { transform-origin: 180px 300px; animation-duration: 7s; }
@keyframes goyang { 0%, 100% { transform: rotate(-1.6deg); } 50% { transform: rotate(1.6deg); } }
.hand { font: 600 28px/1.2 "Caveat", cursive; color: var(--terra); }

/* Pesan */
.card { position: relative; width: 100%; background: var(--card); padding: 44px 26px 30px; text-align: left; border-radius: 4px; transform: rotate(-0.6deg); box-shadow: 0 1px 2px rgba(80, 50, 10, 0.08), 0 20px 44px rgba(120, 70, 10, 0.16); }
.card::before, .card::after { content: ""; position: absolute; top: -12px; width: 92px; height: 26px; background: color-mix(in srgb, var(--lf2) 75%, transparent); }
.card::before { left: 18px; transform: rotate(-6deg); }
.card::after { right: 18px; transform: rotate(5deg); background: color-mix(in srgb, var(--sun) 70%, transparent); }
.card .eyebrow { margin-bottom: 14px; }
.message .text { white-space: pre-line; font-size: 18px; line-height: 1.75; }
.from { margin-top: 22px; font-size: 15px; font-style: italic; color: var(--soft); }
.from span { display: block; font: 700 36px/1.15 "Caveat", cursive; font-style: normal; color: var(--ochre); }
.corner { position: absolute; right: -16px; bottom: -18px; width: 72px; height: 72px; transform: rotate(18deg); filter: drop-shadow(0 6px 8px rgba(120, 70, 10, 0.2)); }

/* Galeri */
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; }
.photos figure { margin: 0; background: #fff; padding: 8px 8px 24px; box-shadow: 0 10px 22px rgba(120, 70, 10, 0.16); transform: rotate(-2deg); }
.photos figure:nth-child(even) { transform: rotate(2deg); }
.photos figure:first-child:last-child, .photos figure:nth-child(3):last-child { grid-column: 1 / -1; }
.photos img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }

/* Balasan */
.reply { background: radial-gradient(closest-side circle at 50% 45%, color-mix(in srgb, var(--lf2) 32%, transparent), transparent 100%); }
.sun { width: 64px; height: 64px; animation: putar 30s linear infinite; }
.reply h2 { font-size: 34px; line-height: 1.15; font-weight: 400; max-width: 11em; }
.reply h2 em { font: 700 44px/1 "Caveat", cursive; color: var(--ochre); }
.lead { color: var(--soft); margin-top: 8px; font-style: italic; }
.reply form { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--leaf); color: #fffaf0; font: 600 16px/1 "Fraunces", serif; cursor: pointer; box-shadow: 0 8px 18px rgba(79, 109, 47, 0.28); }
.btn.ghost { background: var(--card); color: var(--brown); box-shadow: inset 0 0 0 1.5px rgba(59, 38, 20, 0.25); font-weight: 500; }
.btn:focus-visible, textarea:focus-visible, .envelope:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
textarea { font: inherit; font-size: 16px; padding: 14px 16px; border: 0; border-radius: 14px; background: var(--card); color: var(--brown); min-height: 96px; box-shadow: inset 0 0 0 1.5px rgba(59, 38, 20, 0.2); resize: vertical; }
textarea::placeholder { color: #8f7457; }
.note { color: var(--leaf); font-weight: 600; }

/* Amplop */
.envelope { display: none; }
.js [data-opener=amplop] .envelope { display: flex; cursor: pointer; background: radial-gradient(closest-side circle at 50% 55%, color-mix(in srgb, var(--sun) 40%, transparent), transparent 100%); }
.js [data-opener=amplop] main > section:not(.envelope) { display: none; }
.js [data-opener=amplop].opened .envelope { display: none; }
.js [data-opener=amplop].opened main > section:not(.envelope) { display: flex; animation: muncul 0.8s ease both; }
.env-title { font: 700 42px/1.05 "Caveat", cursive; color: var(--brown); margin-bottom: 22px; }
.flap { width: 272px; height: 182px; position: relative; border-radius: 6px; background: var(--env); box-shadow: 0 24px 50px rgba(120, 70, 10, 0.3); animation: angguk 3.4s ease-in-out infinite; overflow: hidden; }
.flap::before { content: ""; position: absolute; inset: 0; background: var(--env2); clip-path: polygon(0 100%, 50% 46%, 100% 100%); }
.flap::after { content: ""; position: absolute; inset: 0 0 auto; height: 104px; background: var(--env3); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.flap .seal { position: absolute; left: 50%; top: 72px; width: 64px; height: 64px; margin-left: -32px; z-index: 1; filter: drop-shadow(0 4px 6px rgba(80, 40, 0, 0.3)); animation: putar 24s linear infinite; }
.envelope .hint { margin-top: 24px; }
@keyframes angguk { 0%, 100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg) translateY(-5px); } }

/* Story */
.bars { display: none; }
.js [data-opener=story] .bars { display: flex; position: fixed; top: 12px; left: 50%; transform: translateX(-50%); width: min(452px, calc(100% - 28px)); gap: 4px; z-index: 5; }
.bars span { flex: 1; height: 3px; border-radius: 3px; background: var(--brown); opacity: 0.18; }
.bars span.done { opacity: 0.85; background: var(--ochre); }
.js [data-opener=story] [data-step] { display: none; cursor: pointer; }
.js [data-opener=story] [data-step].active { display: flex; animation: muncul 0.5s ease both; }
.js [data-opener=story] footer { display: none; }
.js [data-opener=story] .js-only { display: block; }

footer { max-width: 480px; margin: 0 auto; padding: 24px 24px 34px; text-align: center; font-size: 13px; color: var(--soft); background: var(--foot); border-top: 1px dashed rgba(110, 82, 54, 0.25); }
footer a { color: var(--leaf); font-weight: 600; }
.music-toggle { position: fixed; right: 16px; bottom: 16px; z-index: 20; width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--leaf); color: #fffaf0; font-size: 22px; line-height: 1; cursor: pointer; box-shadow: 0 8px 20px rgba(79, 109, 47, 0.35); }
.music-toggle[aria-pressed=true] span { display: inline-block; animation: putar 3s linear infinite; }
@keyframes putar { to { transform: rotate(360deg); } }
@keyframes muncul { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.message, .gallery, .reply { min-height: 0; padding: 56px 28px; }
.reply { padding-bottom: 72px; }
.js [data-opener=story] .message, .js [data-opener=story] .gallery, .js [data-opener=story] .reply { min-height: 100vh; min-height: 100svh; }

/* ---------- Animasi ---------- */
@media (prefers-reduced-motion: no-preference) {
  main > section:not(.envelope) :where(.eyebrow) { animation: mo-naik .8s var(--mo-e) .05s both; }
  main > section:not(.envelope) :where(h1, h2) { animation: mo-naik .9s var(--mo-e) .16s both; }
  main > section:not(.envelope) :where(.text, .lead, .letter) { animation: mo-naik .9s var(--mo-e) .34s both; }
  main > section:not(.envelope) :where(.from) { animation: mo-naik .8s var(--mo-e) .52s both; }
  main > section:not(.envelope) :where(.photos) { animation: mo-naik .9s var(--mo-e) .46s both; }
  main > section:not(.envelope) :where(.quick, form, .note) { animation: mo-naik .8s var(--mo-e) .62s both; }
  main > section:not(.envelope) :where(.hint) { animation: mo-naik .8s var(--mo-e) .75s both; }
  :root { --mo-e: cubic-bezier(.2,.7,.2,1); }

  .opening .envelope .flap { translate: 0 -34px; scale: 1.12; opacity: 0; transition: translate .7s ease-in, scale .7s ease-in, opacity .55s ease-in .12s; }
  .opening .envelope :is(.eyebrow, .hint, .env-title, h1) { opacity: 0; transition: opacity .3s; }

  .flap::before { transform-origin: 50% 0; }
  .opening .envelope .flap::before { transform: perspective(600px) rotateX(180deg); transition: transform .45s ease-in; }

  main .photos figure { animation: mo-pop .8s cubic-bezier(.34,1.56,.64,1) .5s both; }
  main .photos figure:nth-child(2) { animation-delay: .62s; }
  main .photos figure:nth-child(3) { animation-delay: .74s; }
  main .photos figure:nth-child(n+4) { animation-delay: .86s; }

  .corner { animation: mo-ambang 8s ease-in-out infinite; }
}
@keyframes mo-denyut { 0%, 100% { scale: 1; } 50% { scale: 1.08; } }
@keyframes mo-ambang { 0%, 100% { translate: 0 0; } 50% { translate: 0 -9px; } }
@keyframes mo-ayun { from { rotate: -2.2deg; } to { rotate: 2.2deg; } }
@keyframes mo-putar { to { rotate: 360deg; } }
@keyframes mo-kerlip { 0%, 100% { opacity: 1; scale: 1; } 50% { opacity: .35; scale: .72; } }
@keyframes mo-kilau { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes mo-geser { from { translate: -26px 0; } to { translate: 26px 0; } }
@keyframes mo-garis { from { scale: 0 1; } to { scale: 1 1; } }
@keyframes mo-naik { from { opacity: 0; translate: 0 22px; } to { opacity: 1; translate: 0 0; } }
@keyframes mo-blur { from { opacity: 0; filter: blur(10px); scale: 1.05; } to { opacity: 1; filter: blur(0); scale: 1; } }
@keyframes mo-pop { from { opacity: 0; scale: .55; rotate: -8deg; } to { opacity: 1; scale: 1; rotate: 0deg; } }
@keyframes mo-nudge { 0%, 100% { translate: 0 0; } 50% { translate: 5px 0; } }
@keyframes mo-hujan { to { background-position: 0 520px, 0 520px, 0 520px, 0 780px, 0 780px; } }
@keyframes mo-wiggle { 0%, 100% { rotate: -3deg; } 50% { rotate: 3deg; } }

/* ---------- 1.2.0: tone warna + sampul, buket, dan kartu pesan yang lebih kaya ---------- */
/* Amplop beralamat: perangko bunga bergerigi, cap pos, nama penerima tulisan tangan. */
.stamp { position: absolute; right: 14px; top: 12px; z-index: 2; width: 46px; height: 54px; padding: 5px; background: var(--card); display: grid; place-items: center; box-shadow: 0 2px 4px rgba(60, 30, 0, 0.2); -webkit-mask: radial-gradient(circle 3px at 3px 3px, transparent 98%, #000) -3px -3px / 9px 9px; mask: radial-gradient(circle 3px at 3px 3px, transparent 98%, #000) -3px -3px / 9px 9px; transform: rotate(4deg); }
.stamp svg { width: 100%; height: auto; }
.postmark { position: absolute; right: 44px; top: 20px; z-index: 2; width: 52px; height: 52px; border: 2px solid color-mix(in srgb, var(--brown) 45%, transparent); border-radius: 50%; box-shadow: inset 0 0 0 5px transparent, inset 0 0 0 6px color-mix(in srgb, var(--brown) 30%, transparent); transform: rotate(-14deg); opacity: .6; }
.addr { position: absolute; left: 18px; bottom: 14px; z-index: 2; max-width: 62%; text-align: left; font: 700 26px/1.05 "Caveat", cursive; color: var(--brown); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.addr small { display: block; font: 600 10px/1.4 "Fraunces", serif; letter-spacing: 2px; text-transform: uppercase; color: var(--soft); }
.opening .envelope .flap > span { opacity: 0; transition: opacity .25s; }

/* Buket: kelopak yang gugur pelan + label gantung berisi nama pengirim. */
.petals { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.petals i { position: absolute; top: -20px; width: 12px; height: 18px; border-radius: 60% 60% 60% 60% / 80% 80% 30% 30%; background: var(--pm); opacity: .75; animation: gugur 9s linear infinite; }
.petals i:nth-child(1) { left: 8%; animation-delay: -1s; } .petals i:nth-child(2) { left: 24%; animation-delay: -5s; background: var(--pk); width: 9px; height: 14px; }
.petals i:nth-child(3) { left: 43%; animation-delay: -3s; animation-duration: 11s; } .petals i:nth-child(4) { left: 61%; animation-delay: -7s; background: var(--pl); }
.petals i:nth-child(5) { left: 78%; animation-delay: -2s; animation-duration: 12s; background: var(--pk); } .petals i:nth-child(6) { left: 90%; animation-delay: -8s; width: 9px; height: 14px; }
.petals i:nth-child(7) { left: 52%; animation-delay: -10s; animation-duration: 13s; background: var(--pl); }
@keyframes gugur { from { transform: translate(0, -4vh) rotate(0deg); } to { transform: translate(34px, 104vh) rotate(420deg); } }
.hero > :not(.petals) { position: relative; }
.tag { position: relative; margin-top: -6px; padding: 10px 18px 8px 26px; background: var(--card); border-radius: 4px 12px 12px 4px; font: 700 26px/1.05 "Caveat", cursive; color: var(--ochre); box-shadow: 0 8px 18px rgba(80, 50, 10, 0.16); transform: rotate(-3deg); max-width: 86%; overflow-wrap: anywhere; }
.tag::before { content: ""; position: absolute; left: 9px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--brown) 35%, transparent); }
.tag small { display: block; font: 600 10px/1.5 "Fraunces", serif; letter-spacing: 2px; text-transform: uppercase; color: var(--soft); }

/* Kartu pesan: kertas bergaris halus, huruf awal besar, garis hias sebelum tanda tangan. */
.card { background: repeating-linear-gradient(180deg, transparent 0 31px, color-mix(in srgb, var(--soft) 12%, transparent) 31px 32px) 0 76px, var(--card); }
.message .text { line-height: 32px; }
.message .text::first-letter { float: left; margin: 4px 10px 0 0; font: 700 64px/0.8 "Caveat", cursive; color: var(--ochre); }
.rule { display: block; width: 88px; height: 10px; margin: 22px 0 0; background: radial-gradient(circle 3px at 5px 5px, var(--sun) 96%, transparent) 0 0 / 16px 10px repeat-x; }
.from { margin-top: 12px; }

/* Galeri: selotip kertas di tiap foto. */
.photos figure { position: relative; }
.photos figure::before { content: ""; position: absolute; left: 50%; top: -9px; width: 62px; height: 18px; margin-left: -31px; background: color-mix(in srgb, var(--sun) 62%, transparent); transform: rotate(-3deg); }
.photos figure:nth-child(even)::before { background: color-mix(in srgb, var(--lf2) 70%, transparent); transform: rotate(4deg); }

.btn { background: var(--leaf); }
.reply h2 em { display: inline-block; transform: rotate(-2deg); }

/* Video unggahan (field video): ditaruh sebelum galeri, bingkai mengikuti warna teks template (currentColor). */
.vk { width: min(100%, 440px); margin: 34px auto; padding: 0 20px; text-align: center; flex-direction: column; align-items: center; justify-content: center; }
.vk-layar { width: 100%; }
.vk-judul { margin: 0 0 12px; font-weight: 700; font-size: 13px; letter-spacing: .2em; text-transform: uppercase; opacity: .85; }
.vk-layar { position: relative; margin: 0; padding: 10px; border-radius: 20px; border: 1px solid color-mix(in srgb, currentColor 28%, transparent); background: color-mix(in srgb, currentColor 7%, transparent); box-shadow: 0 16px 34px rgba(0, 0, 0, .16); }
.vk-layar video { display: block; width: 100%; max-height: 70vh; border-radius: 12px; background: #000; }
.vk-layar figcaption { margin-top: 10px; font-size: 14px; font-style: italic; opacity: .75; }
