:root {
  color-scheme: light;
  font-family: 'Noto Sans Armenian', 'Segoe UI', system-ui, sans-serif;
  scroll-behavior: smooth;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  --paper: #f8f5ed;
  --card: #fffdf7;
  --ink: #282a20;
  --muted: #595a49;
  --accent: #475231;
  --on-accent: #fffefa;
  --soft: #ececdd;
  --border: #d9d8c8;
  --photo-shadow: rgba(19, 22, 13, .86);
  --display: Georgia, 'Times New Roman', serif;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
}

body:lang(hy) { --display: 'Noto Serif Armenian', Sylfaen, Georgia, serif; }

body[data-event='birthday'] {
  --paper: #fff5ed;
  --card: #fffaf6;
  --ink: #3e2234;
  --muted: #694659;
  --accent: #8a3156;
  --on-accent: #fff9fa;
  --soft: #fbded9;
  --border: #eecdc7;
  --photo-shadow: rgba(53, 14, 37, .87);
  --display: 'Noto Sans Armenian', 'Segoe UI', system-ui, sans-serif;
}

a { color: inherit; }

a:focus-visible, input:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.shell { width: min(1040px, calc(100% - 48px)); margin-inline: auto; }

.skip {
  position: fixed;
  z-index: 3;
  inset: 12px auto auto 12px;
  transform: translateY(-160%);
  padding: 10px 16px;
  background: var(--card);
}

.skip:focus { transform: none; }

.demo-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 70px;
  padding-block: 8px;
  font-size: .82rem;
}

.back-link, .hero-link, .footer-order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.back-link { justify-self: start; min-height: 44px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--card); font-weight: 650; }
.back-link:hover { text-decoration: underline; text-underline-offset: .2em; }
.back-link svg, .hero-link svg, .footer-order svg { flex: 0 0 auto; width: 17px; height: 17px; }

.demo-label {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--muted);
  text-align: center;
}

.language-nav { display: flex; justify-self: end; gap: 2px; }

.language-nav a {
  display: grid;
  min-width: 35px;
  min-height: 40px;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
  text-decoration: none;
}

.language-nav a:hover, .language-nav a[aria-current='true'] { background: var(--soft); color: var(--accent); }

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: clamp(510px, 76vh, 730px);
  min-height: clamp(510px, 76svh, 730px);
  align-items: end;
  overflow: hidden;
  border-radius: 18px;
  background: var(--accent);
  color: #fffdf5;
  text-align: center;
}

.hero-photo, .hero::after, .hero::before { position: absolute; inset: 0; }

.hero-photo {
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.hero::after {
  z-index: -1;
  background: linear-gradient(180deg, transparent 28%, rgba(24, 19, 16, .34) 55%, var(--photo-shadow) 100%);
  content: '';
}

.hero::before {
  z-index: 1;
  inset: 12px;
  border: 1px solid rgba(255, 252, 237, .51);
  border-radius: 11px;
  pointer-events: none;
  content: '';
}

body[data-event='birthday'] .hero { border-radius: 28px; }
body[data-event='birthday'] .hero::before { border-radius: 18px; border-style: dashed; }
body[data-event='birthday'] .hero-photo { object-position: center 18%; }

.hero-content { padding: 40px 24px clamp(42px, 6vw, 75px); }

.hero-kicker, .eyebrow {
  margin: 0;
  font-size: .78rem;
  font-weight: 750;
  letter-spacing: .115em;
  text-transform: uppercase;
}

.hero-kicker { display: flex; align-items: center; justify-content: center; gap: 10px; text-shadow: 0 1px 7px #251c18; }
.hero-kicker > span { flex: 0 0 auto; width: 5px; height: 5px; transform: rotate(45deg); background: currentColor; }

h1, h2 { margin: 0; font-family: var(--display); font-weight: 500; text-wrap: balance; }

.hero h1 {
  margin: 10px 0 12px;
  font-size: clamp(2.65rem, 8.1vw, 6.8rem);
  letter-spacing: -.055em;
  line-height: 1.04;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 24px rgba(23, 15, 10, .5);
}

body[data-event='birthday'] h1, body[data-event='birthday'] h2 { font-weight: 780; }

.hero-date { display: block; font-size: clamp(1rem, 2.2vw, 1.25rem); font-weight: 600; }

.hero-link {
  min-height: 45px;
  margin-top: 22px;
  padding: 9px 16px;
  border: 1px solid rgba(255, 252, 241, .62);
  border-radius: 99px;
  background: rgba(21, 15, 14, .36);
  font-size: .88rem;
  font-weight: 700;
}

.hero-link:hover { background: #fffdf5; color: var(--ink); }
.hero-link:focus-visible { outline-color: #fffdf5; }

.section { scroll-margin-top: 20px; }

h2 { font-size: clamp(1.85rem, 5vw, 3.65rem); letter-spacing: -.05em; line-height: 1.08; }
.eyebrow { margin-bottom: 11px; color: var(--accent); }

.countdown, .schedule {
  width: min(100%, 650px);
  margin-inline: auto;
  padding-block: clamp(46px, 8vw, 90px);
  text-align: center;
}

.ornament { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; color: var(--accent); }
.ornament::before, .ornament::after { width: 18px; height: 1px; background: currentColor; content: ''; }
.ornament i { width: 7px; height: 7px; transform: rotate(45deg); border: 1px solid currentColor; }
body[data-event='birthday'] .ornament i { background: currentColor; border: 0; }

.countdown-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(5px, 1.7vw, 14px);
  margin: 25px 0 0;
  padding: 0;
  list-style: none;
}

.countdown-list li {
  display: grid;
  gap: 4px;
  padding: clamp(9px, 2.5vw, 20px) 2px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
}

.countdown-list strong { font-family: var(--display); font-size: clamp(1.3rem, 4.3vw, 2.95rem); font-variant-numeric: tabular-nums; line-height: 1.05; }
.countdown-list span { color: var(--muted); font-size: clamp(.75rem, 2.3vw, .83rem); line-height: 1.3; overflow-wrap: anywhere; }

.details, .rsvp {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .9fr);
  align-items: center;
  gap: clamp(24px, 6vw, 76px);
  padding: clamp(24px, 5vw, 58px);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--soft);
}

.introduction, .rsvp-intro > p:last-child { max-width: 47ch; margin: 17px 0 0; color: var(--muted); }

.details-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; margin: 26px 0 0; }
.details-meta div { border-top: 1px solid var(--border); padding-top: 10px; overflow-wrap: anywhere; }
.details-meta dt { color: var(--muted); font-size: .77rem; font-weight: 650; }
.details-meta dd { margin: 2px 0 0; font-weight: 700; }
.details-meta dd span { display: block; color: var(--muted); font-size: .9rem; font-weight: 450; }

.calendar-panel { padding: clamp(10px, 3.5vw, 28px); border: 1px solid var(--border); border-radius: 16px; background: var(--card); }
.event-calendar { width: 100%; table-layout: fixed; border-collapse: collapse; color: var(--ink); text-align: center; font-variant-numeric: tabular-nums; }
.event-calendar caption { padding-bottom: 12px; font-family: var(--display); font-size: clamp(1.2rem, 3vw, 1.85rem); font-weight: 650; line-height: 1.2; }
.event-calendar th { padding: 0 1px 6px; color: var(--muted); font-size: clamp(.75rem, 2vw, .78rem); font-weight: 700; }
.event-calendar td { height: clamp(32px, 5vw, 44px); padding: 2px 0; font-size: .87rem; }
.event-day > span { display: inline-grid; width: min(100%, 34px); aspect-ratio: 1; place-items: center; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 750; }

.schedule-list { margin: 24px 0 0; padding: 0; border-top: 1px solid var(--border); list-style: none; text-align: left; }
.schedule-list li { display: grid; grid-template-columns: minmax(80px, .29fr) 1fr; align-items: center; gap: 14px; padding: 13px clamp(8px, 3vw, 22px); border-bottom: 1px solid var(--border); font-weight: 650; }
.schedule-time { color: var(--accent); font-family: var(--display); font-size: clamp(1.12rem, 3vw, 1.5rem); font-variant-numeric: tabular-nums; }

.rsvp { align-items: start; }
.rsvp-intro { padding-top: 5px; }
.rsvp-form { min-width: 0; }
.guest-label, .rsvp-form legend { display: block; margin-bottom: 6px; font-weight: 700; }
.rsvp-form input, .rsvp-form button { font: inherit; }
.rsvp-form input[type='text'] { width: 100%; min-height: 45px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--card); color: var(--ink); }
.rsvp-form input[type='text']::placeholder { color: var(--muted); opacity: 1; }
.rsvp-form fieldset { min-width: 0; margin: 15px 0; padding: 0; border: 0; }
.rsvp-form legend { padding: 0; }
.attendance-options { display: flex; flex-wrap: wrap; gap: 6px; }
.attendance-options label { display: inline-flex; flex: 1 1 125px; align-items: center; gap: 7px; min-height: 43px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 9px; background: var(--card); font-size: .88rem; font-weight: 600; cursor: pointer; }
.attendance-options label:has(input:checked) { border-color: var(--accent); color: var(--accent); }
.attendance-options input { flex-shrink: 0; margin: 0; accent-color: var(--accent); }
.rsvp-form button { width: 100%; min-height: 45px; padding: 9px 13px; border: 0; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-weight: 750; cursor: pointer; }
.rsvp-form button:hover:not(:disabled) { filter: brightness(1.13); }
.rsvp-form button:disabled { opacity: .66; cursor: default; }
#rsvp-status { margin: 0; color: var(--accent); font-size: .91rem; font-weight: 700; }
#rsvp-status:not(:empty) { margin-top: 10px; }

.demo-footer { display: flex; justify-content: center; padding-block: 30px 38px; }
.footer-order { min-height: 44px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 99px; background: var(--card); color: var(--accent); font-size: .87rem; font-weight: 750; text-align: center; }
.footer-order:hover { border-color: var(--accent); }

@media (max-width: 690px) {
  .shell { width: calc(100% - 28px); }
  .demo-header { grid-template-columns: minmax(0, 1fr) auto minmax(max-content, 1fr); }
  .details, .rsvp { grid-template-columns: minmax(0, 1fr); }
  .hero { min-height: clamp(470px, 70vh, 640px); min-height: clamp(470px, 70svh, 640px); }
  .back-link { min-height: 44px; max-width: 100%; }
  .back-link span { overflow-wrap: anywhere; }
  .language-nav a { min-width: 44px; min-height: 44px; }
  body[data-event='wedding'] .hero::after {
    background: linear-gradient(180deg, transparent 28%, rgba(24, 19, 16, .51) 52%, var(--photo-shadow) 100%);
  }
}

@media (max-width: 460px) {
  .demo-header { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; min-height: auto; }
  .demo-label { grid-area: 2 / 1 / 3 / -1; justify-self: start; padding: 2px 8px; font-size: .72rem; }
  .hero::before { inset: 8px; }
  .hero-content { padding-inline: 17px; }
  .details, .rsvp { padding: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
}

.guest-count { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.guest-count[data-hidden="true"] { display: none; }
.guest-count select { font: inherit; color: inherit; background: var(--paper, #fffaf2); border: 1px solid currentColor; border-radius: 6px; min-height: 44px; padding: 4px 10px; }
.calendar-download { display: inline-block; margin-top: 10px; color: inherit; text-underline-offset: 3px; }
