/*
    Rustic Vintage - Old World Charm
    An antique design system with paper textures and sepia tones.
*/

:root {
    --paper: #fdfcf0;
    --sepia: #8b4513;
    --sepia-light: #d2b48c;
    --antique-gold: #c5a059;
    --text: #3d2b1f;
    --muted: #8d7767;
    --font-script: 'Pinyon Script', cursive;
    --font-serif: 'Libre Baskerville', serif;
    --transition: all 0.8s cubic-bezier(0.2, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-serif);
    background-color: var(--paper);
    color: var(--text);
    line-height: 1.8;
    overflow-x: hidden;
}

body.no-scroll {
    overflow: hidden;
    height: 100vh;
}

/* --- Grain & Texture --- */
.grain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    pointer-events: none;
    opacity: 0.05;
    background-image: url("https://www.transparenttextures.com/patterns/60-lines.png");
}

/* --- Intro Screen --- */
.intro-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    background-color: var(--paper);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 1.5s cubic-bezier(0.7, 0, 0.3, 1);
}

.intro-screen.unfolded {
    transform: translateY(-100%);
}

.intro-content {
    text-align: center;
    padding: 2rem;
}

.wax-seal {
    font-size: 3rem;
    color: var(--sepia);
    margin-bottom: 2rem;
    position: relative;
}

.wax-seal::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 80px; height: 80px;
    border: 2px solid var(--sepia);
    border-radius: 50%;
    opacity: 0.2;
}

.intro-label {
    font-family: var(--font-script);
    font-size: 1.8rem;
    color: var(--muted);
    margin-bottom: 1.5rem;
}

.intro-names {
    font-family: var(--font-script);
    font-size: clamp(3.5rem, 12vw, 6rem);
    color: var(--sepia);
    margin-bottom: 4rem;
}

.guest-card {
    background: rgba(139, 69, 19, 0.03);
    padding: 3rem;
    border: 1px solid rgba(139, 69, 19, 0.1);
    border-radius: 20px;
    margin-bottom: 4rem;
}

.guest-card .to { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.3rem; opacity: 0.5; }
.guest-card .name { font-family: var(--font-serif); font-size: 2.2rem; margin-top: 0.5rem; color: var(--sepia); }

.btn-rustic {
    background: var(--sepia);
    color: var(--paper);
    border: none;
    padding: 1.2rem 3.5rem;
    font-family: var(--font-serif);
    text-transform: uppercase;
    letter-spacing: 0.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    transition: var(--transition);
}

.btn-rustic:hover { transform: translateY(-5px); background: var(--text); }

/* --- Navigation --- */
nav {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    z-index: 1000;
    transition: var(--transition);
}

nav.visible { transform: translateX(-50%) translateY(0); }

.nav-rustic {
    background: rgba(253, 252, 240, 0.9);
    backdrop-filter: blur(10px);
    padding: 0.8rem 1.5rem;
    border: 1px solid var(--sepia-light);
    display: flex;
    gap: 1.5rem;
}

nav a {
    color: rgba(139, 69, 19, 0.3);
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

nav a.active { color: var(--sepia); transform: scale(1.2); }

/* --- Music --- */
.music-player {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
    cursor: pointer;
}

.gramophone {
    font-size: 1.8rem;
    color: var(--sepia);
    opacity: 0.4;
}

.music-player.playing .gramophone { animation: spin 4s infinite linear; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* --- Sections --- */
section { padding: 6rem 1.5rem; position: relative; }
@media (min-width: 992px) {
    section { padding: 10rem 2rem; }
}
.container { max-width: 1100px; margin: 0 auto; text-align: center; }
.section-title h2 { font-family: var(--font-script); font-size: 4rem; color: var(--sepia); margin-bottom: 1.5rem; }
.title-divider { width: 50px; height: 1px; background: var(--sepia-light); margin: 0 auto 6rem; }

/* --- Hero --- */
.hero { height: 100vh; display: flex; align-items: center; justify-content: center; padding: 0; }
.antique-frame {
    border: 1px solid var(--sepia-light);
    padding: 3rem 1.5rem;
    width: 90%;
    max-width: 600px;
    position: relative;
    background: rgba(255, 255, 255, 0.2);
}

@media (min-width: 768px) {
    .antique-frame { padding: 6rem 4rem; }
}

.frame-ornament { width: 100px; height: 30px; background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 30"><path d="M0 15 Q25 0 50 15 T100 15" fill="none" stroke="%238b4513" stroke-width="1"/></svg>') no-repeat center; margin: 0 auto; }
.frame-ornament.top { margin-bottom: 3rem; }
.frame-ornament.bottom { margin-top: 3rem; transform: rotate(180deg); }

.hero-tag { font-family: var(--font-script); font-size: 1.8rem; color: var(--muted); margin-bottom: 2rem; }
.hero-title { font-family: var(--font-script); font-size: clamp(3.5rem, 10vw, 5rem); line-height: 1.1; margin-bottom: 2rem; color: var(--sepia); }
.divider { font-size: 1.5rem; color: var(--sepia-light); margin: 2rem 0; }
.hero-date { font-family: var(--font-serif); font-weight: 700; color: var(--sepia); letter-spacing: 0.1rem; }

/* --- Couple --- */
.couple-grid { display: flex; justify-content: center; gap: 4rem; flex-wrap: wrap; }
.couple-card { flex: 1; min-width: 300px; }
.sepia-frame {
    width: 220px;
    height: 300px;
    margin: 0 auto 3rem;
    border: 10px solid white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 10px;
    background: #e4d8c1;
    transform: rotate(-2deg);
}

.inner-frame {
    width: 100%;
    height: 100%;
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    color: var(--sepia);
    opacity: 0.2;
    filter: sepia(1);
}

.couple-card h3 { font-family: var(--font-script); font-size: 3rem; color: var(--sepia); margin-bottom: 1.5rem; }
.parents { font-size: 0.95rem; color: var(--muted); font-style: italic; }

/* --- Event --- */
.countdown-vintage { display: flex; justify-content: center; gap: 1rem; margin-bottom: 4rem; }
@media (min-width: 768px) {
    .countdown-vintage { gap: 3rem; margin-bottom: 8rem; }
}
.time-item span { display: block; font-family: var(--font-script); font-size: 2rem; color: var(--sepia); line-height: 1; }
@media (min-width: 768px) {
    .time-item span { font-size: 4rem; }
}
.time-item label { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.1rem; opacity: 0.5; }

.event-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 4rem; }
.event-card {
    background: white;
    padding: 6rem 3rem;
    border: 1px solid var(--sepia-light);
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.02);
}

.wax-mark { position: absolute; top: -15px; right: -15px; width: 50px; height: 50px; background: var(--sepia); border-radius: 50%; opacity: 0.1; }
.event-card i { font-size: 2.5rem; color: var(--sepia); margin-bottom: 3rem; display: block; }
.event-card h3 { font-family: var(--font-script); font-size: 2.2rem; margin-bottom: 2.5rem; color: var(--sepia); }
.details .date { font-weight: 700; font-size: 1.3rem; margin-bottom: 1rem; }
.details .line { width: 30px; height: 1px; background: var(--sepia-light); margin: 2rem auto; }

/* --- Location --- */
.map-card { background: white; border: 1px solid var(--sepia-light); border-radius: 5px; overflow: hidden; }
.map-details { padding: 5rem 2rem; }
.map-details p { font-size: 1.2rem; margin-bottom: 3rem; max-width: 600px; margin-left: auto; margin-right: auto; color: var(--muted); }

/* --- Gallery --- */
.vintage-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 2rem; }
.gallery-item .frame { padding: 15px; background: white; box-shadow: 0 10px 20px rgba(0,0,0,0.05); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); filter: sepia(0.8) contrast(1.1); }
.gallery-item:hover img { filter: sepia(0.2) contrast(1); }

/* --- RSVP --- */
.rsvp-layout { display: grid; grid-template-columns: 1fr; gap: 3rem; text-align: left; }
@media (min-width: 768px) { .rsvp-layout { grid-template-columns: 1fr 1fr; gap: 5rem; } }
.rustic-form { background: white; padding: 4rem; border: 1px solid var(--sepia-light); }
.rustic-form label { display: block; font-family: var(--font-script); font-size: 1.4rem; color: var(--sepia); margin-bottom: 1rem; }
.rustic-form input, .rustic-form textarea {
    width: 100%;
    padding: 1rem 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--sepia-light);
    font-family: var(--font-serif);
    font-size: 1.1rem;
    margin-bottom: 3rem;
}

.btn-submit {
    width: 100%;
    padding: 1.5rem;
    background: var(--sepia);
    color: var(--paper);
    border: none;
    font-family: var(--font-serif);
    text-transform: uppercase;
    letter-spacing: 0.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.wishes-list { max-height: 600px; overflow-y: auto; padding-right: 2rem; }
.wish-item { padding: 2.5rem; background: rgba(139, 69, 19, 0.02); margin-bottom: 2.5rem; border: 1px dashed var(--sepia-light); position: relative; }
.wish-header { display: flex; justify-content: space-between; margin-bottom: 1rem; }
.wish-header strong { font-family: var(--font-script); font-size: 1.8rem; color: var(--sepia); }
.wish-header span { font-size: 0.7rem; opacity: 0.4; }
.wish-ornament { position: absolute; bottom: 1rem; right: 1rem; color: var(--sepia-light); opacity: 0.3; }

/* --- Footer --- */
.rustic-footer { padding: 12rem 2rem; text-align: center; }
.footer-inner .quote { font-family: var(--font-script); font-size: 2.2rem; margin-bottom: 4rem; color: var(--muted); }
.names { font-family: var(--font-script); font-size: 4rem; color: var(--sepia); margin-bottom: 4rem; }
.copy { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.3rem; opacity: 0.3; }

/* --- Animations --- */
.animate-reveal { opacity: 0; transform: translateY(40px); }

/* --- Responsive --- */
@media (max-width: 992px) {
    .event-cards, .rsvp-layout { grid-template-columns: 1fr; }
}

/* ── Responsive Fix ── */
@media (max-width: 600px) {
  /* Countdown */
  .countdown-vintage {
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 3rem;
  }
  .time-item {
    flex: 1 1 calc(50% - 0.8rem);
    min-width: 60px;
  }
  .time-item span {
    font-size: clamp(1.8rem, 8vw, 2rem) !important;
  }

  /* Event cards */
  .event-cards {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .event-card {
    padding: 3rem 1.5rem;
  }

  /* RSVP layout */
  .rsvp-layout {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .rustic-form {
    padding: 2rem;
  }

  /* Footer */
  .rustic-footer {
    padding: 5rem 1.5rem;
  }
  .footer-inner .quote {
    font-size: clamp(1.2rem, 5vw, 2.2rem);
    word-break: break-word;
    overflow-wrap: break-word;
  }
  .names {
    font-size: clamp(2rem, 8vw, 4rem);
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* Couple */
  .couple-card {
    min-width: unset;
    width: 100%;
  }

  /* Section padding */
  section {
    padding: 4rem 1.5rem;
  }
}
