:root {
  color-scheme: dark;
  --background: #081510;
  --ivory: #fbf1de;
  --gold: #edcf91;
  --muted: #d2d4c4;
  --edge: clamp(26px, 7vw, 108px);
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--background);
  color: var(--ivory);
  font-family: var(--sans);
}

.site-header {
  position: relative;
  z-index: 3;
  background: #101d17;
  border-bottom: 1px solid #dac39433;
}

.site-header__inner {
  max-width: 1720px;
  min-height: 74px;
  margin-inline: auto;
  padding: 12px var(--edge);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: .11em;
  white-space: nowrap;
}

.snow-button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid #dfc38d60;
  border-radius: 999px;
  color: var(--ivory);
  background: #18271e;
  font: 600 0.79rem var(--sans);
  white-space: nowrap;
  cursor: pointer;
}

.snow-button:hover { background: #26382a; }
.snow-button:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.snow-button__icon { color: var(--gold); font: 1.15rem/1 "Segoe UI Symbol", sans-serif; }

.snow-button__switch {
  position: relative;
  width: 24px;
  height: 13px;
  margin-inline-start: 3px;
  border: 1px solid #b6bcaa;
  border-radius: 10px;
}

.snow-button__switch::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  top: 2px;
  left: 2px;
  border-radius: 50%;
  background: #b6bcaa;
}

.snow-button[aria-pressed="true"] .snow-button__switch { border-color: var(--gold); }
.snow-button[aria-pressed="true"] .snow-button__switch::after { left: 13px; background: var(--gold); }

.hero { position: relative; isolation: isolate; overflow: hidden; }

.hero__inner {
  position: relative;
  display: grid;
  align-items: center;
  min-height: clamp(650px, calc(100svh - 74px), 1060px);
  max-width: 1720px;
  margin-inline: auto;
}

.hero__scene {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: #081510;
}

.hero__scene img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: right center;
}

.hero__scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #081510 3%, #081510ed 16%, #081510a6 33%, transparent 62%),
    linear-gradient(0deg, #081510b3, transparent 19%);
}

.hero__content {
  position: relative;
  width: fit-content;
  max-width: 100%;
  padding: 52px var(--edge) 62px;
}

.hero__date {
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--gold);
  margin: 0 0 31px;
  font: 700 .69rem/1.4 system-ui, sans-serif;
  letter-spacing: .32em;
}

.hero__date::before {
  content: "";
  width: 31px;
  height: 1px;
  background: #cfaa70;
}

h1 {
  margin: 0;
  font: 400 clamp(4.5rem, 7.4vw, 8rem)/.92 var(--serif);
  letter-spacing: -.07em;
  text-wrap: nowrap;
}

h1 em {
  display: block;
  padding-right: .12em;
  margin-top: .085em;
  color: var(--gold);
  font-weight: 400;
  letter-spacing: -.075em;
}

.hero__message {
  margin: 30px 0 0;
  color: var(--muted);
  font-size: clamp(.93rem, 1.27vw, 1.1rem);
  line-height: 1.85;
  word-break: keep-all;
}

.countdown {
  width: min(100%, 335px);
  margin-top: 44px;
  padding-top: 17px;
  border-top: 1px solid #dfc38d55;
}

.countdown__title {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .12em;
}

.countdown__values {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0;
}

.countdown__values div {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 4px;
}

.countdown__values div + div { border-left: 1px solid #dfc38d38; }
.countdown__values div:first-child { align-items: start; }
.countdown__values dt { color: var(--muted); font-size: .7rem; }

.countdown__values dd {
  margin: 0;
  font: 400 2rem/1 var(--serif);
  font-variant-numeric: lining-nums tabular-nums;
}

.countdown__celebration { margin: 0; color: var(--gold); font-size: 1.12rem; }

.hero__guestbook-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin-top: 16px;
  color: var(--gold);
  font-size: .83rem;
  font-weight: 700;
  text-underline-offset: 5px;
}

.hero__guestbook-link:hover { color: var(--ivory); }
.hero__guestbook-link span { font-size: 1rem; }

.snow {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.falling-messages {
  position: fixed;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.message-bubble {
  position: relative;
  width: fit-content;
  padding: 9px 13px;
  border: 1px solid #bca475;
  border-radius: 14px 14px 14px 5px;
  color: var(--ivory);
  background: #20352a;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.message-bubble::after {
  content: "";
  position: absolute;
  left: 13px;
  bottom: -5px;
  width: 8px;
  height: 8px;
  border-right: inherit;
  border-bottom: inherit;
  background: inherit;
  transform: rotate(45deg);
}

.falling-messages .message-bubble {
  position: absolute;
  top: 0;
  left: var(--bubble-left);
  max-width: min(250px, 56vw);
  background: #1b2e24f5;
  box-shadow: 0 4px 15px #020a07a8;
  font-size: .88rem;
  animation: bubble-fall var(--bubble-duration) linear both;
}

@keyframes bubble-fall {
  0% { opacity: 0; transform: translate(-50%, calc(-100% - 12px)) rotate(-3deg); }
  8%, 92% { opacity: 1; }
  32% { transform: translate(calc(-50% + var(--bubble-sway)), 30vh) rotate(2deg); }
  66% { transform: translate(calc(-50% - var(--bubble-sway)), 65vh) rotate(-2deg); }
  100% { opacity: 0; transform: translate(-50%, calc(100vh + 20px)) rotate(2deg); }
}

.guestbook {
  border-top: 1px solid #dfc38d40;
  background: radial-gradient(ellipse at top right, #1a291e, transparent 65%), #101d17;
  scroll-margin-top: 16px;
}

.guestbook__inner {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: start;
  gap: clamp(36px, 7vw, 100px);
  max-width: 1320px;
  margin-inline: auto;
  padding: clamp(42px, 7vw, 88px) var(--edge);
}

.guestbook__title {
  margin: 0;
  color: var(--ivory);
  font-size: clamp(1.5rem, 3.4vw, 2.55rem);
  letter-spacing: -.055em;
}

.guestbook__intro {
  margin: 14px 0 20px;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.65;
}

.guestbook__form { position: relative; z-index: 3; }

.guestbook__form input {
  width: 100%;
  min-height: 52px;
  padding: 11px 15px;
  border: 1px solid #dfc38d64;
  border-radius: 6px;
  color: var(--ivory);
  background: #0c1812;
  font: 400 1rem var(--sans);
}

.guestbook__form input::placeholder { color: #aeb5a6; }

.guestbook__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
}

.guestbook__actions button {
  min-height: 44px;
  padding: 0 19px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--gold);
  color: #172119;
  font: 700 .88rem var(--sans);
  cursor: pointer;
}

.guestbook__actions button:not(:disabled):hover { background: var(--ivory); }
.guestbook__actions button:disabled {
  border-color: #dfc38d4d;
  color: var(--muted);
  background: #1b2c21;
  cursor: default;
}

.hero__guestbook-link:focus-visible,
.guestbook__form input:focus-visible,
.guestbook__actions button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.guestbook__status { margin: 12px 0 0; color: var(--gold); font-size: .85rem; }
.guestbook__status:empty { margin: 0; }

.guestbook__wall {
  padding: clamp(17px, 3.5vw, 30px);
  border: 1px solid #dfc38d42;
  border-radius: 8px;
  background: #0c18128c;
}

.guestbook__wall h3 {
  margin: 0;
  color: var(--gold);
  font-size: .88rem;
}

.guestbook__empty {
  margin: 19px 0 0;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.6;
}

.guestbook__messages {
  margin: 0;
  padding: 0;
  list-style: none;
}

.guestbook__messages li {
  max-width: 100%;
  margin-top: 14px;
  font-size: 1rem;
}

.guestbook__messages li:first-child { color: var(--gold); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 1040px) and (min-width: 761px) {
  .hero__inner { min-height: clamp(620px, calc(100svh - 74px), 760px); }
  .hero__scene img { object-fit: cover; object-position: right top; }
  .hero__scene::after {
    background:
      linear-gradient(90deg, #081510fa, #081510bb 25%, #08151038 56%, transparent 73%),
      linear-gradient(0deg, #08151099, transparent 17%);
  }
}

@media (max-width: 760px) {
  .site-header__inner { min-height: 65px; }
  .hero__inner { display: flex; flex-direction: column; min-height: 0; }

  .hero__scene {
    position: relative;
    width: 100%;
    aspect-ratio: 1.1;
    order: 1;
  }

  .hero__scene img { object-fit: cover; object-position: right center; }
  .hero__scene::after {
    background: linear-gradient(0deg, #081510dd, transparent 14%, transparent 92%, #081510a6);
  }

  .hero__content {
    width: 100%;
    padding: 36px var(--edge) 30px;
  }

  .hero__date { margin-bottom: 19px; }
  h1 { font-size: clamp(3.25rem, 13.1vw, 6.1rem); }
  .hero__message { margin-top: 21px; }
  .countdown { margin-top: 24px; padding-top: 13px; }
  .countdown__values dd { font-size: 1.75rem; }
  .hero__guestbook-link { margin-top: 10px; }
  .falling-messages .message-bubble { left: var(--bubble-narrow-left); }
  .guestbook__inner { grid-template-columns: minmax(0, 1fr); }
}
