/* ==========================================================
   PostDoku — "Ink & Paper" editorial theme
   Warm paper background, ink text, stamp-red & teal accents.
   ========================================================== */

/* ============ Variables ============ */
:root {
    --paper: #faf6ee;
    --paper-2: #f3ebdc;
    --card: #fffdf8;
    --ink: #2a2118;
    --ink-2: #635745;
    --ink-3: #a2937c;
    --line: #e5d9c4;
    --coral: #c7482a;
    --coral-dark: #9c3520;
    --coral-soft: #f7ede0;
    --teal: #17766b;
    --teal-dark: #0e5a52;
    --teal-soft: #e4f0ec;
    --footer-bg: #241c13;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-card: 0 2px 6px rgba(42, 33, 24, 0.06), 0 14px 34px rgba(42, 33, 24, 0.08);
    --shadow-lift: 0 6px 14px rgba(42, 33, 24, 0.1), 0 22px 48px rgba(42, 33, 24, 0.14);
    --max-width: 1160px;
    --transition: all 0.25s ease;
    --font-display: Georgia, 'Times New Roman', 'Songti SC', serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Roboto, Helvetica, Arial, sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--paper);
    color: var(--ink);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

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

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

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

::selection {
    background: var(--coral);
    color: #fff;
}

/* ============ Airmail divider ============ */
.airmail {
    height: 7px;
    background: repeating-linear-gradient(
        -45deg,
        var(--coral) 0 14px,
        var(--paper) 14px 28px,
        var(--teal) 28px 42px,
        var(--paper) 42px 56px
    );
    border-top: 1px solid rgba(42, 33, 24, 0.15);
    border-bottom: 1px solid rgba(42, 33, 24, 0.15);
}

/* ============ Container / Sections ============ */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 96px 0;
}

.section-paper {
    background: var(--paper);
}

.section-paper-2 {
    background: var(--paper-2);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.section-header {
    max-width: 640px;
    margin-bottom: 56px;
}

.section-header.center {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--coral);
    margin-bottom: 14px;
}

.kicker::before {
    content: '';
    width: 22px;
    height: 2px;
    background: var(--coral);
}

.section-header.center .kicker::after {
    content: '';
    width: 22px;
    height: 2px;
    background: var(--coral);
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(30px, 4vw, 42px);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 14px;
    color: var(--ink);
}

.section-desc {
    font-size: 17px;
    color: var(--ink-2);
}

/* ============ Navbar ============ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 14px 0;
    background: rgba(250, 246, 238, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    transition: var(--transition);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 21px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--ink);
}

.nav-logo svg {
    color: var(--coral);
}

.nav-logo em {
    font-style: normal;
    color: var(--coral);
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink-2);
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--coral);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
    transition: var(--transition);
}

/* ============ Hero ============ */
.hero {
    position: relative;
    padding: 150px 0 90px;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 85% 12%, rgba(23, 118, 107, 0.08) 0%, transparent 42%),
        radial-gradient(circle at 8% 90%, rgba(199, 72, 42, 0.07) 0%, transparent 45%);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 64px;
    align-items: center;
}

.stamp-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1.5px dashed var(--coral);
    color: var(--coral-dark);
    background: var(--coral-soft);
    padding: 7px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 26px;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(44px, 7vw, 68px);
    font-weight: 700;
    line-height: 1.04;
    margin-bottom: 10px;
    color: var(--ink);
}

.hero-sub {
    display: block;
    font-family: var(--font-body);
    font-size: clamp(19px, 3vw, 25px);
    font-weight: 500;
    color: var(--coral);
    margin-top: 10px;
}

.hero-desc {
    font-size: 17.5px;
    color: var(--ink-2);
    margin-bottom: 36px;
    max-width: 520px;
}

.hero-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 44px;
}

.btn-store {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 24px;
    background: var(--ink);
    color: var(--paper);
    border-radius: var(--radius-md);
    transition: var(--transition);
    min-width: 196px;
    box-shadow: var(--shadow-card);
}

.btn-store:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lift);
    background: #3a2e20;
}

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

.btn-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    text-align: left;
}

.btn-small {
    font-size: 11px;
    font-weight: 500;
    opacity: 0.72;
    letter-spacing: 0.4px;
}

.btn-large {
    font-size: 17px;
    font-weight: 700;
}

.hero-stats {
    display: flex;
    align-items: center;
    gap: 26px;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 700;
    color: var(--ink);
}

.stat-label {
    font-size: 13.5px;
    color: var(--ink-3);
    letter-spacing: 0.3px;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: var(--line);
}

/* Hero visual — puzzle card */
.hero-visual {
    display: flex;
    justify-content: center;
}

.grid-card {
    position: relative;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 34px;
    box-shadow: var(--shadow-lift);
    transform: rotate(2deg);
    max-width: 380px;
    width: 100%;
}

.grid-card::before {
    content: '';
    position: absolute;
    inset: 10px;
    border: 1.5px dashed var(--ink-3);
    border-radius: 12px;
    pointer-events: none;
}

.grid-stamp {
    position: absolute;
    top: -16px;
    right: 22px;
    width: 56px;
    height: 66px;
    background: var(--coral);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(6deg);
    box-shadow: 0 6px 14px rgba(199, 72, 42, 0.35);
}

.grid-stamp::before {
    content: '';
    position: absolute;
    inset: 5px;
    border: 1.5px dashed rgba(255, 255, 255, 0.75);
    border-radius: 2px;
}

.grid-stamp span {
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 20px;
}

.postmark {
    position: absolute;
    bottom: -22px;
    left: 26px;
    width: 84px;
    height: 84px;
    border: 2px solid var(--teal);
    border-radius: 50%;
    opacity: 0.55;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(-12deg);
}

.postmark::before {
    content: '';
    position: absolute;
    inset: 7px;
    border: 1px dashed var(--teal);
    border-radius: 50%;
}

.postmark span {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--teal-dark);
    text-align: center;
    line-height: 1.4;
}

.grid-card svg.puzzle {
    width: 100%;
    height: auto;
}

/* ============ Games ============ */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 26px;
}

.game-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 36px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.game-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--coral) 0%, var(--teal) 100%);
    opacity: 0;
    transition: var(--transition);
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lift);
    border-color: #d8c9ab;
}

.game-card:hover::after {
    opacity: 1;
}

.game-icon {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
    border: 1.5px dashed rgba(255, 255, 255, 0.65);
}

.game-icon.red {
    background: var(--coral);
}

.game-icon.teal {
    background: var(--teal);
}

.game-icon svg {
    width: 28px;
    height: 28px;
    color: #fff;
}

.game-card h3 {
    font-family: var(--font-display);
    font-size: 23px;
    font-weight: 700;
    margin-bottom: 10px;
}

.game-card p {
    color: var(--ink-2);
    font-size: 15.5px;
    margin-bottom: 20px;
}

.game-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.game-tag {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--teal-dark);
    background: var(--teal-soft);
    border: 1px solid rgba(23, 118, 107, 0.25);
    padding: 4px 12px;
    border-radius: 100px;
}

.game-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--coral);
    font-weight: 700;
    font-size: 15px;
    transition: var(--transition);
}

.game-link:hover {
    color: var(--coral-dark);
    gap: 10px;
}

/* ============ About ============ */
.about-grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 72px;
    align-items: center;
}

.about-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 28px;
}

.about-list li {
    position: relative;
    padding-left: 34px;
    font-size: 16px;
    color: var(--ink);
    font-weight: 500;
}

.about-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 1px;
    width: 22px;
    height: 22px;
    background: var(--teal-soft);
    color: var(--teal-dark);
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-visual {
    display: flex;
    justify-content: center;
}

.postcard {
    position: relative;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 34px;
    box-shadow: var(--shadow-card);
    transform: rotate(-2deg);
    width: 100%;
    max-width: 380px;
}

.postcard::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: repeating-linear-gradient(
        -45deg,
        var(--coral) 0 12px,
        var(--card) 12px 24px,
        var(--teal) 24px 36px,
        var(--card) 36px 48px
    );
}

.postcard-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin: 18px 0 22px;
}

.postcard-head h4 {
    font-family: var(--font-display);
    font-size: 19px;
    color: var(--ink);
    line-height: 1.3;
}

.postcard-lines {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 26px;
}

.postcard-lines span {
    height: 0;
    border-bottom: 1.5px solid var(--line);
}

.postcard-lines span:nth-child(2) {
    width: 82%;
}

.postcard-lines span:nth-child(3) {
    width: 64%;
}

.postcard-mini {
    width: 74px;
    height: 88px;
    background: var(--teal);
    border-radius: 4px;
    transform: rotate(3deg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 5px 12px rgba(14, 90, 82, 0.3);
}

.postcard-mini::before {
    content: '';
    position: absolute;
    inset: 5px;
    border: 1.5px dashed rgba(255, 255, 255, 0.7);
    border-radius: 2px;
}

.postcard-mini svg {
    width: 30px;
    height: 30px;
    color: #fff;
}

.postcard-sign {
    font-family: var(--font-display);
    font-style: italic;
    color: var(--coral);
    font-size: 18px;
}

/* ============ Contact ============ */
.postcard-cta {
    position: relative;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    text-align: center;
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.postcard-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: repeating-linear-gradient(
        -45deg,
        var(--coral) 0 14px,
        var(--card) 14px 28px,
        var(--teal) 28px 42px,
        var(--card) 42px 56px
    );
}

.postcard-cta h2 {
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 40px);
    color: var(--ink);
    margin: 14px 0 10px;
}

.postcard-cta p {
    font-size: 17px;
    color: var(--ink-2);
    margin-bottom: 30px;
}

.mail-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: clamp(19px, 3vw, 25px);
    font-weight: 700;
    color: var(--coral);
    border-bottom: 2px solid var(--coral);
    padding-bottom: 3px;
    transition: var(--transition);
}

.mail-link:hover {
    color: var(--coral-dark);
    border-color: var(--coral-dark);
}

.mail-link svg {
    width: 22px;
    height: 22px;
}

/* ============ Footer ============ */
.footer {
    background: var(--footer-bg);
    color: #d8cdbb;
    padding: 64px 0 32px;
}

.footer-top {
    display: grid;
    grid-template-columns: 1.4fr 2fr;
    gap: 64px;
    margin-bottom: 48px;
}

.footer .nav-logo {
    color: var(--paper);
    margin-bottom: 16px;
}

.footer-desc {
    font-size: 15px;
    color: #a89a83;
    max-width: 300px;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.footer-col h4 {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--paper);
    margin-bottom: 16px;
}

.footer-col a {
    display: block;
    font-size: 14.5px;
    color: #a89a83;
    margin-bottom: 12px;
    transition: var(--transition);
}

.footer-col a:hover {
    color: var(--paper);
}

.footer-bottom {
    padding-top: 30px;
    border-top: 1px solid rgba(216, 205, 187, 0.18);
    text-align: center;
}

.footer-bottom p {
    font-size: 13.5px;
    color: #8a7d68;
}

/* ============ Legal Pages ============ */
.legal-page {
    padding: 130px 0 72px;
    min-height: 100vh;
}

.legal-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 56px 48px;
    position: relative;
}

.legal-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 7px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: repeating-linear-gradient(
        -45deg,
        var(--coral) 0 14px,
        var(--card) 14px 28px,
        var(--teal) 28px 42px,
        var(--card) 42px 56px
    );
}

.legal-container h1 {
    font-family: var(--font-display);
    font-size: 36px;
    margin-bottom: 10px;
    color: var(--ink);
}

.legal-container .updated {
    color: var(--ink-3);
    font-size: 14px;
    margin-bottom: 36px;
    letter-spacing: 0.3px;
}

.legal-container h2 {
    font-family: var(--font-display);
    font-size: 21px;
    margin: 34px 0 12px;
    color: var(--coral-dark);
}

.legal-container p {
    color: var(--ink-2);
    margin-bottom: 12px;
    line-height: 1.75;
}

.legal-container ul {
    color: var(--ink-2);
    margin-bottom: 16px;
    padding-left: 20px;
}

.legal-container ul li {
    margin-bottom: 8px;
    line-height: 1.65;
}

.legal-container a {
    color: var(--coral);
    font-weight: 600;
}

.legal-container a:hover {
    color: var(--coral-dark);
}

/* ============ Animations ============ */
.fade-in {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .fade-in {
        opacity: 1;
        transform: none;
        transition: none;
    }
    html {
        scroll-behavior: auto;
    }
}

/* ============ Responsive ============ */
@media (max-width: 1024px) {
    .hero-inner {
        grid-template-columns: 1fr;
        gap: 56px;
    }

    .hero-visual {
        order: -1;
    }

    .grid-card {
        transform: rotate(0deg);
        max-width: 340px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .footer-top {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--card);
        flex-direction: column;
        padding: 22px 24px;
        gap: 14px;
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow-card);
    }

    .nav-links.show {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .section {
        padding: 64px 0;
    }

    .hero {
        padding: 120px 0 64px;
    }

    .hero-actions .btn-store {
        min-width: auto;
        flex: 1;
        justify-content: center;
    }

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

    .legal-container {
        padding: 36px 24px;
    }

    .legal-page {
        padding-top: 108px;
    }

    .footer-links {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .hero-actions {
        flex-direction: column;
    }

    .hero-stats {
        gap: 16px;
    }

    .footer-links {
        grid-template-columns: 1fr;
    }

    .btn-store {
        padding: 12px 18px;
    }

    .grid-card {
        padding: 24px;
    }
}
