/* Styles for the project */
        /* --- 1. SETUP --- */
        :root {
            --bg-color: #fcfcfc;
            --text-main: #111;
            --text-muted: #888;
            --font-serif: 'Libre Caslon Text', serif;
            --font-sans: 'Inter', sans-serif;
            --font-hand: 'Nothing You Could Do', cursive;
        }

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

        body {
            background-color: var(--bg-color);
            color: var(--text-main);
            font-family: var(--font-sans);
            overflow: hidden; /* Default for Focus Mode */
        }

        /* --- 2. VIEW TOGGLE BUTTON --- */
        .view-toggle {
            position: fixed;
            top: 20px;
            right: 20px;
            z-index: 200;
            background: white;
            border: 1px solid rgba(0,0,0,0.1);
            padding: 10px 20px;
            border-radius: 30px;
            font-family: var(--font-sans);
            font-size: 0.8rem;
            text-transform: uppercase;
            letter-spacing: 1px;
            cursor: pointer;
            box-shadow: 0 5px 15px rgba(0,0,0,0.05);
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .view-toggle:hover {
            background: #111;
            color: white;
            border-color: #111;
        }

        /* --- 3. CONTAINER MODES --- */
        
        /* MODE A: FOCUS (Scroll Snap) - DEFAULT */
        #container.focus-mode {
            height: 100vh;
            width: 100vw;
            overflow-y: scroll;
            scroll-snap-type: y mandatory;
            scroll-behavior: smooth;
        }

        #container.focus-mode section {
            height: 100vh;
            width: 100vw;
            scroll-snap-align: start;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        /* MODE B: GRID (Everything Together) */
        #container.grid-mode {
            height: 100vh;
            overflow-y: scroll;
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
            gap: 30px;
            padding: 120px 40px 100px 40px; 
        }

        #container.grid-mode section.hero-section {
            grid-column: 1 / -1;
            height: 60vh;
            display: flex;
            justify-content: center;
            align-items: center;
            margin-bottom: 40px;
        }

        #container.grid-mode .scroll-hint { display: none; }

        /* --- 4. CARD STYLING --- */
        .card-wrapper {
            background: white;
            padding: 40px;
            max-width: 500px;
            width: 100%;
            /* Taller min-height to accommodate button */
            min-height: 600px; 
            border: 1px solid rgba(0,0,0,0.05);
            box-shadow: 0 20px 50px rgba(0,0,0,0.05);
            position: relative;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            cursor: pointer; 
            display: flex;
            flex-direction: column;
            justify-content: center; 
        }

        #container.grid-mode .card-wrapper:hover {
            transform: translateY(-5px);
            box-shadow: 0 25px 60px rgba(0,0,0,0.1);
        }

        /* --- FLIP/REVEAL LOGIC --- */
        .card-face-front, .card-face-back {
            width: 100%;
            animation: fadeIn 0.6s cubic-bezier(0.22, 1, 0.36, 1);
        }

        /* FRONT STATE (Question) */
        .card-face-front {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            height: 100%;
        }

        .q-large {
            font-family: var(--font-serif);
            font-size: 1.8rem;
            line-height: 1.4;
            color: #111;
            margin-bottom: 30px;
            font-style: italic;
        }

        .reveal-hint {
            font-size: 0.7rem;
            text-transform: uppercase;
            letter-spacing: 2px;
            color: #ccc;
            border: 1px solid #eee;
            padding: 8px 16px;
            border-radius: 20px;
        }

        /* BACK STATE */
        .card-face-back {
            display: none;
            text-align: left;
            height: 100%;
            display: none; /* hidden initially */
            flex-direction: column;
        }

        /* FLIPPED STATE CLASS */
        .card-wrapper.flipped .card-face-front { display: none; }
        .card-wrapper.flipped .card-face-back { display: flex; } /* flex to arrange button at bottom */
        .card-wrapper.flipped { background: #fff; }

        /* --- CONTENT STYLING --- */
        .hero-content {
            text-align: center;
            max-width: 600px;
        }

        h1 {
            font-family: var(--font-serif);
            font-size: clamp(3rem, 6vw, 5rem);
            line-height: 1.1;
            margin-bottom: 20px;
        }

        .mirror-text {
            background: linear-gradient(45deg, #555 0%, #000 20%, #888 40%, #ccc 50%, #888 60%, #000 80%, #555 100%);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            background-size: 200%;
            animation: shine 8s infinite linear;
        }

        @keyframes shine { 0% { background-position: -100%; } 100% { background-position: 200%; } }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

        .word-header {
            display: flex;
            justify-content: space-between;
            align-items: baseline;
            margin-bottom: 20px;
            border-bottom: 1px solid #eee;
            padding-bottom: 10px;
        }

        .word-title {
            font-family: var(--font-hand);
            font-size: 2.5rem;
            line-height: 1;
            color: #111;
            transform: rotate(-2deg);
        }

        .word-meta {
            font-size: 0.7rem;
            color: #999;
            text-transform: uppercase;
            letter-spacing: 1px;
            text-align: right;
        }

        .card-image-container {
            width: 100%;
            height: 220px;
            background-color: #f4f4f4;
            margin-bottom: 20px;
            border-radius: 4px;
            overflow: hidden;
            flex-shrink: 0; /* Don't shrink image */
        }

        .card-image {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        .word-script {
            font-family: var(--font-serif);
            font-size: 0.95rem;
            line-height: 1.6;
            color: #444;
            margin-bottom: 20px;
            flex-grow: 1; /* Pushes button to bottom */
        }

        /* --- NEW: ACTION BUTTON --- */
        .action-btn {
            width: 100%;
            padding: 15px;
            background: #111;
            color: white;
            border: none;
            font-family: var(--font-sans);
            text-transform: uppercase;
            letter-spacing: 1px;
            font-size: 0.75rem;
            cursor: pointer;
            transition: background 0.3s;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .action-btn:hover {
            background: #333;
        }

        .action-btn span:last-child {
            opacity: 0.7;
        }

        /* --- 5. FLOATING NAVIGATION --- */
        .floating-nav {
            position: fixed;
            bottom: 30px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(255, 255, 255, 0.9);
            backdrop-filter: blur(10px);
            padding: 10px 20px;
            border-radius: 50px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
            display: flex;
            gap: 10px;
            z-index: 100;
            overflow-x: auto;
            max-width: 90vw;
            border: 1px solid rgba(0,0,0,0.1);
        }

        .nav-btn {
            border: none;
            background: transparent;
            font-family: var(--font-sans);
            font-size: 0.75rem;
            text-transform: uppercase;
            letter-spacing: 1px;
            cursor: pointer;
            padding: 8px 12px;
            border-radius: 20px;
            white-space: nowrap;
            transition: all 0.3s;
            color: #888;
        }

        .nav-btn.active { background: #111; color: white; }

        .toast {
            position: fixed;
            top: 80px;
            left: 50%;
            transform: translateX(-50%);
            background: black;
            color: white;
            padding: 10px 20px;
            border-radius: 30px;
            font-size: 0.8rem;
            opacity: 0;
            transition: opacity 0.3s;
            pointer-events: none;
            z-index: 200;
        }

        .scroll-hint {
            position: absolute;
            bottom: 120px;
            font-size: 0.8rem;
            text-transform: uppercase;
            letter-spacing: 2px;
            animation: bounce 2s infinite;
            opacity: 0.5;
        }

        @keyframes bounce {
            0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
            40% {transform: translateY(-10px);}
            60% {transform: translateY(-5px);}
        }