/* ==============================
   Reset & Base
   ============================== */

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.7;
    color: #3a3330;
    background-color: #faf8f5;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 2rem;
}

h1, h2, h3 {
    font-family: 'Playfair Display', Georgia, serif;
    line-height: 1.25;
}

a {
    color: #7a4a2a;
}

/* Section labels */
.section-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: #a0876e;
    margin-bottom: 0.5rem;
    text-align: center;
}

/* ==============================
   Header
   ============================== */

.site-header {
    background: linear-gradient(135deg, #2a1f14 0%, #3e2e1c 50%, #4a3525 100%);
    color: #f5f0e8;
    padding: 2.5rem 0;
    text-align: center;
    border-bottom: 3px solid #8b6914;
}

.site-label {
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: #c9a84c;
    margin-bottom: 0.6rem;
}

.site-title {
    font-size: 2.6rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    background: linear-gradient(to bottom, #f5edd4, #d4bc7c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.site-tagline {
    margin-top: 0.5rem;
    font-size: 1.05rem;
    color: #c4b89e;
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
}

/* ==============================
   Hero
   ============================== */

.hero {
    padding: 1rem 0 4rem;
    text-align: center;
    position: relative;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(139, 105, 20, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(139, 105, 20, 0.06) 0%, transparent 50%),
        #faf8f5;
    overflow: hidden;
}

.hero-badge {
    display: inline-block;
    background: linear-gradient(135deg, #3e2e1c, #5a3f24);
    color: #e8d9a8;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    padding: 0.45rem 1.3rem;
    border-radius: 100px;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.hero h2 {
    font-size: 2.6rem;
    color: #2a1f14;
    margin-bottom: 1.2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero h2 em {
    color: #7a4a2a;
    font-style: italic;
}

.hero-description {
    max-width: 580px;
    margin: 0 auto 2rem;
    font-size: 1.1rem;
    color: #6b5e52;
    line-height: 1.8;
}

.btn-hero {
    display: inline-block;
    background: linear-gradient(135deg, #7a4a2a 0%, #5a3219 100%);
    color: #fff;
    text-decoration: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 500;
    border-radius: 6px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(90, 50, 25, 0.25);
}

.btn-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(90, 50, 25, 0.35);
    color: #fff;
}

.hero-ornament {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background:
        linear-gradient(135deg, #f0ece4 25%, transparent 25%) -50px 0,
        linear-gradient(225deg, #f0ece4 25%, transparent 25%) -50px 0,
        linear-gradient(315deg, #f0ece4 25%, transparent 25%),
        linear-gradient(45deg, #f0ece4 25%, transparent 25%);
    background-size: 100px 50px;
    background-color: transparent;
    opacity: 0;
}

/* ==============================
   Sample
   ============================== */

.sample {
    padding: 3rem 0;
    background-color: #faf8f5;
}

.sample-box {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #e6ddd0;
    border-radius: 12px;
    padding: 2rem 2.5rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 2px 12px rgba(42, 31, 20, 0.06);
}

.sample-text {
    flex: 1;
}

.sample-text h2 {
    font-size: 1.3rem;
    color: #2a1f14;
    margin-bottom: 0.3rem;
}

.sample-text p {
    font-size: 0.92rem;
    color: #7a7068;
    line-height: 1.5;
}

.btn-sample {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    background: #fff;
    color: #7a4a2a;
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    border: 2px solid #7a4a2a;
    border-radius: 8px;
    transition: background-color 0.2s, color 0.2s;
}

.btn-sample:hover {
    background: #7a4a2a;
    color: #fff;
}

.btn-sample svg {
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .sample-box {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
        gap: 1rem;
    }
}

/* ==============================
   Features
   ============================== */

.features {
    padding: 4.5rem 0;
    background-color: #f0ece4;
}

.features h2 {
    text-align: center;
    font-size: 2rem;
    color: #2a1f14;
    margin-bottom: 3rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.feature-card {
    background: #fff;
    border: 1px solid #e6ddd0;
    border-radius: 10px;
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
    transition: transform 0.25s, box-shadow 0.25s;
    position: relative;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(42, 31, 20, 0.1);
}

.feature-icon-wrap {
    width: 52px;
    height: 52px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #f5f0e6, #ede4d4);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon {
    width: 26px;
    height: 26px;
    color: #7a4a2a;
}

.feature-card h3 {
    font-size: 1.15rem;
    color: #2a1f14;
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.92rem;
    color: #7a7068;
    line-height: 1.6;
    margin-bottom: 0.8rem;
}

.feature-count {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #a0876e;
    background: #f5f0e6;
    padding: 0.25rem 0.7rem;
    border-radius: 100px;
}

/* ==============================
   Details
   ============================== */

.details {
    padding: 5rem 0;
}

.details-inner {
    display: flex;
    align-items: center;
    gap: 4rem;
}

.details-text {
    flex: 1;
}

.details-text .section-label {
    text-align: left;
}

.details-text h2 {
    font-size: 2rem;
    color: #2a1f14;
    margin-bottom: 1.5rem;
}

.details-list {
    list-style: none;
    padding: 0;
}

.details-list li {
    padding: 0.65rem 0;
    padding-left: 2rem;
    position: relative;
    color: #5a4e44;
    font-size: 1rem;
    border-bottom: 1px solid #ede8e0;
}

.details-list li:last-child {
    border-bottom: none;
}

.details-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #7a4a2a, #a06030);
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 12px;
}

.details-visual {
    flex: 0 0 280px;
    height: 340px;
    position: relative;
}

.stack-card {
    position: absolute;
    border-radius: 8px;
    border: 1px solid #e0d8cc;
}

.stack-1 {
    width: 200px;
    height: 260px;
    background: linear-gradient(145deg, #f5f0e6 0%, #ebe2d2 100%);
    bottom: 0;
    left: 0;
    transform: rotate(-6deg);
    box-shadow: 0 8px 25px rgba(42, 31, 20, 0.1);
    z-index: 1;
}

.stack-2 {
    width: 200px;
    height: 260px;
    background: linear-gradient(145deg, #fff 0%, #f5f0e6 100%);
    bottom: 20px;
    left: 30px;
    transform: rotate(-2deg);
    box-shadow: 0 8px 25px rgba(42, 31, 20, 0.12);
    z-index: 2;
}

.stack-3 {
    width: 200px;
    height: 260px;
    background: linear-gradient(145deg, #fff 0%, #faf8f2 100%);
    bottom: 40px;
    left: 60px;
    transform: rotate(2deg);
    box-shadow: 0 10px 30px rgba(42, 31, 20, 0.14);
    z-index: 3;
}

.stack-3::before {
    content: "";
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    height: 6px;
    background: #e0d8cc;
    border-radius: 3px;
}

.stack-3::after {
    content: "";
    position: absolute;
    top: 36px;
    left: 20px;
    width: 60%;
    height: 4px;
    background: #ebe4d6;
    border-radius: 2px;
}

/* ==============================
   Purchase
   ============================== */

.purchase {
    padding: 5rem 0;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(139, 105, 20, 0.08) 0%, transparent 60%),
        #f0ece4;
}

.purchase-box {
    max-width: 460px;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    padding: 3rem 2.5rem;
    text-align: center;
    box-shadow:
        0 1px 3px rgba(42, 31, 20, 0.06),
        0 8px 30px rgba(42, 31, 20, 0.1);
    border: 1px solid #e6ddd0;
    position: relative;
}

.purchase-label {
    text-transform: uppercase;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: #a0876e;
    margin-bottom: 0.4rem;
}

.purchase-box h2 {
    font-size: 1.6rem;
    color: #2a1f14;
    margin-bottom: 1.2rem;
}

.price-wrap {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin-bottom: 0.3rem;
}

.price-dollar {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #7a4a2a;
    margin-top: 1.6rem;
    margin-left: 0.3rem;
}

.price-amount {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 4rem;
    font-weight: 700;
    color: #7a4a2a;
    line-height: 1;
}

.price-note {
    font-size: 0.9rem;
    color: #8a7d6f;
    margin-bottom: 1.8rem;
}

.btn-buy {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #7a4a2a 0%, #5a3219 100%);
    color: #fff;
    border: none;
    padding: 1.05rem 2rem;
    font-size: 1.15rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(90, 50, 25, 0.3);
    letter-spacing: 0.02em;
}

.btn-buy:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(90, 50, 25, 0.4);
}

.btn-buy:disabled {
    background: #b8a490;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.trust-row {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: #9a8d7f;
}

.trust-item svg {
    flex-shrink: 0;
    color: #a0876e;
}

/* ==============================
   FAQ
   ============================== */

.faq {
    padding: 4.5rem 0;
}

.faq h2 {
    text-align: center;
    font-size: 2rem;
    color: #2a1f14;
    margin-bottom: 2.5rem;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: #fff;
    border: 1px solid #e6ddd0;
    border-radius: 10px;
    padding: 1.5rem;
}

.faq-item h3 {
    font-size: 1.05rem;
    color: #2a1f14;
    margin-bottom: 0.4rem;
}

.faq-item p {
    color: #7a7068;
    font-size: 0.92rem;
    line-height: 1.6;
}

/* ==============================
   Footer
   ============================== */

.site-footer {
    background: linear-gradient(135deg, #2a1f14 0%, #3e2e1c 100%);
    color: #b0a48e;
    text-align: center;
    padding: 2rem 0;
    font-size: 0.85rem;
    border-top: 3px solid #8b6914;
}

/* ==============================
   Success Page
   ============================== */

.success-page {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
    background:
        radial-gradient(ellipse at 50% 30%, rgba(139, 105, 20, 0.05) 0%, transparent 60%),
        #faf8f5;
}

.success-box {
    max-width: 520px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #e6ddd0;
    border-radius: 16px;
    padding: 3rem 2.5rem;
    text-align: center;
    box-shadow:
        0 1px 3px rgba(42, 31, 20, 0.06),
        0 8px 30px rgba(42, 31, 20, 0.1);
}

.success-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #f5f0e6, #ede4d4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b8f3c;
}

.success-icon.error-icon {
    color: #b04040;
}

.success-box h2 {
    font-size: 1.8rem;
    color: #2a1f14;
    margin-bottom: 1rem;
}

.success-box p {
    color: #6b5e52;
    margin-bottom: 1.2rem;
    line-height: 1.6;
}

.expiry-note {
    font-size: 0.85rem;
    color: #9a8d7f;
    margin-top: 1.5rem;
}

.btn-download {
    display: inline-block;
    background: linear-gradient(135deg, #7a4a2a 0%, #5a3219 100%);
    color: #fff;
    text-decoration: none;
    padding: 1rem 2.5rem;
    font-size: 1.15rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(90, 50, 25, 0.3);
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(90, 50, 25, 0.4);
    color: #fff;
}

.btn-back {
    display: inline-block;
    color: #7a4a2a;
    text-decoration: none;
    font-weight: 500;
    padding: 0.6rem 1.5rem;
    border: 2px solid #7a4a2a;
    border-radius: 8px;
    transition: background-color 0.2s, color 0.2s;
}

.btn-back:hover {
    background: #7a4a2a;
    color: #fff;
}

.error-message {
    color: #b04040;
    font-weight: 600;
}

/* ==============================
   Family Tree
   ============================== */

.tree-section {
    padding: 4.5rem 0 3rem;
    background: #f0ece4;
}

.tree-title {
    text-align: center;
    font-size: 2rem;
    color: #2a1f14;
    margin-bottom: 2.5rem;
}

.tree-scroll-wrapper {
    overflow-x: auto;
    padding-bottom: 1.5rem;
}

.family-tree {
    display: grid;
    grid-template-columns: repeat(8, 125px);
    column-gap: 16px;
    row-gap: 50px;
    position: relative;
    padding: 20px;
    width: 1152px;
    /* Centers on viewports wider than 1152px, 2rem left margin on narrow ones */
    margin: 0 max(2rem, calc(50% - 576px));
}

.tree-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 1152px;
    height: 870px;
    pointer-events: none;
    z-index: 0;
}

.tree-node {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
}

.tree-node img {
    display: block;
    width: 125px;
    height: 170px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 4px 16px rgba(42, 31, 20, 0.25);
}

/* Grid placement — gen 4 (great-grandparents, top row) */
.tree-node[data-id="8"]  { grid-column: 1;     grid-row: 1; }
.tree-node[data-id="9"]  { grid-column: 2;     grid-row: 1; }
.tree-node[data-id="10"] { grid-column: 3;     grid-row: 1; }
.tree-node[data-id="11"] { grid-column: 4;     grid-row: 1; }
.tree-node[data-id="12"] { grid-column: 5;     grid-row: 1; }
.tree-node[data-id="13"] { grid-column: 6;     grid-row: 1; }
.tree-node[data-id="14"] { grid-column: 7;     grid-row: 1; }
.tree-node[data-id="15"] { grid-column: 8;     grid-row: 1; }

/* Gen 3 (grandparents) — each spans 2 columns */
.tree-node[data-id="4"]  { grid-column: 1 / 3; grid-row: 2; }
.tree-node[data-id="5"]  { grid-column: 3 / 5; grid-row: 2; }
.tree-node[data-id="6"]  { grid-column: 5 / 7; grid-row: 2; }
.tree-node[data-id="7"]  { grid-column: 7 / 9; grid-row: 2; }

/* Gen 2 (parents) — each spans 4 columns */
.tree-node[data-id="2"]  { grid-column: 1 / 5; grid-row: 3; }
.tree-node[data-id="3"]  { grid-column: 5 / 9; grid-row: 3; }

/* Gen 1 (subject) — spans all 8 columns */
.tree-node[data-id="1"]  { grid-column: 1 / 9; grid-row: 4; }

/* ==============================
   Image Parade Animation
   ============================== */

.parade-stage {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    pointer-events: none;
}

/* Outer wrap handles horizontal travel */
.parade-wrap {
    position: absolute;
    transform: translateX(-130vw);
    will-change: transform;
}

/* Inner card — real image */
.parade-card {
    display: block;
    width: 250px;
    height: 320px;
    border-radius: 6px;
    box-shadow: 0 8px 28px rgba(42, 31, 20, 0.45);
    object-fit: cover;
}

@keyframes cardFlyIn {
    from { transform: translateX(-130vw); }
    to   { transform: translateX(0); }
}

.parade-wrap.fly {
    animation: cardFlyIn var(--dur, 700ms) var(--ease, cubic-bezier(0.25, 0.46, 0.45, 0.94)) forwards;
}

/* ==============================
   Responsive
   ============================== */

@media (max-width: 900px) {
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .details-inner {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }

    .details-text .section-label {
        text-align: center;
    }

    .details-text h2 {
        text-align: center;
    }

    .details-visual {
        height: 280px;
        flex: 0 0 auto;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 1.2rem;
    }

    .site-title {
        font-size: 1.8rem;
    }

    .hero {
        padding: 3.5rem 0 3rem;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .features h2,
    .details-text h2,
    .faq h2 {
        font-size: 1.6rem;
    }

    .price-amount {
        font-size: 3rem;
    }

    .purchase-box {
        padding: 2rem 1.5rem;
    }

    .faq-grid {
        grid-template-columns: 1fr;
    }

    .trust-row {
        flex-direction: column;
        align-items: center;
        gap: 0.6rem;
    }

    .details-visual {
        display: none;
    }
}
