/* Homepage-specific styles. Builds on event-theme.css (body[data-theme="home"]). */

html { scroll-behavior: auto; }
body[data-theme="home"] { background: #0a1510; overflow-x: hidden; }

/* ----- Atmosphere (fixed backdrop) ------------------------------------- */
.atmos {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(ellipse 70% 50% at 50% 110%, rgba(3, 8, 5, .9) 0%, rgba(3, 8, 5, 0) 70%),
    linear-gradient(180deg, #07110c 0%, #0a1710 38%, #0c1c14 70%, #09150f 100%);
}
.atmos canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.atmos__vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, rgba(0,0,0,0) 45%, rgba(4,10,7,.6) 100%); }
.moon {
  position: absolute; top: 9vh; right: 12vw; width: clamp(110px, 13vw, 180px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 42% 38%, #ffffff 0%, #f6faf7 32%, #e6ede7 56%, #cfd9d1 78%, #aab8ae 100%);
  box-shadow: 0 0 40px rgba(230, 245, 238, .55), 0 0 120px rgba(214, 238, 228, .28);
  will-change: transform, opacity;
}
.moon::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; opacity: .35;
  background:
    radial-gradient(circle at 30% 30%, rgba(140, 152, 144, .7) 0 12%, transparent 13%),
    radial-gradient(circle at 62% 46%, rgba(140, 152, 144, .6) 0 10%, transparent 11%),
    radial-gradient(circle at 40% 70%, rgba(140, 152, 144, .5) 0 8%, transparent 9%);
  filter: blur(3px);
}
@media (max-width: 640px) { .moon { top: 12vh; right: 8vw; } }

/* ----- Page shell ------------------------------------------------------ */
.home-main { position: relative; z-index: 1; }
.home-main .section + .section { border-top: 0; }
.home-main .section { padding-block: clamp(80px, 11vw, 136px); }
.section-head { text-align: center; margin-bottom: clamp(40px, 6vw, 64px); }
.section-head p { margin: 16px auto 0; max-width: 560px; color: var(--ink-soft); }
.accent-word { color: var(--accent); font-style: italic; }

/* nav: mobile menu */
.nav-toggle { display: none; background: none; border: 0; color: inherit; padding: 8px; cursor: pointer; }
@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .ev-links.home-links {
    display: none; position: fixed; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: rgba(6, 13, 9, .97); padding: 6px 24px 18px; border-bottom: 1px solid var(--line);
  }
  .ev-links.home-links.open { display: flex; }
  .ev-links.home-links a, .ev-links.home-links button { padding: 16px 0; text-align: left; border-top: 1px solid var(--line); }
  .ev-links.home-links .ev-pill { margin-top: 12px; text-align: center; border-top: 0; }
  .ev-links.home-links .hide-sm { display: block; }
}

/* ----- Hero ------------------------------------------------------------ */
.home-hero { min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 120px 24px 96px; position: relative; }
.home-hero .display { font-size: clamp(64px, 12vw, 152px); color: var(--hero-ink); }
.home-hero .tag {
  margin-top: 28px; display: inline-flex; align-items: center; gap: 18px;
  font-size: 13px; font-weight: 600; letter-spacing: .32em; text-transform: uppercase; color: var(--accent);
}
.home-hero .tag::before, .home-hero .tag::after { content: ""; width: 44px; height: 1px; background: currentColor; opacity: .55; }
.home-hero .when { margin: 22px 0 0; font-size: 14px; letter-spacing: .12em; color: var(--hero-ink-soft); }
.home-hero .hero__actions { margin-top: 44px; }
.scroll-cue {
  position: absolute; left: 50%; bottom: 32px; transform: translateX(-50%);
  font-size: 11px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--ink-faint); text-decoration: none;
}

/* ----- Gate ------------------------------------------------------------ */
.gate-screen { position: fixed; inset: 0; z-index: 90; overflow: hidden; }
.gate-screen[hidden] { display: none; }
.gate-veil { position: absolute; inset: 0; background: rgba(5, 12, 8, .74); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); transition: opacity 1.2s ease; }
.gate-card {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 24px;
  transition: opacity 400ms ease, transform 500ms cubic-bezier(0.23, 1, 0.32, 1), filter 400ms ease;
}
/* The gate materialises (blur + scale together) rather than plainly fading. */
.js .gate-card { animation: gate-in 520ms cubic-bezier(0.23, 1, 0.32, 1) both; }
@keyframes gate-in {
  from { opacity: 0; transform: scale(0.965); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
.gate-inner { width: min(420px, 100%); text-align: center; display: grid; gap: 18px; justify-items: center; }
.gate-inner .display { font-size: clamp(48px, 9vw, 64px); }
.gate-inner p { margin: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.7; }
.gate-form { width: 100%; display: grid; gap: 12px; margin-top: 6px; }
.field {
  width: 100%; min-height: 52px; padding: 0 18px; border-radius: var(--radius); touch-action: manipulation;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line); color: var(--ink);
  font: 500 15px/1.4 var(--font-body);
  transition: border-color 150ms ease, background-color 150ms ease;
}
textarea.field { padding: 14px 18px; min-height: 112px; resize: vertical; }
.field::placeholder { color: var(--ink-faint); }
.field:focus { outline: none; border-color: var(--accent); background: rgba(255, 255, 255, .07); }
.gate-form .btn { width: 100%; border-radius: var(--radius); min-height: 52px; }
.gate-error { min-height: 1em; color: #eba8a8; font-size: 13.5px; line-height: 1.6; }
.link-btn { background: none; border: 0; padding: 4px 0; cursor: pointer; color: var(--ink-soft); font: 600 11px var(--font-body); letter-spacing: .16em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.envelope { position: absolute; inset: 0; display: none; place-items: center; background: #050906; opacity: 0; transition: opacity .5s ease; }
.envelope video { width: 100%; height: 100%; object-fit: cover; }
.entry-flash { position: fixed; inset: 0; z-index: 95; background: #fff; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.lotus { color: var(--accent); }

/* ----- Invitation list ------------------------------------------------- */
.invite-list { display: grid; gap: 12px; max-width: 760px; margin: 0 auto; }
.invite {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px;
  padding: 26px 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  text-decoration: none; color: inherit;
  transition: border-color 150ms ease, background-color 150ms ease, transform 100ms ease-out;
}
.invite:active { transform: scale(0.99); }
.invite__name { display: block; font-family: var(--font-display); font-size: 28px; line-height: 1.2; }
.invite__date { display: block; margin-top: 4px; font-size: 14px; letter-spacing: .06em; color: var(--ink-soft); }
.invite__who { font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); text-align: right; }
.invite__arrow { color: var(--accent); margin-left: 8px; font-family: var(--font-body); font-size: 18px; }
@media (hover: hover) and (pointer: fine) {
  .invite:hover { border-color: rgba(224, 164, 68, .5); background: rgba(255, 255, 255, .055); }
}
@media (max-width: 560px) {
  .invite { grid-template-columns: 1fr; padding: 22px; }
  .invite__who { text-align: left; }
}
.note-card {
  max-width: 760px; margin: 0 auto; padding: 44px 32px; text-align: center; border: 1px dashed var(--line);
  border-radius: var(--radius); color: var(--ink-soft);
}
.list-hint { text-align: center; margin: 14px 0 0; font-size: 13px; color: var(--ink-faint); }

/* ----- RSVP ------------------------------------------------------------ */
.rsvp-card {
  max-width: 760px; margin: 0 auto; padding: clamp(24px, 5vw, 44px);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  transition: background-color 400ms ease, border-color 400ms ease;
}
.rsvp-card.is-confirmed { background: linear-gradient(160deg, #f0c77f, #e0a444); border-color: rgba(58, 42, 15, .25); color: #2e2210; }
.step-label { display: block; margin-bottom: 10px; font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.step-help { margin: -4px 0 14px; font-size: 13.5px; color: var(--ink-soft); }
.rsvp-block + .rsvp-block { margin-top: 28px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, .03); border: 1px solid var(--line); color: var(--ink-soft);
  font: 600 12.5px var(--font-body); letter-spacing: .02em;
  transition: transform 100ms ease-out, border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}
.pill:active { transform: scale(0.97); }
.pill { touch-action: manipulation; }
.pill[aria-pressed="true"] { background: var(--accent-soft); border-color: rgba(224, 164, 68, .7); color: #f3cd87; }
.pill.is-done { border-color: rgba(111, 180, 140, .55); color: #a4d8b8; background: rgba(111, 180, 140, .1); }
.pill .tick { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: #6fb48c; color: #0e1a13; font-size: 10px; font-weight: 800; }
.member {
  border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(20px, 4vw, 28px); margin-top: 20px;
  background: rgba(0, 0, 0, .12);
}
.name-input {
  display: block; width: 100%; max-width: 360px; background: none; border: 0; border-bottom: 1px dashed rgba(242, 236, 220, .3);
  color: var(--ink); font: 500 28px/1.2 var(--font-display); padding: 0 0 4px;
}
.name-input:focus { outline: none; border-bottom-color: var(--accent); }
.name-hint { display: block; margin-top: 6px; font-size: 11.5px; color: var(--ink-faint); }
.events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.event-tile {
  position: relative; min-height: 104px; padding: 16px 14px; border-radius: var(--radius); cursor: pointer; overflow: hidden;
  border: 1px solid rgba(242, 236, 220, .35); color: #f7f1e3; text-align: center;
  font: 700 11.5px/1.5 var(--font-body); letter-spacing: .1em; text-transform: uppercase; text-shadow: 0 1px 4px rgba(0, 0, 0, .7);
  background-size: cover; background-position: center; filter: grayscale(100%);
  transition: filter 300ms ease, border-color 150ms ease, transform 100ms ease-out;
}
.event-tile:active { transform: scale(0.97); }
.event-tile { touch-action: manipulation; }
.event-tile small { display: block; margin-top: 4px; font-size: 12.5px; letter-spacing: .04em; text-transform: none; font-weight: 600; }
.event-tile[aria-pressed="true"] { filter: none; border-color: rgba(224, 164, 68, .85); }
.event-tile .yes { display: none; margin-top: 4px; font-size: 10px; letter-spacing: .14em; color: #ffd88a; }
.event-tile[aria-pressed="true"] .yes { display: block; }
.decline { margin-top: 12px; }
.decline[aria-pressed="true"] { background: rgba(217, 110, 110, .15); border-color: rgba(217, 110, 110, .6); color: #eba8a8; }
.btn--soft { background: var(--accent-soft); color: #f3cd87; border-color: rgba(224, 164, 68, .5); border-radius: var(--radius); }
.summary { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 13.5px; }
.rsvp-details { display: grid; gap: 12px; }
.rsvp-divider { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 24px; }
.rsvp-send { width: 100%; margin-top: 20px; border-radius: var(--radius); min-height: 54px; }
.confirmed { text-align: center; padding: 12px 0; }
.confirmed[hidden] { display: none; }
.confirmed .display { font-size: 34px; margin: 8px 0 10px; color: #2e2210; }
.confirmed p { margin: 0 auto; max-width: 380px; color: rgba(46, 34, 16, .8); }
.confirmed .summary { margin-top: 20px; padding-top: 18px; border-top: 1px solid rgba(46, 34, 16, .18); justify-items: center; color: rgba(46, 34, 16, .8); }
.confirmed .btn { margin-top: 22px; color: #2e2210; border-color: rgba(46, 34, 16, .4); }

/* ----- Story ----------------------------------------------------------- */
.story { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(36px, 6vw, 80px); align-items: center; }
.story figure { margin: 0; position: relative; }
.story figure::before { content: ""; position: absolute; inset: -14px 14px 14px -14px; border: 1px solid rgba(224, 164, 68, .35); border-radius: var(--radius); }
.story img { position: relative; width: 100%; height: auto; border-radius: var(--radius); }
.story .prose p { font-size: 16.5px; line-height: 1.85; }
.story-coda { margin: clamp(48px, 7vw, 80px) auto 0; max-width: 720px; text-align: center; }
@media (max-width: 820px) { .story { grid-template-columns: 1fr; } }

/* ----- Gallery --------------------------------------------------------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.gallery figure { margin: 0; }
.gallery .wide { grid-column: span 2; }
.gallery img { width: 100%; height: 360px; object-fit: cover; border-radius: var(--radius); }
.gallery figcaption { margin-top: 10px; font-size: 13px; color: var(--ink-faint); }
@media (max-width: 760px) {
  .gallery { grid-template-columns: 1fr; }
  .gallery .wide { grid-column: auto; }
  .gallery img { height: 280px; }
}

/* ----- Gifts ----------------------------------------------------------- */
.gifts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; max-width: 820px; margin: 0 auto; }
.gift { display: flex; flex-direction: column; align-items: center; text-align: center; }
.gift p { flex: 1; margin: 0 0 26px; }

/* ----- Countdown + footer --------------------------------------------- */
.home-countdown .countdown strong { font-size: clamp(48px, 8vw, 84px); }
.home-footer { text-align: center; padding: 72px 24px 80px; border-top: 1px solid var(--line); }
.home-footer .display { font-size: 38px; }
.home-footer .muted { margin: 12px 0 0; font-size: 12.5px; letter-spacing: .2em; text-transform: uppercase; }
.home-footer .sign { margin: 10px 0 0; font-family: var(--font-display); font-style: italic; font-size: 19px; color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .pill:active, .event-tile:active, .invite:active { transform: none; }
  .js .gate-card { animation: none; }
  .moon { transition: none; }
}

/* Less transparency / more contrast: solid chrome, defined edges. */
@media (prefers-reduced-transparency: reduce) {
  .gate-veil { background: #07110c; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .ev-links.home-links { background: #060d09; }
}
@media (prefers-contrast: more) {
  .rsvp-card, .member, .invite, .note-card { border-color: rgba(242, 236, 220, .5); }
  .field { border-color: rgba(242, 236, 220, .5); }
  .gate-veil { background: rgba(3, 8, 5, .94); }
}

@media (max-width: 560px) {
  .events-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .story figure::before { inset: -10px 10px 10px -10px; }
  .member { padding: 18px; }
}
