/* ============================================
   MapleByte Design System
   Fonts: Playfair Display + DM Sans
   ============================================ */

:root {
    --color-bg: #F4F0EB;
    --color-bg-alt: #EBE5DD;
    --color-surface: #FDFBF8;
    --color-text: #1C1714;
    --color-text-secondary: #7A6E63;
    --color-text-tertiary: #A89E94;
    --color-accent: #C84B31;
    --color-accent-hover: #A93D28;
    --color-border: rgba(28, 23, 20, 0.08);
    --color-border-hover: rgba(28, 23, 20, 0.2);
    --color-dark-bg: #1C1714;
    --color-dark-surface: #2A2320;
    --color-dark-text: rgba(255, 255, 255, 0.7);
    --color-dark-text-dim: rgba(255, 255, 255, 0.35);

    --font-display: 'Syne', system-ui, sans-serif;
    --font-body: 'Nunito Sans', system-ui, sans-serif;

    --max-width: 1080px;
    --nav-height: 72px;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: 0.2s var(--ease-out);
    --transition-medium: 0.5s var(--ease-out);
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* --- Grain Overlay --- */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    opacity: 0.028;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='512' height='512' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* --- Base Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.15;
}

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

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

.app-store-badge-link {
    display: inline-block;
    line-height: 0;
    border-radius: 14px;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.app-store-badge-link:hover {
    transform: translateY(-2px);
    opacity: 0.96;
}

.app-store-badge-link:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
}

.app-store-badge-image {
    width: 176px;
    height: auto;
    display: block;
}

/* Legacy: hide old card-style legal-links sections */
.legal-links-wrap { display: none; }

/* --- Legal link buttons (compact row below App Store badge) --- */
.legal-link-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 16px;
}

.legal-link-btn {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-body);
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 7px 18px;
    border-radius: 100px;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.18);
    letter-spacing: 0.01em;
    transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

.legal-link-btn:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 640px) {
    .app-store-badge-image {
        width: 164px;
    }
}

/* --- Navigation --- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(244, 240, 235, 0.8);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--color-border);
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 21px;
    color: var(--color-text);
    text-decoration: none;
    letter-spacing: -0.3px;
}

.nav-logo svg {
    width: 22px;
    height: 24px;
    color: #F07040;
    flex-shrink: 0;
}

.nav-logo img {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    gap: 28px;
    list-style: none;
    align-items: center;
}

.nav-links a {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
    position: relative;
}

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

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--color-accent);
    transition: width 0.3s var(--ease-out);
}

.nav-links a:hover::after {
    width: 100%;
}

/* --- Footer --- */
.footer {
    background: var(--color-dark-bg);
    padding: 48px 24px 40px;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer-top {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-dark-text);
    font-family: var(--font-display);
    font-size: 18px;
    text-decoration: none;
}

.footer-brand svg {
    width: 18px;
    height: 20px;
    opacity: 0.5;
}

.footer-links-list {
    display: none;
    gap: 24px;
    list-style: none;
    flex-wrap: wrap;
}

.footer-links-list a {
    color: var(--color-dark-text-dim);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-links-list a:hover {
    color: rgba(255, 255, 255, 0.9);
}

.footer-bottom {
    padding-top: 24px;
    font-size: 12px;
    color: var(--color-dark-text-dim);
    text-align: center;
}

/* --- Section Label --- */
.section-label {
    display: block;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-text-tertiary);
    margin-bottom: 28px;
}

/* --- Back Link --- */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    margin-bottom: 40px;
    transition: color var(--transition-fast), gap var(--transition-fast);
}

.back-link:hover {
    color: var(--color-accent);
    gap: 10px;
}

/* --- Legal Page --- */
.legal-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 120px 24px 80px;
}

.legal-page h1 {
    font-size: 38px;
    color: var(--color-text);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.legal-page .updated {
    color: var(--color-text-tertiary);
    font-size: 14px;
    margin-bottom: 48px;
}

.legal-page h2 {
    font-size: 22px;
    color: var(--color-text);
    margin: 40px 0 12px;
    letter-spacing: -0.3px;
}

.legal-page p,
.legal-page li {
    font-size: 15px;
    color: var(--color-text-secondary);
    line-height: 1.75;
    margin-bottom: 12px;
}

.legal-page ul {
    padding-left: 20px;
    margin-bottom: 16px;
}

.legal-page a {
    color: var(--color-accent);
    transition: opacity var(--transition-fast);
}

.legal-page a:hover {
    opacity: 0.7;
}

.legal-page strong {
    color: var(--color-text);
    font-weight: 600;
}

/* --- Animations --- */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeUp 0.8s var(--ease-out) both;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.25s; }
.delay-3 { animation-delay: 0.4s; }
.delay-4 { animation-delay: 0.55s; }
.delay-5 { animation-delay: 0.7s; }

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    :root {
        --nav-height: 64px;
    }

    .nav-links {
        gap: 16px;
    }

    .nav-links a {
        font-size: 13px;
    }

    .footer-top {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .footer-links-list {
        justify-content: center;
    }

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

    .legal-page h1 {
        font-size: 30px;
    }
}
