
:root {
    --background: #f8f6f1;
    --white: #ffffff;
    --text: #292820;
    --muted: #77756d;
    --gold: #ad8b55;
    --gold-light: #d8b66a;
    --border: #e9e4d9;
    --dark: #292820;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background: var(--background);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    line-height: 1.7;
    overflow-x: hidden;
}

/* NAVIGATION */

.navbar {
    height: 75px;
    padding: 0 8%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--background);
}

.logo {
    font-family: 'Playfair Display', serif;
    font-size: 25px;
    color: var(--gold);
    font-weight: 600;
}

.nav-link {
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--gold);
}

/* HERO SECTION */

.hero {
    min-height: 620px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 80px 20px;
    background:
        linear-gradient(rgba(30, 28, 23, 0.60), rgba(30, 28, 23, 0.72)),
        url('https://images.unsplash.com/photo-1470252649378-9c29740c9fa8?w=1800');
    background-position: center;
    background-size: cover;
    color: white;
}

.hero-content {
    max-width: 700px;
}

.grandpa-photo {
    width: 155px;
    height: 155px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--gold);
    padding: 5px;
    margin-bottom: 25px;
}

.eyebrow {
    color: var(--gold);
    letter-spacing: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 18px;
}

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(45px, 7vw, 76px);
    font-weight: 500;
    line-height: 1.15;
    margin-bottom: 25px;
}

.hero-title {
    color: #e4c99b;
    font-size: 14px;
    letter-spacing: 2px;
    margin-top: -12px;
    margin-bottom: 25px;
    text-transform: uppercase;
}

.life-dates {
    color: #e9e5dd;
    font-family: 'Playfair Display', serif;
    font-size: 16px;
    letter-spacing: 1.5px;
    margin-bottom: 25px;
}

.gold-line {
    height: 2px;
    width: 65px;
    background: var(--gold);
    margin: 0 auto 25px;
}

.hero-message {
    max-width: 440px;
    margin: 0 auto 35px;
    color: #e9e5dd;
    font-size: 16px;
}

/* BUTTONS */

.primary-button {
    display: inline-block;
    background: var(--gold);
    color: white;
    border: none;
    padding: 14px 28px;
    text-decoration: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s ease;
}

.primary-button:hover {
    background: #8f7040;
    transform: translateY(-2px);
}

.primary-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* INTRODUCTION */

.intro {
    max-width: 760px;
    margin: auto;
    padding: 110px 25px;
    text-align: center;
}

.intro h2,
.section-heading h2,
.submit-area h2 {
    font-family: 'Playfair Display', serif;
    font-size: 38px;
    font-weight: 500;
    margin-bottom: 20px;
}

.intro > p:last-child {
    color: var(--muted);
    font-size: 15px;
}

/* TRIBUTES SECTION */

.tributes-section {
    padding: 90px 8%;
    background: #fff;
}

.section-heading {
    text-align: center;
    margin-bottom: 50px;
}

.section-heading > p:last-child {
    color: var(--muted);
    font-size: 14px;
}

/* TRIBUTE CARDS */

.tribute-grid {
    max-width: 1100px;
    margin: 45px auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.tribute-card {
    position: relative;
    background: #292820;
    border: 1px solid rgba(173, 139, 85, 0.35);
    border-radius: 10px;
    padding: 32px 28px;
    text-align: left;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.tribute-card:hover {
    transform: translateY(-5px);
    border-color: var(--gold);
}

.tribute-card::before {
    content: "“";
    display: block;
    font-family: Georgia, serif;
    font-size: 65px;
    line-height: 1;
    color: var(--gold-light);
    opacity: 0.85;
}

.tribute-card h3 {
    color: var(--gold-light);
    font-family: 'Playfair Display', serif;
    font-size: 21px;
    font-weight: 500;
    margin: 15px 0;
}

.tribute-card p {
    color: #e4dfd3;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    line-height: 1.9;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* SUBMIT TRIBUTE AREA */

.submit-area {
    margin: 90px auto 0;
    max-width: 650px;
    padding: 50px 25px;
    text-align: center;
    background: var(--background);
}

.submit-area p {
    color: var(--muted);
    margin-bottom: 25px;
}

/* FOOTER */

footer {
    text-align: center;
    padding: 35px 15px;
    background: var(--dark);
    color: #d6d1c6;
    font-size: 12px;
}

footer p + p {
    color: #a7a195;
    margin-top: 5px;
}

/* TRIBUTE FORM */

.form-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.form-overlay.active {
    display: flex;
}

.tribute-form {
    background: #fffdf8;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px;
    border-radius: 8px;
    position: relative;
}

.tribute-form h2 {
    font-family: 'Playfair Display', serif;
    font-size: 30px;
    margin-bottom: 10px;
}

.tribute-form > p {
    color: var(--muted);
    margin-bottom: 25px;
}

.close-form {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: #777;
}

.tribute-form label {
    display: block;
    margin: 18px 0 8px;
    font-size: 14px;
    font-weight: 600;
}

.tribute-form input,
.tribute-form textarea {
    width: 100%;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    background: white;
}

.tribute-form textarea {
    resize: vertical;
}

.tribute-form input:focus,
.tribute-form textarea:focus {
    outline: 1px solid var(--gold);
    border-color: var(--gold);
}

.tribute-form .primary-button {
    margin-top: 25px;
    width: 100%;
}

#form-notice {
    margin-top: 15px;
    font-size: 13px;
}

/* SUCCESS ANIMATION */

.success-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(25, 23, 19, 0.96);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
    padding: 25px;
}

.success-overlay.show {
    opacity: 1;
    visibility: visible;
}

.success-content {
    text-align: center;
    max-width: 500px;
    transform: translateY(20px);
    transition: transform 0.8s ease;
}

.success-overlay.show .success-content {
    transform: translateY(0);
}

.success-heart {
    font-size: 65px;
    color: #c5a16b;
    margin-bottom: 25px;
    animation: heartGlow 1.8s ease-in-out infinite;
}

.success-content h2 {
    color: #f5ead8;
    font-family: 'Playfair Display', serif;
    font-size: 34px;
    margin: 20px 0;
}

.success-content > p {
    color: #c9c1b4;
    line-height: 1.8;
}

.success-gold-line {
    width: 65px;
    height: 2px;
    background: var(--gold);
    margin: 30px auto;
    animation: lineAppear 1.2s ease forwards;
}

.success-content .success-footer {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    color: #d6b987;
}

@keyframes heartGlow {
    0%, 100% {
        transform: scale(1);
        text-shadow: 0 0 10px var(--gold);
    }

    50% {
        transform: scale(1.15);
        text-shadow: 0 0 30px #d6b987;
    }
}

@keyframes lineAppear {
    from {
        width: 0;
    }

    to {
        width: 65px;
    }
}

/* MOBILE OPTIMIZATION */

@media (max-width: 600px) {

    .navbar {
        height: 65px;
        padding: 0 20px;
    }

    .logo {
        font-size: 22px;
    }

    .nav-link {
        font-size: 12px;
    }

    .hero {
        min-height: 570px;
        padding: 70px 22px;
        background-position: center;
    }

    .hero h1 {
        font-size: clamp(42px, 11vw, 58px);
    }

    .grandpa-photo {
        width: 130px;
        height: 130px;
        margin-bottom: 22px;
    }

    .hero-title {
        font-size: 12px;
    }

    .life-dates {
        font-size: 13px;
        letter-spacing: 1px;
    }

    .hero-message {
        font-size: 14px;
        max-width: 310px;
        line-height: 1.8;
    }

    .primary-button {
        padding: 15px 25px;
        font-size: 13px;
        min-height: 48px;
    }

    .intro {
        padding: 75px 25px;
    }

    .intro h2,
    .section-heading h2,
    .submit-area h2 {
        font-size: 30px;
        line-height: 1.3;
    }

    .intro > p:last-child {
        font-size: 14px;
        line-height: 1.9;
    }

    .tributes-section {
        padding: 70px 20px;
    }

    .section-heading {
        margin-bottom: 35px;
    }

    .section-heading > p:last-child {
        font-size: 13px;
        max-width: 300px;
        margin: auto;
    }

    .tribute-grid {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 0;
    }

    .tribute-card {
        padding: 28px 22px;
    }

    .submit-area {
        margin-top: 60px;
        padding: 40px 20px;
    }

    .tribute-form {
        padding: 30px 22px;
    }

    .success-content h2 {
        font-size: 27px;
    }

    footer {
        padding: 30px 18px;
        font-size: 11px;
    }
}

/* SMALL PHONES */

@media (max-width: 360px) {

    .nav-link {
        font-size: 11px;
    }

    .hero h1 {
        font-size: 39px;
    }

    .intro h2,
    .section-heading h2 {
        font-size: 27px;
    }
}
