/* ---------- tokens ---------- */
:root {
  --page: #f2f6fa;      /* latar halaman di layar lebar */
  --cream: #ffffff;     /* kartu */
  --paper: #f7f9fc;     /* isian form, panel heksagon */
  --cocoa: #1e3a5c;     /* navy: tombol, kotak tanggal */
  --cocoa-deep: #16304d;
  --rose: #6f8cab;      /* steel blue: aksen */
  --gold: #9db4cc;      /* dusty blue: garis bingkai */
  --line: #d6e0ea;
  --ink: #1c2836;
  --muted: #5f7288;
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --script: "Pinyon Script", "Brush Script MT", cursive;
  --card-w: 30rem;
  --gutter: 1rem;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.55;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}
body.is-closed { overflow: hidden; height: 100dvh; }

p { margin: 0 0 1em; }
h1, h2 { margin: 0; font-weight: 600; line-height: 1.15; }
a { color: var(--cocoa); }
b, strong { font-weight: 700; }
.tiny { font-size: 0.85rem; color: var(--muted); }
.script { font-family: var(--script); font-weight: 400; line-height: 1.1; }
.amp { font-family: var(--script); color: var(--rose); padding: 0 .15em; }

/* ---------- corner decorations ---------- */
.deco {
  position: fixed;
  z-index: 0;
  width: clamp(72px, 20vw, 150px);
  height: auto;
  opacity: .55;
  pointer-events: none;
  user-select: none;
}
.deco-tr { top: .5rem; right: .75rem; transform: rotate(180deg); }
.deco-bl { bottom: .5rem; left: .75rem; }

/* ---------- card column ---------- */
.card {
  position: relative;
  z-index: 1;
  max-width: var(--card-w);
  margin: 0 auto;
  padding: 5rem var(--gutter) 4rem;
  text-align: center;
}
.section { padding: 1.5rem 0; }
.section > p:last-child { margin-bottom: 0; }
.rule {
  border: 0;
  border-top: 2px dashed color-mix(in srgb, var(--rose) 55%, transparent);
  margin: 0.5rem 0;
}
.salam { font-style: italic; font-size: 1.15rem; }
.lead-in { margin-bottom: 0.75rem; }

/* ---------- cover ---------- */
.cover .deco { position: absolute; }
.cover {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 1.25rem var(--gutter);
  background: var(--cream);
  overflow: auto;
  transition: transform .9s cubic-bezier(.65,0,.3,1), opacity .9s ease;
}
.cover.is-open { transform: translateY(-100%); opacity: 0; pointer-events: none; }
.cover-inner { width: min(100%, 22rem); text-align: center; }
.cover-bouquet {
  display: block;
  width: min(58vw, 12.5rem);
  height: auto;
  margin: 0 auto -2.6rem;
  position: relative;
  z-index: 0;
}
.hex { position: relative; z-index: 1; }
.cover-kicker { font-size: 1.2rem; letter-spacing: .02em; color: var(--muted); margin-bottom: .25rem; }
.cover-date { font-weight: 600; font-size: 1.25rem; margin: 1rem 0 1.1rem; }
.cover-to p { margin: 0; }
.cover-to .guest { font-size: 1.6rem; font-weight: 700; margin: .1em 0 .3em; overflow-wrap: anywhere; }
.cover-to { margin-bottom: 1.4rem; }

/* hexagon frame: gold hairline outside, paper inside */
.hex {
  --hex: polygon(50% 0, 100% 24%, 100% 76%, 50% 100%, 0 76%, 0 24%);
  width: min(64vw, 13.5rem);
  aspect-ratio: 5 / 6;
  margin: 0 auto;
  padding: 3px;
  background: linear-gradient(160deg, var(--rose), var(--gold) 50%, var(--rose));
  clip-path: var(--hex);
  filter: drop-shadow(0 10px 22px rgba(30, 58, 92, .14));
}
.hex-panel {
  width: 100%;
  height: 100%;
  clip-path: var(--hex);
  background: var(--paper);
  display: grid;
  place-items: center;
}
.names {
  font-size: clamp(2.6rem, 12vw, 3.4rem);
  margin: 0;
  display: grid;
  line-height: 1.05;
}
.names .amp { font-size: .55em; line-height: 1; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  font-size: 1.05rem;
  padding: .7rem 1.5rem;
  border-radius: 999px;
  border: 1.5px solid var(--cocoa);
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  transition: background-color .2s, color .2s;
}
.btn-primary { background: var(--cocoa); color: var(--cream); }
.btn-primary:hover { background: var(--cocoa-deep); }
.btn-ghost { background: transparent; color: var(--cocoa); }
.btn-ghost:hover { background: color-mix(in srgb, var(--cocoa) 10%, transparent); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, .music-btn:focus-visible {
  outline: 3px solid var(--rose);
  outline-offset: 2px;
}
.btn[disabled] { opacity: .6; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: 1.25rem; }

/* ---------- couple ---------- */
.person-name { font-size: clamp(2rem, 9vw, 2.6rem); color: var(--cocoa); margin-bottom: .35rem; }
.person-parents { color: var(--muted); font-size: 1.05rem; }
.with { font-size: 1.7rem; color: var(--rose); margin: .25rem 0 .75rem; }

/* ---------- event + tiles (signature element) ---------- */
.event-row {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  text-align: left;
}
.tiles { display: grid; gap: 4px; flex: none; }
.tile {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  background: var(--cocoa);
  color: var(--cream);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1;
  border-radius: 4px;
}
.tile-day { height: 2.25rem; font-size: .8rem; letter-spacing: .05em; text-transform: uppercase; }
.event-date { font-size: 1.55rem; font-weight: 700; }
.event-time { margin: .25rem 0 .75rem; font-weight: 500; }
.event-place { font-size: 1.05rem; margin: 0; }

.tiles-row { grid-auto-flow: column; justify-content: center; gap: .5rem; margin: .5rem 0 0; }
.tile-count { width: 4.4rem; height: 4.6rem; gap: 0; align-content: center; }
.tile-count b { font-size: 1.9rem; font-variant-numeric: tabular-nums; }
.tile-count small { font-size: .8rem; font-weight: 500; letter-spacing: .04em; opacity: .85; }
.countdown-title { font-size: 2rem; color: var(--cocoa-deep); margin-bottom: .25rem; }
.countdown-done { margin: .5rem 0 0; font-style: italic; }

.sign { font-size: 2.4rem; color: var(--cocoa-deep); margin: .5rem 0 0; }

/* ---------- wishes ---------- */
.section-title { font-size: 2.4rem; color: var(--cocoa-deep); margin-bottom: 1rem; }
.wish-form { display: grid; gap: .9rem; text-align: left; }
.wish-form label { display: grid; gap: .3rem; }
.wish-form label > span { font-weight: 600; font-size: 1rem; }
.wish-form label > span em { font-weight: 400; color: var(--muted); font-style: italic; }
.wish-form input, .wish-form textarea, .link-box {
  font: inherit;
  font-size: 1.05rem;
  padding: .65rem .85rem;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  width: 100%;
}
.wish-form textarea { resize: vertical; min-height: 5.5rem; }
.wish-form .btn { justify-self: center; }
.form-note { min-height: 1.3em; margin: 0; font-size: 1rem; color: var(--muted); text-align: center; }
.form-note.is-error { color: var(--rose); }
.form-note.is-ok { color: var(--cocoa); }

.wish-list { list-style: none; margin: 1.75rem 0 0; padding: 0; display: grid; gap: .75rem; text-align: left; }
.wish-list li {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--rose);
  padding: .75rem 1rem;
  border-radius: 0 8px 8px 0;
}
.wish-list .who { display: flex; justify-content: space-between; gap: .75rem; align-items: baseline; }
.wish-list .who b { font-size: 1.1rem; }
.wish-list .who time { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.wish-list .msg { margin: .2rem 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.wish-empty { margin-top: 1.5rem; color: var(--muted); font-style: italic; }

.card-footer { margin-top: 2rem; font-size: .9rem; color: var(--muted); }
.card-footer p { margin: 0; }

/* ---------- music ---------- */
.music-btn {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 5;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 0;
  background: var(--cocoa);
  color: var(--cream);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(30, 58, 92, .28);
}
.music-btn[aria-pressed="true"] svg { animation: spin 4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- share page ---------- */
.share-page .card { padding-top: 3.5rem; }
.names-small { font-size: 2.6rem; color: var(--cocoa-deep); margin: 0; }
.share-title { font-size: 1.8rem; margin: .25rem 0 .75rem; }
.link-box { display: block; text-align: left; overflow-wrap: anywhere; color: var(--cocoa); font-weight: 500; }
.actions-share { margin-top: .25rem; }
.btn-wa { background: #1f8f5a; border-color: #1f8f5a; }
.btn-wa:hover { background: #17724a; }

/* ---------- responsive / motion ---------- */
@media (max-width: 400px) {
  .event-row { flex-direction: column; text-align: center; }
  .tiles:not(.tiles-row) { grid-auto-flow: column; }
  .tile-day { width: 4rem; height: 4rem; font-size: .75rem; }
  .tile-count { width: 4rem; }
}
@media (min-width: 640px) {
  body { background: var(--page); }
  .card {
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 6px;
    margin: 2.5rem auto;
    padding: 3.5rem 2.5rem 3rem;
    box-shadow: 0 18px 50px rgba(30, 58, 92, .08);
  }
  .deco { opacity: .9; }
  .deco-tr { top: 1.5rem; right: 2rem; }
  .deco-bl { bottom: 1.5rem; left: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
  .cover { transition: opacity .3s ease; }
  .cover.is-open { transform: none; }
  .music-btn[aria-pressed="true"] svg { animation: none; }
  .btn { transition: none; }
}
