/* Apresiasi — piagam terima kasih bersih & profesional: kertas off-white, satu warna utama dan satu aksen logam (4 tone). */
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 500; src: url("fonts/fraunces.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Fraunces"; font-style: italic; font-weight: 400; src: url("fonts/fraunces-italic.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400 800; src: url("fonts/manrope.woff2") format("woff2"); font-display: swap; }

:root {
  --paper: #f6f3ec; --paper-2: #fffdf8; --ink: #0f3b40; --ink-2: #4a6467; --line: #dcd6c8;
  --teal-d: #0b2f33; --mid: var(--mid); --accent: #d99a2b; --accent-d: #9a6612; --accent-l: #f3cf7a; --btn-ink: #1d1405;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Manrope", system-ui, sans-serif;
}
/* Tone warna (field "tone"): teal = bawaan di atas. --ink = warna utama, --teal-d = versi gelapnya, --mid = versi terangnya. */
:root[data-tone="navy"] { --paper: #f4f3ef; --ink: #14254a; --ink-2: #4e5b78; --line: #d8d6cf; --teal-d: #0d1a36; --mid: #23407a; --accent: #cfa64a; --accent-d: #8c6a1c; --accent-l: #ecd28e; }
:root[data-tone="marun"] { --paper: #f7f2ec; --ink: #4a1220; --ink-2: #775560; --line: #e0d4c8; --teal-d: #33101a; --mid: #742236; --accent: #dba64a; --accent-d: #96661a; --accent-l: #f1d391; }
:root[data-tone="arang"] { --paper: #f4f2ee; --ink: #24262b; --ink-2: #5d6068; --line: #dad7d0; --teal-d: #17181c; --mid: #40434c; --accent: #c98a4b; --accent-d: #8f5a25; --accent-l: #e9bd8e; --btn-ink: #1c120a; }
/* Warna lencana, daun laurel, dan amplop (dipakai <symbol>/<svg> di index.html). */
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.g1 { stop-color: var(--accent-l); } .g2 { stop-color: var(--accent); } .g3 { stop-color: var(--accent-d); }
.b-ink { fill: var(--ink); } .b-mid { fill: var(--mid); } .b-line { stroke: var(--accent); } .b-ring { stroke: var(--accent-l); } .b-star { fill: var(--accent-l); }
.e-in { fill: var(--line); } .e-deep { fill: var(--teal-d); } .e-sheet { fill: var(--paper-2); } .e-rule { stroke: var(--line); fill: none; } .e-paper { fill: var(--paper); }
* { box-sizing: border-box; }
html { background: var(--teal-d); }
body { margin: 0; min-height: 100vh; color: var(--ink); font: 17px/1.65 var(--sans); -webkit-font-smoothing: antialiased; background: url("img/garis.svg") 0 0 / 24px 24px, radial-gradient(ellipse at 50% 0%, var(--mid) 0%, var(--teal-d) 65%); background-attachment: fixed; }
main { max-width: 480px; margin: 0 auto; position: relative; z-index: 1; background: var(--paper); }
section { min-height: 100vh; min-height: 100svh; padding: 56px 28px; display: flex; flex-direction: column; justify-content: center; gap: 14px; position: relative; }
h1, h2, p, dl, dd { margin: 0; }
.label { font: 700 12px/1.4 var(--sans); letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent-d); }
.label.muted { color: var(--ink-2); letter-spacing: 0.16em; }
.label.light { color: var(--accent); }
.hint { font: 500 14px/1.4 var(--sans); color: var(--ink-2); }

/* Amplop */
.envelope { display: none; background: url("img/garis.svg") 0 0 / 24px 24px, radial-gradient(ellipse at 50% 40%, var(--mid) 0%, var(--ink) 50%, var(--teal-d) 100%); color: var(--paper); align-items: center; text-align: center; }
.js [data-opener=amplop] .envelope { display: flex; cursor: pointer; }
.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.45s ease both; }
.envelope:focus-visible { outline: 2px solid var(--accent); outline-offset: -10px; }
.env-to { font: 400 20px/1.3 var(--serif); font-style: italic; color: rgba(246, 243, 236, 0.8); max-width: 340px; }
.env-to em { display: block; font: 500 36px/1.15 var(--serif); color: var(--paper); margin-top: 4px; text-wrap: balance; }
.env { width: min(300px, 78vw); height: auto; overflow: visible; margin: 34px 0 18px; filter: drop-shadow(0 24px 28px rgba(0, 0, 0, 0.35)); }
.env .flap-front, .env .flap-back, .env .letter, .env .seal { transform-box: view-box; }
.env .flap-front, .env .flap-back { transform-origin: 150px 40px; }
.env .flap-front { transition: transform 0.24s ease-in; }
.env .flap-back { transform: scaleY(0); transition: transform 0.22s ease-out 0.24s; }
.env .seal { transform-origin: 150px 140px; transition: opacity 0.16s, transform 0.16s; }
.env .letter { transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) 0.32s; }
.opening .env .flap-front { transform: scaleY(0); }
.opening .env .flap-back { transform: scaleY(-1); }
.opening .env .seal { opacity: 0; transform: scale(0.7); }
.opening .env .letter { transform: translateY(-62px); }
.envelope .hint { color: rgba(246, 243, 236, 0.78); letter-spacing: 0.06em; animation: denyut 2.4s ease-in-out infinite; }

/* Pembuka: lembar sertifikat */
.hero { padding: 28px 18px; background: var(--paper); }
.sheet { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 96px 26px 44px; background: repeating-radial-gradient(circle at 100% 100%, transparent 0 13px, color-mix(in srgb, var(--ink) 5%, transparent) 13px 14px) right bottom / 75% 55% no-repeat, var(--paper-2); border: 1px solid var(--line); box-shadow: 0 1px 0 #fff inset, 0 30px 60px -40px color-mix(in srgb, var(--ink) 45%, transparent); }
.sheet::before { content: ""; position: absolute; inset: 7px; border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); pointer-events: none; }
.sheet::after { content: ""; position: absolute; left: 26px; right: 26px; top: 0; height: 4px; background: linear-gradient(90deg, var(--ink) 0 72%, var(--accent) 72% 100%); }
.sheet-top { position: absolute; top: 26px; left: 26px; right: 26px; display: flex; justify-content: space-between; gap: 10px; white-space: nowrap; }
.badge { width: 92px; height: auto; margin: 0 0 30px; filter: drop-shadow(0 10px 14px color-mix(in srgb, var(--ink) 22%, transparent)); }
.hero h1 { font: 500 52px/1.02 var(--serif); letter-spacing: -0.025em; color: var(--ink); text-wrap: balance; }
.hero h1 em { display: block; font-weight: 400; font-style: italic; color: var(--accent-d); font-size: 0.82em; letter-spacing: -0.01em; margin-bottom: 4px; }
.lede { margin-top: 18px; max-width: 30ch; font: 500 17px/1.6 var(--sans); color: var(--ink-2); }
.meta { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr; gap: 16px; }
.meta dt { font: 700 11px/1.4 var(--sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 4px; }
.meta dd { font: 700 17px/1.35 var(--sans); color: var(--ink); overflow-wrap: anywhere; }
.js-only { display: none; }
.js [data-opener=story] .js-only { display: block; }
.hero .js-only { text-align: center; padding-top: 14px; }

/* Pesan */
.message { background: var(--paper); padding: 64px 28px; }
.quote { position: relative; padding-top: 56px; }
.qmark { position: absolute; top: -34px; left: -6px; font: 400 150px/1 var(--serif); font-style: italic; color: var(--accent); }
.message .label { margin-bottom: 16px; }
.message .text { font: 500 21px/1.6 var(--serif); letter-spacing: -0.005em; color: var(--ink); white-space: pre-line; text-wrap: pretty; }
.sign { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.sign strong { font: 400 italic 28px/1.2 var(--serif); color: var(--ink); }

/* Galeri */
.gallery { background: var(--paper-2); border-top: 1px solid var(--line); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.grid img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 4px; }
.grid img:first-child:nth-last-child(odd) { grid-column: 1 / -1; aspect-ratio: 16 / 10; }

/* Balasan */
.reply { background: url("img/garis.svg") 0 0 / 24px 24px, radial-gradient(ellipse at 50% 0%, var(--mid) 0%, var(--ink) 60%); color: var(--paper); }
.badge.sm { position: static; width: 64px; margin: 0 0 6px; filter: none; }
.reply h2 { font: 500 42px/1.05 var(--serif); letter-spacing: -0.02em; color: var(--paper); text-wrap: balance; margin-bottom: 4px; }
.reply h2 em { font-weight: 400; color: var(--accent); }
.reply .hint { color: rgba(246, 243, 236, 0.78); }
.reply form { display: flex; flex-direction: column; gap: 10px; }
.quick { display: flex; flex-direction: column; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 12px 20px; border: 0; border-radius: 10px; background: var(--accent); color: var(--btn-ink); font: 800 16px/1.3 var(--sans); letter-spacing: 0.01em; cursor: pointer; text-align: left; transition: background 0.15s, transform 0.15s; }
.btn::after { content: "→"; margin-left: 14px; font-weight: 600; }
.btn.ghost { background: rgba(246, 243, 236, 0.06); color: var(--paper); font-weight: 600; font-size: 15px; box-shadow: inset 0 0 0 1px rgba(246, 243, 236, 0.28); }
.btn.ghost::after { color: var(--accent); }
.btn:hover { background: var(--accent-l); }
.btn.ghost:hover { background: rgba(246, 243, 236, 0.12); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
textarea { font: 16px/1.5 var(--sans); padding: 14px 16px; border: 0; border-radius: 10px; background: rgba(246, 243, 236, 0.08); box-shadow: inset 0 0 0 1px rgba(246, 243, 236, 0.28); color: var(--paper); min-height: 104px; resize: vertical; }
textarea::placeholder { color: rgba(246, 243, 236, 0.6); }
.note { font: 600 16px/1.5 var(--sans); padding: 14px 16px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--paper); box-shadow: inset 3px 0 0 var(--accent); }
footer { position: relative; z-index: 1; padding: 26px; text-align: center; font: 500 13px/1.4 var(--sans); letter-spacing: 0.04em; color: rgba(246, 243, 236, 0.65); }
footer a { color: var(--paper); }

/* Story */
.bars { display: none; }
.js [data-opener=story] .bars { display: flex; position: fixed; top: 10px; left: 50%; transform: translateX(-50%); width: min(452px, calc(100% - 28px)); gap: 4px; z-index: 30; color: var(--accent); }
.bars span { flex: 1; height: 3px; border-radius: 3px; background: currentColor; opacity: 0.3; }
.bars span.done { opacity: 1; }
.js [data-opener=story] [data-step] { display: none; cursor: pointer; }
.js [data-opener=story] [data-step].active { display: flex; animation: muncul 0.45s ease both; }
.js [data-opener=story] footer { display: none; }
.js [data-opener=story] .hero { padding-top: 30px; }

.music-toggle { position: fixed; right: 16px; bottom: 16px; z-index: 40; width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--ink); color: var(--accent); font-size: 21px; line-height: 1; cursor: pointer; box-shadow: 0 8px 22px color-mix(in srgb, var(--teal-d) 35%, transparent); }
.music-toggle[aria-pressed=true] span { display: inline-block; animation: putar 3s linear infinite; }

/* Mode langsung & tanpa JS: bagian setelah pembuka mengikuti tinggi isinya */
[data-opener=langsung] main > section:not(.hero), [data-opener=amplop].opened main > section:not(.hero), html:not(.js) main > section:not(.hero) { min-height: 0; padding-top: 72px; padding-bottom: 72px; }

@keyframes muncul { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes denyut { 50% { opacity: 0.55; } }
@keyframes putar { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (min-width: 700px) {
  main { box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.6); }
}

/* ---------- 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); }

  .badge { animation: mo-pop 1s .6s cubic-bezier(.34,1.56,.64,1) both; }
  .qmark { animation: mo-ambang 6s 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 + piagam yang lebih megah ---------- */
/* Lencana diapit dua tangkai laurel; cincin putus-putusnya berkilau pelan. */
.crest { display: flex; align-items: flex-end; justify-content: center; gap: 6px; margin: 0 0 22px; color: var(--accent); }
.crest .badge { width: 96px; margin: 0; }
.laurel { width: 46px; height: 92px; margin-bottom: 26px; opacity: .9; }
.laurel.flip { transform: scaleX(-1); }
.hero .sheet { align-items: center; text-align: center; padding-top: 84px; }
.given { font: 700 11px/1.4 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 10px; }
.hero h1 { font-size: 46px; overflow-wrap: anywhere; }
.lede { max-width: 32ch; margin-left: auto; margin-right: auto; }
.lede .label { display: block; margin-bottom: 4px; }
.meta { width: 100%; justify-items: center; }
.meta dd { font: 400 italic 26px/1.2 var(--serif); }
.meta div { position: relative; padding-top: 12px; }
.meta div::before { content: ""; position: absolute; left: 50%; top: 0; width: 150px; margin-left: -75px; border-top: 1px solid var(--ink); opacity: .35; }
.meta { border-top: 0; padding-top: 0; }
/* Sudut hias piagam. */
.corner { position: absolute; width: 26px; height: 26px; border: 2px solid var(--accent); pointer-events: none; }
.corner.tl { left: 14px; top: 14px; border-right: 0; border-bottom: 0; } .corner.tr { right: 14px; top: 14px; border-left: 0; border-bottom: 0; }
.corner.bl { left: 14px; bottom: 14px; border-right: 0; border-top: 0; } .corner.br { right: 14px; bottom: 14px; border-left: 0; border-top: 0; }
.sheet::after { left: 0; right: 0; background: linear-gradient(90deg, var(--ink) 0 34%, var(--accent) 34% 66%, var(--ink) 66% 100%); }
.sheet-top { top: 32px; left: 48px; right: 48px; }
.sheet-top .label { font-size: 10px; letter-spacing: .16em; }

/* Pesan: kartu kutipan dengan garis aksen dan huruf awal besar. */
.quote { padding: 56px 22px 26px; background: var(--paper-2); border: 1px solid var(--line); border-left: 4px solid var(--accent); box-shadow: 0 24px 50px -36px color-mix(in srgb, var(--ink) 55%, transparent); }
.qmark { top: -22px; left: 14px; font-size: 130px; }
.message .text::first-letter { float: left; margin: 6px 10px 0 0; font: 500 62px/0.82 var(--serif); color: var(--accent-d); }
.sign strong { color: var(--accent-d); }

/* Galeri: bingkai tipis berjarak, seperti foto dokumentasi yang dipajang. */
.grid img { padding: 5px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 2px; }
.badge.sm { width: 64px; height: auto; }
@media (prefers-reduced-motion: no-preference) {
  .crest .badge { animation: mo-pop 1s .5s cubic-bezier(.34,1.56,.64,1) both, mo-kilau-emas 5s 2s ease-in-out infinite; }
  .laurel { animation: mo-naik .9s .8s var(--mo-e) both; }
  .corner { animation: mo-blur 1s 1s both; }
}
@keyframes mo-kilau-emas { 0%, 100% { filter: drop-shadow(0 10px 14px color-mix(in srgb, var(--ink) 22%, transparent)); } 50% { filter: drop-shadow(0 10px 14px color-mix(in srgb, var(--ink) 22%, transparent)) drop-shadow(0 0 14px color-mix(in srgb, var(--accent-l) 80%, transparent)); } }

/* 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; }
