/* ============================================
   style.css - whatsappwish.com
   DESIGN SYSTEM: "Digital Postcard"
   Grounded in real stationery — postcards, stamps, wax seals —
   because that's literally what this tool does: helps you send
   someone a message. Not another purple-gradient SaaS template.
   ============================================ */

:root {
    /* Postal palette */
    --ink: #3D3B36;
    /* warm charcoal grey — page background */
    --ink-deep: #29281F;
    /* darker grey — footer */
    --paper: #F6F0E2;
    /* card paper cream */
    --paper-soft: #FFFDF8;
    /* lighter paper variant */
    --stamp-red: #C0392B;
    /* postage stamp accent */
    --stamp-red-deep: #9C2E20;
    --gold-seal: #C9A227;
    /* wax seal gold */
    --text-ink: #3D3B36;
    /* dark text on paper */
    --text-muted: #6B6558;
    /* muted warm grey on paper */
    --text-on-navy: #F6F0E2;
    /* light text on dark background */
    --line: rgba(61, 59, 54, 0.15);
}

/* Vintage mode — true black-and-white, like an old photograph.
   Stays distinct from Color mode because red/gold desaturate too here,
   while Color mode keeps them as real color accents against the grey. */
:root[data-theme="vintage"] {
    --ink: #242321;
    --ink-deep: #161514;
    --paper: #E9E4D6;
    --paper-soft: #F5F2E9;
    --stamp-red: #545048;
    --stamp-red-deep: #3A3732;
    --gold-seal: #8C877D;
    --text-ink: #242321;
    --text-muted: #6E6A62;
    --text-on-navy: #E9E4D6;
    --line: rgba(36, 35, 33, 0.15);
}

/* Smooth cross-fade when switching modes */
body,
.generator-box,
.wish-box,
.related-grid a,
button,
.btn,
.site-header,
.site-footer,
input[type="text"],
select {
    transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 0;
    background: var(--ink);
    color: var(--text-on-navy);
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

h1,
h2,
h3 {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* ---- Header ---- */
.site-header {
    background: var(--ink);
    border-bottom: 1px solid rgba(246, 240, 226, 0.15);
    padding: 20px 0;
    position: relative;
    overflow: hidden;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.logo {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 26px;
    font-weight: 700;
    font-style: italic;
    color: var(--paper);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo::before {
    content: '✉';
    font-style: normal;
    font-size: 20px;
    color: var(--stamp-red);
}

.site-header nav a {
    margin-left: 20px;
    color: var(--paper);
    text-decoration: none;
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid transparent;
    padding-bottom: 3px;
}

.site-header nav a:hover {
    border-bottom-color: var(--stamp-red);
}

.theme-toggle {
    background: transparent;
    color: var(--paper);
    border: 1px solid rgba(246, 240, 226, 0.4);
    box-shadow: none;
    padding: 6px 10px;
    font-size: 15px;
    border-radius: 50%;
    line-height: 1;
    margin-left: 16px;
}

.theme-toggle:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--stamp-red);
}

/* ---- Main content ---- */
.main-content {
    padding: 48px 20px 70px;
}

h1 {
    color: var(--paper);
    font-size: 32px;
    margin-bottom: 10px;
}

p.subtitle {
    color: rgba(246, 240, 226, 0.75);
    margin-bottom: 28px;
    font-size: 16px;
}

/* ---- Eyebrow / postmark label ---- */
.eyebrow {
    font-family: 'Space Mono', monospace;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--stamp-red);
    display: inline-block;
    margin-bottom: 10px;
}

/* ---- The Postcard (generator box) ---- */
.generator-box {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 32px;
    margin-bottom: 32px;
    position: relative;
    box-shadow: 6px 8px 0 rgba(0, 0, 0, 0.25);
}

/* Stamp badge — the signature element, appears on every postcard */
.stamp-badge {
    position: absolute;
    top: -14px;
    right: 24px;
    width: 64px;
    padding: 8px 4px 6px;
    background: var(--paper-soft);
    border: 2px dashed var(--ink);
    text-align: center;
    transform: rotate(-4deg);
    box-shadow: 2px 3px 0 rgba(27, 42, 74, 0.2);
    font-family: 'Space Mono', monospace;
}

.stamp-badge .stamp-icon {
    font-size: 20px;
    display: block;
    line-height: 1;
}

.stamp-badge .stamp-label {
    font-size: 7px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    display: block;
    margin-top: 4px;
}

label {
    font-family: 'Space Mono', monospace;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    display: block;
    margin-bottom: 6px;
}

input[type="text"],
select {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px;
    font-family: 'Work Sans', sans-serif;
    background: var(--paper-soft);
    border: 1px solid var(--ink);
    border-radius: 2px;
    margin-bottom: 18px;
    color: var(--text-ink);
}

input[type="text"]:focus,
select:focus {
    outline: none;
    border-color: var(--stamp-red);
    box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.15);
}

.wish-box {
    background: var(--paper-soft);
    border: 1px dashed var(--ink);
    border-radius: 2px;
    padding: 24px;
    font-family: 'Fraunces', Georgia, serif;
    font-size: 19px;
    line-height: 1.65;
    color: var(--text-ink);
    margin-bottom: 20px;
}

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

button,
.btn {
    background: var(--stamp-red);
    color: var(--paper-soft);
    border: 2px solid var(--ink);
    padding: 12px 22px;
    border-radius: 2px;
    font-family: 'Space Mono', monospace;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    box-shadow: 3px 3px 0 var(--ink);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

button:hover,
.btn:hover {
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0 var(--ink);
}

button:active,
.btn:active {
    transform: translate(3px, 3px);
    box-shadow: 0 0 0 var(--ink);
}

button.secondary,
.btn.secondary {
    background: var(--paper-soft);
    color: var(--ink);
}

/* ---- SEO article section ---- */
.article-section {
    margin: 36px 0;
    color: rgba(246, 240, 226, 0.9);
}

.article-section h2 {
    font-size: 21px;
    color: var(--paper);
    margin-bottom: 14px;
}

.article-section p {
    color: rgba(246, 240, 226, 0.75);
}

/* ---- FAQ accordion ---- */
.faq-item {
    border-bottom: 1px solid rgba(246, 240, 226, 0.15);
    padding: 16px 0;
}

.faq-question {
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--paper);
    font-family: 'Fraunces', Georgia, serif;
    font-size: 16px;
}

.faq-question span {
    font-family: 'Space Mono', monospace;
    color: var(--stamp-red);
}

.faq-answer {
    color: rgba(246, 240, 226, 0.7);
    margin-top: 10px;
    display: none;
    line-height: 1.6;
}

.faq-item.open .faq-answer {
    display: block;
}

/* ---- Related wishes ---- */
.related-wishes {
    margin-top: 44px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.related-grid a {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 2px;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--text-ink);
    font-size: 14px;
    box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.15);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.related-grid a:hover {
    transform: translate(1px, 2px);
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.15);
    border-color: var(--stamp-red);
}

/* ---- Footer ---- */
.site-footer {
    background: var(--ink-deep);
    border-top: 1px solid rgba(246, 240, 226, 0.1);
    padding: 28px 0;
    margin-top: 40px;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: rgba(246, 240, 226, 0.6);
    font-family: 'Space Mono', monospace;
}

.footer-nav a {
    margin-left: 16px;
    color: rgba(246, 240, 226, 0.6);
    text-decoration: none;
}

.footer-nav a:hover {
    color: var(--stamp-red);
}

/* ---- Decorative accents (pure CSS/SVG, no external assets) ---- */

/* Hand-drawn squiggle under key headings */
.doodle-wrap {
    margin: 4px 0 18px;
    line-height: 0;
}

.doodle-wrap svg {
    display: block;
}

/* Torn-paper perforation strip, sits right under a postcard */
.torn-strip {
    height: 14px;
    background: var(--paper);
    margin-top: -1px;
    margin-bottom: 24px;
    clip-path: polygon(0% 0%, 4% 100%, 8% 0%, 12% 100%, 16% 0%, 20% 100%, 24% 0%, 28% 100%,
            32% 0%, 36% 100%, 40% 0%, 44% 100%, 48% 0%, 52% 100%, 56% 0%, 60% 100%,
            64% 0%, 68% 100%, 72% 0%, 76% 100%, 80% 0%, 84% 100%, 88% 0%, 92% 100%,
            96% 0%, 100% 100%);
}

/* Small star/sparkle accents */
.sparkle {
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--gold-seal);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    opacity: 0.85;
    pointer-events: none;
}

.sparkle.sm {
    width: 9px;
    height: 9px;
    opacity: 0.6;
}

.sparkle.red {
    background: var(--stamp-red);
}

/* Sparkle automatically added near every stamp badge */
.stamp-badge::after {
    content: '';
    position: absolute;
    top: -8px;
    left: -10px;
    width: 10px;
    height: 10px;
    background: var(--gold-seal);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    opacity: 0.9;
}

/* ---- AdSense ad container ---- */
.ad-container {
    margin: 32px 0;
    text-align: center;
    min-height: 90px;
    /* reduces layout shift while the ad loads */
}

/* ---- Motion ---- */

/* Postcard "arrives" on page load — like mail landing on the table */
@keyframes postcard-in {
    from {
        opacity: 0;
        transform: translateY(16px) rotate(-1.5deg);
    }

    to {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
}

.generator-box {
    animation: postcard-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* Sparkles twinkle gently — opacity only, so it never fights the
   scroll parallax transform applied separately via JS */
@keyframes twinkle {

    0%,
    100% {
        opacity: 0.85;
    }

    50% {
        opacity: 0.35;
    }
}

.sparkle {
    animation: twinkle 2.6s ease-in-out infinite;
}

.sparkle.sm {
    animation-duration: 3.2s;
}

/* Stamp badge gives a little life on hover, like picking it up */
.stamp-badge {
    transition: transform 0.25s ease;
}

.stamp-badge:hover {
    transform: rotate(-8deg) scale(1.05);
}

/* ---- Touch targets (accessibility + mobile usability) ---- */
button,
.btn,
.theme-toggle {
    min-height: 44px;
}

.site-header nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

@media (max-width: 600px) {
    h1 {
        font-size: 24px;
    }

    .wish-box {
        font-size: 17px;
        padding: 20px;
    }

    .generator-box {
        padding: 24px;
    }

    .stamp-badge {
        top: -12px;
        right: 16px;
        width: 54px;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .site-header nav {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 4px;
    }

    .site-header nav a {
        margin-left: 0;
        margin-right: 16px;
    }

    .ad-container {
        min-height: 60px;
        margin: 24px 0;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn-group button {
        width: 100%;
    }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {

    button,
    .btn,
    .related-grid a,
    .stamp-badge {
        transition: none;
    }

    .generator-box,
    .sparkle {
        animation: none;
    }
}