/* Lencana — ucapan kelulusan/pelantikan polisi: cokelat dinas dan emas, lencana tersemat, papan nama dada. Tanpa lambang resmi. */
@font-face { font-family: "Cinzel"; src: url("fonts/cinzel.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("fonts/cormorant-garamond.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("fonts/cormorant-garamond-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root { --bg: #2b2118; --bg2: #3a2c1f; --ink: #f3ead8; --soft: #b9a88c; --accent: #c9a24a; --card: #f3ead8; --card-ink: #2b2118; --line: #5a4732; --btn-ink: #2b2118; --serif: "Cormorant Garamond", Georgia, serif; --caps: "Cinzel", Georgia, serif; }
/* Tone warna (field "tone"): cokelat = bawaan di atas. */
:root[data-tone="biru"] { --bg: #121a2e; --bg2: #1c2744; --ink: #eef1f7; --soft: #9aa6c2; --accent: #d4b25a; --card: #eef1f7; --card-ink: #121a2e; --line: #2f3d63; --btn-ink: #121a2e; }
:root[data-tone="hitam"] { --bg: #141414; --bg2: #222222; --ink: #f2efe8; --soft: #a7a39a; --card: #f2efe8; --card-ink: #141414; --line: #3a3a3a; --btn-ink: #141414; }

body { margin: 0; min-height: 100vh; background: radial-gradient(90% 60% at 50% 0%, var(--bg2), var(--bg)) fixed; color: var(--ink); font: 500 19px/1.5 var(--serif); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
em { font-style: italic; color: var(--accent); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.kicker, .lbl { font: 500 12px/1.4 var(--caps); letter-spacing: .28em; text-transform: uppercase; color: var(--accent); }

.cover h1 { font: 500 40px/1.1 var(--serif); }
.badge { position: relative; width: 170px; height: 198px; color: var(--accent); filter: drop-shadow(0 22px 26px rgb(0 0 0 / .5)); margin-top: 18px; transform: translateY(-12px) rotate(-8deg) scale(1.08); transition: transform .7s cubic-bezier(.3, 1.5, .5, 1); overflow: hidden; }
.badge svg { width: 100%; height: 100%; }
.shine { position: absolute; top: -20%; left: -70%; width: 46%; height: 140%; background: linear-gradient(90deg, transparent, rgb(255 255 255 / .6), transparent); transform: rotate(18deg); }
.opening .badge { transform: none; }
.opening .shine { left: 130%; transition: left .9s ease .45s; }
.open { min-height: 50px; padding: 0 30px; border: 1px solid var(--accent); border-radius: 2px; background: var(--accent); color: var(--btn-ink); font: 600 13px/1 var(--caps); letter-spacing: .24em; text-transform: uppercase; cursor: pointer; animation: napas 2.2s ease-in-out infinite; }

.hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.crest { width: 74px; height: 86px; color: var(--accent); }
/* Dengan 3D aktif lencana digambar scene.js di kotak ini (sampul: .badge, isi: .stage3d). */
.stage3d { display: grid; place-items: center; }
.gl .stage3d { width: 100%; height: 210px; }
.gl .crest, .gl .badge svg, .gl .badge .shine { visibility: hidden; }
.gl .badge { filter: none; }
/* Papan nama dada: pelat gelap, huruf putih tegas, bingkai emas. */
.plate { max-width: 100%; padding: 12px 22px; border: 2px solid var(--accent); border-radius: 4px; background: #0d0d0d; box-shadow: 0 10px 22px rgb(0 0 0 / .4), inset 0 1px 0 rgb(255 255 255 / .15); }
.plate span { font: 700 26px/1.15 var(--caps); letter-spacing: .12em; text-transform: uppercase; color: #fff; overflow-wrap: anywhere; }
.school { font-size: 17px; font-style: italic; color: var(--soft); }
.bars { display: flex; flex-direction: column; gap: 5px; margin-top: 4px; }
.bars i { display: block; width: 64px; height: 7px; background: var(--accent); clip-path: polygon(0 0, 50% 60%, 100% 0, 100% 40%, 50% 100%, 0 40%); }

.letter { padding: 32px 26px; background: var(--card); color: var(--card-ink); border-radius: 2px; box-shadow: 0 20px 40px rgb(0 0 0 / .4); outline: 1px solid color-mix(in srgb, var(--card-ink) 30%, transparent); outline-offset: -9px; }
.msg { font: 500 22px/1.5 var(--serif); }
.sign { margin-top: 18px; font: italic 600 26px/1.1 var(--serif); text-align: right; }
.lbl { margin-bottom: 14px; text-align: center; }
.brief ol { counter-reset: p; display: flex; flex-direction: column; gap: 10px; }
.brief li { counter-increment: p; display: flex; gap: 14px; align-items: baseline; padding: 14px 16px; border: 1px solid var(--line); border-left: 4px solid var(--accent); background: color-mix(in srgb, var(--bg2) 70%, transparent); font-size: 19px; line-height: 1.35; }
.brief li::before { content: counter(p, decimal-leading-zero); flex: none; font: 600 13px/1 var(--caps); letter-spacing: .1em; color: var(--accent); }
.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.photos figure { margin: 0; padding: 6px; background: var(--card); box-shadow: 0 10px 22px rgb(0 0 0 / .35); }
.photos figure:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
.photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.card { padding: 28px 24px; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg2) 70%, transparent); text-align: center; }
.reply h2 { margin-bottom: 16px; font: 500 30px/1.1 var(--serif); }
.hint { font-size: 16px; font-style: italic; color: var(--soft); }
.quick { justify-content: center; }
.btn { min-height: 50px; padding: 0 24px; border: 0; border-radius: 2px; background: var(--accent); color: var(--btn-ink); font: 600 12px/1.2 var(--caps); letter-spacing: .2em; text-transform: uppercase; cursor: pointer; }
.btn.ghost { min-height: 44px; padding: 0 16px; border: 1px solid var(--line); background: transparent; color: var(--ink); font: italic 500 18px/1.2 var(--serif); letter-spacing: 0; text-transform: none; }
textarea { border: 1px solid var(--line); border-radius: 2px; background: var(--bg); color: var(--ink); font: 500 18px/1.4 var(--serif); }
textarea::placeholder { color: var(--soft); font-style: italic; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
img { max-width: 100%; display: block; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.js-only { display: none; }
.js .js-only { display: block; }
main { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; padding: 0 22px; }

/* Cara dibuka "amplop": sampul diketuk dulu. Tanpa JS sampul dilewati dan semua isi langsung tampil. */
.cover { display: none; min-height: 100vh; min-height: 100svh; padding: 48px 0 40px; flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center; cursor: pointer; }
.js body[data-opener="amplop"]:not(.opened) .cover { display: flex; }
.js body[data-opener="amplop"]:not(.opened) .content,
.js body[data-opener="amplop"]:not(.opened) .foot { display: none; }
.content { display: flex; flex-direction: column; gap: 28px; padding: 40px 0 54px; }
.opened .content { animation: masuk .7s cubic-bezier(.2, .7, .2, 1) both; }
form { display: flex; flex-direction: column; gap: 12px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; }
textarea { width: 100%; min-height: 96px; padding: 14px 16px; resize: vertical; }
.msg { white-space: pre-line; overflow-wrap: anywhere; }
.music-toggle { position: fixed; top: 14px; right: 14px; z-index: 5; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.music-toggle svg { width: 20px; height: 20px; }
.music-toggle[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--btn-ink); }
.foot { position: relative; z-index: 1; padding: 8px 22px 34px; text-align: center; font-size: 12px; color: var(--soft); }
.anim .reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1); }
.anim .reveal.in { opacity: 1; transform: none; }
@keyframes masuk { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes napas { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Adegan 3D (scene.js + three.js): kanvas menempel di layar di belakang isi. Tanpa WebGL kanvas tetap tak terlihat
   dan gambar CSS/SVG biasa yang tampil. */
.scene { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .8s ease; }
.gl .scene { opacity: 1; }
