:root {
    --bg: #fbf7ef;
    --paper: #fffdf8;
    --paper-2: #f5ead8;
    --text: #2d261c;
    --muted: #746756;
    --gold: #b88635;
    --gold-soft: #d8b56d;
    --line: rgba(184,134,53,.32);
    --shadow: 0 20px 70px rgba(72, 51, 22, .14);
    --radius: 26px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: Georgia, 'Times New Roman', serif;
    background:
        radial-gradient(circle at 20% 10%, rgba(216,181,109,.18), transparent 28rem),
        radial-gradient(circle at 90% 30%, rgba(184,134,53,.10), transparent 22rem),
        var(--bg);
    color: var(--text);
    line-height: 1.65;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
.container { width: min(1120px, 92vw); margin: 0 auto; }
.narrow { width: min(820px, 90vw); }

.nav {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: min(1120px, 92vw);
    z-index: 20;
    background: rgba(255,253,248,.88);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(184,134,53,.18);
    border-radius: 999px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px 10px 20px;
    box-shadow: 0 12px 40px rgba(0,0,0,.08);
}
.nav__brand {
    text-decoration: none;
    font-weight: 700;
    color: #6f4b12;
    letter-spacing: .04em;
}
.nav__links { display: flex; gap: 6px; }
.nav__links a {
    text-decoration: none;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 999px;
    color: var(--muted);
}
.nav__links a:hover { background: rgba(184,134,53,.12); color: var(--text); }
.nav__toggle {
    display: none;
    border: 0;
    background: transparent;
    font-size: 24px;
    color: var(--gold);
}

.hero {
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(120deg, rgba(255,253,248,.96), rgba(245,234,216,.86)),
        url("../img/papa-principal.webp") center/cover;
}
.hero__overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(251,247,239,.98) 0%, rgba(251,247,239,.91) 45%, rgba(251,247,239,.65) 100%);
}
.hero__content {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 46px;
    align-items: center;
    padding-top: 86px;
    padding-bottom: 54px;
}
.eyebrow, .section__label {
    color: #8a5f14;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    font-size: 13px;
    margin: 0 0 10px;
}
.hero h1 {
    font-size: clamp(42px, 7vw, 76px);
    line-height: 1.03;
    margin: 0;
    letter-spacing: -.035em;
}
.dates {
    color: var(--muted);
    font-size: 19px;
    margin: 16px 0 0;
}
.hero__phrase {
    font-size: clamp(20px, 2.6vw, 30px);
    line-height: 1.38;
    max-width: 720px;
    margin: 24px 0 12px;
}
.hero__subphrase {
    font-size: 18px;
    max-width: 650px;
    color: var(--muted);
    margin: 0 0 28px;
}
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 999px;
    min-height: 48px;
    padding: 12px 22px;
    font-family: Arial, sans-serif;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
}
.btn--primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-soft));
    color: #fff;
    box-shadow: 0 12px 30px rgba(184,134,53,.28);
}
.btn--ghost {
    border-color: var(--line);
    color: #6f4b12;
    background: rgba(255,255,255,.55);
}
.hero__portrait {
    justify-self: center;
    width: min(450px, 100%);
    padding: 14px;
    background: rgba(255,253,248,.75);
    border: 1px solid rgba(184,134,53,.22);
    border-radius: 34px;
    box-shadow: var(--shadow);
}
.hero__portrait img {
    border-radius: 24px;
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
}

.section { padding: 86px 0; }
.section-head {
    text-align: center;
    width: min(840px, 92vw);
    margin: 0 auto 38px;
}
.section h2 {
    font-size: clamp(32px, 4.2vw, 52px);
    line-height: 1.08;
    letter-spacing: -.025em;
    margin: 0 0 16px;
}
.section p { font-size: 18px; color: var(--muted); }
.story { background: linear-gradient(180deg, rgba(255,253,248,.78), rgba(245,234,216,.46)); }

.chapter, .nissan-feature {
    background: rgba(255,253,248,.9);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 14px 50px rgba(72,51,22,.08);
    padding: clamp(24px, 4vw, 42px);
    margin: 22px auto;
}
.chapter {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 26px;
    width: min(980px, 100%);
}
.chapter--warm {
    background:
        linear-gradient(135deg, rgba(255,253,248,.95), rgba(245,234,216,.72));
}
.chapter--wide { width: 100%; }
.chapter--legacy { background: rgba(255,253,248,.96); }
.chapter__num {
    font-family: Arial, sans-serif;
    font-weight: 800;
    color: #8a5f14;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-size: 13px;
}
.chapter h3, .nissan-feature h3 {
    margin: 0 0 14px;
    font-size: clamp(28px, 3.4vw, 42px);
    line-height: 1.08;
}
.chapter p, .nissan-feature p { margin: 0 0 14px; }
.chapter strong { color: #6f4b12; }

.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 16px;
    margin-top: 22px;
}
.vehicle-card {
    background: #fff;
    border: 1px solid rgba(184,134,53,.22);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(72,51,22,.06);
}
.vehicle-card img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
}
.vehicle-card div, .vehicle-card--text {
    padding: 18px;
}
.vehicle-card span {
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-family: Arial, sans-serif;
    font-weight: 800;
    color: #8a5f14;
    background: rgba(184,134,53,.12);
    margin-bottom: 10px;
}
.vehicle-card h4 {
    font-size: 24px;
    margin: 0 0 8px;
}
.vehicle-card p { font-size: 16px; margin: 0; }

.nissan-feature {
    width: 100%;
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 30px;
    align-items: center;
    background: linear-gradient(135deg, rgba(255,253,248,.98), rgba(245,234,216,.8));
}
.nissan-feature__image img {
    width: 100%;
    border-radius: 22px;
    box-shadow: 0 14px 50px rgba(72,51,22,.12);
}
.legacy-list {
    display: grid;
    gap: 10px;
    padding: 0;
    margin: 18px 0 22px;
    list-style: none;
}
.legacy-list li {
    background: #fff;
    border: 1px solid rgba(184,134,53,.18);
    border-radius: 16px;
    padding: 12px 14px;
    color: #4d3f2f;
}

.video-frame {
    position: relative;
    width: min(920px, 100%);
    margin: 0 auto;
    aspect-ratio: 16/9;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    background: #1d1a15;
}
.video-frame iframe { width: 100%; height: 100%; border: 0; }

.gallery-section {
    background: rgba(255,253,248,.72);
}
.gallery-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin: -10px 0 28px;
}
.filter-btn {
    border: 1px solid var(--line);
    background: rgba(255,255,255,.72);
    color: #6f4b12;
    border-radius: 999px;
    padding: 10px 14px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-weight: 700;
}
.filter-btn.active, .filter-btn:hover {
    background: linear-gradient(135deg, var(--gold), var(--gold-soft));
    color: #fff;
}
.gallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 12px;
}
.gallery__item {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid var(--line);
    box-shadow: 0 10px 30px rgba(72,51,22,.06);
    background: var(--paper);
    padding: 0;
    cursor: zoom-in;
}
.gallery__item[hidden] { display: none; }
.gallery__item img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    transition: transform .35s ease, filter .35s ease;
}
.gallery__item:hover img {
    transform: scale(1.05);
    filter: saturate(1.05);
}
.gallery__item span {
    position: absolute;
    left: 10px;
    bottom: 10px;
    background: rgba(45,38,28,.72);
    color: #fff;
    border-radius: 999px;
    padding: 6px 10px;
    font: 700 12px Arial, sans-serif;
}

.dedications-section {
    background: rgba(255,253,248,.7);
}
.dedications-grid {
    display: grid;
    grid-template-columns: .92fr 1.08fr;
    gap: 34px;
    align-items: start;
}
.memory-form, .memories {
    background: rgba(255,253,248,.92);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 14px 50px rgba(72,51,22,.08);
}
.memory-form label {
    display: block;
    font-family: Arial, sans-serif;
    font-weight: 700;
    color: #544637;
    margin: 14px 0;
}
.memory-form input,
.memory-form textarea {
    width: 100%;
    margin-top: 7px;
    border: 1px solid rgba(184,134,53,.28);
    border-radius: 14px;
    padding: 13px 14px;
    font: 16px Arial, sans-serif;
    color: var(--text);
    background: #fff;
    outline: none;
}
.memory-form input:focus,
.memory-form textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 4px rgba(184,134,53,.12);
}
.form-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}
.form-help, .form-message, .char-counter {
    display: block;
    font-family: Arial, sans-serif;
    color: var(--muted);
    margin: 8px 0 16px;
}
.form-message.success { color: #2f7d52; font-weight: 700; }
.form-message.error { color: #9f2b2b; font-weight: 700; }
.hp-field {
    position: absolute !important;
    left: -9999px !important;
    opacity: 0 !important;
}
.memories h3 {
    margin-top: 0;
    font-size: 28px;
}
.memory-list { display: grid; gap: 14px; }
.memory-card {
    background: #fff;
    border: 1px solid rgba(184,134,53,.18);
    border-radius: 18px;
    padding: 18px;
    animation: memoryIn .45s ease both;
}
@keyframes memoryIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}
.memory-card__name {
    font-weight: 800;
    color: #6f4b12;
    margin: 0 0 6px;
    font-family: Arial, sans-serif;
}
.memory-card__text {
    color: var(--text);
    font-size: 17px;
    margin: 0 0 10px;
}
.memory-card__date {
    color: var(--muted);
    font: 13px Arial, sans-serif;
}
.loading, .empty {
    color: var(--muted);
    font-style: italic;
}

.closing { text-align: center; }
.closing__quote {
    font-size: clamp(25px, 3vw, 38px) !important;
    line-height: 1.35;
    color: var(--text) !important;
}
.closing__thanks {
    color: #8a5f14 !important;
    font-weight: 700;
}
.footer {
    padding: 28px 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    text-align: center;
    font-family: Arial, sans-serif;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
}
.lightbox.open { display: block; }
.lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20,16,11,.86);
    backdrop-filter: blur(5px);
}
.lightbox__dialog {
    position: relative;
    width: min(1060px, 94vw);
    height: min(88vh, 820px);
    margin: 6vh auto;
    display: grid;
    place-items: center;
}
.lightbox figure {
    margin: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 12px;
}
.lightbox img {
    max-width: 100%;
    max-height: calc(88vh - 92px);
    margin: auto;
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(0,0,0,.4);
    background: #fff;
}
.lightbox figcaption {
    color: #fff;
    text-align: center;
    font-family: Arial, sans-serif;
}
.lightbox figcaption span {
    color: #f2d38c;
    font-weight: 700;
    display: block;
    margin-bottom: 2px;
}
.lightbox figcaption strong {
    display: block;
    font-size: 18px;
}
.lightbox figcaption small {
    display: block;
    opacity: .75;
    margin-top: 4px;
}
.lightbox__close,
.lightbox__nav {
    position: absolute;
    border: 0;
    color: #fff;
    background: rgba(255,255,255,.14);
    cursor: pointer;
    border-radius: 999px;
    z-index: 2;
}
.lightbox__close {
    right: 0;
    top: -42px;
    width: 42px;
    height: 42px;
    font-size: 30px;
}
.lightbox__nav {
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    font-size: 42px;
}
.lightbox__nav--prev { left: -10px; }
.lightbox__nav--next { right: -10px; }
.lightbox__close:hover,
.lightbox__nav:hover {
    background: rgba(184,134,53,.92);
}

.success-overlay {
    position: fixed;
    inset: 0;
    display: none;
    place-items: center;
    z-index: 100;
    background: rgba(45,38,28,.42);
    backdrop-filter: blur(3px);
}
.success-overlay.show { display: grid; }
.success-card {
    background: #fffdf8;
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 30px;
    width: min(92vw, 390px);
    text-align: center;
    box-shadow: 0 30px 80px rgba(0,0,0,.22);
    animation: successPop .42s ease both;
}
.success-icon {
    width: 70px;
    height: 70px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    margin: 0 auto 14px;
    background: linear-gradient(135deg, var(--gold), var(--gold-soft));
    color: #fff;
    font: 800 38px Arial, sans-serif;
}
.success-card h3 { margin: 0 0 8px; font-size: 28px; }
.success-card p { margin: 0; color: var(--muted); font-size: 16px; }
@keyframes successPop {
    from { opacity: 0; transform: translateY(18px) scale(.94); }
    to { opacity: 1; transform: none; }
}
.confetti-piece {
    position: fixed;
    top: -14px;
    z-index: 120;
    width: 9px;
    height: 14px;
    border-radius: 3px;
    pointer-events: none;
    animation: confettiFall var(--fall-duration, 1600ms) linear forwards;
}
@keyframes confettiFall {
    0% { transform: translate3d(0, -20px, 0) rotate(0deg); opacity: 1; }
    100% { transform: translate3d(var(--drift, 0px), 105vh, 0) rotate(720deg); opacity: 0; }
}

.reveal {
    opacity: 0;
    transform: translateY(18px);
    animation: reveal .75s ease forwards;
}
@keyframes reveal {
    to { opacity: 1; transform: none; }
}

@media (max-width: 940px) {
    .chapter, .nissan-feature { grid-template-columns: 1fr; }
    .vehicle-grid { grid-template-columns: 1fr; }
    .nissan-feature__image { order: 2; }
    .nissan-feature__text { order: 1; }
}
@media (max-width: 860px) {
    .nav { top: 10px; border-radius: 22px; align-items: flex-start; flex-wrap: wrap; }
    .nav__toggle { display: block; }
    .nav__links {
        display: none;
        width: 100%;
        flex-direction: column;
        padding: 10px 0 4px;
    }
    .nav.open .nav__links { display: flex; }
    .hero__content {
        grid-template-columns: 1fr;
        padding-top: 110px;
        text-align: center;
        gap: 28px;
    }
    .hero__actions { justify-content: center; }
    .hero__subphrase { margin-left: auto; margin-right: auto; }
    .hero__portrait { width: min(360px, 92vw); }
    .hero__overlay { background: linear-gradient(180deg, rgba(251,247,239,.98), rgba(251,247,239,.82)); }
    .section { padding: 66px 0; }
    .gallery { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .dedications-grid { grid-template-columns: 1fr; }
    .lightbox__nav--prev { left: 4px; }
    .lightbox__nav--next { right: 4px; }
    .lightbox__close { right: 4px; top: -48px; }
}
@media (max-width: 480px) {
    .container { width: min(94vw, 1120px); }
    .hero__phrase { font-size: 20px; }
    .btn { width: 100%; }
    .gallery { gap: 8px; }
    .memory-form, .memories, .chapter, .nissan-feature { padding: 20px; }
    .chapter h3, .nissan-feature h3 { font-size: 29px; }
    .form-row { align-items: flex-start; flex-direction: column; gap: 0; }
    .gallery-toolbar { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 6px; }
    .filter-btn { white-space: nowrap; }
}
