@font-face {
  font-family: "Noto Serif Thai";
  src: url("fonts/noto-serif-thai.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}

@font-face {
  font-family: "Noto Sans Thai";
  src: url("fonts/noto-sans-thai.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}

:root {
  color-scheme: light;
  --paper: #fcf8ed;
  --gold: #80530d;
  --gold-bright: #a2630e;
  --gold-hover: #784709;
  --gold-line: #d9b66d;
  --ink: #4f3b22;
  --ink-muted: #655239;
  --white: #fffdf7;
  --serif: "Noto Serif Thai", "Thonburi", "Leelawadee UI", Georgia, serif;
  --sans: "Noto Sans Thai", "Leelawadee UI", Tahoma, Arial, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
::selection { background: #e8d49d; color: #392b18; }
img { max-width: 100%; }
a { color: inherit; touch-action: manipulation; }
a:focus-visible { outline: 3px solid var(--gold); outline-offset: 5px; }
/* Keep a visible keyboard fallback in older browsers without :focus-visible. */
@supports not selector(:focus-visible) {
  a:focus { outline: 3px solid var(--gold); outline-offset: 5px; }
}

.skip-link {
  position: absolute;
  top: -120px;
  left: 16px;
  z-index: 5;
  padding: 12px 20px;
  background: var(--white);
  border: 1px solid var(--gold);
}
.skip-link:focus { top: 16px; }

.intro-page {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100svh;
  background:
    radial-gradient(ellipse at 14% 20%, #f1d57e35, transparent 40%),
    radial-gradient(ellipse at 94% 8%, #d8e6e925, transparent 30%),
    var(--paper);
}

.watercolor {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: block;
  pointer-events: none;
}
.watercolor img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 72%;
}

.ceremony {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .87fr) minmax(0, 1.13fr);
  align-items: center;
  gap: clamp(24px, 3vw, 48px);
  width: min(100%, 1380px);
  min-height: 100vh;
  min-height: 100svh;
  margin-inline: auto;
  padding: clamp(20px, 4vh, 40px) clamp(24px, 4vw, 64px) clamp(72px, 12vh, 120px);
  padding-left: max(clamp(24px, 4vw, 72px), env(safe-area-inset-left));
  padding-right: max(clamp(24px, 4vw, 72px), env(safe-area-inset-right));
  padding-top: max(clamp(20px, 4vh, 40px), env(safe-area-inset-top));
}

.royal-portrait {
  position: relative;
  min-width: 0;
  width: 100%;
  max-width: 420px;
  max-width: min(420px, 52vh);
  margin: 0 auto;
  align-self: center;
  animation: portrait-arrive 700ms var(--ease) both;
}
.royal-portrait picture { display: block; }
.royal-portrait img {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 360 / 393;
  mix-blend-mode: multiply;
  -webkit-mask-image: linear-gradient(#000 0%, #000 76%, transparent 100%);
  mask-image: linear-gradient(#000 0%, #000 76%, transparent 100%);
}

.ceremony-copy {
  min-width: 0;
  text-align: center;
  color: var(--gold);
  animation: copy-arrive 650ms 100ms var(--ease) both;
}
.ceremony-date {
  margin: 0;
  font: 400 clamp(2.3rem, min(3.8vw, 7.4vh), 4rem)/1.3 var(--serif);
  letter-spacing: -.035em;
}
.keep {
  display: inline-block;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: break-word;
}
.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: min(66%, 290px);
  margin-inline: auto;
  color: #b88b3e;
}
.ornament span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-line));
}
.ornament span:last-child { transform: rotate(180deg); }
.ornament svg { flex: 0 0 48px; overflow: visible; }
.ornament-top { margin-top: 6px; margin-bottom: 10px; }
.ornament-bottom { margin-top: 12px; margin-bottom: 10px; }

.royal-title {
  margin: 0;
  font: 400 clamp(1.125rem, min(1.85vw, 3.5vh), 1.75rem)/1.5 var(--serif);
  text-wrap: balance;
}
.royal-title-lead {
  display: block;
  margin-bottom: 5px;
  font-size: clamp(1rem, 1.25vw, 1.125rem);
  line-height: 1.55;
  color: var(--ink);
}
.royal-title-line { display: block; }
.occasion {
  margin: 0;
  font: 400 clamp(1.5rem, min(2.4vw, 4.6vh), 2.15rem)/1.45 var(--serif);
  text-wrap: balance;
}
.homage {
  margin: 8px 0 0;
  font: 400 clamp(1rem, 1.35vw, 1.2rem)/1.55 var(--serif);
  text-wrap: balance;
}
.signature {
  margin: 14px 0 0;
  color: var(--ink-muted);
  font-size: clamp(.875rem, 1.12vw, 1rem);
  line-height: 1.55;
}
.signature p { margin: 0; }
.company-name {
  display: block;
  min-height: 1.55em;
  margin-top: 4px !important;
  color: var(--gold);
  font-size: 1.05em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

/* One capsule, two real links; the entire half is a touch target. */
.entry-buttons {
  display: inline-flex;
  align-items: stretch;
  width: min(100%, 320px);
  min-height: 50px;
  margin-top: 18px;
  padding: 3px;
  gap: 3px;
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  background: #fffdf7f2;
  box-shadow: 0 4px 10px #8e652319, inset 0 1px 0 #fff;
}
.entry-link {
  position: relative;
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  justify-content: center;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  font: 400 .9375rem/1.5 var(--sans);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 180ms ease, box-shadow 180ms ease, color 180ms ease;
}
.entry-link-primary {
  color: var(--white);
  background: var(--gold-bright);
  box-shadow: inset 0 1px 0 #e4bc7259, 0 1px 3px #70450726;
}
.entry-link-secondary { color: #503514; font-family: Arial, var(--sans); }
@media (hover: hover) and (pointer: fine) {
  .entry-link-primary:hover { background: var(--gold-hover); }
  .entry-link-secondary:hover { background: #f3e6c6; color: var(--gold-hover); }
}
.entry-link-primary:active { background: #68400b; box-shadow: inset 0 2px 4px #4e2c1a33; }
.entry-link-secondary:active { background: #edd9ac; }

@keyframes portrait-arrive {
  from { opacity: .35; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes copy-arrive {
  from { opacity: .45; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 1700px) {
  .ceremony { max-width: 1480px; }
  .royal-portrait { max-width: min(460px, 53vh); }
}

@media (min-width: 768px) and (max-width: 1100px) {
  .ceremony { grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr); gap: 20px; padding-inline: 28px; }
  .ceremony-date { font-size: clamp(2rem, 4.2vw, 3rem); }
  .royal-title { font-size: clamp(1.0625rem, 1.9vw, 1.375rem); line-height: 1.5; }
  .occasion { font-size: clamp(1.4rem, 2.7vw, 1.85rem); }
}

@media (max-width: 767px) {
  .ceremony {
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 2px;
    max-width: 620px;
    min-height: 100vh;
    min-height: 100svh;
    padding: 18px 20px 110px;
    padding-top: max(18px, env(safe-area-inset-top));
    padding-bottom: max(110px, calc(90px + env(safe-area-inset-bottom)));
  }
  .royal-portrait { width: 235px; width: clamp(210px, 62vw, 275px); max-width: 275px; }
  .watercolor { inset: auto 0 0; height: clamp(260px, 78vw, 340px); }
  .watercolor::after {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 45%;
    background: linear-gradient(var(--paper), #fcf8ed00);
  }
  .watercolor img { object-position: center bottom; }
  .ceremony-date { font-size: clamp(1.875rem, 7.6vw, 2.6rem); line-height: 1.35; }
  .ornament-top { margin-top: 5px; margin-bottom: 8px; }
  .royal-title { font-size: clamp(1rem, 3.7vw, 1.2rem); line-height: 1.5; }
  .royal-title-lead { font-size: .9375rem; line-height: 1.55; margin-bottom: 4px; }
  .ornament-bottom { margin-top: 9px; margin-bottom: 8px; }
  .occasion { font-size: clamp(1.375rem, 5.4vw, 1.7rem); line-height: 1.45; }
  .homage { font-size: .9375rem; line-height: 1.6; margin-top: 7px; }
  .signature { font-size: .875rem; margin-top: 12px; line-height: 1.55; }
  .company-name { font-size: 1rem; }
  .entry-buttons { margin-top: 15px; width: min(100%, 286px); }
  .entry-link { padding-inline: 10px; font-size: .875rem; }
}

@media (max-width: 359px) {
  .ceremony { padding-inline: 16px; }
  .royal-portrait { width: 210px; }
  .ceremony-date { font-size: 1.875rem; }
  .royal-title { font-size: 1rem; }
  .occasion { font-size: 1.3rem; }
  .entry-link { padding-inline: 8px; }
}

/* Portrait tablets use a balanced central composition instead of tiny columns. */
@media (min-width: 768px) and (max-width: 1180px) and (orientation: portrait) {
  .ceremony { grid-template-columns: minmax(0, 1fr); align-content: center; gap: 6px; max-width: 740px; padding: 28px 40px 120px; }
  .royal-portrait { width: clamp(240px, 33vw, 310px); max-width: 310px; }
  .watercolor { inset: auto 0 0; height: 450px; }
  .watercolor::after { content: ""; position: absolute; inset: 0 0 auto; height: 40%; background: linear-gradient(var(--paper), #fcf8ed00); }
  .ceremony-date { font-size: clamp(2.5rem, 5vw, 3.4rem); }
  .royal-title { font-size: clamp(1.2rem, 2.4vw, 1.5rem); line-height: 1.5; }
  .royal-title-lead { font-size: 1.0625rem; }
  .occasion { font-size: clamp(1.85rem, 3.6vw, 2.25rem); }
  .homage { font-size: 1.125rem; }
  .signature { font-size: .9375rem; margin-top: 14px; }
  .entry-buttons { width: 320px; min-height: 50px; margin-top: 18px; }
  .entry-link { min-height: 44px; font-size: .9375rem; }
}

@media (max-width: 480px) and (max-height: 740px) {
  .ceremony { padding-top: max(16px, env(safe-area-inset-top)); gap: 4px; }
  .royal-portrait { width: 195px; }
  .ceremony-date { font-size: 1.875rem; }
  .royal-title { line-height: 1.5; }
  .royal-title-lead { margin-bottom: 4px; }
  .ornament-top { margin-bottom: 8px; }
  .ornament-bottom { margin-top: 8px; margin-bottom: 7px; }
  .homage { margin-top: 8px; }
  .signature { margin-top: 12px; }
  .entry-buttons { margin-top: 15px; }
}

/* Short landscape screens stay readable and may scroll naturally. */
@media (min-width: 560px) and (max-height: 540px) and (orientation: landscape) {
  .ceremony { grid-template-columns: minmax(0, .62fr) minmax(0, 1.38fr); gap: 18px; max-width: 1100px; padding: 18px 24px 75px; }
  .royal-portrait { width: 100%; max-width: 240px; }
  .ceremony-date { font-size: 2rem; }
  .royal-title { font-size: 1rem; }
  .royal-title-lead { font-size: .9375rem; margin-bottom: 7px; }
  .ornament-top { margin-bottom: 10px; }
  .ornament-bottom { margin: 10px auto 5px; }
  .occasion { font-size: 1.4rem; }
  .homage { font-size: 1rem; margin-top: 4px; }
  .signature { margin-top: 10px; }
  .entry-buttons { margin-top: 12px; }
}

/* Soft CSS-only bokeh rises slowly; no trails or frame-by-frame JavaScript. */
.light-effects { display: none; position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
html[data-light-effects] .light-effects { display: block; }
.light-mote {
  position: absolute; left: var(--x); bottom: -28px;
  width: var(--size); height: var(--size); border-radius: 50%;
  opacity: 0; animation: light-rise var(--duration) var(--delay) linear infinite;
  background: radial-gradient(circle, #fff9dbe6 0%, #f3cd6cad 22%, #dfac4947 48%, #dfac4900 76%);
  box-shadow: 0 0 16px 6px #f1ce7b4d;
  filter: blur(1.5px);
}
@keyframes light-rise {
  0% { transform: translate3d(0, 20px, 0) scale(.65); opacity: 0; }
  15% { opacity: .8; }
  55% { opacity: .6; }
  80% { opacity: .7; }
  100% { transform: translate3d(var(--drift), -110vh, 0) scale(1.15); opacity: 0; }
}
html[data-page-hidden] .light-effects * { animation-play-state: paused; }
@media (max-width: 767px) {
  .light-effects { height: auto; }
  .light-mote:nth-child(n+4) { display: none; }
}
@media (prefers-reduced-motion: reduce), (update: slow) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .light-effects { display: none !important; }
}
html[data-reduced-data] .watercolor { display: none; }
html[data-reduced-data] .royal-portrait, html[data-reduced-data] .ceremony-copy { animation: none; }
html[data-reduced-data] .light-effects { display: none; }

@media (forced-colors: active) {
  .watercolor, .portrait-wash, .ornament, .light-effects { display: none !important; }
  .entry-buttons, .entry-link { border: 1px solid ButtonText; }
}
@media print {
  .watercolor, .entry-buttons, .skip-link, .light-effects { display: none !important; }
  .ceremony { min-height: auto; padding: 24px; }
  .royal-portrait, .ceremony-copy { animation: none; }
}
