/* ===== Root Variables ===== */
:root {
    --bg: #F8F6F2;
    --surface: #FFFFFF;
    --text: #4B4B4B;
    --text-muted: #6B6B6B;
    --heading: #3F3F3F;
    --accent: #5B6770;
    --accent-hover: #4A555D;
    --gold: #B08A5A;
    --border: rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 14px 34px rgba(0, 0, 0, 0.1);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-script: 'Great Vibes', 'Dancing Script', cursive;
    --font-classic: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --header-h: 64px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-h);
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
}

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

/* ===== Header ===== */
.header {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 50;
    background: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    height: var(--header-h);
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.nav {
    display: none;
    flex: 1;
    gap: 32px;
    font-size: 14px;
    font-weight: 500;
}

.nav a {
    transition: color 0.2s ease;
}

.nav a:hover {
    color: #000;
}

.nav-right {
    justify-content: flex-end;
}

.logo {
    font-family: var(--font-serif);
    font-size: 26px;
    letter-spacing: -0.02em;
    color: var(--heading);
}

.hamburger {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 5px;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--heading);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 24px 20px;
    background: var(--surface);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 15px;
    font-weight: 500;
}

.mobile-menu[hidden] {
    display: none;
}

.mobile-menu a {
    padding: 6px 0;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 28px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.btn-light {
    background: #fff;
    color: #222;
}

.btn-light:hover {
    background: #F1EEE8;
}

.btn-outline-light {
    border: 1px solid rgba(255, 255, 255, 0.85);
    color: #fff;
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ===== Hero ===== */
.hero {
    position: relative;
    height: 380px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    /* Put your own photo at assets/images/hero.jpg; the gradient shows until then */
    background:
        url('../assets/images/hero.jpg') center / cover no-repeat,
        linear-gradient(160deg, #8E8A7E 0%, #5F6A5C 45%, #3E463D 100%);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
}

.hero-content {
    position: relative;
    max-width: 900px;
    color: #fff;
}

.hero-title {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 24px;
    line-height: 1.25;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 32px;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
}

/* ===== Section headings ===== */
.section-head {
    text-align: center;
    margin-bottom: 56px;
}

.section-title {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 30px;
    line-height: 1.2;
    letter-spacing: -0.025em;
    color: var(--heading);
    margin-bottom: 20px;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 15px;
}

/* ===== Templates ===== */
.templates {
    max-width: 1280px;
    margin: 0 auto;
    padding: 80px 16px;
}

.template-group {
    margin-bottom: 80px;
}

.template-group:last-child {
    margin-bottom: 0;
}

.group-title {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 24px;
    color: var(--heading);
    letter-spacing: -0.02em;
}

.group-desc {
    color: var(--text-muted);
    font-size: 15px;
    margin-top: 4px;
}

.group-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 20px 0 32px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    font-size: 13px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chip:hover,
.chip.active {
    border-color: rgba(0, 0, 0, 0.25);
    box-shadow: var(--shadow-sm);
}

.chip-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

.group-count {
    font-size: 13px;
    color: #9A9A9A;
}

.carousel {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 4px 12px;
    margin: 0 -4px;
}

.carousel::-webkit-scrollbar {
    display: none;
}

.carousel-progress {
    height: 4px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 4px;
    margin-top: 8px;
    overflow: hidden;
}

.carousel-progress span {
    display: block;
    height: 100%;
    width: 30%;
    background: var(--gold);
    border-radius: 4px;
    transition: transform 0.1s linear;
}

/* Product card */
.product-card {
    flex: 0 0 240px;
    scroll-snap-align: start;
    background: var(--surface);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s ease, outline-color 0.3s ease;
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.product-card:hover {
    box-shadow: var(--shadow-lg);
}

.product-card.highlight {
    outline-color: var(--gold);
}

.product-media {
    aspect-ratio: 4 / 5;
    overflow: hidden;
}

.product-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.product-color {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.product-name {
    font-family: var(--font-serif);
    font-size: 17px;
    color: var(--heading);
    margin-bottom: 8px;
}

.btn-demo {
    margin-top: auto;
    width: 100%;
    padding: 10px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: background 0.2s ease;
}

.btn-demo:hover {
    background: var(--accent-hover);
}

/* ===== Invitation preview (drawn envelope, js/envelope.js) ===== */
.product-media {
    container-type: inline-size;
}

.invite-preview {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 13cqw 7cqw 12cqw;
    text-align: center;
    transition: transform 0.5s ease;
}

.product-card:hover .invite-preview {
    transform: scale(1.04);
}

/* Text tone follows the envelope colour (--tone is set per card). */
.ip-eyebrow {
    font-family: var(--font-classic);
    font-size: 3.7cqw;
    font-weight: 500;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--tone) 70%, #4a4a4a);
}

.ip-guest {
    font-family: var(--font-script);
    font-size: 9.5cqw;
    line-height: 1.25;
    color: #2f2f2f;
    margin-top: 2.5cqw;
}

.env-art-wrap {
    position: relative;
    width: 78%;
}

.env-art {
    position: relative;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 3 / 2;
    filter: drop-shadow(0 7cqw 6cqw rgba(40, 40, 60, 0.16)) drop-shadow(0 1cqw 1.2cqw rgba(0, 0, 0, 0.1));
}

.env-layer {
    position: absolute;
    inset: 0;
}

.env-layer svg,
.env-seal-layer svg {
    display: block;
    width: 100%;
    height: 100%;
}

.env-flap-layer {
    bottom: auto;
    height: 100%;
}

.env-seal-layer {
    position: absolute;
    left: 50%;
    top: 61%;
    width: 29%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
}

.tap-hand {
    position: absolute;
    left: 57%;
    top: 64%;
    width: 11%;
    color: #fff;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
    animation: tap-hint 1.8s ease-in-out infinite;
}

.ip-names {
    font-family: var(--font-classic);
    font-size: 4.6cqw;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #2f2f2f;
}

.ip-names em {
    font-family: var(--font-classic);
    font-style: italic;
    font-weight: 500;
    text-transform: none;
    color: color-mix(in srgb, var(--tone) 75%, #4a4a4a);
    font-size: 5.6cqw;
    margin: 0 2.4cqw;
}

.ip-date {
    font-family: var(--font-classic);
    font-size: 4.2cqw;
    font-weight: 500;
    letter-spacing: 0.16em;
    color: #3d3d3d;
    margin-top: 1.8cqw;
}

@keyframes tap-hint {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.9; }
    50% { transform: translate(-6%, -8%) scale(0.92); opacity: 1; }
}

/* ===== Contact ===== */
.contact {
    background: var(--surface);
    padding: 80px 16px;
    text-align: center;
}

.contact-text {
    max-width: 640px;
    margin: 0 auto 40px;
    line-height: 1.75;
}

.contact-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 24px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 999px;
    font-size: 15px;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.pill-icon {
    width: 18px;
    height: 18px;
}

.zalo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #0068FF;
    border-radius: 6px;
    color: #0068FF;
    font-size: 6px;
    font-weight: 700;
    transition: inherit;
}

.pill-zalo:hover {
    background: #22C55E;
    border-color: #22C55E;
    color: #fff;
}

.pill-zalo:hover .zalo-icon {
    border-color: #fff;
    color: #fff;
}

.pill-tiktok:hover {
    background: #000;
    border-color: #000;
    color: #fff;
}

/* ===== Features ===== */
.features {
    max-width: 1280px;
    margin: 0 auto;
    padding: 80px 16px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.feature-card {
    background: var(--surface);
    border-radius: 24px;
    padding: 24px 20px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.feature-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.feature-icon {
    font-size: 26px;
    margin-bottom: 18px;
}

.feature-card h4 {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 19px;
    line-height: 1.3;
    color: var(--heading);
    margin-bottom: 10px;
}

.feature-card p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ===== About ===== */
.about {
    background: var(--surface);
    padding: 80px 16px 64px;
    text-align: center;
}

.eyebrow {
    font-size: 11px;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: #9A9A9A;
    margin-bottom: 20px;
}

.about-title {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 28px;
}

.about-text {
    max-width: 720px;
    margin: 0 auto;
    line-height: 1.75;
}

.values {
    background: var(--surface);
    padding: 0 16px 80px;
}

.values-grid {
    max-width: 1024px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.value-card {
    background: var(--bg);
    border-radius: 24px;
    padding: 32px 24px;
    text-align: center;
}

.value-card h4 {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: 24px;
    color: var(--heading);
    margin-bottom: 12px;
}

.value-card p {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 240px;
    margin: 0 auto;
}

/* ===== Footer ===== */
.footer {
    background: var(--accent);
    color: #fff;
    text-align: center;
    padding: 32px 16px calc(32px + env(safe-area-inset-bottom));
    font-size: 13px;
}

/* ===== Reveal on scroll ===== */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: none;
}

/* ===== Small tablets / large phones (≥640px) ===== */
@media (min-width: 640px) {
    .hero-title {
        font-size: 30px;
    }

    .section-title {
        font-size: 34px;
    }

    .product-card {
        flex-basis: 260px;
    }

    .features-grid {
        gap: 20px;
    }

    .values-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== Tablets / iPad portrait (≥768px) ===== */
@media (min-width: 768px) {
    :root {
        --header-h: 84px;
    }

    .header-inner {
        padding: 0 24px;
    }

    .nav {
        display: flex;
    }

    .hamburger,
    .mobile-menu {
        display: none !important;
    }

    .logo {
        font-size: 28px;
        padding: 0 24px;
    }

    .hero {
        height: 520px;
    }

    .hero-title {
        font-size: 52px;
        line-height: 1.12;
        margin-bottom: 24px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .templates,
    .features {
        padding: 112px 24px;
    }

    .contact,
    .about {
        padding-left: 24px;
        padding-right: 24px;
    }

    .contact {
        padding-top: 112px;
        padding-bottom: 112px;
    }

    .about {
        padding-top: 128px;
    }

    .section-title {
        font-size: 36px;
    }

    .group-title {
        font-size: 28px;
    }

    .features-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 24px;
    }

    .feature-card {
        padding: 28px 24px;
    }

    .feature-card h4 {
        font-size: 21px;
    }

    .values {
        padding: 0 24px 80px;
    }

    .value-card h4 {
        font-size: 26px;
    }
}

/* ===== Laptops / iPad landscape (≥1024px) ===== */
@media (min-width: 1024px) {
    .hero-title {
        font-size: 60px;
    }

    .product-card {
        flex-basis: 280px;
    }

    .features-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .value-card {
        padding: 40px 32px;
    }
}

/* ===== Touch devices: no hover lift ===== */
@media (hover: none) {
    .product-card:hover .invite-preview,
    .feature-card:hover {
        transform: none;
    }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
    .tap-hand {
        animation: none;
    }

    html {
        scroll-behavior: auto;
    }

    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
