:root {
  --bg: #F2F1EA;
  --bg2: #E4E6DA;
  --ink: #24301F;
  --soft: #6B7462;
  --accent: #6E7F5E;
  --line: rgba(36, 48, 31, .16);
  --fx: #8FA383;
  --card: rgba(255, 255, 255, .55);
  --radius: 4px;
  --title: 'Cormorant Garamond', Georgia, serif;
  --body: 'Manrope', system-ui, sans-serif;
  --track: .14em;
  --shadow: 0 18px 50px rgba(36, 48, 31, .12);
  --c1: #4A5A3F;
  --c2: #8FA383;
  --c3: #F1EDE3;
  --c4: #D9C4A3;
}

html[data-theme="deco"] {
  --bg: #0A0A0D;
  --bg2: #121218;
  --ink: #F3EEE4;
  --soft: #A9A399;
  --accent: #C9A96E;
  --line: rgba(201, 169, 110, .3);
  --fx: #C9A96E;
  --card: rgba(255, 255, 255, .04);
  --track: .28em;
  --shadow: 0 24px 60px rgba(0, 0, 0, .55);
  --c1: #0B0B0D;
  --c2: #C9A96E;
  --c3: #E6D6B8;
  --c4: #4A4A52;
}

html[data-theme="rustic"] {
  --bg: #EBE1D3;
  --bg2: #DCCFBB;
  --ink: #3B2E23;
  --soft: #7A6753;
  --accent: #8A6A45;
  --line: rgba(59, 46, 35, .2);
  --fx: #B08D57;
  --card: rgba(255, 253, 248, .55);
  --radius: 2px;
  --track: .1em;
  --shadow: 0 16px 40px rgba(59, 46, 35, .16);
  --c1: #A2553A;
  --c2: #D8B98A;
  --c3: #F2E7D6;
  --c4: #6B4A32;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-locked {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
}

img { display: block; max-width: 100%; height: auto; }

.fx { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.fx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.fx-aurora { position: absolute; inset: -20%; opacity: 0; transition: opacity .8s ease; }
.fx-aurora.is-on { opacity: 1; }

.fx-aurora i {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .3;
  background: radial-gradient(circle at 50% 50%, var(--fx), transparent 65%);
  will-change: transform;
}

.fx-aurora i:nth-child(1) { top: -10%; left: -15%; animation: drift1 34s ease-in-out infinite; }
.fx-aurora i:nth-child(2) { bottom: -20%; right: -10%; animation: drift2 42s ease-in-out infinite; }
.fx-aurora i:nth-child(3) { top: 35%; left: 45%; opacity: .18; animation: drift3 50s ease-in-out infinite; }

@keyframes drift1 { 50% { transform: translate3d(8vw, 6vh, 0) scale(1.15); } }
@keyframes drift2 { 50% { transform: translate3d(-10vw, -5vh, 0) scale(1.1); } }
@keyframes drift3 { 50% { transform: translate3d(-6vw, 8vh, 0) scale(.9); } }

.topbar {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 40;
  padding: 12px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
}

.langs {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.langs button {
  min-width: 40px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--soft);
  font-family: var(--body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  cursor: pointer;
}

.langs button + button { border-left: 1px solid var(--line); }
.langs button.is-active { background: var(--accent); color: var(--bg); }

.panel-btn {
  position: fixed;
  right: 16px;
  bottom: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 44;
  width: 58px;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  color: var(--accent);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.panel-btn:hover { border-color: var(--accent); }

.sound-btn {
  position: fixed;
  right: 16px;
  bottom: 84px;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  z-index: 44;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  color: var(--soft);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: color .25s ease, border-color .25s ease;
}

.sound-btn .sound-on { display: none; }
.sound-btn .sound-off { display: inline; }
.sound-btn.is-on { color: var(--accent); border-color: var(--accent); }
.sound-btn.is-on .sound-on { display: inline; }
.sound-btn.is-on .sound-off { display: none; }
.sound-btn.is-on::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: .5;
  animation: soundPulse 1.8s ease-out infinite;
}

@keyframes soundPulse {
  0% { transform: scale(1); opacity: .5; }
  100% { transform: scale(1.35); opacity: 0; }
}

.sound-tip {
  position: fixed;
  right: 74px;
  bottom: 96px;
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  z-index: 44;
  max-width: 46vw;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 12px;
  letter-spacing: .02em;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(8px);
  transition: opacity .4s ease, transform .4s ease;
  pointer-events: none;
}

.sound-tip.is-show { opacity: 1; transform: none; }

.sound-tip::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 50%;
  width: 9px;
  height: 9px;
  transform: translateY(-50%) rotate(45deg);
  background: var(--card);
  border-right: 1px solid var(--line);
  border-top: 1px solid var(--line);
}

.page { position: relative; z-index: 1; }

.block {
  max-width: 720px;
  margin: 0 auto;
  padding: 84px 22px;
  text-align: center;
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition: opacity .9s ease, transform .9s cubic-bezier(.22, .61, .36, 1);
  will-change: opacity, transform;
}

.block.is-in { opacity: 1; transform: none; will-change: auto; }
.block[hidden] { display: none; }

.eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--accent);
}

.h2 {
  margin: 0 0 18px;
  font-family: var(--title);
  font-weight: 300;
  font-size: clamp(28px, 6vw, 44px);
  line-height: 1.15;
}

html[data-theme="deco"] .h2 { text-transform: uppercase; letter-spacing: .1em; font-size: clamp(22px, 5vw, 34px); }
html[data-theme="rustic"] .h2 { font-style: italic; }

.lead {
  margin: 0 auto;
  max-width: 46ch;
  font-size: 15px;
  color: var(--soft);
  white-space: pre-line;
}

.block-cover {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 74px;
}

.rail-wrap { position: relative; margin: 0 -22px; }

.rail {
  display: flex;
  gap: 14px;
  padding: 10px 22px 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.rail::-webkit-scrollbar { display: none; }
.rail.is-grab { cursor: grabbing; }

.rail figure {
  position: relative;
  flex: 0 0 auto;
  width: min(78vw, 300px);
  margin: 0;
  scroll-snap-align: center;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--card);
  outline: 1px solid transparent;
  outline-offset: 3px;
  transition: outline-color .25s ease;
}

.rail img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; -webkit-user-drag: none; user-select: none; }

html[data-cover="mag1"] figure[data-cover="mag1"],
html[data-cover="mag2"] figure[data-cover="mag2"],
html[data-cover="mag3"] figure[data-cover="mag3"] { outline-color: var(--accent); }

.pick {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 999px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(6px);
  color: #1C1C1E;
  font-family: var(--body);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background .25s ease, color .25s ease;
}

.pick.is-picked { background: var(--accent); border-color: var(--accent); color: var(--bg); }

.rail-arrow {
  display: none;
  position: absolute;
  top: 44%;
  z-index: 3;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  backdrop-filter: blur(8px);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.rail-prev { left: 2px; }
.rail-next { right: 2px; }

@media (hover: hover) and (pointer: fine) {
  .rail-arrow { display: block; }
  .rail-arrow[hidden] { display: none; }
}

.rail-hint { margin: 0; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--soft); }

@media (min-width: 900px) {
  .block-cover { max-width: 1060px; padding-top: 86px; }
  .rail { justify-content: center; }
  .rail figure { width: 300px; }
}

.mag-lines {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--soft);
}

.mag-lines li:first-child {
  font-family: var(--title);
  font-size: 26px;
  letter-spacing: .06em;
  color: var(--ink);
}

.timer-date {
  margin: 0 0 22px;
  font-family: var(--title);
  font-size: clamp(20px, 4.4vw, 27px);
  line-height: 1.3;
}

html[data-theme="rustic"] .timer-date { font-style: italic; }

.timer {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 0;
  max-width: 420px;
  margin: 0 auto;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.timer-cell { flex: 1; position: relative; }

.timer-cell + .timer-cell::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--line);
}

.timer-cell b {
  display: block;
  font-family: var(--title);
  font-weight: 300;
  font-size: clamp(34px, 9vw, 46px);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.timer-cell span {
  display: block;
  margin-top: 4px;
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--soft);
}

.timer-over { font-family: var(--title); font-size: 24px; }

.cal { display: flex; justify-content: center; }

.cal-img {
  width: min(88vw, 420px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.cal-note { margin-top: 8px; text-align: center; }

.timeline {
  list-style: none;
  margin: 8px auto 0;
  padding: 0;
  max-width: 560px;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 50%;
  width: 1px;
  background: linear-gradient(transparent, var(--line) 8%, var(--line) 92%, transparent);
}

.timeline li {
  position: relative;
  width: 50%;
  padding: 14px 22px;
  text-align: right;
}

.timeline li.tl-right { margin-left: 50%; text-align: left; }

.tl-dot {
  position: absolute;
  top: 24px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: var(--bg);
}

.tl-left .tl-dot { right: -5px; }
.tl-right .tl-dot { left: -4px; }

.tl-card b {
  display: block;
  font-family: var(--title);
  font-size: 22px;
  font-weight: 400;
  color: var(--accent);
  line-height: 1.1;
}

.tl-card strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .04em;
  margin-top: 2px;
}

.tl-card p { margin: 4px 0 0; font-size: 13px; color: var(--soft); line-height: 1.5; }

@media (max-width: 520px) {
  .timeline::before { left: 9px; }
  .timeline li, .timeline li.tl-right { width: 100%; margin-left: 0; padding: 12px 0 12px 30px; text-align: left; }
  .tl-left .tl-dot, .tl-right .tl-dot { left: 5px; right: auto; }
}

.palette { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin-top: 26px; }
.pal { width: 74px; display: flex; flex-direction: column; align-items: center; }

.pal-blob {
  width: 58px;
  height: 56px;
  border: 1px solid var(--line);
  box-shadow: inset 0 -6px 18px rgba(0, 0, 0, .06);
}

.pal-1 .pal-blob { background: var(--c1); border-radius: 52% 48% 44% 56% / 56% 52% 48% 44%; }
.pal-2 .pal-blob { background: var(--c2); border-radius: 46% 54% 56% 44% / 48% 44% 56% 52%; }
.pal-3 .pal-blob { background: var(--c3); border-radius: 55% 45% 48% 52% / 44% 56% 44% 56%; }
.pal-4 .pal-blob { background: var(--c4); border-radius: 48% 52% 52% 48% / 52% 48% 52% 48%; }

.pal-line { width: 1px; height: 34px; background: var(--line); }

.pal em {
  font-style: normal;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--soft);
  line-height: 1.4;
}

.btn {
  display: inline-block;
  margin-top: 18px;
  padding: 13px 26px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: transparent;
  color: var(--accent);
  font-family: var(--body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: var(--track);
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background .25s ease, color .25s ease;
}

.btn:hover { background: var(--accent); color: var(--bg); }
.btn-solid { background: var(--accent); color: var(--bg); }
.btn-solid:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: default; }

.form {
  max-width: 420px;
  margin: 18px auto 0;
  text-align: left;
  display: grid;
  gap: 12px;
}

.field { display: grid; gap: 6px; }

.field > span, .choice legend {
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--soft);
}

input[type="text"], input[type="email"], input[type="url"], input[type="datetime-local"], textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  font-family: var(--body);
  font-size: 15px;
  font-weight: 300;
}

textarea { resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); }

.choice { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.choice legend { padding: 0; margin-bottom: 4px; }
.choice-hint { margin: -4px 0 0; font-size: 11px; color: var(--soft); }

.opt {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}

.opt input[type="checkbox"], .opt input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1px solid var(--line);
  background: var(--card);
  position: relative;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}

.opt input[type="checkbox"] { border-radius: 4px; }
.opt input[type="radio"] { border-radius: 50%; }

.opt input:checked { background: var(--accent); border-color: var(--accent); }

.opt input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid var(--bg);
  border-width: 0 1.6px 1.6px 0;
  transform: rotate(45deg);
}

.opt input[type="radio"]:checked::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--bg);
}

.opt input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sub {
  display: grid;
  gap: 8px;
  margin: -2px 0 4px 30px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.sub[hidden] { display: none; }
.sub .opt { font-size: 13px; color: var(--soft); }

.gotcha { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.form-msg { margin: 4px 0 0; font-size: 13px; color: var(--accent); min-height: 16px; }
.form-note { margin: 0; font-size: 11px; color: var(--soft); }

.cm-list { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 10px; text-align: left; }

.cm-list li {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: 12px 14px;
}

.cm-list b { font-family: var(--title); font-size: 17px; font-weight: 400; }
.cm-list p { margin: 4px 0 0; font-size: 14px; color: var(--soft); }
.cm-empty { border-style: dashed; color: var(--soft); font-size: 13px; }

.finale-heart {
  width: min(78vw, 380px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path d='M16 29S3 20.5 3 11.8C3 7 6.8 3.5 11 3.5c2.8 0 4.4 1.4 5 2.6.6-1.2 2.2-2.6 5-2.6 4.2 0 8 3.5 8 8.3C29 20.5 16 29 16 29z' fill='black'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><path d='M16 29S3 20.5 3 11.8C3 7 6.8 3.5 11 3.5c2.8 0 4.4 1.4 5 2.6.6-1.2 2.2-2.6 5-2.6 4.2 0 8 3.5 8 8.3C29 20.5 16 29 16 29z' fill='black'/></svg>");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-position: center;
  mask-position: center;
}

.finale-heart img { width: 100%; height: 100%; object-fit: cover; }
.finale-frame { width: min(86vw, 420px); margin: 0 auto; }
.finale-frame img { width: 100%; border-radius: var(--radius); }

html[data-finale="heart"] .finale-frame { display: none; }
html[data-finale="frame"] .finale-heart { display: none; }

.finale-text {
  margin: 22px 0 0;
  font-family: var(--title);
  font-size: clamp(19px, 4.2vw, 26px);
  font-style: italic;
  color: var(--soft);
}

.block-order { border-top: 1px solid var(--line); padding-bottom: 110px; }

.sign {
  margin: 34px 0 0;
  font-size: 10px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--soft);
}

@media (prefers-reduced-motion: reduce) {
  .fx-aurora i, .sound-btn.is-on::after { animation: none; }
  .sound-tip { transition: opacity .4s ease; transform: none; }
  .block { opacity: 1; transform: none; transition: none; }
}
