/* ================================================================
   Frank & Emilie — Wedding Invitation
   Elegant & Classic Design
   ================================================================ */

/* ---------- Design Tokens ---------- */
:root {
  /* Palette */
  --ivory:        #FAF7F2;
  --cream:        #F3EDE4;
  --linen:        #EDE6DA;
  --champagne:    #D4C9B8;
  --gold:         #B8973E;
  --gold-light:   #D4B85C;
  --gold-muted:   #C6A96A;
  --charcoal:     #2C2825;
  --warm-gray:    #6B6460;
  --soft-gray:    #9B9490;
  --blush:        #E8D8D0;
  --sage:         #8B9A7E;
  --sage-light:   #A8B89C;
  --error:        #B44040;
  --success:      #5C8A5C;

  /* Typography */
  --font-display: 'Cormorant Garamond', 'Georgia', serif;
  --font-body:    'Libre Baskerville', 'Georgia', serif;

  /* Spacing */
  --section-pad:  clamp(4rem, 10vw, 8rem);
  --container:    720px;

  /* Transitions */
  --ease-out:     cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: clamp(0.925rem, 1.6vw, 1.05rem);
  line-height: 1.75;
  color: var(--charcoal);
  background-color: var(--ivory);
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.3s var(--ease-out);
}

a:hover {
  color: var(--gold-light);
}

::selection {
  background: var(--gold);
  color: var(--ivory);
}

/* ---------- Container ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-wide {
  max-width: 960px;
}

/* ---------- Section ---------- */
.section {
  padding: var(--section-pad) 0;
  position: relative;
}

.section-alt {
  background-color: var(--cream);
}

.section-alt::before,
.section-alt::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--champagne), transparent);
}

.section-alt::before { top: 0; }
.section-alt::after  { bottom: 0; }

/* ---------- Section Titles ---------- */
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 300;
  letter-spacing: 0.08em;
  text-align: center;
  color: var(--charcoal);
}

.ornamental-rule {
  width: 60px;
  height: 1px;
  background: var(--gold);
  margin: 1.25rem auto 2.5rem;
  position: relative;
}

.ornamental-rule::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 7px;
  height: 7px;
  background: var(--gold);
  border-radius: 50%;
}

/* ---------- Reveal Animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.reveal:nth-child(2)  { transition-delay: 0.08s; }
.reveal:nth-child(3)  { transition-delay: 0.16s; }
.reveal:nth-child(4)  { transition-delay: 0.24s; }
.reveal:nth-child(5)  { transition-delay: 0.32s; }

/* ================================================================
   HERO
   ================================================================ */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem;
  position: relative;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, var(--cream) 0%, transparent 70%),
    var(--ivory);
  overflow: hidden;
}

/* Decorative corner ornaments */
.hero-ornament {
  position: absolute;
  width: 120px;
  height: 120px;
  opacity: 0.35;
}

.hero-ornament.top {
  top: 2rem;
  left: 2rem;
  border-top: 1px solid var(--gold);
  border-left: 1px solid var(--gold);
}

.hero-ornament.bottom {
  bottom: 2rem;
  right: 2rem;
  border-bottom: 1px solid var(--gold);
  border-right: 1px solid var(--gold);
}

.hero-ornament::before {
  content: '';
  position: absolute;
  width: 40px;
  height: 40px;
}

.hero-ornament.top::before {
  top: 8px;
  left: 8px;
  border-top: 1px solid var(--gold);
  border-left: 1px solid var(--gold);
}

.hero-ornament.bottom::before {
  bottom: 8px;
  right: 8px;
  border-bottom: 1px solid var(--gold);
  border-right: 1px solid var(--gold);
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-prelude {
  font-family: var(--font-body);
  font-size: clamp(0.8rem, 1.5vw, 0.95rem);
  font-style: italic;
  letter-spacing: 0.1em;
  color: var(--warm-gray);
  margin-bottom: 1.5rem;
}

.hero-names {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(3rem, 10vw, 6rem);
  line-height: 1.15;
  letter-spacing: 0.03em;
  color: var(--charcoal);
  margin-bottom: 0.5rem;
}

.hero-names .name {
  display: inline-block;
}

.hero-names .ampersand {
  display: inline-block;
  font-style: italic;
  font-weight: 300;
  color: var(--gold);
  margin: 0 0.15em;
  font-size: 0.7em;
  vertical-align: 0.05em;
}

/* Ornamental divider */
.ornamental-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
  color: var(--gold);
}

.ornamental-divider span {
  display: block;
  width: 50px;
  height: 1px;
  background: var(--gold);
}

.hero-invite {
  font-family: var(--font-body);
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  font-style: italic;
  color: var(--warm-gray);
  line-height: 1.8;
  margin-bottom: 2rem;
}

.hero-date {
  display: block;
  margin-bottom: 1rem;
}

.date-line {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--charcoal);
}

.date-year {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--warm-gray);
  margin-top: 0.25rem;
}

.hero-venue {
  font-family: var(--font-display);
  font-size: clamp(0.9rem, 1.8vw, 1.1rem);
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-muted);
}

/* Scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--champagne);
  transition: color 0.3s;
}

.scroll-hint:hover {
  color: var(--gold);
}

.scroll-dot {
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50%      { transform: translateY(8px); opacity: 0.3; }
}

/* ================================================================
   SIDE NAVIGATION
   ================================================================ */
.side-nav {
  position: fixed;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.nav-dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--champagne);
  background: transparent;
  transition: all 0.3s var(--ease-out);
  position: relative;
}

.nav-dot span {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--warm-gray);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.nav-dot:hover span {
  opacity: 1;
}

.nav-dot:hover {
  border-color: var(--gold);
}

.nav-dot.active {
  background: var(--gold);
  border-color: var(--gold);
}

/* Hide on small screens */
@media (max-width: 768px) {
  .side-nav { display: none; }
}

/* ================================================================
   TIMELINE
   ================================================================ */
.timeline {
  position: relative;
  padding: 1rem 0;
}

/* Vertical line */
.timeline::before {
  content: '';
  position: absolute;
  left: calc(60px + 1.5rem + 6px);
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--champagne) 10%, var(--champagne) 90%, transparent);
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.25rem 0;
  position: relative;
}

.timeline-time {
  flex-shrink: 0;
  width: 60px;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--gold);
  text-align: right;
}

.timeline-dot {
  flex-shrink: 0;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--ivory);
  border: 2px solid var(--gold);
  margin-top: 0.35rem;
  position: relative;
  z-index: 1;
}

.section-alt .timeline-dot {
  background: var(--cream);
}

.timeline-content h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.02em;
  margin-bottom: 0.25rem;
}

.timeline-content p {
  color: var(--warm-gray);
  font-size: 0.9rem;
}

/* ================================================================
   IMAGE BAND
   ================================================================ */
.image-band {
  width: 100%;
  height: clamp(250px, 40vw, 400px);
  background-image: url('castle.jpg');
  background-position: center 40%;
  background-size: cover;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

@supports (-webkit-touch-callout: none) {
  /* iOS doesn't support background-attachment: fixed */
  .image-band {
    background-attachment: scroll;
  }
}

@media (max-width: 600px) {
  .image-band {
    background-attachment: scroll;
  }
}

.image-band-2 {
  background-image: url('castle2.jpg');
  background-position: center 50%;
}

/* ================================================================
   VENUE
   ================================================================ */
.venue-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.venue-info h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.venue-info p {
  color: var(--warm-gray);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.venue-note {
  font-style: italic;
  font-size: 0.85rem !important;
  color: var(--soft-gray) !important;
}

.map-embed {
  border-radius: 8px;
  overflow: hidden;
  box-shadow:
    0 2px 8px rgba(44, 40, 37, 0.06),
    0 8px 24px rgba(44, 40, 37, 0.04);
  border: 1px solid var(--champagne);
}

.map-embed iframe {
  display: block;
}

@media (max-width: 600px) {
  .venue-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* ================================================================
   DETAILS (Dress Code & Gifts)
   ================================================================ */
.details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}

.detail-card {
  text-align: center;
  padding: 2.5rem 2rem;
  border: 1px solid var(--champagne);
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--ivory) 0%, rgba(250, 247, 242, 0.5) 100%);
  transition: box-shadow 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}

.detail-card:hover {
  box-shadow: 0 8px 30px rgba(44, 40, 37, 0.06);
  transform: translateY(-2px);
}

.detail-icon {
  color: var(--gold);
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: center;
}

.detail-card h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-bottom: 1rem;
}

.detail-card p {
  font-size: 0.9rem;
  color: var(--warm-gray);
  margin-bottom: 0.5rem;
}

.detail-card p:last-child {
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .details-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 520px;
  }

  .detail-card {
    padding: 2rem 1.5rem;
  }
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 0.75rem 1.75rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  text-decoration: none;
}

.btn-primary {
  background: var(--gold);
  color: var(--ivory);
  font-size: 1.1rem;
  padding: 1rem 2.5rem;
  width: 100%;
  margin-top: 1rem;
}

.btn-primary:hover {
  background: var(--gold-light);
  color: var(--ivory);
  box-shadow: 0 4px 16px rgba(184, 151, 62, 0.3);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: transparent;
  color: var(--gold);
  border: 1px dashed var(--champagne);
  font-size: 0.95rem;
  width: 100%;
  padding: 0.7rem 1.5rem;
}

.btn-secondary:hover {
  border-color: var(--gold);
  background: rgba(184, 151, 62, 0.05);
  color: var(--gold);
}

.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--champagne);
  font-size: 0.85rem;
  padding: 0.5rem 1.25rem;
  margin-top: 0.25rem;
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ================================================================
   RSVP FORM
   ================================================================ */
.rsvp-deadline {
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: var(--warm-gray);
  margin-bottom: 2.5rem;
}

.rsvp-deadline strong {
  color: var(--charcoal);
}

.rsvp-form {
  max-width: 560px;
  margin: 0 auto;
}

.guest-row {
  padding: 1.5rem;
  margin-bottom: 1rem;
  background: var(--ivory);
  border: 1px solid var(--champagne);
  border-radius: 8px;
  transition: box-shadow 0.3s var(--ease-out);
  position: relative;
}

.section-alt .guest-row {
  background: var(--ivory);
}

.guest-row:focus-within {
  box-shadow: 0 2px 12px rgba(184, 151, 62, 0.12);
  border-color: var(--gold-muted);
}

.guest-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.guest-label {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--gold);
  letter-spacing: 0.04em;
}

.remove-guest {
  background: none;
  border: none;
  color: var(--soft-gray);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all 0.2s;
}

.remove-guest:hover {
  color: var(--error);
  background: rgba(180, 64, 64, 0.06);
}

.guest-fields {
  display: grid;
  gap: 1rem;
}

.field label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--charcoal);
  margin-bottom: 0.35rem;
}

.required {
  color: var(--gold);
}

.field input,
.field select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--charcoal);
  background: var(--cream);
  border: 1px solid var(--champagne);
  border-radius: 4px;
  transition: all 0.3s var(--ease-out);
  appearance: none;
  -webkit-appearance: none;
}

.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B6460' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.5rem;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--ivory);
  box-shadow: 0 0 0 3px rgba(184, 151, 62, 0.1);
}

.field input::placeholder {
  color: var(--soft-gray);
  font-style: italic;
}

.field input.invalid,
.field select.invalid {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(180, 64, 64, 0.08);
}

/* Form message */
.form-message {
  text-align: center;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.form-message.error {
  background: rgba(180, 64, 64, 0.08);
  color: var(--error);
  border: 1px solid rgba(180, 64, 64, 0.2);
}

.form-message.success {
  background: rgba(92, 138, 92, 0.08);
  color: var(--success);
  border: 1px solid rgba(92, 138, 92, 0.2);
}

/* Loading spinner */
.spinner {
  animation: spin 0.8s linear infinite;
  transform-origin: center;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn-loading {
  align-items: center;
  gap: 0.5rem;
}

.btn-loading:not([hidden]) {
  display: inline-flex;
}

/* Success state */
.rsvp-success {
  text-align: center;
  padding: 3rem 1rem;
  max-width: 460px;
  margin: 0 auto;
}

.rsvp-success .success-icon {
  color: var(--sage);
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: center;
  animation: fadeScale 0.5s var(--ease-spring);
}

@keyframes fadeScale {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.rsvp-success h3 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
}

.rsvp-success p {
  color: var(--warm-gray);
}

/* ================================================================
   CONTACT
   ================================================================ */
.contact-intro {
  text-align: center;
  color: var(--warm-gray);
  margin-bottom: 2rem;
}

.contact-cards {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1.5rem 2.5rem;
  border: 1px solid var(--champagne);
  border-radius: 8px;
  transition: all 0.3s var(--ease-out);
  text-decoration: none;
}

.contact-card:hover {
  border-color: var(--gold);
  box-shadow: 0 4px 16px rgba(184, 151, 62, 0.1);
  transform: translateY(-2px);
  color: inherit;
}

.contact-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--charcoal);
}

.contact-phone {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--gold);
  letter-spacing: 0.02em;
}

/* ================================================================
   FOOTER
   ================================================================ */
.footer {
  text-align: center;
  padding: 3rem 1.5rem 2.5rem;
  background: var(--charcoal);
  color: var(--champagne);
  position: relative;
}

.footer-ornament {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 30%, var(--gold) 70%, transparent);
  opacity: 0.3;
}

.footer-names {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--cream);
  margin-bottom: 0.25rem;
}

.footer-date {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.2em;
  color: var(--soft-gray);
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 600px) {
  .hero-ornament { display: none; }

  .timeline::before {
    left: calc(36px + 1rem + 5px);
  }

  .timeline-time {
    width: 36px;
    font-size: 1.05rem;
  }

  .timeline-item {
    gap: 1rem;
  }

  .timeline-dot {
    width: 11px;
    height: 11px;
    margin-top: 0.25rem;
  }

  .timeline-content h3 {
    font-size: 1.1rem;
  }

  .contact-cards {
    flex-direction: column;
    align-items: center;
  }

  .contact-card {
    width: 100%;
    max-width: 280px;
  }
}

/* ================================================================
   PRINT
   ================================================================ */
@media print {
  .side-nav,
  .scroll-hint,
  .map-embed,
  .rsvp-form,
  #add-guest,
  .btn { display: none !important; }

  .section { padding: 2rem 0; }
  .reveal { opacity: 1 !important; transform: none !important; }

  body { font-size: 12pt; }
}
