/* --- Global Resets & Font --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Removed the global transition - apply transitions more specifically */
    /* transition-property: color, background-color, border-color, transform, box-shadow, opacity; */
    /* transition-duration: 0.3s; */
    /* transition-timing-function: ease; */
}

html {
    scroll-behavior: smooth;
}

/* --- CSS Variables for Modern Cookie Style --- */
:root {
    --bg-color: #fdfaf6; 
    --text-color: #1a1a1a;
    --primary-brown: #6b4f4b;
    --accent-brown: #a0522d;
    --dark-brown: #4a2c2a;
    --border-color: #1a1a1a;
    --shadow-color: rgba(26, 26, 26, 0.7);
    --highlight-bg: #fffbeb;
    --highlight-border: #f0ad4e;
    --secondary-highlight-bg: #e0f2f1;
    --secondary-highlight-border: #00796b;
    --action-color: #ff7043; /* Changed to orange for cookie theme */
    --action-hover-color: #e64a19;
    --warning-color: #d9534f;

    --border-width: 2px;
    --shadow-offset: 6px;
    --border-radius-sharp: 12px; /* Increased radius for modern feel */
    --border-radius-soft: 24px; /* Increased soft radius */
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-x: hidden;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Cpath fill='%239C92AC' fill-opacity='0.1' d='M1 3h1v1H1V3zm2-2h1v1H3V1z'%3E%3C/path%3E%3C/svg%3E");
}

/* --- Typography --- */
h1, h2, h3, h4 {
    font-weight: 700;
    margin-bottom: 0.8em;
    color: var(--dark-brown);
    letter-spacing: 0.5px;
}

h1 { 
    font-size: clamp(2.8rem, 8vw, 4.5rem); 
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--dark-brown), var(--accent-brown));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 2px 2px 3px rgba(0,0,0,0.1);
}

h2 { font-size: clamp(2.2rem, 6vw, 3.2rem); }
h3 { font-size: 1.8rem; }
h4 { font-size: 1.4rem; font-weight: 600; }

p {
    margin-bottom: 1.2em;
    max-width: 70ch;
}

a {
    color: var(--action-color);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    font-weight: 600;
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease; /* Specific transitions */
}

a:hover {
    color: var(--bg-color);
    background-color: var(--action-hover-color);
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: var(--border-radius-sharp);
}

/* --- Unique Border & Shadow Styles --- */
.hard-border {
    border: var(--border-width) solid var(--border-color);
}

.hard-shadow {
    box-shadow: var(--shadow-offset) var(--shadow-offset) 10px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.interactive-shadow:hover,
.interactive-shadow:focus-visible {
    transform: translate(-3px, -3px);
    box-shadow: calc(var(--shadow-offset) + 3px) calc(var(--shadow-offset) + 3px) 12px var(--shadow-color);
}

*:focus-visible {
    outline: 3px dashed var(--action-color);
    outline-offset: 3px;
}

*:focus {
    outline: none; /* Keep this, but rely on focus-visible */
}

/* --- Toggles --- */
.toggle-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    gap: 12px;
}

.toggle-container button {
    background-color: var(--bg-color);
    color: var(--text-color);
    border: var(--border-width) solid var(--border-color);
    padding: 8px 18px;
    border-radius: var(--border-radius-sharp);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 4px 4px 8px var(--shadow-color);
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.toggle-container button:hover {
    background-color: var(--highlight-bg);
    transform: translate(-1px, -1px);
    box-shadow: 5px 5px 10px var(--shadow-color);
}

.toggle-container button:active {
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 5px var(--shadow-color);
}

/* --- Modernized Header --- */
.immersive-header {
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: linear-gradient(135deg, #f4e9dd, #f9f3e9);
    padding: 60px 20px 40px 20px;
    position: relative;
    overflow: hidden;
    border-bottom: var(--border-width) solid var(--border-color);
}

.header-content {
    margin-bottom: 3vh;
    max-width: 850px;
    z-index: 10;
    position: relative;
}

.immersive-header h1 {
    margin-bottom: 0.4em;
    position: relative;
    z-index: 5;
}

.immersive-header h1::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 6px;
    background: var(--accent-brown);
    border-radius: 3px;
}

.immersive-header p {
    font-size: clamp(1.2rem, 3.5vw, 1.6rem);
    color: var(--primary-brown);
    max-width: 55ch;
    margin-left: auto;
    margin-right: auto;
    font-weight: 500;
}

.header-comparison-image {
    display: block;
    max-width: 95%;
    width: auto;
    max-height: 65vh;
    object-fit: contain;
    margin-top: 2vh;
    border-radius: var(--border-radius-soft);
    border: var(--border-width) solid var(--border-color);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 12px var(--shadow-color);
    background-color: transparent; /* Make background transparent */
    padding: 8px;
    z-index: 5;
    transition: transform 0.5s ease, filter 0.4s ease; /* Combine transitions */
}

.header-comparison-image:hover {
    transform: scale(1.02);
}

/* --- Scroll Down Arrow --- */
.scroll-down-link {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--accent-brown);
    font-size: 2.5rem;
    z-index: 20;
    opacity: 0.8;
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
    animation: bounce 2s infinite ease-in-out;
}

.scroll-down-link, .scroll-down-link:hover {
    background-color: transparent;
    text-decoration: none;
}

.scroll-down-link:hover {
    opacity: 1;
    transform: translateX(-50%) translateY(5px);
    color: var(--dark-brown);
}

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

/* --- Main Content Area --- */
main {
    padding: 80px 20px 60px 20px;
    max-width: 1200px; /* Expanded for larger content */
    margin: 0 auto;
}

/* --- Card Styling --- */
.card {
    background-color: var(--bg-color);
    padding: 40px 50px;
    margin-bottom: 60px;
    border-radius: var(--border-radius-sharp);
    border: var(--border-width) solid var(--border-color);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 12px var(--shadow-color);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s 0.1s ease-out forwards; /* Added slight delay */
    position: relative; /* Needed for pseudo-elements */
}

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

/* --- Input Section --- */
.input-section h2, .selection-section h2 {
    text-align: center;
    margin-bottom: 1.5em;
    position: relative;
}

.input-section h2::after, .selection-section h2::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--accent-brown);
    border-radius: 2px;
}

.input-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

#butter-amount, #butter-unit {
    padding: 16px 20px;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--border-radius-sharp);
    font-size: 1.2rem;
    background-color: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    box-shadow: inset 2px 2px 4px rgba(0,0,0,0.05);
    background: linear-gradient(to bottom, #ffffff, #f7f7f7); /* Added gradient from later rule */
    /* Merged styles from later rule */
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 
                0 2px 4px rgba(0,0,0,0.1),
                inset 2px 2px 4px rgba(0,0,0,0.05);
}

#butter-amount {
    width: 180px;
    text-align: right;
    flex-grow: 1;
    min-width: 120px;
}

#butter-unit {
    cursor: pointer;
    flex-shrink: 0;
    font-weight: 600;
}

#butter-amount:focus, #butter-unit:focus {
    border-color: var(--action-color);
    box-shadow: inset 2px 2px 4px rgba(0,0,0,0.05), 0 0 0 3px rgba(255, 112, 67, 0.3),
                 inset 0 1px 0 rgba(255,255,255,0.8); /* Keep inset white highlight */
    transform: translateY(-2px);
}

/* --- Main Action Button --- */
#start-experiment-btn {
    display: block;
    margin: 40px auto 0 auto;
    padding: 16px 45px;
    background-color: var(--action-color);
    color: var(--bg-color);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--border-radius-sharp);
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: var(--shadow-offset) var(--shadow-offset) 12px var(--shadow-color);
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

#start-experiment-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

#start-experiment-btn:hover {
    background-color: var(--action-hover-color);
    transform: translate(-3px, -3px);
    box-shadow: calc(var(--shadow-offset) + 3px) calc(var(--shadow-offset) + 3px) 15px var(--shadow-color);
}

#start-experiment-btn:hover::before {
    left: 100%;
}

#start-experiment-btn:active {
    transform: translate(var(--shadow-offset) / 2, var(--shadow-offset) / 2);
    box-shadow: calc(var(--shadow-offset) / 2) calc(var(--shadow-offset) / 2) 8px var(--shadow-color);
    transition-duration: 0.1s; /* Faster active transition */
}

.warning {
    color: var(--warning-color);
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    margin-top: 20px;
    border: 2px dashed var(--warning-color);
    padding: 12px;
    border-radius: var(--border-radius-sharp);
    background-color: rgba(217, 83, 79, 0.07);
}

/* --- Modern Cookie Selection Section --- */
.cookie-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Force 3 columns */
    gap: 40px;
    margin-top: 40px;
}

.cookie-option {
    text-align: center;
    padding: 40px 30px;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--border-radius-sharp);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, border-color 0.3s ease; /* Specific transitions */
    background-color: var(--bg-color);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 12px var(--shadow-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

/* Add subtle pattern to cookie cards */
.cookie-option::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%239C92AC' fill-opacity='0.05' fill-rule='evenodd'%3E%3Ccircle cx='3' cy='3' r='3'/%3E%3Ccircle cx='13' cy='13' r='3'/%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.7;
    z-index: 0;
    transition: opacity 0.3s ease;
}

/* Add chocolate chip spots to cookie cards */
.cookie-option::after { /* Combined with shine effect logic later */
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-image: radial-gradient(var(--primary-brown) 10%, transparent 10%),
                      radial-gradient(var(--primary-brown) 10%, transparent 10%);
    background-position: 0 0, 30px 30px;
    background-size: 60px 60px;
    opacity: 0.05;
    z-index: 0;
    transition: opacity 0.3s ease;
}


.cookie-option img {
    width: 280px; /* Much larger images */
    height: 280px;
    object-fit: contain; /* Ensures the whole image is visible */
    border-radius: 50%;
    margin: 0 auto 30px auto;
    border: var(--border-width) solid var(--border-color);
    /* transition moved to .header-comparison-image (shared) */
    padding: 8px;
    background-color: transparent; /* Transparent background */
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.2));
    transition: transform 0.4s ease, filter 0.4s ease, border-color 0.3s ease; /* Specific */
}

.cookie-option h3 {
    margin-bottom: 0.5em;
    color: var(--dark-brown);
    font-size: 1.8rem;
    position: relative;
    z-index: 1;
}

.cookie-option p {
    font-size: 1.1rem;
    color: var(--primary-brown);
    margin-bottom: 0;
    flex-grow: 1;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.cookie-option:hover {
    transform: translate(-4px, -4px) rotate(-1deg);
    box-shadow: calc(var(--shadow-offset) + 4px) calc(var(--shadow-offset) + 4px) 15px var(--shadow-color);
    background-color: var(--highlight-bg);
}

.cookie-option:hover img {
    transform: scale(1.05) rotate(5deg);
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.3));
}

.cookie-option:hover::before, .cookie-option:hover::after {
    opacity: 0.1; /* Slightly fade pattern/chips on hover if desired */
}

.cookie-option.selected {
    border-color: var(--action-color);
    background-color: rgba(255, 112, 67, 0.08);
    transform: translate(2px, 2px);
    box-shadow: calc(var(--shadow-offset) - 2px) calc(var(--shadow-offset) - 2px) 8px var(--action-color);
}

.cookie-option.selected img {
    border-color: var(--action-color);
    transform: scale(1.02);
    filter: drop-shadow(0 8px 12px rgba(255, 112, 67, 0.4));
}

/* Add subtle shine effect to selected cookie - Modified to use ::after */
.cookie-option.selected::after {
    /* Keep chip background */
    background-image: radial-gradient(var(--primary-brown) 10%, transparent 10%),
                      radial-gradient(var(--primary-brown) 10%, transparent 10%),
                      /* Add shine on top */
                      radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 60%);
    background-position: 0 0, 30px 30px, 50% 50%; /* Center the shine */
    background-size: 60px 60px, 60px 60px, 200% 200%; /* Control shine size */
    opacity: 1; /* Ensure it's visible */
    /* Reset chip opacity potentially */
     background-blend-mode: overlay; /* Experiment with blend modes */

    /* Animation */
    animation: shine 2s infinite linear;
    top: 0; /* Reset positioning if needed */
    left: 0;
    width: 100%;
    height: 100%;
}

@keyframes shine {
    /* Rotating the shine gradient - adjust if needed */
     0% { background-position: 0 0, 30px 30px, 50% 50%; } /* Initial state */
     /* This rotation might be too complex with multiple backgrounds.
        Maybe just animate opacity or position of the shine layer?
        Let's simplify - just keep the chip pattern static and overlay the shine */
     /* Alternative: animate the shine position or opacity instead of rotation */
}

/* --- Recipe Display Section --- */
.recipe-section h2 {
    text-align: center;
    margin-bottom: 1em;
    color: var(--accent-brown);
    position: relative;
}

.recipe-section h2::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--accent-brown);
    border-radius: 2px;
}

.recipe-yield {
    text-align: center;
    font-style: normal;
    color: var(--primary-brown);
    margin-bottom: 40px;
    font-size: 1.3rem;
    font-weight: 600;
    background-color: var(--highlight-bg);
    padding: 8px 20px;
    border-radius: var(--border-radius-sharp);
    display: inline-block;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    border: 1px solid var(--highlight-border); /* Add subtle border */
}

.ingredients-title, .prep-tech-title, .steps-title {
    font-size: 2rem;
    color: var(--dark-brown);
    margin-top: 2em;
    margin-bottom: 1.2em;
    padding-bottom: 0.5em;
    border-bottom: var(--border-width) solid var(--border-color);
    position: relative;
}

.ingredients-title::before, .prep-tech-title::before, .steps-title::before {
    content: "🍪";
    margin-right: 10px;
    font-size: 1.8rem;
}

.prep-tech-title::before {
    content: "⏲️";
}

.steps-title::before {
    content: "👨‍🍳";
}

.ingredient-list ul, .recipe-steps ol {
    list-style-position: outside;
    padding-left: 30px;
    margin-bottom: 40px;
}

.ingredient-list li, .recipe-steps li {
    margin-bottom: 1.2em;
    font-size: 1.1rem;
}

.ingredient-list strong {
    display: inline-block;
    min-width: 130px;
    margin-right: 15px;
    font-weight: 700;
    color: var(--text-color);
}

.ingredient-list .unit-notes, /* Use a class for notes like (large) */
.ingredient-list .unit-g,
.ingredient-list .unit-cups {
    font-size: 0.95em;
    color: var(--primary-brown);
    margin-left: 5px;
    display: inline-block;
}

.recipe-steps li {
    line-height: 1.9;
}

.recipe-steps li::marker {
    font-weight: 700;
    color: var(--accent-brown);
    font-size: 1.2em;
}

.recipe-steps strong {
    font-weight: 700;
    background-color: var(--highlight-bg);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    color: var(--text-color);
    border: 1px solid var(--highlight-border);
}

/* --- Pro Tips & Notes --- */
.pro-tip, .note {
    background-color: var(--highlight-bg);
    padding: 30px 35px;
    border-radius: var(--border-radius-sharp);
    margin: 40px 0;
    border: var(--border-width) solid var(--border-color);
    border-left: 8px solid var(--highlight-border);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 12px rgba(0,0,0,0.12);
    position: relative;
    font-size: 1.1rem;
}

.note {
    background-color: var(--secondary-highlight-bg);
    border-left-color: var(--secondary-highlight-border);
}

.pro-tip h4, .note h4 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--text-color);
    margin-top: 0;
    margin-bottom: 0.8em;
    border-bottom: 2px dashed var(--primary-brown);
    padding-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex; /* Use flex for icon alignment */
    align-items: center;
}

.pro-tip h4::before, .note h4::before { /* Added icons via CSS */
    margin-right: 10px;
    font-size: 1.5rem; /* Adjust icon size */
    line-height: 1; /* Prevent extra space */
}

.pro-tip h4::before {
     content: "💡"; /* Lightbulb emoji */
}

.note h4::before {
     content: "📝"; /* Note emoji */
}


#stuffed-easter-egg .pro-tip h4, #chocolate-recommendation h4 {
    font-family: 'Caveat', cursive;
    font-size: 2rem;
    text-transform: none;
    letter-spacing: normal;
    color: var(--dark-brown);
    border-bottom-style: solid;
    border-bottom-color: var(--highlight-border);
}

#chocolate-recommendation h4 {
    border-bottom-color: var(--secondary-highlight-border);
}

.pro-tip p, .note p {
    margin-bottom: 0.8em;
    line-height: 1.7;
}

.pro-tip code, .note code {
    background-color: rgba(0,0,0,0.08);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.95em;
    color: var(--text-color);
    border: 1px solid rgba(0,0,0,0.1);
}

.pro-tip p + p, .note p + p {
    margin-top: 1em;
}

/* --- Easter Egg --- */
.easter-egg {
    background: repeating-linear-gradient(
        45deg,
        var(--secondary-highlight-bg),
        var(--secondary-highlight-bg) 15px,
        #c8e6c9 15px,
        #c8e6c9 30px
    );
    border: var(--border-width) solid var(--border-color);
    margin-top: 60px;
    padding: 50px;
    border-radius: var(--border-radius-sharp);
}

.easter-egg h2 {
    text-align: center;
    color: var(--secondary-highlight-border);
    font-weight: 700;
    background-color: var(--bg-color);
    padding: 15px 25px;
    display: inline-block;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--border-radius-sharp);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 12px var(--shadow-color);
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

.stuffed-image {
    max-width: 350px;
    margin: 40px auto;
    border-radius: var(--border-radius-sharp);
    border: var(--border-width) solid var(--border-color);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 12px var(--shadow-color);
    padding: 12px;
    background-color: #fff;
}

.easter-egg .pro-tip {
    background-color: var(--bg-color);
    border-left-color: var(--action-color);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 12px rgba(255, 112, 67, 0.2); /* Adjusted shadow to match action color */
}

.easter-egg .pro-tip h4 {
    color: var(--action-color);
    border-bottom-color: var(--action-color);
}

/* --- Conclusion & Footer --- */
.conclusion {
    text-align: center;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border-top: var(--border-width) solid var(--border-color);
    border-bottom: var(--border-width) solid var(--border-color);
    padding-top: 50px;
    padding-bottom: 50px;
}

.conclusion h2 {
    color: #2e7d32;
    text-transform: uppercase;
    position: relative;
}

.conclusion h2::after {
    content: "";
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: #2e7d32;
    border-radius: 2px;
}

.conclusion p {
    max-width: 60ch;
    margin-left: auto;
    margin-right: auto;
    font-weight: 500;
    font-size: 1.2rem;
}

.conclusion strong {
    font-weight: 700;
}

.conclusion a {
    color: var(--bg-color);
    background-color: #2e7d32;
    padding: 4px 10px;
    border-radius: 6px;
    text-decoration: none;
    border: 1px solid #1b5e20;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease; /* Added transition */
}

.conclusion a:hover {
    background-color: #1b5e20;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

footer {
    text-align: center;
    padding: 40px;
    margin-top: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-brown);
    background: linear-gradient(135deg, #f4e9dd, #f9f3e9);
    border-top: var(--border-width) solid var(--border-color);
}

/* --- RTL Support --- */
html[dir="rtl"] {
    body {
        /* Consider specific Arabic font */
    }

    .toggle-container { left: 20px; right: auto; }
    #butter-amount { text-align: left; } /* Should be right for RTL numbers? Test needed */
    .ingredient-list ul, .recipe-steps ol { padding-left: 0; padding-right: 30px; }
    .ingredient-list strong { margin-left: 15px; margin-right: 0; }
    .ingredient-list .unit-notes, /* RTL spacing */
    .ingredient-list .unit-g, 
    .ingredient-list .unit-cups { margin-left: 0; margin-right: 5px; }

    .pro-tip, .note { 
        border-left: var(--border-width) solid var(--border-color); /* Reset left */
        border-right: 8px solid var(--highlight-border); /* Add right */
        border-left-width: var(--border-width); /* Ensure left is standard */
    }
    .note { border-right-color: var(--secondary-highlight-border); }
    .easter-egg .pro-tip { 
        border-left: var(--border-width) solid var(--border-color); /* Reset left */
        border-right: 8px solid var(--action-color); /* Add right */
    }
    
    .pro-tip h4::before, .note h4::before { /* RTL icon spacing */
         margin-right: 0;
         margin-left: 10px;
    }
    
    .card::before { /* Decorative element RTL */
        right: auto;
        left: 10px;
    }

    .ingredient-list li:hover { /* RTL hover effect */
        transform: translateX(-5px);
    }
}

/* --- Media Queries --- */
@media (max-width: 1000px) {
    .cookie-options {
        /* Changed to 2 columns earlier on larger screens */
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* More flexible */
        gap: 30px;
    }
    
    .cookie-option img {
        width: 220px;
        height: 220px;
    }
    
    main {
        padding: 60px 20px 50px 20px; /* Slightly adjust padding */
    }
}

@media (max-width: 768px) {
    :root {
        --border-width: 2px;
        --shadow-offset: 4px;
        --border-radius-sharp: 10px; /* Slightly smaller radius */
        --border-radius-soft: 20px;
    }
    
    .card { padding: 30px 25px; margin-bottom: 40px; }
    main { padding: 50px 15px 40px 15px; } /* Reduce side padding */
    .immersive-header { padding: 70px 15px 40px 15px; }
    .header-comparison-image { max-height: 50vh; }
    
    h1 { font-size: clamp(2.2rem, 7vw, 3rem); }
    h2 { font-size: clamp(1.8rem, 6vw, 2.4rem); }
    
    .cookie-options {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Adjust minmax */
    }
    
    .cookie-option img { width: 200px; height: 200px; }

    #start-experiment-btn { padding: 14px 35px; font-size: 1.2rem; }
    .toggle-container button { padding: 8px 16px; font-size: 0.9rem; box-shadow: 3px 3px 6px var(--shadow-color); }
    .toggle-container button:hover { box-shadow: 4px 4px 8px var(--shadow-color); }
    .toggle-container button:active { box-shadow: 1px 1px 3px var(--shadow-color); }
    
    .pro-tip, .note { padding: 25px 20px; } /* Reduce padding */
    .pro-tip h4, .note h4 { font-size: 1.4rem; }
    #stuffed-easter-egg .pro-tip h4, #chocolate-recommendation h4 { font-size: 1.8rem; }
    
    .easter-egg { padding: 35px 25px; }
    
    .ingredients-title, .prep-tech-title, .steps-title {
        font-size: 1.9rem; /* Adjust size */
    }
    .ingredients-title::before, .prep-tech-title::before, .steps-title::before {
        font-size: 1.7rem; /* Adjust size */
    }

}

@media (max-width: 480px) {
     :root {
         --border-radius-sharp: 8px;
         --border-radius-soft: 16px;
     }
    .card { padding: 25px 15px; } /* Reduce padding more */
    main { padding: 40px 10px 30px 10px; }
    .immersive-header { padding: 60px 10px 30px 10px; }
    .header-comparison-image { max-height: 40vh; padding: 5px; } /* Reduce height and padding */

    .cookie-options {
        grid-template-columns: 1fr; /* Single column */
        gap: 30px;
    }
    
    .cookie-option {
        padding: 30px 20px;
    }

    .cookie-option img { width: 160px; height: 160px; padding: 4px; margin-bottom: 20px; } /* Smaller image */
    
    .input-group { flex-direction: column; gap: 10px; align-items: stretch; } /* Stack inputs */
    #butter-amount { width: 100%; text-align: center; }
    #butter-unit { width: 100%; text-align: center; }


    .ingredient-list strong { min-width: 90px; margin-right: 8px; } /* Adjust spacing */
    html[dir="rtl"] .ingredient-list strong { margin-left: 8px; margin-right: 0; }
    footer { padding: 25px 15px; font-size: 1rem; }
    
    .immersive-header h1::after,
    .input-section h2::after,
    .selection-section h2::after,
    .recipe-section h2::after,
    .conclusion h2::after {
        width: 50px; /* Smaller underlines */
        height: 3px;
        bottom: -8px;
    }
    
    .ingredients-title, .prep-tech-title, .steps-title {
        font-size: 1.7rem;
    }
    
    .ingredients-title::before, .prep-tech-title::before, .steps-title::before {
        font-size: 1.5rem;
    }
    
    .pro-tip, .note {
        padding: 20px 15px;
        font-size: 1rem; /* Slightly smaller text */
    }
    .pro-tip h4, .note h4 { font-size: 1.3rem; }
     #stuffed-easter-egg .pro-tip h4, #chocolate-recommendation h4 { font-size: 1.6rem; }
     
     .toggle-container { top: 10px; right: 10px; gap: 8px; }
     html[dir="rtl"] .toggle-container { left: 10px; right: auto; }
     .toggle-container button { padding: 6px 12px; font-size: 0.8rem; }

}

/* Cookie Background Elements */
.cookie-crumb { /* Consider removing if not used or implement JS to add them */
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: var(--accent-brown);
    border-radius: 50%;
    opacity: 0.6;
    pointer-events: none;
    z-index: 0;
}

.immersive-header::before { /* Decorative background shapes */
    content: "";
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--highlight-bg) 0%, transparent 70%);
    top: 15%;
    right: -100px;
    opacity: 0.4; /* Reduced opacity */
    border-radius: 50%;
    z-index: 1;
    pointer-events: none; /* Ensure they don't interfere */
}

.immersive-header::after { /* Decorative background shapes */
    content: "";
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--highlight-bg) 0%, transparent 70%);
    bottom: 10%;
    left: -80px;
    opacity: 0.3; /* Reduced opacity */
    border-radius: 50%;
    z-index: 1;
     pointer-events: none; /* Ensure they don't interfere */
}


/* Add subtle animations */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); } /* Reduced float amount */
    100% { transform: translateY(0px); }
}

.header-comparison-image {
    animation: float 6s ease-in-out infinite;
}

/* Additional decorative elements */
.card::before { /* Small decorative dot on cards */
    content: "";
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px; /* Smaller */
    height: 30px; /* Smaller */
    background: radial-gradient(circle, var(--accent-brown) 0%, transparent 60%); /* Adjusted gradient */
    opacity: 0.08; /* Reduced opacity */
    border-radius: 50%;
    z-index: 0;
     pointer-events: none;
     transition: opacity 0.3s ease, transform 0.3s ease;
}

.card:hover::before {
    opacity: 0.15;
    transform: scale(1.1);
}

/* Recipe section enhancements */
.ingredient-list li {
    position: relative;
    padding-left: 5px;
    transition: transform 0.2s ease;
}
html[dir="rtl"] .ingredient-list li { padding-left: 0; padding-right: 5px; }


.ingredient-list li:hover {
    transform: translateX(5px);
}
html[dir="rtl"] .ingredient-list li:hover { transform: translateX(-5px); }


.recipe-steps li {
    position: relative;
    transition: background-color 0.3s ease;
    padding: 8px 10px; /* Added padding for hover effect */
    border-radius: var(--border-radius-sharp);
    margin-left: -10px; /* Counteract padding */
    margin-right: -10px;
}
html[dir="rtl"] .recipe-steps li { margin-left: -10px; margin-right: -10px; }

.recipe-steps li:hover {
    background-color: rgba(255, 251, 235, 0.6); /* Slightly more visible hover */
}
