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

:root {
    --max:          860px;

    --bg:           #f5f6fa;
    --bg-2:         #eef0f7;
    --surface:      #ffffff;
    --surface-2:    #f0f2f9;

    --border:       rgba(0,0,0,0.07);
    --border-hi:    rgba(0,0,0,0.12);

    --text:         #0f1117;
    --muted:        #5c6070;
    --muted-2:      #9096a8;

    --blue:         #1d6ef5;
    --blue-light:   #e8f0fe;
    --blue-glow:    rgba(29,110,245,0.2);

    --yellow:       #f5c518;
    --yellow-bg:    #fffbea;

    --radius:       14px;
    --radius-lg:    20px;
    --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --shadow:       0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.05);
    --shadow-md:    0 8px 32px rgba(0,0,0,0.09);
}

html { scroll-behavior: smooth; scroll-padding-top: 64px; }
#download { scroll-margin-top: 80px; }

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

.container {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 1.5rem);
}

/* ── Header ── */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(245,246,250,0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.navbar { padding: 0; }

.nav-container {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 1.5rem);
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.logo-image { width: 30px; height: 30px; border-radius: 7px; object-fit: cover; }
.logo-text { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.03em; color: var(--text); }
.logo-by { font-size: 0.72rem; color: var(--muted-2); font-weight: 500; }
.maker-gully-logo { height: 20px; width: auto; border-radius: 4px; opacity: 0.55; }

.nav-links { display: flex; align-items: center; gap: 0.25rem; }

.nav-link {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    transition: color 0.15s, background 0.15s;
}
.nav-link:hover { color: var(--text); background: var(--surface); }

/* ── Hero ── */
.hero {
    position: relative;
    overflow: hidden;
    padding: clamp(5rem, 12vw, 7.5rem) 0 clamp(4rem, 8vw, 6rem);
    text-align: center;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

/* Subtle grid lines */
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
    background-size: 52px 52px;
    pointer-events: none;
}

.hero-background { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.floating-tiles { position: absolute; inset: 0; }

.tile {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    animation: float 7s ease-in-out infinite;
    opacity: 0.9;
}

/* Tiles use a single bold blue palette — no per-tile color framing */
.tile-1 { top: 14%; left: 6%;   background: #1d6ef5; box-shadow: 0 4px 20px rgba(29,110,245,0.3);  animation-delay: 0s; }
.tile-2 { top: 20%; right: 9%;  background: #3a85f7; box-shadow: 0 4px 20px rgba(29,110,245,0.25); animation-delay: 1.2s; }
.tile-3 { top: 50%; left: 10%;  background: #0a50c8; box-shadow: 0 4px 20px rgba(10,80,200,0.3);   animation-delay: 2.4s; }
.tile-4 { top: 64%; right: 14%; background: #1d6ef5; box-shadow: 0 4px 20px rgba(29,110,245,0.25); animation-delay: 3.6s; }
.tile-5 { top: 34%; left: 76%;  background: #5ba3ff; box-shadow: 0 4px 20px rgba(91,163,255,0.3);  animation-delay: 4.8s; }
.tile-6 { top: 76%; left: 7%;   background: #0a50c8; color: var(--yellow); box-shadow: 0 4px 20px rgba(10,80,200,0.3); animation-delay: 0.6s; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50%       { transform: translateY(-16px) rotate(2deg); }
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 620px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 1.5rem);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--blue);
    background: var(--blue-light);
    border: 1px solid rgba(29,110,245,0.2);
    border-radius: 999px;
    padding: 0.3rem 0.9rem;
    margin-bottom: 1.75rem;
}

.hero-title { margin-bottom: 1rem; }

.title-main {
    display: block;
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 900;
    letter-spacing: -0.06em;
    line-height: 0.95;
    margin-bottom: 0.4rem;
    color: var(--text);
}

.title-sub {
    display: block;
    font-size: clamp(0.95rem, 2.2vw, 1.2rem);
    font-weight: 500;
    color: var(--muted);
    letter-spacing: -0.01em;
}

.hero-description {
    font-size: clamp(0.88rem, 1.8vw, 0.97rem);
    color: var(--muted);
    line-height: 1.7;
    max-width: 460px;
    margin: 0 auto 2.5rem;
}

/* ── Stats bar ── */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 0;
    background: var(--bg);
    border: 1px solid var(--border-hi);
    border-radius: var(--radius-lg);
    overflow: hidden;
    max-width: 360px;
    margin: 0 auto 2.75rem;
}

.stat-item {
    flex: 1;
    text-align: center;
    padding: 1rem 0.5rem;
    border-right: 1px solid var(--border);
}
.stat-item:last-child { border-right: none; }

.stat-number {
    display: block;
    font-size: clamp(1.6rem, 4vw, 2.25rem);
    font-weight: 900;
    letter-spacing: -0.05em;
    line-height: 1;
    margin-bottom: 0.2rem;
    color: var(--blue);
}

.stat-label {
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted-2);
}

.hero-actions { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }

/* ── Download buttons ── */
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1.85rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: transform 0.18s, box-shadow 0.18s;
}

.download-btn--primary {
    background: var(--blue);
    color: #fff;
    box-shadow: 0 4px 20px var(--blue-glow);
}
.download-btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px var(--blue-glow);
}

.download-btn--secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-hi);
    box-shadow: var(--shadow);
}
.download-btn--secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.download-btn i { font-size: 1.2rem; }

/* ── Shared section ── */
.section { padding: clamp(3.5rem, 7vw, 5rem) 0; }
.section--alt { background: var(--bg-2); }

.section-header {
    text-align: center;
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

.section-label {
    display: inline-block;
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--blue);
    margin-bottom: 0.5rem;
}

.section-header h2 {
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.section-header p {
    font-size: 0.9rem;
    color: var(--muted);
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.65;
}

/* ── How to Play ── */
.how-to-play { background: var(--bg); }

.steps-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    background: var(--border-hi);
    border: 1px solid var(--border-hi);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.step-card {
    background: var(--surface);
    padding: 2rem 1.5rem;
    text-align: center;
}

.step-num {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 10px;
    background: var(--blue);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 4px 12px var(--blue-glow);
}

.step-card h3 { font-size: 1rem; font-weight: 700; color: var(--text); letter-spacing: -0.02em; margin-bottom: 0.4rem; }
.step-card p { font-size: 0.84rem; color: var(--muted); line-height: 1.6; }

/* ── Game Modes — all uniform, no per-mode accent colors ── */
.game-modes { background: var(--surface); }

.modes-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.mode-card {
    background: var(--bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.25rem;
    border: 1px solid var(--border);
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.mode-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(29,110,245,0.2);
}

.mode-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.mode-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 11px;
    background: var(--blue-light);
    border: 1px solid rgba(29,110,245,0.15);
}

.mode-icon i { font-size: 1.05rem; color: var(--blue); }

.mode-icon-2048 {
    font-size: 0.6rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    color: var(--blue);
}

.mode-info h3 { font-size: 0.95rem; font-weight: 700; color: var(--text); letter-spacing: -0.02em; margin-bottom: 0.15rem; }

.mode-badge {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted-2);
}

.mode-card p { font-size: 0.82rem; color: var(--muted); line-height: 1.6; margin-bottom: 1rem; flex: 1; }

.mode-stats { display: flex; gap: 0.5rem; }

.mode-stats .stat {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.stat-value { display: block; font-size: 1rem; font-weight: 800; color: var(--text); letter-spacing: -0.03em; }
.mode-stats .stat-label { font-size: 0.6rem; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.08em; }

/* ── Special Tiles ── */
.special-tiles { background: var(--bg); }

.tiles-showcase {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
}

.tile-demo { display: flex; justify-content: center; }

.tile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }

.demo-tile {
    width: 90px;
    height: 90px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    box-shadow: var(--shadow-md);
}

.demo-tile.anchor { background: #6b7280; }
.demo-tile.reset  { background: #e74c3c; }
.demo-tile.halve  { background: #9b59b6; }
.demo-tile.double { background: #27ae60; }

.tiles-info { display: flex; flex-direction: column; gap: 0.65rem; }

.tile-info {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.9rem 1.1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: border-color 0.15s;
}
.tile-info:hover { border-color: var(--border-hi); }

.tile-icon {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.88rem;
    color: #fff;
    flex-shrink: 0;
}

.tile-icon.anchor { background: #6b7280; }
.tile-icon.reset  { background: #e74c3c; }
.tile-icon.halve  { background: #9b59b6; }
.tile-icon.double { background: #27ae60; }

.tile-details h3 { font-size: 0.875rem; font-weight: 700; color: var(--text); letter-spacing: -0.02em; margin-bottom: 0.15rem; }
.tile-details p { font-size: 0.78rem; color: var(--muted); line-height: 1.5; }

/* ── Features ── */
.features { background: var(--surface); }

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

.feature-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem 1.25rem;
    box-shadow: var(--shadow);
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.feature-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(29,110,245,0.2);
}

.feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--blue);
    margin-bottom: 0.85rem;
    background: var(--blue-light);
    border: 1px solid rgba(29,110,245,0.15);
}

.feature-card h3 { font-size: 0.9rem; font-weight: 700; color: var(--text); letter-spacing: -0.02em; margin-bottom: 0.3rem; }
.feature-card p { font-size: 0.8rem; color: var(--muted); line-height: 1.6; }

/* ── Footer ── */
.footer {
    background: var(--bg-2);
    border-top: 1px solid var(--border);
    padding: 1.75rem 0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    text-align: center;
}

.footer-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; justify-content: center; }

.footer-link {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.15s;
}
.footer-link:hover { color: var(--text); }

.footer-brand { display: flex; align-items: center; justify-content: center; gap: 0.65rem; }
.footer-copy { font-size: 0.75rem; color: var(--muted-2); }

.footer-mg-logo {
    width: 28px;
    height: 28px;
    border-radius: 5px;
    opacity: 0.45;
    transition: opacity 0.15s;
    vertical-align: middle;
}
.maker-gully-footer-link:hover .footer-mg-logo { opacity: 0.75; }

/* ── Privacy page ── */
.privacy-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(4rem, 9vw, 5.5rem) 0 clamp(2.5rem, 4.5vw, 3.5rem);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.privacy-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0,0,0,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.025) 1px, transparent 1px);
    background-size: 52px 52px;
    pointer-events: none;
}

.privacy-hero-inner {
    position: relative;
    z-index: 2;
    max-width: 640px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 4vw, 1.5rem);
}

.privacy-hero .section-label { display: inline-block; }

.privacy-hero h1 {
    font-size: clamp(1.85rem, 4vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text);
    margin: 0.75rem 0 0.5rem;
}

.privacy-meta { font-size: 0.82rem; color: var(--muted); }

.privacy-content {
    padding: clamp(2.5rem, 5vw, 3.5rem) 0 clamp(3.5rem, 7vw, 5rem);
    background: var(--bg);
}

.privacy-prose { max-width: 680px; margin: 0 auto; }

.privacy-back {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    margin-bottom: 2.5rem;
    transition: color 0.15s;
}
.privacy-back:hover { color: var(--text); }

.privacy-section {
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
}
.privacy-section:last-of-type { border-bottom: none; }

.privacy-prose h2 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    margin: 2rem 0 0.6rem;
}
.privacy-prose h2:first-of-type { margin-top: 0; }

.privacy-prose p, .privacy-prose li { font-size: 0.9rem; color: var(--muted); line-height: 1.75; }
.privacy-prose ul { padding-left: 1.25rem; display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.5rem; }
.privacy-prose strong { color: var(--text); font-weight: 600; }
.privacy-prose a { color: var(--blue); text-decoration: none; }
.privacy-prose a:hover { text-decoration: underline; }

.privacy-contact {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.4rem;
    margin-top: 2.5rem;
    box-shadow: var(--shadow);
}

.privacy-contact h3 { font-size: 0.9rem; font-weight: 700; color: var(--text); margin-bottom: 0.5rem; }
.privacy-contact p { font-size: 0.88rem; color: var(--muted); line-height: 1.7; margin: 0; }
.privacy-contact a { color: var(--blue); text-decoration: none; font-weight: 500; }
.privacy-contact a:hover { text-decoration: underline; }

/* ── Responsive ── */
@media (max-width: 700px) {
    .modes-grid    { grid-template-columns: 1fr; }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .steps-row     { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 640px) {
    .nav-container { height: auto; min-height: 56px; flex-direction: column; align-items: stretch; gap: 0.5rem; padding-top: 0.6rem; padding-bottom: 0.6rem; }
    .logo { justify-content: center; }
    .nav-links { justify-content: center; flex-wrap: wrap; }
    .tiles-showcase { grid-template-columns: 1fr; }
    .tile-demo { margin-bottom: 0.5rem; }
    .demo-tile { width: 76px; height: 76px; }
    .hero-stats { max-width: none; }
}

@media (max-width: 480px) {
    .features-grid { grid-template-columns: 1fr; }
}

/* ── Dark mode ── */
@media (prefers-color-scheme: dark) {
    :root {
        --bg:           #0f1117;
        --bg-2:         #161920;
        --surface:      #1a1d25;
        --surface-2:    #1e2230;
        --border:       rgba(255,255,255,0.07);
        --border-hi:    rgba(255,255,255,0.13);
        --text:         #f0f2f8;
        --muted:        #8b90a0;
        --muted-2:      #5a5f70;
        --blue-light:   rgba(29,110,245,0.15);
        --yellow-bg:    rgba(245,197,24,0.1);
        --shadow:       0 1px 3px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.25);
        --shadow-md:    0 8px 32px rgba(0,0,0,0.4);
    }

    .header { background: rgba(15,17,23,0.92); }
    .hero { background: var(--bg); border-bottom-color: var(--border); }
    .privacy-hero { background: var(--bg); border-bottom-color: var(--border); }
}

/* ── Hamburger (mobile nav) ── */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.45rem;
    color: var(--text);
    border-radius: 8px;
    flex-shrink: 0;
    transition: background 0.15s;
}
.nav-toggle:hover { background: var(--surface); }
@media (max-width: 640px) {
    .nav-toggle { display: flex; align-items: center; justify-content: center; }
    .nav-container { position: relative; flex-direction: row; align-items: center; }
    .logo { justify-content: flex-start; }
    .nav-links {
        display: none;
        position: absolute;
        top: calc(100% + 6px);
        left: 0; right: 0;
        flex-direction: column;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 12px;
        padding: 0.4rem;
        gap: 0.15rem;
        z-index: 10;
    }
    .nav-links a { padding: 0.65rem 0.85rem; width: 100%; border-radius: 8px; }
    .nav-container.nav-open .nav-links { display: flex; }
}
