:root {
    --bg-color: #fbfaf7;
    --paper-white: #ffffff;
    --ink-black: #1a1a1a;
    --border-color: #e5e5e1;
    --text-muted: #6b7280;

    /* Specific Colors from Figma */
    --pastel-green: #c3f1d6;
    --pastel-orange: #ffecd1;
    --pastel-yellow: #fffde8;
    --pastel-lavender: #e0d7ff;

    /* Fonts */
    --font-heading: 'Cormorant Garamond', serif;
    --font-numbers: 'Outfit', sans-serif;
    --font-ui: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-color);
    color: var(--ink-black);
    font-family: var(--font-ui);
    line-height: 1.5;
    position: relative;
    overflow-x: hidden;
}

/* 0.5px Math Grid Background */
.math-grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    background-image:
        linear-gradient(to right, rgba(0, 0, 0, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
    background-size: 24px 24px;
    z-index: -1;
}

/* Navigation */
.navbar {
    position: sticky;
    top: 0;
    width: 100%;
    background-color: rgba(251, 250, 247, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 600;
}

.nav-logo {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    object-fit: cover;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    text-decoration: none;
    color: var(--ink-black);
    font-weight: 500;
    font-size: 14px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-weight: 500;
    border-radius: 9999px;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.btn:active {
    transform: scale(0.98);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-primary {
    background-color: var(--ink-black);
    color: var(--paper-white);
    padding: 12px 24px;
    font-size: 15px;
}

.btn-secondary {
    background-color: transparent;
    color: var(--ink-black);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    font-size: 15px;
}

/* Base Container */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-narrow {
    max-width: 600px;
    margin: 0 auto;
}

/* Hero Section */
.hero {
    padding: 64px 0 32px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background-color: var(--paper-white);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 24px;
}

.badge-dot {
    width: 6px;
    height: 6px;
    background-color: #10b981;
    border-radius: 50%;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 56px;
    line-height: 1.1;
    color: var(--ink-black);
    font-weight: 400;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    margin-top: 24px;
    margin-bottom: 32px;
    max-width: 400px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 64px;
}

/* Card Visual Stack */
.card-stack {
    position: relative;
    width: 320px;
    height: 480px;
    margin: 0 auto;
}

.card {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: var(--paper-white);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tag {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.counter {
    font-size: 12px;
    color: var(--text-muted);
}

.card-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
}

.math-problem,
.number-problem,
.letter-problem {
    font-family: var(--font-numbers);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1;
    width: 100%;
}

.math-number {
    font-size: 64px;
}

.large-number {
    font-size: 120px;
    align-self: center;
}

.large-letter {
    font-family: var(--font-heading);
    font-size: 120px;
    align-self: center;
}

.card-footer {
    font-size: 18px;
    font-weight: 500;
    text-align: center;
}

.back-card {
    transform: rotate(-4deg) translateX(-20px);
    z-index: 1;
}

.middle-card {
    background-color: var(--pastel-yellow);
    transform: rotate(2deg) translateX(10px) translateY(-10px);
    z-index: 2;
}

.front-card {
    background-color: var(--pastel-green);
    transform: rotate(-1deg);
    z-index: 3;
}

/* Group 29 Specific Overrides for the Front Card */
.group-29-card {
    background-color: #c3fec6;
    /* The vibrant pastel green from group_29.dart */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
    /* Little more pop on the shadow */
}

.group-29-card .tag {
    background-color: var(--paper-white);
    padding: 6px 12px;
    border-radius: 12px;
    color: var(--ink-black);
    border: 1px solid var(--border-color);
}

.group-29-card .counter {
    background-color: var(--paper-white);
    padding: 4px 10px;
    border-radius: 10px;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

.group-29-card .card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
}

.pagination-dots {
    display: flex;
    gap: 6px;
}

.pagination-dots .dot {
    width: 6px;
    height: 6px;
    background-color: #000;
}

.pagination-dots .dot.active {
    background-color: #1f2937;
    /* The dark active square colour from group_29.dart */
}

/* Features */
.features {
    padding: 64px 0;
    text-align: left;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 48px;
    font-weight: 400;
    margin-bottom: 48px;
    text-align: center;
}

.feature-grid {
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.feature-card {
    display: flex;
    flex-direction: column;
}

.feature-icon-wrapper {
    height: 160px;
    background-color: var(--paper-white);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.feature-mini-card {
    background: var(--paper-white);
    border: 1px solid var(--border-color);
    padding: 16px 24px;
    border-radius: 8px;
    font-family: var(--font-numbers);
    font-size: 24px;
    position: absolute;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.feature-mini-card:not(.rotated) {
    transform: translateX(-30px) rotate(-5deg);
    z-index: 2;
}

.feature-mini-card.rotated {
    transform: translateX(30px) rotate(5deg);
    background-color: var(--pastel-orange);
    z-index: 1;
}

.feature-mini-card.mint {
    background-color: var(--pastel-green);
}

.feature-mini-card.peach {
    background-color: var(--pastel-orange);
}

.feature-mini-card.lavender {
    background-color: var(--pastel-lavender);
}

.feature-mini-card .card-content {
    font-size: 24px;
    font-family: var(--font-numbers);
    font-weight: 700;
}

.feature-mini-card .card-content.serif {
    font-family: var(--font-heading);
    font-size: 32px;
}

.feature-deck-stack {
    position: relative;
    width: 100px;
    height: 120px;
}

.feature-deck-card {
    position: absolute;
    width: 80px;
    height: 100px;
    background: var(--paper-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.feature-deck-card.mint {
    background-color: var(--pastel-green);
    z-index: 3;
}

.feature-deck-card.peach {
    background-color: var(--pastel-orange);
    z-index: 2;
    transform: translate(10px, 10px);
}

.feature-deck-card.lavender {
    background-color: var(--pastel-lavender);
    z-index: 1;
    transform: translate(20px, 20px);
}

.illustration-deck {
    width: 64px;
    height: 80px;
    background: var(--paper-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    position: absolute;
}

.illustration-deck.deck-2 {
    background-color: var(--pastel-green);
    transform: translate(12px, 12px);
    z-index: -1;
}

.icon-circle {
    width: 48px;
    height: 48px;
    background-color: var(--pastel-orange);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
}

.feature-desc {
    color: var(--text-muted);
    font-size: 16px;
}

/* CTA */
.cta-section {
    padding: 64px 0 80px 0;
}

.cta-box {
    background-color: var(--paper-white);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 48px 32px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cta-icon {
    width: 64px;
    height: 64px;
    background-color: var(--pastel-green);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.cta-title {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 16px;
}

.cta-desc {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 32px;
    max-width: 280px;
}

.cta-btn {
    width: 100%;
    padding: 16px;
    font-size: 18px;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border-color);
    padding: 64px 24px 32px;
    background-color: #fff;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 600;
    color: var(--ink-black);
}

.footer-logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

.seo-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
    text-align: left;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 48px 0;
}

.seo-column h4 {
    font-family: var(--font-heading);
    font-size: 20px;
    margin-bottom: 16px;
    color: var(--ink-black);
}

.seo-column p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    text-decoration: none;
    color: var(--text-muted);
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--ink-black);
}

/* Product Showcase */
.showcase-section {
    padding: 80px 0;
    max-width: 1200px;
    margin: 0 auto;
}

.showcase-row {
    display: flex;
    align-items: center;
    gap: 64px;
    margin-bottom: 120px;
}

.showcase-row.reverse {
    flex-direction: row-reverse;
}

.showcase-content {
    flex: 1;
}

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

.phone-mockup {
    width: 280px;
    height: 580px;
    background: #000;
    border-radius: 40px;
    padding: 12px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.15);
    position: relative;
    border: 4px solid #333;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 30px;
    overflow: hidden;
    position: relative;
}

.phone-screen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.showcase-label {
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: block;
}

.showcase-title {
    font-family: var(--font-heading);
    font-size: 40px;
    line-height: 1.2;
    margin-bottom: 24px;
}

.showcase-text {
    font-size: 17px;
    color: var(--text-muted);
    line-height: 1.6;
}

.feature-list {
    margin-top: 32px;
    list-style: none;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 15px;
}

.feature-check {
    width: 20px;
    height: 20px;
    background: var(--pastel-green);
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #065f46;
    font-size: 12px;
    margin-top: 2px;
}

@media (max-width: 768px) {
    .showcase-row {
        flex-direction: column !important;
        text-align: center;
        gap: 40px;
    }

    .feature-item {
        justify-content: center;
        text-align: left;
    }
}

@media (max-width: 768px) {
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}