/* ============================================
   CSS VARIABLES & DESIGN TOKENS
   ============================================ */
:root {
  /* Fonts */
  --font-primary: "ivypresto-display", serif; /* Adobe Fonts */
  --font-headline: "ivypresto-headline", serif; /* Adobe Fonts*/
  --font-mono: "Cutive Mono", monospace; /* Google Fonts */
  --font-body: "ivypresto-text", serif; /* Adobe Fonts */

  /* Colors - inspired by Figma reference */
  --color-bg-dark: #1a1a1a;
  --color-bg-light: #ffffff;
  --color-text-primary: #2d2d2d;
  --color-text-secondary: #666666;
  --color-text-light: #ffffff;
  --color-accent: #4a4a4a;
  --color-border: #e0e0e0;
  --color-overlay: rgba(0, 0, 0, 0.75);
  --color-hover: rgba(0, 0, 0, 0.05);

  /* Typography */
  --font-serif: 'Georgia', 'Times New Roman', serif;
  --font-sans: var(--font-primary);
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;
  --font-size-3xl: 2.5rem;
  --font-size-4xl: 3.5rem;
  --font-size-5xl: 4.5rem;
  --font-weight-thin: 100;
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;

  /* Spacing - 8px base scale */
  --spacing-0-5: 0.25rem;  /* 4px (0.5 × 8) */
  --spacing-1: 0.5rem;     /* 8px (1 × 8) */
  --spacing-2: 1rem;       /* 16px (2 × 8) */
  --spacing-3: 1.5rem;     /* 24px (3 × 8) */
  --spacing-4: 2rem;       /* 32px (4 × 8) */
  --spacing-5: 2.5rem;     /* 40px (5 × 8) */
  --spacing-6: 3rem;       /* 48px (6 × 8) */
  --spacing-7: 3.5rem;     /* 56px (7 × 8) */
  --spacing-8: 4rem;       /* 64px (8 × 8) */
  --spacing-9: 4.5rem;     /* 72px (9 × 8) */
  --spacing-10: 5rem;      /* 80px (10 × 8) */

  /* Legacy spacing aliases (for backwards compatibility) */
  --spacing-xs: var(--spacing-1);   /* 8px */
  --spacing-sm: var(--spacing-2);   /* 16px */
  --spacing-md: var(--spacing-3);   /* 24px */
  --spacing-lg: var(--spacing-4);   /* 32px */
  --spacing-xl: var(--spacing-6);   /* 48px */
  --spacing-2xl: var(--spacing-8);  /* 64px */

  /* Layout */
  --left-pane-width: 50%;
  --right-pane-width: 50%;
  --gutter-width: 2vw;
  --half-gutter-width: 1vw;
  --carousel-height: 100vh;

  /* Transitions */
  --transition-fast: 200ms ease;
  --transition-medium: 300ms ease;
  --transition-slow: 500ms ease;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.15);

  /* Z-index */
  --z-carousel: 1;
  --z-nav: 10;
  --z-lightbox-trigger: 20;
  --z-lightbox: 1000;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-y: scroll;
  scrollbar-gutter: stable; /* Always reserve space for scrollbar */
}

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-thin);
  line-height: 1.6;
  color: var(--color-text-primary);
  background-color: var(--color-bg-light);
  overflow-x: hidden;
}

/* Monospace font utility class */
.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

/* No longer needed - using GSAP for transitions */
/* .pane-header.page-exit {
  animation: fadeOutDown 800ms cubic-bezier(.7,0,.3,1) forwards;
  pointer-events: none;
}

#nav-links.page-exit .nav-list li {
  animation: fadeOutDown 800ms cubic-bezier(.7,0,.3,1) forwards;
  pointer-events: none;
}

@keyframes fadeOutDown {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-48px);
  }
}

@keyframes fadeOutDownDetail {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-96px);
  }
}

#page-content.page-exit {
  animation: fadeOutDownDetail 800ms cubic-bezier(.7,0,.3,1) forwards;
  pointer-events: none;
}

.pane-header.page-enter {
  animation: contentFadeIn 800ms cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

#nav-links.page-enter .nav-list li {
  opacity: 0;
  transform: translateY(120px);
  animation: contentFadeIn 800ms cubic-bezier(0.25, 1, 0.5, 1) forwards;
} */

/* Font utility classes */
.font-primary {
  font-family: var(--font-primary);
}

.font-mono {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================
   LAYOUT: SPLIT SCREEN
   ============================================ */
#app {
  display: flex;
  min-height: 100vh;
  max-height: none;
  position: relative;
  z-index: 1; /* Base layer - below black overlay (500) */
  will-change: clip-path; /* Enable clip-path animations */
}

/* Left Pane */
#left-pane {
  width: var(--left-pane-width);
  background-color: var(--color-bg-light);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: var(--z-nav);
  overflow-y: visible;
  overflow-x: hidden;
  min-height: 100vh;
  height: auto;
}

body.page-transitioning {
  overflow: hidden;
}

body.page-transitioning #left-pane {
  overflow-y: hidden;
}

/* Hide overflow during page transitions */
#main-content {
  overflow: hidden;
}

#main-content.detail-mode {
  overflow: visible;
  transition: overflow 0s 1000ms;
}

/* Prevent scrolling during loading and transitioning */
body.loading,
body.transitioning {
  position: fixed;
  width: 100%;
  overflow: hidden;
}

/* Override position fixed when closing gallery to prevent scroll reset */
body.lightbox-open.transitioning {
  position: static !important;
  overflow: visible !important;
}

body.loading #left-pane {
  overflow: hidden;
}

/* Right Pane - Carousel */
#carousel {
  width: var(--right-pane-width);
  height: var(--carousel-height);
  position: fixed;
  right: 0;
  top: 0;
  z-index: var(--z-carousel);
  overflow: hidden;
}

/* ============================================
   LEFT PANE: HEADER, CONTENT, FOOTER
   ============================================ */
.pane-header {
  padding: var(--spacing-4);
  /* border-bottom: 1px solid var(--color-border); */
  position: relative;
  opacity: 1;
  transition: padding 400ms cubic-bezier(.27,0,0,1);
}

/* Reduce padding when on detail page */
.pane-header.detail-mode {
  padding-bottom: var(--spacing-8);
  padding-left: var(--spacing-4);
  padding-right: var(--spacing-4);
  padding-top: var(--spacing-4);
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  position: fixed;
  top: 0;
  left: 0;
  width: var(--left-pane-width);
  z-index: 100;
  background: linear-gradient(180deg, #FFF 62%, rgba(255, 255, 255, 0.00) 100%);
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .pane-header.detail-mode {
    height: 56px;
  }
}

@media (max-width: 480px) {
  .pane-header.detail-mode {
    height: 48px;
  }
}

.back-button {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.back-button:hover {
  color: var(--color-text-primary);
  border-color: var(--color-text-primary);
}

.back-button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* No longer needed - using GSAP for transitions */
.back-button.visible {
  display: flex;
  /* opacity: 0;
  transform: translateY(120px);
  animation: contentFadeIn 800ms cubic-bezier(0.25, 1, 0.5, 1) forwards;
  animation-delay: 0ms; */
}

.back-button svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Scrolled page title in header */
.pane-header .scrolled-title {
  font-family: var(--font-mono);
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 300ms cubic-bezier(.27,0,0,1), transform 300ms cubic-bezier(.27,0,0,1);
  pointer-events: none;
  white-space: nowrap;
}

.pane-header.scrolled .scrolled-title {
  opacity: 1;
  transform: translateY(0);
}

.site-title {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  opacity: 1;
  transition: opacity 400ms cubic-bezier(.27,0,0,1);
}

.site-title.fade-out {
  opacity: 0;
  visibility: hidden;
  display: none;
}

.site-title h1 {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  color: var(--color-text-primary);
  line-height: 1;
  margin: 0;
}

.wedding-date {
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  font-weight: var(--font-weight-normal);
  margin: 0;
  overflow: hidden;
  cursor: pointer;
  min-width: 165px;
  text-align: right;
}

.wedding-date-text {
  display: block;
  position: relative;
  line-height: 1.2;
  overflow: hidden;
  white-space: nowrap;
}

.date-main,
.date-hover {
  display: block;
  line-height: 1.2;
  transition: transform 300ms ease-in-out;
  white-space: nowrap;
  text-align: right;
}

.date-main {
  transform: translateY(0);
}

.date-hover {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  transform: translateY(120%);
}

.wedding-date:hover .date-main {
  transform: translateY(-120%);
}

.wedding-date:hover .date-hover {
  transform: translateY(0);
}

#main-content {
  flex: 1;
  padding: var(--spacing-4);
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  transition: padding 400ms cubic-bezier(.27,0,0,1);
}

/* Add top padding to account for fixed header */
#main-content.detail-mode {
  padding-top: calc(64px + var(--spacing-8));
  align-items: flex-start; /* Override flex-end to start content at top */
}

/* ============================================
   NAVIGATION (HOME STATE)
   ============================================ */
#nav-links {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.nav-wrapper {
  margin-top: auto;
}

.pane-footer {
  padding: var(--spacing-md) var(--spacing-lg);
  border-top: 1px solid var(--color-border);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  text-align: center;
}

/* ============================================
   NAVIGATION LINKS (Home State)
   ============================================ */
#nav-links {
  display: block;
}

#nav-links.hidden {
  display: none;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-0-5);
}

.nav-list li {
  width: 100%;
}

.nav-link {
  display: flex;
  align-items: baseline;
  gap: 24px;
  padding-bottom: var(--spacing-1);
  /* background-color: #ffffff;
  border: 1px solid var(--color-border); */
  /* border-radius: 8px; */
  font-family: var(--font-primary);
  font-weight: var(--font-weight-thin);
  /* font-style: italic; */
  font-size: var(--font-size-5xl);
  color: var(--color-text-primary);
  text-align: left;
  width: 100%;
  overflow: hidden;
  position: relative;
}

.nav-link-number-wrapper {
  overflow: hidden;
  display: inline-block;
  flex-shrink: 0;
  line-height: 1;
  vertical-align: baseline;
}

.nav-link-number {
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  display: block;
  line-height: 1;
  transform: translateY(115%);
}

.nav-link-text {
  display: inline-block;
  position: relative;
  line-height: 1.2;
  overflow: hidden;
  margin: -4px -2px -8px -4px;
  transform: translateY(100%);
}

.nav-link-main,
.nav-link-hover {
  display: block;
  line-height: 1.2;
  transition: none;
  padding: 4px 2px 8px 4px;
  white-space: nowrap;
}

.nav-link-main {
  transform: translateY(0);
}

.nav-link-hover {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateY(120%);
}

.nav-link-text:hover .nav-link-main {
  transform: translateY(-120%);
  transition: transform 300ms ease-in-out;
}

.nav-link-text:hover .nav-link-hover {
  transform: translateY(0);
  transition: transform 300ms ease-in-out;
}

.nav-link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* RSVP Button */
.rsvp-button {
  width: 100%;
  padding: var(--spacing-3);
  margin-top: var(--spacing-5);
  background-color: var(--color-bg-dark);
  color: var(--color-text-light);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-normal);
  border-radius: 60px;
  transition: opacity var(--transition-fast), background-color var(--transition-fast);
  text-align: center;
  letter-spacing: 0.05em;
  overflow: hidden;
  position: relative;
}

.rsvp-button-text {
  display: block;
  position: relative;
  line-height: 1.2;
  overflow: hidden;
}

.rsvp-main,
.rsvp-hover {
  display: block;
  line-height: 1.2;
  transition: none;
}

.rsvp-main {
  transform: translateY(0);
}

.rsvp-hover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  transform: translateY(120%);
}

.rsvp-button:hover .rsvp-main {
  transform: translateY(-120%);
  transition: transform 300ms ease-in-out;
}

.rsvp-button:hover .rsvp-hover {
  transform: translateY(0);
  transition: transform 300ms ease-in-out;
}

.rsvp-button:hover {
  opacity: 0.9;
}

.rsvp-button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ============================================
   PAGE CONTENT (Detail State)
   ============================================ */
#page-content {
  display: none;
}

#page-content.visible {
  display: block;
  width: 100%;
  padding-right: var(--spacing-4); /* 32px right padding for horizontal layouts */
  position: relative;
  z-index: 1;
}

/* Remove right padding when stacked (mobile) */
@media (max-width: 768px) {
  #page-content.visible {
    padding-right: 0;
  }
}

/* No longer needed - using GSAP for transitions */
/* #page-content > * {
  opacity: 0;
  transform: translateY(120px);
}

#page-content.visible > * {
  animation: contentFadeIn 800ms cubic-bezier(0.25, 1, 0.5, 1) forwards;
  animation-delay: 0ms;
}

@keyframes contentFadeIn {
  from {
    opacity: 0;
    transform: translateY(120px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
} */

/* Page title - styled like nav links */
#page-content .page-title {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-thin);
  /* font-style: italic; */
  font-size: var(--font-size-5xl);
  color: var(--color-text-primary);
  margin-top: calc((64px + var(--spacing-8)) * -1 + 64px + var(--spacing-6)); /* Negative margin to pull up to fixed header, offset by min-height + 48px spacing */
  margin-bottom: 42vh;
  line-height: 1.2;
}

@media (max-width: 1024px) {
  #page-content .page-title {
    margin-bottom: 40vh;
  }
}

@media (max-width: 768px) {
  #page-content .page-title {
    margin-bottom: 30vh;
  }
}

@media (max-width: 480px) {
  #page-content .page-title {
    margin-bottom: 20vh;
  }
}

#page-content h2 {
  font-family: var(--font-headline);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-thin);
  margin-bottom: var(--spacing-2);
  color: var(--color-text-primary);
}

#page-content h3 {
  font-family: var(--font-serif);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-normal);
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-sm);
  color: var(--color-text-primary);
}

#page-content p {
  margin-bottom: var(--spacing-md);
  line-height: 1.8;
  color: var(--color-text-secondary);
}

.content-section {
  margin-bottom: var(--spacing-10);
}

.content-section:last-child {
  margin-bottom: 0;
}

#page-content ul,
#page-content ol {
  margin-bottom: var(--spacing-md);
  margin-left: var(--spacing-md);
}

#page-content li {
  margin-bottom: var(--spacing-xs);
  line-height: 1.8;
  color: var(--color-text-secondary);
  list-style: disc;
}

#page-content a {
  color: var(--color-accent);
  text-decoration: underline;
}

#page-content a:hover {
  text-decoration: none;
}

/* ============================================
   FORMS (RSVP)
   ============================================ */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-group label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: var(--spacing-sm);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-family: inherit;
  font-size: var(--font-size-base);
  transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

.form-group input[aria-invalid="true"],
.form-group select[aria-invalid="true"] {
  border-color: #d32f2f;
}

.form-error {
  display: none;
  color: #d32f2f;
  font-size: var(--font-size-sm);
  margin-top: var(--spacing-xs);
}

.form-error.visible {
  display: block;
}

.form-actions {
  margin-top: var(--spacing-lg);
}

.btn-primary {
  display: inline-block;
  padding: var(--spacing-sm) var(--spacing-lg);
  background-color: var(--color-accent);
  color: var(--color-text-light);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  border-radius: 6px;
  transition: all var(--transition-fast);
  min-height: 44px;
}

.btn-primary:hover {
  transform: scale(1.02);
  opacity: 0.9;
}

.btn-primary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.form-success {
  display: none;
  padding: var(--spacing-md);
  background-color: #e8f5e9;
  border: 1px solid #4caf50;
  border-radius: 6px;
  color: #2e7d32;
  margin-top: var(--spacing-md);
}

.form-success.visible {
  display: block;
}

/* RSVPify Embed */
#rsvpify-embed-container {
  width: 100%;
  margin: 0;
  padding: 0;
}

#rsvpify-embed-container iframe {
  width: 100% !important;
  min-height: 1000px !important;
  border: none !important;
  display: block !important;
}

/* Details/Summary (FAQ) */
details {
  margin-bottom: var(--spacing-md);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: var(--spacing-sm);
}

summary {
  cursor: pointer;
  font-weight: var(--font-weight-medium);
  padding: var(--spacing-xs);
  color: var(--color-text-primary);
}

summary:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

details[open] summary {
  margin-bottom: var(--spacing-sm);
}

/* ============================================
   SCHEDULE PAGE - EVENT LAYOUT
   ============================================ */
.event {
  padding: 32px 80px 40px 0px;
  position: relative;
}

.event::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -64px;
  right: -96px;
  height: 1px;
  background-color: #EEEEEE;
}

.event:last-child::after {
  display: none;
}

.event-title {
  margin-bottom: 28px;
}

.event-title h2 {
  font-family: var(--font-primary);
  font-size: var(--font-size-5xl);
  font-weight: var(--font-weight-thin);
  margin: 0;
  color: var(--color-text-primary);
}

.event-info {
  display: flex;
  flex-direction: row;
  gap: 88px;
  margin-bottom: 24px;
}

#page-content .event-info p {
  margin: 0;
  color: var(--color-text-secondary);
  line-height: 1.8;
}

.event-description {
  margin: 0;
}

#page-content .event-description p {
  margin: 0;
  color: var(--color-text-secondary);
  line-height: 1.8;
}

/* ============================================
   CAROUSEL
   ============================================ */
.carousel-track {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 1;
  transform: translateX(100%);
  transition: transform 600ms ease-in-out;
  pointer-events: none;
}

.slide.active {
  pointer-events: auto;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: #f0f0f0;
}

/* Loading state for images */
.slide img:not([complete]) {
  opacity: 0;
}

.slide img[complete] {
  animation: fadeInImage 0.3s ease-in;
}

@keyframes fadeInImage {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Carousel Click Zones */
.carousel-zone {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  z-index: 10;
  background: transparent;
  cursor: pointer;
}

.zone-left {
  left: 0;
  cursor: url('data:image/svg+xml;utf8,<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3 23.9575L45 23.9575" stroke="%231A1A1A" stroke-width="2.5"/><path d="M21.2424 4.5C21.2424 19.4179 3 23.9586 3 23.9586C3 23.9586 21.2424 28.4992 21.2424 43.4171" stroke="%231A1A1A" stroke-width="2.5"/></svg>') 24 24, w-resize;
}

.zone-right {
  right: 0;
  cursor: url('data:image/svg+xml;utf8,<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M45 23.9596L3 23.9596" stroke="%231A1A1A" stroke-width="2.5"/><path d="M26.7576 43.417C26.7576 28.4991 45 23.9584 45 23.9584C45 23.9584 26.7576 19.4178 26.7576 4.4999" stroke="%231A1A1A" stroke-width="2.5"/></svg>') 24 24, e-resize;
}

.carousel-zone:focus-visible {
  outline: 2px solid var(--color-text-light);
  outline-offset: -4px;
}

/* Carousel Counter (Top Left) */
.carousel-counter {
  position: absolute;
  top: calc(var(--spacing-4) + 1.5px);
  left: var(--spacing-4);
  z-index: 60;
  color: var(--color-text-primary);
  font-size: var(--font-size-base);
  opacity: 1;
  line-height: 1;
}

/* Fullscreen Button (Top Right) */
.lightbox-trigger {
  position: absolute;
  top: calc(var(--spacing-4) + 1.5px);
  right: var(--spacing-4);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-primary);
  font-size: var(--font-size-base);
  padding: 0;
  opacity: 1;
  transition: opacity 400ms cubic-bezier(.27,0,0,1);
  overflow: hidden;
}

.lightbox-trigger-text {
  display: block;
  position: relative;
  line-height: 1;
  overflow: hidden;
}

.lightbox-main,
.lightbox-hover {
  display: block;
  line-height: 1;
  transition: none;
}

.lightbox-main {
  transform: translateY(0);
}

.lightbox-hover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  transform: translateY(120%);
}

.lightbox-trigger:hover .lightbox-main {
  transform: translateY(-120%);
  transition: transform 300ms ease-in-out;
}

.lightbox-trigger:hover .lightbox-hover {
  transform: translateY(0);
  transition: transform 300ms ease-in-out;
}

.lightbox-trigger:focus-visible {
  outline: 2px solid var(--color-text-primary);
  outline-offset: 2px;
}

/* ============================================
   GALLERY / MASONRY GRID
   ============================================ */
.gallery-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: #ffffff;
  z-index: var(--z-lightbox);
  display: none;
  overflow-y: scroll;
  padding: 80px 0;
  -webkit-overflow-scrolling: touch;
}

.gallery-overlay.open {
  display: block;
}

.gallery-close {
  position: fixed;
  top: var(--spacing-4);
  right: var(--spacing-4);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  color: var(--color-text-secondary);
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 1000;
  transform: translateZ(0);
}

.gallery-close:hover {
  color: var(--color-text-primary);
  border-color: var(--color-text-primary);
}

.gallery-close:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.gallery-close img {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Masonry Grid - Flexbox scattered layout (like reference site) */
.masonry-grid {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  padding: 0 40px 100px 40px;
  align-items: flex-end;
}

.masonry-item {
  display: flex;
  box-sizing: border-box;
  flex: 0 0 auto;
  padding-right: var(--half-gutter-width);
  padding-left: var(--half-gutter-width);
  padding-bottom: calc(var(--gutter-width) * 8);
  will-change: transform;
  overflow: hidden;
}

.masonry-item img {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0;
  clip-path: inset(100% 0 0 0);
  transform: translateY(60px);
  transition: opacity 1400ms cubic-bezier(.27, 0, 0, 1),
              clip-path 1400ms cubic-bezier(.27, 0, 0, 1),
              transform 1400ms cubic-bezier(.27, 0, 0, 1);
}

.masonry-item.animate-in img {
  opacity: 1;
  clip-path: inset(0% 0 0 0);
  transform: translateY(0);
}

.masonry-item.animation-complete img {
  transition: transform 0.1s linear;
  clip-path: none;
}

.masonry-item.no-animation img {
  opacity: 1;
  clip-path: inset(0% 0 0 0);
  transform: translateY(0);
  transition: none;
}

/* 9-image repeating pattern */

/* Image 1 (9n-8) */
.masonry-item:nth-child(9n-8) {
  flex-basis: 41.66666667%;
  max-width: 41.66666667%;
  margin-right: 8.33333333%;
}

.masonry-item:nth-child(9n-8).size-wide {
  flex-basis: 50%;
  max-width: 50%;
  margin-left: 0;
  margin-right: 0;
}

/* Image 2 (9n-7) */
.masonry-item:nth-child(9n-7) {
  flex-basis: 25%;
  max-width: 25%;
  margin-left: 25%;
}

.masonry-item:nth-child(9n-7).size-wide {
  flex-basis: 33.33333333%;
  max-width: 33.33333333%;
  margin-left: 16.66666666%;
  margin-right: 0;
}

/* Image 3 (9n-6) */
.masonry-item:nth-child(9n-6) {
  flex-basis: 33.33333333%;
  max-width: 33.33333333%;
  margin-left: 16.66666666%;
  margin-right: 0;
  align-self: center;
}

.masonry-item:nth-child(9n-6).size-wide {
  flex-basis: 41.66666667%;
  max-width: 41.66666667%;
  margin-left: 0;
  margin-right: 8.33333333%;
  align-self: center;
}

/* Image 4 (9n-5) */
.masonry-item:nth-child(9n-5) {
  flex-basis: 33.33333333%;
  max-width: 33.33333333%;
  margin-left: 8.33333333%;
  margin-right: 8.33333333%;
  align-self: center;
}

.masonry-item:nth-child(9n-5).size-wide {
  flex-basis: 33.33333333%;
  max-width: 33.33333333%;
  margin-left: 8.33333333%;
  margin-right: 8.33333333%;
  align-self: center;
}

/* Image 5 (9n-4) */
.masonry-item:nth-child(9n-4) {
  flex-basis: 25%;
  max-width: 25%;
  margin-left: 8.33333333%;
  align-self: center;
}

.masonry-item:nth-child(9n-4).size-wide {
  flex-basis: 25%;
  max-width: 25%;
  margin-left: 8.33333333%;
  align-self: center;
}

/* Image 6 (9n-3) */
.masonry-item:nth-child(9n-3) {
  flex-basis: 50%;
  max-width: 50%;
  margin-left: 8.33333333%;
  margin-right: 8.33333333%;
}

.masonry-item:nth-child(9n-3).size-wide {
  flex-basis: 58.33333333%;
  max-width: 58.33333333%;
  margin-left: 8.33333333%;
  margin-right: 0;
}

/* Image 7 (9n-2) */
.masonry-item:nth-child(9n-2) {
  flex-basis: 33.33333333%;
  max-width: 33.33333333%;
  margin-left: 33.33333333%;
  margin-right: 33.33333333%;
}

.masonry-item:nth-child(9n-2).size-wide {
  flex-basis: 66.66666667%;
  max-width: 66.66666667%;
  margin-left: 16.66666666%;
  margin-right: 16.66666666%;
}

/* Image 8 (9n-1) */
.masonry-item:nth-child(9n-1) {
  flex-basis: 25%;
  max-width: 25%;
  margin-left: 0;
  margin-right: 16.66666666%;
  align-self: center;
}

.masonry-item:nth-child(9n-1).size-wide {
  flex-basis: 33.33333333%;
  max-width: 33.33333333%;
  margin-left: 0;
  margin-right: 8.33333333%;
  align-self: center;
}

/* Image 9 (9n) */
.masonry-item:nth-child(9n) {
  flex-basis: 41.66666667%;
  max-width: 41.66666667%;
  margin-left: 16.66666666%;
  align-self: center;
}

.masonry-item:nth-child(9n).size-wide {
  flex-basis: 50%;
  max-width: 50%;
  margin-left: 8.33333333%;
  align-self: center;
}

/* ============================================
   LOADING ANIMATION
   ============================================ */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: #ffffff;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 1;
  transition: opacity 1200ms ease-in-out;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.typewriter-container {
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  opacity: 1;
  transition: opacity 1200ms ease-in-out;
}

.typewriter-container.fade-out {
  opacity: 0;
}

.typewriter-text::after {
  content: '';
  display: inline-block;
  width: 1px;
  height: 1em;
  background-color: currentColor;
  margin-left: 2px;
  animation: blink 1s step-end infinite;
  vertical-align: middle;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.typewriter-text.no-cursor::after {
  opacity: 0;
  animation: none;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Nav links - initial hidden state for load animation */
.pane-header .site-title {
  overflow: hidden;
}

.pane-header .site-title > * {
  transform: translateY(100%);
}

.carousel-counter,
.lightbox-trigger {
  overflow: hidden;
}

.carousel-counter > *,
.lightbox-trigger > * {
  transform: translateY(100%);
  display: inline-block;
}


.rsvp-li {
  overflow: hidden;
}

.rsvp-button {
  transform: translateY(100%);
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* ≤1024px: Adjust pane widths */
@media (max-width: 1024px) {
  :root {
    --left-pane-width: 45%;
    --right-pane-width: 55%;
  }

  .site-title h1 {
    font-size: var(--font-size-sm);
  }
}

/* ≤768px: Stack layout */
@media (max-width: 768px) {
  :root {
    --carousel-height: 60vh;
  }

  #app {
    flex-direction: column;
  }

  #left-pane {
    width: 100%;
    order: 2;
  }

  #carousel {
    width: 100%;
    height: var(--carousel-height);
    position: relative;
    order: 1;
  }

  .pane-header {
    padding: var(--spacing-md);
  }

  #main-content {
    padding: var(--spacing-md);
  }

  .site-title h1 {
    font-size: var(--font-size-base);
  }

  .lightbox-nav {
    width: 44px;
    height: 44px;
  }

  .lightbox-prev {
    left: var(--spacing-xs);
  }

  .lightbox-next {
    right: var(--spacing-xs);
  }

  .lightbox-close {
    top: var(--spacing-xs);
    right: var(--spacing-xs);
  }
}

/* ≤480px: Mobile optimization */
@media (max-width: 480px) {
  :root {
    --font-size-3xl: 1.75rem;
    --font-size-2xl: 1.5rem;
    --font-size-xl: 1.25rem;
    --spacing-lg: 1.5rem;
  }

  .pane-header,
  #main-content,
  .pane-footer {
    padding: var(--spacing-sm);
  }

  .nav-link {
    padding: var(--spacing-sm);
    font-size: var(--font-size-base);
  }

  .carousel-counter {
    top: var(--spacing-sm);
    left: var(--spacing-sm);
    font-size: var(--font-size-xs);
  }

  .lightbox-trigger {
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    font-size: var(--font-size-xs);
  }
}

/* ============================================
   REGISTRY PAGE (Figma Design)
   ============================================ */
.registry-content {
  display: flex;
  flex-direction: column;
  gap: 48px;
  margin: 0;
}

#page-content .registry-message {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 100;
  color: #7a7a7a;
  line-height: 25px;
  margin: 0;
}

.registry-details {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.registry-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

#page-content .registry-label {
  flex: 1;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 100;
  color: #7a7a7a;
  line-height: 25px;
  margin: 0;
}

.registry-info {
  flex: 1;
  display: flex;
  justify-content: space-between;
}

#page-content .registry-person {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 100;
  color: #1a1a1a;
  line-height: 25px;
  margin: 0;
  width: 160px;
}

/* ============================================
   FAQ ACCORDION (Figma Design)
   ============================================ */
.faq-accordion {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.faq-item {
  width: 100%;
}

.faq-row {
  display: flex;
  gap: 88px;
  padding: 24px 16px 8px 16px;
  align-items: flex-start;
  position: relative;
  transition: padding-bottom 0.4s ease;
}

.faq-item[aria-expanded="true"] .faq-row {
  padding-bottom: 32px;
}

.faq-row::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -64px;
  right: -96px;
  height: 1px;
  background-color: #EEEEEE;
}

.faq-item:last-child .faq-row::after {
  display: none;
}

.faq-number {
  font-family: var(--font-mono);
  font-size: 16px;
  color: #1a1a1a;
  text-align: center;
  width: 10px;
  padding: 6px 0;
  flex-shrink: 0;
}

.faq-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.faq-header {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.faq-header:hover {
  opacity: 0.7;
}

#page-content .faq-question {
  flex: 1;
  font-family: var(--font-headline);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-thin);
  color: #000;
  margin: 0;
  line-height: normal;
}

.faq-icon {
  position: relative;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.faq-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.faq-icon .icon-vertical {
  transform-origin: center;
  transition: transform 0.4s ease;
}

.faq-icon .icon-horizontal {
  transition: opacity 0.4s ease;
}

.faq-item[aria-expanded="true"] .faq-icon .icon-vertical {
  transform: scaleY(0);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.faq-item[aria-expanded="true"] .faq-answer {
  /* Gap is handled by parent .faq-content */
}

#page-content .faq-answer p {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 100;
  color: #7a7a7a;
  line-height: 25px;
  margin: 0;
  padding-right: 48px;
}

/* ============================================
   FOCUS STATES (Accessibility)
   ============================================ */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ============================================
   PAGE TRANSITION ANIMATIONS (GSAP + Clip-Path)
   ============================================ */

/* Barba container - enable clip-path animations */
[data-barba="container"] {
  position: relative;
  will-change: clip-path;
}

/* Black overlay that fades in during page transitions */
.transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--color-bg-dark);
  opacity: 0;
  pointer-events: none;
  z-index: 500; /* Above homepage (1), below gallery (1000) and loading (9999) */
  will-change: opacity;
}

/* Transition wrapper for clip-path animations */
.page-transition-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  will-change: clip-path;
  clip-path: inset(0 0 0 0);
}

/* Loading overlay with clip-path support */
.loading-overlay {
  will-change: clip-path, opacity;
}

/* Gallery overlay with clip-path support */
.gallery-overlay {
  will-change: clip-path;
  /* Don't set initial clip-path here - let GSAP handle it */
  /* Removed transform from will-change to preserve fixed positioning of children */
}

/* Disable pointer events during transitions */
body.transitioning {
  pointer-events: none;
}

body.transitioning * {
  pointer-events: none !important;
}

/* Gallery transitions - disable pointer events without fixing body position */
body.gallery-transitioning {
  pointer-events: none;
}

body.gallery-transitioning * {
  pointer-events: none !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --color-border: #000000;
    --color-text-secondary: #000000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
