/* ================================
   Custom Cursor (desktop only)
================================ */
@media (hover: hover) and (pointer: fine) {
    *, *::before, *::after {
        cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M5 2 C5 2 5 24 5 24 L10 18 L15 28 L18 27 L13 17 L21 17 Z' fill='white' stroke='black' stroke-width='2' stroke-linejoin='round' stroke-linecap='round'/%3E%3C/svg%3E") 5 2, auto !important;
    }
}

/* ================================
   Keyframe Animations
================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes sectionEnter {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

:root {
    --bg-color: #fcf8ed;
    --text-color: #0b0b0b;
    --border-color: #0b0b0b;
    --nav-padding: 0.5rem 2rem;
    --card-bg: transparent;
}

/* ================================
   Dark Mode (lamp = ON)
================================ */
body.dark-mode {
    --bg-color: #111010;
    --text-color: #ede9db;
    --border-color: #ede9db;
}

/* Smooth theme transition on key elements */
body,
.nav-container,
.mac-file,
.paper-sheet,
#file-text-display,
.windows-folder-back,
.windows-folder-front,
.ttt-cell,
.arrow-circle {
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

/* Sticker text */
body.dark-mode .sticker-text {
    color: #7aaff5;
}
body.dark-mode .sticker-text::before {
    -webkit-text-stroke-color: #111010;
}

/* Puzzle icon in products */
body.dark-mode .puzzle-sticker-wrapper .main {
    fill: #ede9db;
}
body.dark-mode .puzzle-sticker-wrapper .shadow {
    fill: #111010;
    stroke: #111010;
}

/* Arrow circle */
body.dark-mode .arrow-circle {
    border-color: #7aaff5;
    color: #7aaff5;
}
body.dark-mode #dark-everywhere-sticker:hover .arrow-circle {
    background: #7aaff5;
    color: #111010;
}

/* Nav */
body.dark-mode .nav-container {
    background: rgba(17, 16, 16, 0.95) !important;
}
body.dark-mode .nav-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: #ede9db;
}
body.dark-mode .nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ccc;
}

/* Tic-Tac-Toe */
body.dark-mode .ttt-cell {
    border-color: #ede9db;
    color: #ede9db;
}
body.dark-mode .ttt-cell.x-cell,
body.dark-mode .ttt-cell.o-cell {
    color: #ede9db;
}
body.dark-mode .ttt-status { color: #ede9db; }
body.dark-mode .ttt-reset {
    border-color: #ede9db;
    color: #ede9db;
    background: transparent;
}
body.dark-mode .ttt-reset:hover {
    background: #ede9db;
    color: #111010;
}

/* Contact pills — keep their colourful bg, just fix text & border */
body.dark-mode .contact-pill {
    border-color: transparent;
}
body.dark-mode .contact-pill:hover {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: #ede9db !important;
}

/* Polaroid and Postcard — unchanged in dark mode */

/* Folders */
body.dark-mode .windows-folder-back,
body.dark-mode .windows-folder-back::before {
    background-color: #4a3010;
}
body.dark-mode .windows-folder-front { background-color: #7a5214; }
body.dark-mode .mac-file { background-color: #1e1e1e; }
body.dark-mode .mac-file::before {
    background: 
        linear-gradient(to right, #444 70%, transparent 70%) 0 0px / 100% 2px no-repeat,
        linear-gradient(to right, #444 100%, transparent 100%) 0 8px / 100% 2px no-repeat,
        linear-gradient(to right, #444 85%, transparent 85%) 0 16px / 100% 2px no-repeat,
        linear-gradient(to right, #444 95%, transparent 95%) 0 24px / 100% 2px no-repeat,
        linear-gradient(to right, #444 40%, transparent 40%) 0 32px / 100% 2px no-repeat;
}
body.dark-mode .mac-file::after {
    background-color: #111010;
    border-color: #ede9db;
}
body.dark-mode .folder-name { color: #ede9db; }

/* Paper / file display */
body.dark-mode .paper-sheet { background-color: #1a1a1a; }
body.dark-mode .text-content { color: #ede9db !important; }
body.dark-mode #file-text-display { background-color: #111010; }
body.dark-mode .back-btn {
    background: #1e1e1e !important;
    border-color: #ede9db !important;
    color: #ede9db !important;
}


/* Draggable elements — cursor + prevent native browser drag */
.draggable {
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none; /* Essential for mobile dragging */
}
.draggable img, .draggable svg {
    pointer-events: none;
    -webkit-user-drag: none;
}

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

body,
html {
    width: 100%;
    height: 100%;
    font-family: 'Instrument Serif', serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
    overflow-x: hidden; /* Prevent horizontal scroll from sticker pseudo-elements */
}

body.is-dragging {
    touch-action: none !important;
    user-select: none !important;
    overflow: hidden !important;
}

#page-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    position: relative;
}

/* Main Content Area */
#main-content {
    flex: 1;
    position: relative;
    padding: 2rem;
    overflow-y: auto;
}

/* Sections */
.view-section {
    display: none; /* Hidden by default */
    width: 100%;
    height: 100%;
    opacity: 0;
}

.view-section.active {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    animation: sectionEnter 0.45s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

#home {
    justify-content: flex-start;
    align-items: center;
    padding-left: 5vw;
}

/* On desktop, .middle-row is just a transparent passthrough — children are position:absolute */
.middle-row {
    display: contents;
}

.hero {
    user-select: none;
    -webkit-user-select: none;
}

.hero h1 {
    font-size: clamp(3rem, 7vw, 6rem);
    font-weight: 400;
    line-height: 1;
    letter-spacing: -0.02em;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.08em;
}

/* Earth sticker beside heading */
.earth-line {
    display: flex;
    align-items: center;
    gap: 0.25em;
    line-height: 1;
}

.hero-second-line {
    display: flex;
    align-items: center;
    line-height: 1;
}



/* Sticker Text Effect */
.sticker-text {
    position: absolute;
    right: 5vw;
    top: 8%;
    transform: translateY(-50%) rotate(-4deg);
    font-size: clamp(4rem, 8vw, 7rem);
    font-family: 'Instrument Serif', serif;
    color: #14079d;
    /* Navy blue color requested by user */
    display: inline-block;
    filter: drop-shadow(4px 8px 12px rgba(0, 0, 0, 0.15));
    z-index: 10;
}

.sticker-text::before {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    -webkit-text-stroke: 18px white;
    z-index: -1;
}

/* Cards Section */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 2vw;
    width: 90%;
    max-width: 1200px;
    height: 80%;
    margin: 0 auto;
}

.card {
    border: 1px solid var(--border-color);
    border-radius: 2.5rem;
    /* Pill-like corners on cards */
    background: var(--card-bg);
}

.card:nth-child(3) {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
}

/* Products Specific Layout - Top Left as requested */
#products.active {
    justify-content: flex-start;
    align-items: flex-start;
    padding: 10vh 10vw;
}

#dark-everywhere-sticker {
    transform: rotate(3deg);
    display: flex !important;
    align-items: center !important;
    gap: 1.5rem;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: grab;
    z-index: 10;
}

#dark-everywhere-sticker:hover {
    transform: rotate(0deg) scale(1.05);
}

#dark-everywhere-sticker .product-link {
    text-decoration: none !important;
    color: inherit;
    line-height: 0.6;
    /* very low vertical spacing */
    display: block;
    text-transform: lowercase;
}

.puzzle-sticker-wrapper {
    display: inline-block;
    width: 1.2em;
    height: 1.2em;
    margin-left: 1rem;
    position: relative;
}

.puzzle-sticker-wrapper svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    display: block;
}

.puzzle-sticker-wrapper .main {
    fill: #000;
    /* completely black */
}

.puzzle-sticker-wrapper .shadow {
    fill: white;
    stroke: white;
    stroke-width: 16px;
    /* prominent sticker stroke */
    stroke-linejoin: round;
}

#dark-everywhere-sticker .sticker-text {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    transform: none !important;
    display: inline-block;
    font-size: clamp(3rem, 7vw, 5.5rem);
}

#dark-everywhere-sticker .sticker-text::before {
    -webkit-text-stroke: 16px white;
    /* matched to icon stroke */
}

/* Arrow inside circle effect */
.arrow-container {
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: translateX(-15px) rotate(15deg);
}

#dark-everywhere-sticker:hover .arrow-container {
    opacity: 1;
    transform: translateX(0) rotate(0deg);
}

.arrow-circle {
    width: 60px;
    height: 60px;
    border: 2px solid #14079d;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #14079d;
    font-size: 2rem;
    transition: all 0.3s ease;
}

#dark-everywhere-sticker:hover .arrow-circle {
    background: #14079d;
    color: #fff9ed;
}

/* Contact and T&C fallback styles */
.contact-content,
.tc-content {
    margin: 0 auto;
    text-align: center;
}

/* Navigation */
.bottom-nav {
    position: fixed;
    bottom: 5vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
}

.nav-container {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 0.25rem;
    background-color: var(--bg-color);
    /* overlap nicely over content if scrolled */
    gap: 0.5rem;
}

.nav-link {
    font-family: 'Cedarville Cursive', cursive;
    font-size: 1.5rem;
    text-decoration: none;
    color: var(--text-color);
    padding: 0.25rem 1.5rem;
    border-radius: 50px;
    border: 1px solid transparent;
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, color 0.25s ease;
    cursor: pointer;
    z-index: 10001;
}

.nav-link:hover {
    color: #444;
    background: rgba(0,0,0,0.04);
}

.nav-link.active {
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 2px 4px 12px rgba(0,0,0,0.08);
    color: #000;
}

/* T&C Specific Layout */
#tc.active {
    justify-content: center;
    align-items: flex-start;
}

#file-text-display {
    display: flex !important;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    /* Ensure the page is completely white */
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    z-index: 200;
    /* Over everything */
    padding: 2rem 0;
}

#file-text-display.hidden-folder-view {
    display: none !important;
}

.text-content {
    white-space: pre-wrap;
    /* Preserve newlines from the script */
    word-break: break-word;
}

.hidden-nav {
    display: none !important;
}

/* Sticker Tape & Brand Stickers */
.sticker-tape {
    position: absolute;
    width: 140px;
    height: 30px;
    opacity: 0.65;
    z-index: 60;
    pointer-events: none;
    backdrop-filter: blur(1px);
    /* Slight translucent tape feel */
    border-radius: 2px;
}

.brand-sticker {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: white;
    font-weight: bold;
    border: 3px solid white;
    /* Thick white border for sticker look */
    box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.1);
    transform: rotate(-10deg);
    cursor: grab;
    user-select: none;
}

.brand-sticker:hover {
    transform: rotate(0deg) scale(1.1);
}

/* Labs.google Style Contact Section */
.labs-style {
    position: relative;
    overflow: hidden;
    background: #fdfdfd;
}

.labs-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.blob-wrapper {
    position: absolute;
    bottom: -10vh;
    left: 0;
    width: 100%;
    height: 60vh;
    display: flex;
    align-items: flex-end;
    pointer-events: none;
}

.blob {
    position: absolute;
    filter: blur(2px);
    transition: transform 1s ease-in-out;
}

.labs-pill {
    position: absolute;
    background-color: #42f59e; /* Bright Labs Green */
    border-radius: 50px;
    padding: 12px 35px;
    font-family: 'Instrument Serif', serif;
    color: #111;
    font-size: 1.4rem;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    z-index: 50;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s;
    white-space: nowrap;
}

.labs-pill:hover {
    transform: scale(1.05) translateY(-5px) !important;
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

/* Social Media Contact pills & Games */
.contact-split-layout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 0 5vw;
}

.contact-pills-side {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3rem;
    flex: 1;
}

.contact-game-side {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center status and button relative to the board */
    justify-content: center;
    gap: 1.5rem;
    flex: 1;
}

/* Tic Tac Toe Board */
.ttt-board {
    display: grid;
    grid-template-columns: repeat(3, 110px);
    grid-template-rows: repeat(3, 110px);
    /* No outer background/padding as requested */
    background: transparent;
    padding: 0;
}

.ttt-cell {
    background: transparent; /* No white background */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-family: 'Instrument Serif', serif;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
    
    /* Classic 4-line grid style */
    border-right: 4px solid #000;
    border-bottom: 4px solid #000;
}

/* Remove borders on outer edges to create the 4-line grid look */
.ttt-cell:nth-child(3n) { border-right: none; }
.ttt-cell:nth-child(n+7) { border-bottom: none; }

.ttt-cell:hover {
    background: rgba(0, 0, 0, 0.03); /* Very subtle hover feel */
}

.ttt-cell.x-cell { color: #000; } /* Set to pure black as requested */
.ttt-cell.o-cell { color: #000; } /* Set to pure black as requested */

.ttt-status {
    font-family: 'Instrument Serif', serif;
    font-size: 1.8rem;
    color: #111;
}

.ttt-reset {
    padding: 10px 25px;
    border: 2px solid #000;
    background: transparent;
    font-family: 'Instrument Serif', serif;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s;
}

.ttt-reset:hover {
    scale: 1.1;
    background: #000;
    color: white;
}

.contact-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem 3rem;
    border-radius: 100px;
    font-family: 'Instrument Serif', serif;
    font-size: 1.8rem;
    text-decoration: none;
    color: #111;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid #000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    cursor: pointer;
    z-index: 50;
    
    /* Floating Animation */
    animation: float-around 5s ease-in-out infinite;
}

/* Offset animation timing for more natural movement */
.contact-pill:nth-child(2) {
    animation-delay: -2.5s;
    animation-duration: 6s;
}

.contact-pill:nth-child(3) {
    animation-delay: -1.2s;
    animation-duration: 5.5s;
}

.contact-pill:hover, 
.contact-pill:active {
    transform: scale(1.1) translateY(-10px) rotate(0deg) !important;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    background-color: white !important;
    animation-play-state: paused;
}

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

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

@media (max-width: 768px) {

    /* ── Base ── */
    html { font-size: 14px; overflow-x: hidden; }

    body, html { overflow: hidden; overflow-x: hidden; }

    #page-container { overflow-x: hidden; }

    #main-content {
        padding: 0.5rem;
        overflow-x: hidden;
        overflow-y: auto;
        position: relative;
        touch-action: pan-y;
        -webkit-overflow-scrolling: touch;
        overflow: hidden; /* sections switch, not scroll between them */
    }

    /* ── Sections ── */
    .view-section {
        height: auto !important;
        min-height: 100%;
        overflow-x: hidden;
        overflow-y: visible;
    }

    .view-section.active {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        overflow: visible;
        /* Account for bottom nav + iOS home indicator */
        padding-bottom: calc(18vh + env(safe-area-inset-bottom, 0px));
    }

    /* ── HOME ── */
    #home.active {
        padding: 1rem 1rem calc(18vh + 20px) 1rem;
        gap: 1.2rem;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        height: 100% !important;
        display: flex !important;
    }

    .hero { order: 1; width: 100%; text-align: center; flex-shrink: 0; display: block; position: static; margin: 0 auto; user-select: none; -webkit-user-select: none; }
    .hero h1 span { display: block; width: 100%; text-align: center; }
    #home.active .middle-row { order: 2; display: flex !important; flex-direction: column !important; align-items: center !important; gap: 1.2rem; width: 100%; }
    #home.active .middle-row .sticker-text {
        position: relative !important;
        top: auto !important; right: auto !important;
        left: auto !important; bottom: auto !important;
        transform: rotate(-3deg) !important;
        align-self: center;
    }

    .hero h1 {
        font-size: clamp(2.2rem, 7.5vw, 3rem);
        line-height: 1.05;
        gap: 0.05em;
        align-items: center;
    }

    .lamp-wrapper {
        margin-left: 0.2rem;
    }

    .lamp-svg {
        width: 60px;
        height: 60px;
    }

    .light-beam {
        width: 90px;
        height: 50px;
        right: 50%;
    }

    /* "welcome" sticker */
    .sticker-text {
        position: relative !important;
        top: auto !important; right: auto !important;
        left: auto !important; bottom: auto !important;
        transform: rotate(-3deg) !important;
        font-size: 2.6rem !important;
        text-align: center;
        margin: 0 auto !important;
        display: block;
        flex-shrink: 0;
        pointer-events: auto !important;
        cursor: grab;
        width: fit-content;
    }

    .sticker-text::before {
        -webkit-text-stroke: 10px white;
        pointer-events: none; /* Don't let the outline steal touches */
    }

    /* Postcard */
    .postcard {
        position: relative !important;
        bottom: auto !important;
        right: auto !important;
        top: auto !important;
        left: auto !important;
        transform: rotate(2deg) !important;
        width: 75vw !important;
        max-width: 280px !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 auto !important;
        flex-shrink: 0;
        cursor: grab;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    .postcard-bg {
        position: absolute !important;
        top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
    }
    .postcard-bg-solid {
        position: absolute !important;
        top: 8px !important; left: 8px !important; right: 8px !important; bottom: 8px !important;
    }
    .postcard-content {
        padding: 20px !important;
        gap: 0.4rem !important;
        position: relative !important;
        width: 100% !important;
    }
    .stamp-img {
        width: 100% !important;
        max-height: 160px !important;
        height: auto !important;
        object-fit: contain !important;
        margin: 0 auto !important;
        display: block !important;
        mix-blend-mode: multiply;
    }
    .postcard h3 { font-size: 1.1rem !important; line-height: 1.1 !important; margin: 0 !important; }
    .postcard-date { font-size: 1rem !important; }

    /* Polaroid */
    .polaroid-wrapper {
        position: relative !important;
        top: auto !important; right: auto !important;
        left: auto !important; bottom: auto !important;
        transform: translateY(0) rotate(-3deg) !important;
        width: 75vw !important;
        max-width: 280px !important;
        height: auto !important;
        overflow: visible !important;
        padding: 10px 10px 45px 10px !important;
        margin: 0 auto !important;
        box-shadow: 0 4px 18px rgba(0,0,0,0.15) !important;
        overflow: visible !important;
        background-color: #fff !important;
        flex-shrink: 0;
        cursor: grab;
    }

    .polaroid-img {
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        object-fit: cover !important;
        object-position: center top !important;
        display: block !important;
    }

    .polaroid-caption {
        font-size: 0.95rem !important;
        margin-top: 6px !important;
        display: block !important;
        text-align: center !important;
        color: #333 !important;
        position: absolute !important;
        bottom: 8px !important;
        left: 0 !important;
        right: 0 !important;
    }

    /* Hide sticker tapes on mobile — they break layout */
    .sticker-tape {
        display: none !important;
    }

    /* ── PRODUCTS ── */
    #products.active {
        padding: 3rem 1.5rem !important;
        align-items: center !important;
    }

    #dark-everywhere-sticker {
        width: 100%;
        max-width: 100%;
        transform: rotate(2deg);
    }

    #dark-everywhere-sticker .sticker-text {
        font-size: 2.2rem !important;
    }

    #dark-everywhere-sticker .sticker-text::before {
        -webkit-text-stroke: 10px white;
    }

    .puzzle-sticker-wrapper {
        width: 1em;
        height: 1em;
        margin-left: 0.4rem;
    }

    /* Arrow always visible on touch (no hover state on mobile) */
    .arrow-container {
        opacity: 1 !important;
        transform: none !important;
    }

    .arrow-circle {
        width: 44px;
        height: 44px;
    }

    /* ── CONTACT ── */
    .contact-split-layout {
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: center !important;
        gap: 2.5rem;
        padding: 2rem 1rem !important;
        height: auto !important;
    }

    .contact-pills-side {
        width: 100%;
        align-items: center;
        gap: 1.5rem;
    }

    .contact-pill {
        font-size: 1.2rem;
        padding: 0.9rem 1.8rem;
        min-height: 44px; /* Minimum touch target */
        display: inline-flex;
        align-items: center;
        justify-content: center;
        -webkit-tap-highlight-color: transparent; /* Cleaner touch interaction */
    }

    .contact-game-side {
        width: 100%;
        align-items: center;
        padding-right: 0 !important;
    }

    .ttt-board {
        grid-template-columns: repeat(3, 75px);
        grid-template-rows: repeat(3, 75px);
        margin: 0 auto;
    }

    /* Bigger touch targets for tic-tac-toe cells */
    .ttt-cell {
        font-size: 2.2rem;
        min-width: 44px;
        min-height: 44px;
    }

    .ttt-status { font-size: 1.2rem; }

    .ttt-reset {
        font-size: 1rem;
        padding: 10px 20px;
        min-height: 44px; /* Minimum touch target */
    }

    /* ── T&C ── */
    #tc.active {
        align-items: center !important;
    }

    .folder-grid {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 2rem;
        justify-content: center;
        margin-top: 5vh;
    }

    .folder-container {
        min-width: 80px;
    }

    .windows-folder {
        width: 80px;
        height: 60px;
    }

    .windows-folder-back { height: 55px; }
    .windows-folder-back::before { width: 35px; height: 12px; }
    .windows-folder-front { height: 45px; }
    .mac-file { width: 55px; height: 70px; }
    .folder-name { font-size: 1.1rem; }

    .paper-sheet {
        width: 95vw;
        padding: 1rem;
    }

    .paper-sheet .text-content,
    #file-text-display .text-content {
        font-size: 1.1rem !important;
        line-height: 1.5 !important;
    }

    #file-text-display .back-btn {
        font-size: 1.1rem !important;
        padding: 0.6rem 1.2rem !important;
        min-height: 44px !important; /* Minimum touch target */
    }

    /* ── NAVIGATION ── */
    .bottom-nav {
        /* Account for iOS home indicator with safe-area-inset-bottom */
        bottom: calc(1.5vh + env(safe-area-inset-bottom, 0px));
    }

    .nav-container {
        padding: 5px 10px;
        gap: 2px;
        background: rgba(252, 248, 237, 0.97);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-radius: 50px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.12);
        max-width: calc(100vw - 32px);
    }

    .nav-link {
        font-size: 1rem !important;
        padding: 10px 14px !important;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* ── Extra small screens (iPhone SE, Galaxy A series narrow) ── */
@media (max-width: 390px) {
    .hero h1 {
        font-size: clamp(1.7rem, 7vw, 2.2rem);
    }

    .sticker-text {
        font-size: 1.9rem !important;
    }

    .postcard {
        width: 145px !important;
        height: auto !important;
    }
    .stamp-img {
        width: 100% !important;
        height: auto !important;
        margin: 0 auto !important;
        display: block !important;
    }
    .postcard-content { padding: 15px !important; }
    .postcard h3 { font-size: 0.95rem !important; margin: 0 !important; }
    .postcard-date { font-size: 0.85rem !important; }

    .polaroid-wrapper {
        width: 110px !important;
        max-width: 110px !important;
        padding: 5px 5px 34px 5px !important;
        overflow: visible !important;
    }

    .polaroid-img {
        height: 100px !important;
        width: 100% !important;
    }

    .polaroid-caption {
        font-size: 0.8rem !important;
        display: block !important;
        text-align: center !important;
    }

    .ttt-board {
        grid-template-columns: repeat(3, 65px);
        grid-template-rows: repeat(3, 65px);
    }

    .ttt-cell { font-size: 2rem; }

    .contact-pill {
        font-size: 1rem;
        padding: 0.8rem 1.2rem;
    }

    .nav-link {
        font-size: 0.95rem !important;
        padding: 11px 11px !important;
    }

    #products.active {
        padding: 2rem 1rem !important;
    }

    #dark-everywhere-sticker .sticker-text {
        font-size: 1.8rem !important;
    }
}

/* Minimalist Folder Icon Styles */
.folder-grid {
    display: flex;
    gap: 4rem;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 15vh;
    /* Center it nicely */
}

.folder-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.folder-container:hover {
    transform: translateY(-10px);
}

.windows-folder {
    position: relative;
    width: 120px;
    height: 90px;
    margin-bottom: 1.5rem;
    perspective: 800px;
    /* For 3D opening effect */
    transform: rotate(-3deg) rotateY(-15deg);
    /* Tilted so the opening animation is clearly visible */
    transform-style: preserve-3d;
}

.windows-folder-back {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background-color: #ffdca8;
    /* Light warm yellow */
    border-radius: 0;
    /* Sharp corners */
    border: 2px solid var(--border-color);
}

.windows-folder-back::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: -2px;
    /* compensate for border */
    width: 50px;
    height: 15px;
    background-color: #ffdca8;
    border: 2px solid var(--border-color);
    border-bottom: none;
    border-radius: 0;
    /* Sharp corners */
}

.windows-folder-front {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background-color: #ffca28;
    /* Classic Windows folder yellow */
    border: 2px solid var(--border-color);
    border-radius: 0;
    /* Sharp corners */
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
    /* Slight shadow to separate front and back */
    transform-origin: bottom;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    /* Smooth opening */
}

.folder-container:hover .windows-folder-front {
    transform: rotateX(-35deg);
}


.hidden-folder-view {
    display: none !important;
}

.mac-file {
    position: relative;
    width: 70px;
    height: 90px;
    background-color: #fff;
    border: 2px solid var(--border-color);
    border-top-right-radius: 20px;
    margin-bottom: 1.5rem;
    box-shadow: inset 0 -2px 0px rgba(0, 0, 0, 0.05);
    /* Slight depth */
}

/* Lines representing text inside the file icon */
.mac-file::before {
    content: '';
    position: absolute;
    top: 25px;
    left: 12px;
    right: 15px;
    height: 40px;
    background: 
        linear-gradient(to right, #ddd 70%, transparent 70%) 0 0px / 100% 2px no-repeat,
        linear-gradient(to right, #ddd 100%, transparent 100%) 0 8px / 100% 2px no-repeat,
        linear-gradient(to right, #ddd 85%, transparent 85%) 0 16px / 100% 2px no-repeat,
        linear-gradient(to right, #ddd 95%, transparent 95%) 0 24px / 100% 2px no-repeat,
        linear-gradient(to right, #ddd 40%, transparent 40%) 0 32px / 100% 2px no-repeat;
    pointer-events: none;
}

.mac-file::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    background-color: #fcf8ed;
    border-bottom: 2px solid var(--border-color);
    border-left: 2px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.folder-name {
    font-family: 'Instrument Serif', serif;
    font-size: 1.5rem;
    color: var(--text-color);
    text-align: center;
    letter-spacing: 0.05em;
}

.paper-sheet {
    background-color: #fff;
    width: 90vw;
    max-width: 800px;
    height: auto;
    /* Allow growth as text expands */
    min-height: auto;
    padding: 1rem 2rem;
    border: none;
    /* Removed border for a cleaner "full page" look as requested */
    text-align: left;
    margin-bottom: 5vh;
}

/* Red Lamp CSS */
.lamp-wrapper {
    display: inline-block;
    vertical-align: middle;
    position: relative;
    cursor: pointer;
    margin-left: 1rem;
    /* subtle filter for the entire lamp to anchor it visually */
    filter: drop-shadow(2px 5px 10px rgba(0, 0, 0, 0.1));
    z-index: 100;
}

.bulb-core {
    transition: fill 0.3s ease;
}

.light-beam {
    position: absolute;
    top: 45%;
    right: 60%; /* Adjusted to hit the word 'awesom' */
    transform: rotate(10deg);
    width: 350px;
    height: 180px;
    /* More dramatic conical light beam */
    background: conic-gradient(from 120deg at right center, rgba(255, 250, 200, 0.6) 0deg, rgba(255, 250, 200, 0) 60deg);
    filter: blur(20px);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 1; /* Was -1, now above section background */
}

.glow-text {
    transition: all 0.5s ease;
    position: relative;
    z-index: 2;
}

.hover-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}


.hover-trigger:hover .bulb-core,
.hover-trigger.it-is-on .bulb-core {
    fill: #fff9ea;
    filter: drop-shadow(0 0 10px #fff);
}

.hover-trigger:hover .light-beam,
.hover-trigger.it-is-on .light-beam {
    opacity: 1;
}

.hover-trigger:hover .glow-text,
.hover-trigger.it-is-on .glow-text {
    color: #000;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.8), 0 0 30px rgba(255, 250, 200, 0.4);
    transform: scale(1.05);
}

/* Dark mode: "awesom." glows white when lamp is on */
body.dark-mode .glow-text {
    color: #ede9db; /* warm white at rest in dark mode */
}

body.dark-mode .hover-trigger:hover .glow-text,
body.dark-mode .hover-trigger.it-is-on .glow-text {
    color: #ffffff;
    text-shadow:
        0 0 10px rgba(255, 255, 255, 1),
        0 0 30px rgba(255, 255, 255, 0.8),
        0 0 60px rgba(255, 250, 180, 0.7),
        0 0 100px rgba(255, 240, 120, 0.4);
    transform: scale(1.05);
}

/* Brighter light beam in dark mode */
body.dark-mode .light-beam {
    background: conic-gradient(from 120deg at right center, rgba(255, 250, 200, 0.85) 0deg, rgba(255, 250, 200, 0) 60deg);
}

/* Polaroid Photo Component */
.polaroid-wrapper {
    position: absolute;
    /* Vertically centre so it never overflows on short viewports */
    top: 50%;
    right: 5vw;
    transform: translateY(-50%) rotate(5deg);
    background-color: #fff;
    padding: 12px 12px 45px 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s;
    cursor: pointer;
    z-index: 50;
}

.polaroid-wrapper:hover {
    transform: translateY(-50%) rotate(2deg) scale(1.03);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.polaroid-img {
    width: 220px;
    height: 250px;
    object-fit: cover;
    object-position: center top; /* keep the face in frame */
    background-color: #eee;
    display: block;
}

.polaroid-caption {
    margin-top: 10px;
    font-family: 'Instrument Serif', serif;
    font-size: 1.8rem;
    color: #333;
    text-align: center;
}


/* Postcard Stamp Element */
.postcard {
    position: absolute;
    bottom: 8%;
    right: 24vw;
    width: 300px; /* Increased for prominence */
    height: 340px; 
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5c1825;
    text-align: center;
    transform: rotate(6deg);
    z-index: 15;
    filter: drop-shadow(2px 8px 15px rgba(0, 0, 0, 0.15));
}

/* Outer shape containing the CSS mask that bites out the circles */
.postcard-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #fff9f2;
    /* Warm paper tone */
    z-index: -2;
    /* Improved mask with precise 20px tiling that aligns with 240x280 dimensions */
    -webkit-mask: radial-gradient(circle at 10px 10px, transparent 5px, black 5.1px) -10px -10px / 20px 20px;
    mask: radial-gradient(circle at 10px 10px, transparent 5px, black 5.1px) -10px -10px / 20px 20px;
    -webkit-mask-repeat: round;
    mask-repeat: round;
}

/* Because the mask carves holes out of the entire background indiscriminately,
   we place a solid core just smaller than the holes to cover up the center. */
.postcard-bg-solid {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    background-color: #fff9f2;
    z-index: -1;
    border: 1px solid #8B4513;
    /* Inner Brown Borderline */
}

.postcard-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 16px; /* Increased from 10px to avoid overlapping the borderline at 10px */
    width: 100%;
    z-index: 10;
}

.stamp-img {
    width: 100%; /* Fill the available width within padding */
    max-height: 220px; /* Increased for visibility */
    object-fit: contain;
    mix-blend-mode: multiply; /* Removes white outline/bg from the image */
    margin-bottom: 0.1rem;
    display: block;
}

.postcard h3 {
    font-family: 'Instrument Serif', serif;
    font-size: 1.8rem; /* Slightly reduced to fit integrated look */
    font-weight: 400;
    line-height: 1.1;
    margin: 0;
}

.postcard-date {
    font-family: 'Instrument Serif', serif;
    /* Matching Bhubaneswar font */
    font-size: 1.8rem;
    color: #7b2938;
    /* Keeping the rose/maroon color as per 'previous was was' look */
}