/* Lekas — ucapan semoga sembuh: bungkus obat apotek yang dibuka jadi kertas resep dengan obat yang bisa dicentang. */
@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 { --bg: #e6f6ef; --ink: #173b2c; --soft: #5c8573; --accent: #1f8a5f; --pop: #ef5b5b; --card: #ffffff; --line: #bfe3d2; --btn-ink: #ffffff; --serif: "Fraunces", Georgia, serif; --hand: "Caveat", "Fraunces", cursive; }
/* Tone warna (field "tone"): mint = bawaan di atas. */
:root[data-tone="biru"] { --bg: #e6f0fb; --ink: #16324f; --soft: #5a7895; --accent: #2563a8; --pop: #f08a24; --line: #bdd5ee; }
:root[data-tone="peach"] { --bg: #fff0e6; --ink: #4a2414; --soft: #94705f; --accent: #c2562a; --pop: #2f9e8f; --line: #f3d2bf; }

body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font: 400 17px/1.55 var(--serif); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
em { font-style: italic; color: var(--accent); }
.kicker, .lbl { font: 600 12px/1.4 var(--serif); letter-spacing: .22em; text-transform: uppercase; color: var(--accent); }
.cross { position: relative; flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--pop); }
.cross::before, .cross::after { content: ""; position: absolute; left: 50%; top: 50%; background: #fff; border-radius: 2px; transform: translate(-50%, -50%); }
.cross::before { width: 18px; height: 5px; }
.cross::after { width: 5px; height: 18px; }

.cover h1 { font: 400 42px/1.05 var(--serif); }
.bag { position: relative; width: 210px; padding: 34px 20px 26px; border-radius: 6px 6px 18px 18px; background: var(--card); border: 2px solid var(--line); box-shadow: 0 18px 0 -8px var(--line), 0 26px 40px rgb(0 0 0 / .1); display: flex; flex-direction: column; align-items: center; gap: 6px; transform: rotate(-3deg); transition: transform .5s cubic-bezier(.3, 1.4, .5, 1), opacity .5s; }
.bag::before { content: ""; position: absolute; top: -2px; left: -2px; right: -2px; height: 18px; border-radius: 6px 6px 0 0; background: repeating-linear-gradient(90deg, var(--accent) 0 10px, transparent 10px 20px), var(--line); }
.bag b { margin-top: 8px; font: 600 22px/1.1 var(--serif); }
.bag small { font: 500 19px/1.2 var(--hand); color: var(--soft); }
.opening .bag { transform: rotate(4deg) translateY(-40px) scale(1.08); opacity: 0; }
.open { min-height: 48px; padding: 0 26px; border: 0; border-radius: 999px; background: var(--accent); color: var(--btn-ink); font: 600 16px/1 var(--serif); cursor: pointer; animation: napas 2.2s ease-in-out infinite; }

/* Kertas resep: bergaris, sobekan atas, cap merah saat semua obat tercentang. */
.rx { position: relative; padding: 26px 22px 24px; background: repeating-linear-gradient(180deg, transparent 0 33px, color-mix(in srgb, var(--line) 55%, transparent) 33px 34px), var(--card); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 16px 34px rgb(0 0 0 / .08); }
.rx::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 9px; background: linear-gradient(135deg, var(--card) 6px, transparent 0) 0 0 / 12px 9px repeat-x, linear-gradient(-135deg, var(--card) 6px, transparent 0) 0 0 / 12px 9px repeat-x; }
.rx header { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 2px solid var(--accent); }
.rx header b { display: block; font: 600 21px/1.1 var(--serif); }
.rx header small { font-size: 13px; color: var(--soft); }
.who { margin-top: 14px; display: grid; gap: 4px; font-size: 15px; }
.who div { display: flex; gap: 8px; }
.who dt { flex: none; width: 82px; color: var(--soft); }
.who dd { font: 600 22px/1.15 var(--hand); }
.r { margin-top: 12px; font: italic 600 40px/1 var(--serif); color: var(--accent); }
.doses { margin-top: 6px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.doses label { display: flex; align-items: flex-start; gap: 12px; padding: 6px 0; cursor: pointer; }
.doses input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.box { flex: none; width: 26px; height: 26px; margin-top: 2px; border: 2px solid var(--accent); border-radius: 7px; background: var(--card); display: grid; place-items: center; transition: background .15s; }
.box::after { content: ""; width: 12px; height: 6px; border: solid #fff; border-width: 0 0 3px 3px; transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.doses input:checked + .box { background: var(--accent); }
.doses input:checked + .box::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.doses input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 3px; }
.txt b { display: block; font: 600 25px/1.1 var(--hand); }
.txt small { display: block; font-size: 14px; color: var(--soft); }
.doses input:checked ~ .txt b { text-decoration: line-through; text-decoration-color: var(--pop); opacity: .7; }
.progress { margin-top: 10px; font-size: 14px; font-style: italic; color: var(--soft); }
.note { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--line); }
.lbl { margin-bottom: 8px; }
.msg { font: 500 24px/1.42 var(--hand); white-space: pre-line; overflow-wrap: anywhere; }
.rx footer { margin-top: 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; min-height: 84px; }
.stamp { padding: 10px 14px; border: 3px double var(--pop); border-radius: 10px; color: var(--pop); font: 700 15px/1.05 var(--serif); letter-spacing: .14em; text-transform: uppercase; text-align: center; transform: rotate(-9deg); opacity: .85; }
.js .stamp { opacity: 0; transform: rotate(-9deg) scale(1.8); transition: opacity .25s, transform .35s cubic-bezier(.3, 1.5, .5, 1); }
.js .cured .stamp { opacity: .85; transform: rotate(-9deg); }
.sign { font: 600 34px/1 var(--hand); color: var(--accent); }
.sign::before { content: "dr. "; font-size: 22px; color: var(--soft); }

.photos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.photos figure { margin: 0; padding: 7px 7px 22px; background: var(--card); box-shadow: 0 8px 20px rgb(0 0 0 / .1); transform: rotate(-1.5deg); }
.photos figure:nth-child(even) { transform: rotate(1.8deg); }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.card { padding: 26px 22px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.reply h2 { margin-bottom: 14px; font: 400 30px/1.1 var(--serif); }
.hint { font-size: 15px; color: var(--soft); }
.btn { min-height: 50px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--accent); color: var(--btn-ink); font: 600 16px/1.2 var(--serif); cursor: pointer; }
.btn.ghost { min-height: 44px; padding: 0 16px; border: 1px solid var(--line); background: transparent; color: var(--ink); font-weight: 400; font-size: 15px; }
textarea { border: 1px solid var(--line); border-radius: 14px; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--serif); }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
img { max-width: 100%; display: block; }
h1, h2, p, ul, ol, dl, dd { margin: 0; }
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; 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: 26px; padding: 34px 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; }
.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 { 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; } }

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