/*--------------------------------------------------
  BIT SYSTEMS AFRICA - CUSTOM STYLESHEET (Fixed)
  --------------------------------------------------*/

/* 1. :root Variables */
:root {
    /* Day Theme */
    --color-bg: #f4f1ea;
    --color-text: #0a0a0a;
    --color-text-muted: #555;
    --color-border: #0a0a0a;
    --color-highlight: #f796a6; /* Pastel Red */
    --color-highlight-dark: #e07a8b;
    --color-grid: rgba(0, 0, 0, 0.05);
    --color-black: #0a0a0a;
    --color-white: #e0e0e0;
    --line-thick-color: var(--color-text);
    --line-thick-height: 4px;
    --line-thin-color: var(--color-text);
    --line-thin-height: 1.5px;
    --line-extra-color: var(--color-text);
    --line-extra-height: 1.5px;
    --line-gap: 5px;
    --font-primary: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
    --font-secondary: 'Times New Roman', 'Times', 'serif';
    --font-monospace: 'Courier New', 'Courier', 'monospace';
}

/* Dark Theme */
[data-theme="dark"] {
    --color-bg: #0d0d0d;
    --color-text: #e0e0e0;
    --color-text-muted: #888;
    --color-border: #e0e0e0;
    --color-grid: rgba(255, 255, 255, 0.08);
    --line-thick-color: var(--color-text);
    --line-thin-color: var(--color-text);
    --line-extra-color: var(--color-black);
}

/* 2. Global & Body Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-primary);
    line-height: 1.6;
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
    width: 100%;
    cursor: none; /* Hide default cursor */
}

/* Ensure default cursor available on touch/pointer coarse devices */
@media (hover: none) and (pointer: coarse) {
    body {
        cursor: auto;
    }
}

a, button, .service-item, .value-item {
    cursor: pointer;
}

.main-content {
    width: 100%;
    height: 100vh;
    overflow-y: scroll;
    overflow-x: hidden;
    scroll-snap-type: y mandatory;
    position: relative;
    z-index: 1; /* Explicit Z-index */
}

.scroll-container {
    width: 100%;
}

/* 3. Theme Switcher */
.theme-switcher {
    position: fixed;
    top: 40px;
    left: 40px;
    z-index: 1000;
    cursor: pointer;
    font-size: 1.25rem;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-icon-sun, .theme-icon-moon {
    position: absolute;
    transition: transform 0.4s ease, opacity 0.4s ease;
}

.theme-icon-moon {
    transform: scale(0);
    opacity: 0;
}

[data-theme="dark"] .theme-icon-sun {
    transform: scale(0);
    opacity: 0;
}

[data-theme="dark"] .theme-icon-moon {
    transform: scale(1);
    opacity: 1;
}

/* 4. Loader */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-bg);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease 1s, transform 0.5s ease 1s;
    overflow: hidden;
}

    .loader.hidden {
        opacity: 0;
        transform: scale(1.1);
        pointer-events: none;
    }

.loader-logo {
    position: relative;
    z-index: 10;
}

    .loader-logo img {
        width: 250px;
        opacity: 0;
        animation: loader-logo-fade 1s ease forwards 0.5s;
    }

.loader-logo-dark {
    display: none;
}

[data-theme="dark"] .loader-logo-light {
    display: none;
}

[data-theme="dark"] .loader-logo-dark {
    display: block;
}

@keyframes loader-logo-fade {
    to {
        opacity: 1;
    }
}

.loader-bits {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-monospace);
    font-size: 1.25rem;
    line-height: 1.1;
    color: var(--color-text-muted);
    opacity: 0.2;
    width: 200%;
    text-align: center;
    word-break: break-all;
    user-select: none;
}

/* 5. Page Transition Canvas */
#patternTransition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9990; /* High Z-index */
    pointer-events: none; /* Initially allow clicks through */
    background: transparent;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* 6. Custom Cursor (Fixed for Chrome) */
.cursor-dot, .cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none; /* CRITICAL FIX */
    opacity: 0;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: var(--color-highlight);
    transition: opacity 0.3s ease;
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 2px solid var(--color-highlight);
    transition: opacity 0.3s ease, width 0.2s, height 0.2s, background-color 0.2s;
}

/* Hover States */
body.hovering .cursor-outline {
    width: 60px;
    height: 60px;
    background-color: rgba(247, 150, 166, 0.1);
    border-color: transparent;
}

body.hovering .cursor-dot {
    opacity: 0;
}

/* 7. Background Grid */
.background-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background-image: repeating-linear-gradient(var(--color-grid) 0 1px, transparent 1px 100px), repeating-linear-gradient(90deg, var(--color-grid) 0 1px, transparent 1px 100px);
    opacity: 1;
    pointer-events: none;
}

/* 8. Frame Border */
.photo-frame-border {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9991;
    pointer-events: none;
}

.frame-edge {
    position: absolute;
    display: flex;
    z-index: 1;
}

    .frame-edge .line-thin, .frame-edge .line-thick, .frame-edge .line-extra {
        background-color: var(--color-border);
        transition: background-color 0.4s ease;
    }

html[data-theme="light"] .frame-edge .line-thin, html[data-theme="light"] .frame-edge .line-thick, html[data-theme="light"] .frame-edge .line-extra {
    background-color: #0a0a0a !important;
}

[data-theme="dark"] .frame-edge .line-thin {
    background-color: var(--line-thin-color) !important;
}

[data-theme="dark"] .frame-edge .line-thick {
    background-color: var(--line-thick-color) !important;
}

[data-theme="dark"] .frame-edge .line-extra {
    background-color: var(--line-extra-color) !important;
}

.frame-edge-top, .frame-edge-bottom {
    flex-direction: column;
    left: 10px;
    right: 10px;
    height: calc(var(--line-thin-height) + var(--line-thick-height) + var(--line-extra-height) + (2 * var(--line-gap)));
}

.frame-edge-top {
    top: 10px;
}

.frame-edge-bottom {
    bottom: 10px;
}

    .frame-edge-top .line-thin, .frame-edge-bottom .line-thin {
        order: 1;
        height: var(--line-thin-height);
        width: 100%;
    }

    .frame-edge-top .line-thick, .frame-edge-bottom .line-thick {
        order: 2;
        margin-top: var(--line-gap);
        height: var(--line-thick-height);
        width: 100%;
    }

    .frame-edge-top .line-extra, .frame-edge-bottom .line-extra {
        order: 3;
        margin-top: var(--line-gap);
        height: var(--line-extra-height);
        width: 100%;
    }

.frame-edge-left, .frame-edge-right {
    flex-direction: row;
    top: 10px;
    bottom: 10px;
    width: calc(var(--line-thin-height) + var(--line-thick-height) + var(--line-extra-height) + (2 * var(--line-gap)));
}

.frame-edge-left {
    left: 10px;
}

.frame-edge-right {
    right: 10px;
}

    .frame-edge-left .line-thin, .frame-edge-right .line-thin {
        order: 1;
        width: var(--line-thin-height);
        height: 100%;
    }

    .frame-edge-left .line-thick, .frame-edge-right .line-thick {
        order: 2;
        margin-left: var(--line-gap);
        width: var(--line-thick-height);
        height: 100%;
    }

    .frame-edge-left .line-extra, .frame-edge-right .line-extra {
        order: 3;
        margin-left: var(--line-gap);
        width: var(--line-extra-height);
        height: 100%;
    }

.photo-frame-border::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    right: 6px;
    bottom: 6px;
    border: 4px solid transparent;
    transition: border-color 0.4s ease;
}

[data-theme="dark"] .photo-frame-border::before {
    border-color: var(--color-black);
}

/* 9. Typography */
h1, h2, h3, h4 {
    font-family: var(--font-primary);
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text);
}

h1 {
    font-size: 5rem;
}

h2 {
    font-size: 3.5rem;
}

h3 {
    font-size: 2rem;
}

h4 {
    font-size: 1.2rem;
}

a {
    color: var(--color-text);
    text-decoration: none;
}

p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 4rem;
    text-align: left;
    margin-bottom: 0.5rem;
    font-weight: 800;
}

.section-subtitle {
    font-size: 1.5rem;
    text-align: left;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    max-width: 800px;
}

/* 10. MAIN NAVIGATION */
.menu-toggle {
    position: fixed;
    top: 40px;
    right: 40px;
    z-index: 9998;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.burger-line {
    width: 30px;
    height: 2px;
    background-color: var(--color-text);
    margin: 6px 0;
    transition: transform 0.4s ease, background-color 0.4s ease;
}

.menu-toggle.open .burger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-toggle.open .burger-line:nth-child(2) {
    transform: scaleX(0);
}

.menu-toggle.open .burger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9997;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-100%);
    transition: transform 0.6s cubic-bezier(0.86, 0, 0.07, 1);
    background: transparent;
    pointer-events: none;
    overflow: hidden;
}

    .nav-overlay.open {
        transform: translateY(0);
        pointer-events: all;
    }

.nav-background-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-bg);
    background-image: repeating-linear-gradient(var(--color-grid) 0 1px, transparent 1px 100px), repeating-linear-gradient(90deg, var(--color-grid) 0 1px, transparent 1px 100px);
    z-index: 1; /* Lowest */
    pointer-events: auto;
}

#navStarsContainer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5; /* Above background */
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

[data-theme="dark"] #navStarsContainer {
    opacity: 1;
}

.nav-menu {
    list-style: none;
    text-align: center;
    position: relative;
    z-index: 10; /* Highest */
}

    .nav-menu li {
        margin: 10px 0;
    }

    .nav-menu a {
        font-size: 4rem;
        font-weight: 700;
        color: var(--color-text-muted);
        text-decoration: none;
        display: inline-block;
        padding: 0 10px;
        transition: color 0.3s ease;
        position: relative;
    }

        .nav-menu a.active, .nav-menu a:hover {
            color: var(--color-text);
        }

        .nav-menu a .typewriter-char {
            display: inline-block;
            color: var(--color-text-muted);
            transition: color 0.1s ease;
            will-change: color; /* GPU Hint */
            transform: translateZ(0); /* GPU Force */
        }

        .nav-menu a.active .typewriter-char {
            color: var(--color-text);
        }

        .nav-menu a.active .char-typed {
            color: var(--color-highlight) !important; /* Force Override */
        }

        .nav-menu a .typewriter-caret {
            display: none;
            width: 4px;
            height: 50px;
            background-color: var(--color-highlight);
            margin-left: 5px;
            vertical-align: sub;
            opacity: 0;
        }

        .nav-menu a.active .typewriter-caret {
            display: inline-block;
            opacity: 1;
        }

.nav-slider {
    position: absolute;
    left: 0;
    bottom: 0;
    height: calc(var(--line-thin-height) + var(--line-thick-height) + var(--line-extra-height) + (2 * var(--line-gap)));
    width: 0;
    transition: left 0.4s ease, width 0.4s ease, bottom 0.4s ease;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

    .nav-slider .line-thin {
        height: var(--line-thin-height);
        background-color: var(--line-thin-color);
        order: 1;
    }

    .nav-slider .line-thick {
        height: var(--line-thick-height);
        background-color: var(--line-thick-color);
        margin-top: var(--line-gap);
        order: 2;
    }

    .nav-slider .line-extra {
        height: var(--line-extra-height);
        background-color: var(--line-extra-color);
        margin-top: var(--line-gap);
        order: 3;
    }

.nav-border-lines {
    position: absolute;
    left: 40px;
    right: 40px;
    z-index: 10;
    display: flex;
    flex-direction: column;
}

.nav-border-top {
    top: 40px;
}

.nav-border-bottom {
    bottom: 40px;
}

.nav-border-lines .line-thin {
    height: var(--line-thin-height);
    background-color: var(--line-thin-color);
    order: 1;
}

.nav-border-lines .line-thick {
    height: var(--line-thick-height);
    background-color: var(--line-thick-color);
    margin-top: var(--line-gap);
    order: 2;
}

.nav-border-lines .line-extra {
    height: var(--line-extra-height);
    background-color: var(--line-extra-color);
    margin-top: var(--line-gap);
    order: 3;
}

/* 11. Footer */
.footer-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 10;
    pointer-events: none;
    background-color: var(--color-text);
    color: var(--color-bg);
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

[data-theme="dark"] .footer-container {
    border: 1px solid var(--color-black);
}

.footer-lines {
    width: 100%;
    padding: 0 40px;
    display: flex;
    flex-direction: column;
}

    .footer-lines .line-thin {
        height: var(--line-thin-height);
        background-color: var(--color-bg);
        order: 1;
    }

    .footer-lines .line-thick {
        height: var(--line-thick-height);
        background-color: var(--color-bg);
        margin-top: var(--line-gap);
        order: 2;
    }

    .footer-lines .line-extra {
        height: var(--line-extra-height);
        background-color: var(--color-extra-color);
        margin-top: var(--line-gap);
        order: 3;
    }

[data-theme="dark"] .footer-lines .line-extra {
    background-color: var(--color-black);
}

.sticky-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    font-size: 0.9rem;
    color: var(--color-bg);
}

    .sticky-footer .credits strong {
        color: var(--color-bg);
        font-weight: 700;
    }

/* 12. Layout Sections */
.page-section {
    width: 100%;
    min-height: 100vh;
    padding: 80px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    scroll-snap-align: start;
    display: none;
}

    .page-section.active {
        display: flex;
    }

.container-fluid {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 13. Components */
.btn-awwward {
    position: relative;
    display: inline-block;
    padding: 12px 24px;
    border: 1px solid var(--color-border);
    border-radius: 30px;
    overflow: hidden;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.4s ease, border-color 0.4s ease;
    cursor: pointer;
    background: none;
    font-size: 1rem;
    word-break: keep-all;
}

    .btn-awwward span {
        position: relative;
        z-index: 2;
    }

    .btn-awwward::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: var(--color-text);
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.7, 0, 0.3, 1);
        z-index: 1;
    }

    .btn-awwward:hover {
        color: var(--color-bg);
    }

        .btn-awwward:hover::before {
            transform: translateY(0);
        }

.reveal-up {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1s ease, transform 1s ease;
    transition-delay: var(--delay, 0s);
}

    .reveal-up.is-visible {
        opacity: 1;
        transform: translateY(0);
    }

/* 14. Page Sections */
/* HOME */
#home {
    padding: 0;
    height: 100vh;
    height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: auto;
}

.home-content {
    position: relative;
    z-index: 2;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.home-logo-link {
    text-decoration: none;
}

.home-logo {
    max-width: 480px;
    margin-bottom: 0.2rem;
}

    .home-logo img {
        width: 100%;
    }

.logo-dark-mode {
    display: none;
}

[data-theme="dark"] .logo-light-mode {
    display: none;
}

[data-theme="dark"] .logo-dark-mode {
    display: block;
}

.home-banner h1 {
    font-size: 4rem;
    font-weight: 800;
    min-height: auto;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.home-banner .scramble-text {
    display: inline-block;
    line-height: 1.1;
}

.scramble-char {
    color: var(--color-highlight);
}

.bit-explanation {
    max-width: 700px;
    margin-bottom: 1.5rem;
}

    .bit-explanation p {
        font-size: 1.05rem;
        color: var(--color-text-muted);
        margin-bottom: 0.75rem;
        line-height: 1.6;
    }

        .bit-explanation p:last-child {
            color: var(--color-text);
            font-size: 1.1rem;
        }

    .bit-explanation strong {
        color: var(--color-text);
    }

#home .btn-awwward {
    margin-top: 1rem;
}

.particle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

    .particle-container .bit {
        position: absolute;
        font-family: var(--font-monospace);
        font-size: 1.5rem;
        color: var(--color-text-muted);
        opacity: 0;
        animation: fall 10s linear infinite;
        user-select: none;
    }

[data-theme="dark"] .particle-container .bit {
    color: var(--color-text-muted);
    opacity: 0.2;
}

@keyframes fall {
    0% {
        transform: translateY(-100px);
        opacity: 0;
    }

    10% {
        opacity: 0.3;
    }

    90% {
        opacity: 0.3;
    }

    100% {
        transform: translateY(110vh);
        opacity: 0;
    }
}

/* ABOUT */
.about-header {
    text-align: left;
    margin-bottom: 2rem;
}

    .about-header .section-subtitle {
        margin-bottom: 0;
    }

.about-philosophy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.philosophy-card {
    background-color: var(--color-grid);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55), box-shadow 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    will-change: transform;
}

[data-theme="dark"] .philosophy-card {
    background-color: rgba(255, 255, 255, 0.03);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.philosophy-card:hover {
    background-color: var(--color-bg);
    border-color: var(--color-border);
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .philosophy-card:hover {
    background-color: var(--color-bg);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.philosophy-card .philosophy-icon {
    font-size: 2.5rem;
    color: var(--color-highlight);
    margin-bottom: 1rem;
    transition: transform 0.3s ease, color 0.3s ease;
}

.philosophy-card:hover .philosophy-icon {
    transform: scale(1.2) rotate(5deg);
    color: var(--color-highlight-dark);
}

.philosophy-card h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.philosophy-card:hover h3 {
    color: var(--color-highlight);
}

.philosophy-card p {
    font-size: 1rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.philosophy-card:hover p {
    color: var(--color-text);
}

.about-values {
    text-align: left;
}

.values-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: left;
}

.values-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.value-item {
    perspective: 1000px;
    min-height: 180px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

    .value-item:hover {
        transform: scale(1.05);
    }

.value-item-flipper {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    transform-style: preserve-3d;
}

.value-item:hover .value-item-flipper {
    transform: rotateY(180deg);
}

.value-item-front, .value-item-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border: 1px solid var(--color-grid);
    border-radius: 8px;
    background-color: var(--color-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
}

.value-item:hover .value-item-front, .value-item:hover .value-item-back {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.value-item-back {
    transform: rotateY(180deg);
    background-color: var(--color-text);
    color: var(--color-bg);
}

[data-theme="dark"] .value-item-front {
    background-color: var(--color-grid);
}

.value-item-front .value-icon {
    font-size: 3rem;
    color: var(--color-highlight);
    margin-bottom: 0.5rem;
    transition: transform 0.3s ease;
}

.value-item-front:hover .value-icon {
    transform: rotate(360deg);
}

.value-item-front h4 {
    font-size: 1.5rem;
}

.value-item-back p {
    font-size: 1rem;
    margin-bottom: 0;
    color: var(--color-bg);
}

/* SERVICES */
.services-accordion {
    max-width: 1200px;
    margin: 0 auto;
}

.service-item {
    border-bottom: 2px solid var(--color-grid);
    cursor: pointer;
    position: relative;
    z-index: 2; /* Keep z-index reasonable */
}

    .service-item:first-child {
        border-top: 2px solid var(--color-grid);
    }

.service-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2.5rem 1rem;
    transition: background-color 0.3s ease;
}

.service-title {
    display: flex;
    align-items: center;
}

.service-number {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text-muted);
    margin-right: 2rem;
}

.service-title h3 {
    font-size: 2.5rem;
    font-weight: 600;
}

.service-icon {
    font-size: 2rem;
    color: var(--color-text);
    transition: transform 0.4s ease;
}

.service-content {
    display: grid;
    grid-template-rows: 0fr;
    overflow: hidden;
    transition: grid-template-rows 0.5s cubic-bezier(0.7, 0, 0.3, 1);
}

.service-content-inner {
    min-height: 0;
    padding: 0 1rem 0 5rem;
    overflow: hidden;
}

    .service-content-inner p {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
        padding-top: 1rem;
    }

    .service-content-inner ul {
        list-style: none;
        margin-bottom: 2.5rem;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem 1.5rem;
    }

    .service-content-inner li {
        position: relative;
        padding-left: 25px;
        line-height: 1.4;
    }

        .service-content-inner li::before {
            content: '\f00c';
            font-family: 'Font Awesome 6 Free';
            font-weight: 900;
            position: absolute;
            left: 0;
            top: 5px;
            color: var(--color-highlight);
            font-size: 0.9rem;
        }

.service-item.active .service-content {
    grid-template-rows: 1fr;
}

.service-item.active .service-icon {
    transform: rotate(180deg);
}

.service-item:hover .service-header {
    background-color: rgba(0, 0, 0, 0.1);
}

.service-item.active .service-header {
    background-color: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .service-item:hover .service-header {
    background-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .service-item.active .service-header {
    background-color: rgba(255, 255, 255, 0.1);
}

/* CONTACT REDESIGN - POSTCARD STYLE */
#contact {
    position: relative;
    overflow: hidden;
    padding-bottom: 100px; /* Space for the card to "sit" */
}

/* Contact Pattern Canvas Styling */
#contactPatternCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 35%; /* Extended slightly */
    z-index: 0;
    opacity: 0.2;
    pointer-events: none;
    mix-blend-mode: multiply;
}

[data-theme="dark"] #contactPatternCanvas {
    mix-blend-mode: screen;
    opacity: 0.15;
}
/* =========================================
   DARK MODE OVERRIDES FOR CONTACT POSTCARD
   ========================================= */

/* 1. Invert the Postcard Container Background & Shadows */
[data-theme="dark"] .contact-form-container {
    /*background-color: #1a1a1a;*/ /* Dark Charcoal Paper */
    color: #e0e0e0; /* White Text */
    /* Adjusted shadows for dark environment */
    box-shadow: 0 1px 1px rgba(0,0,0,0.5), 0 10px 0 -5px #252525, /* Darker layer 1 */
    0 10px 1px -4px rgba(0,0,0,0.5), 0 20px 0 -10px #0d0d0d, /* Darker layer 2 */
    0 20px 1px -9px rgba(0,0,0,0.5), 30px 30px 50px rgba(0,0,0,0.8); /* Deep shadow */
}

    /* 2. Invert the Internal Double Border */
    [data-theme="dark"] .contact-form-container::after {
        border-color: rgba(255,255,255,0.1);
        outline-color: rgba(255,255,255,0.2); /* Subtle white outline */
    }

/* 3. Invert the Stamp */
[data-theme="dark"] .postcard-stamp {
    border-color: #444;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 20%, transparent 20%);
    background-size: 10px 10px;
}

    [data-theme="dark"] .postcard-stamp i {
        color: #444;
    }

/* 4. INVERT THE XHOSA PATTERN (White Lines) */
[data-theme="dark"] .form-control {
    color: #e0e0e0; /* Input text color */
    /* The Xhosa Stack - using White (#e0e0e0) instead of Black */
    background-image:
    /* 1. Top Line: Dotted */
    linear-gradient(to right, #e0e0e0 50%, transparent 50%),
    /* 2. Middle Line: Thin Solid */
    linear-gradient(to right, #e0e0e0, #e0e0e0),
    /* 3. Bottom Line: Thick Solid */
    linear-gradient(to right, #e0e0e0, #e0e0e0);
}

    /* Keep the Pink Highlight on Focus (No change needed, but good to ensure specificity) */
    [data-theme="dark"] .form-control:focus {
        background-image: linear-gradient(to right, var(--color-highlight) 50%, transparent 50%), linear-gradient(to right, var(--color-highlight), var(--color-highlight)), linear-gradient(to right, var(--color-highlight-dark), var(--color-highlight-dark));
    }

/* 5. Invert Floating Labels */
[data-theme="dark"] .floating-label {
    color: #888; /* Dimmer default */
}

[data-theme="dark"] .form-control:focus ~ .floating-label,
[data-theme="dark"] .form-control:not(:placeholder-shown) ~ .floating-label {
    color: var(--color-highlight); /* Highlight active label */
}

/* 6. Invert Button */
[data-theme="dark"] .contact-form .btn-awwward {
    border-color: #e0e0e0;
    color: #e0e0e0;
}

    [data-theme="dark"] .contact-form .btn-awwward:hover {
        color: #0a0a0a; /* Text turns black on hover (against the white fill) */
        border-color: var(--color-highlight);
    }

#contact .container-fluid {
    max-width: 1600px;
    position: relative;
    z-index: 2;
}

.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr; /* Give form slightly more width */
    gap: 6rem;
    align-items: center;
    min-height: calc(100vh - 200px);
}

.contact-info .section-title, .contact-info .section-subtitle {
    text-align: left;
}

.contact-info p {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    max-width: 500px;
    line-height: 1.8;
}

.contact-direct-links {
    margin-top: 3rem;
}

/* --- THE POSTCARD CONTAINER --- */
.contact-form-container {
    width: 100%;
    padding: 4rem;
    position: relative;
    /*background-color: #fcfbf9;*/ /* Warm paper tone */
    color: #0a0a0a; /* Always dark text on the postcard */
    /* Postcard Depth & Texture */
    box-shadow: 0 1px 1px rgba(0,0,0,0.1), 0 10px 0 -5px #eee, 0 10px 1px -4px rgba(0,0,0,0.1), 0 20px 0 -10px #e5e5e5, 0 20px 1px -9px rgba(0,0,0,0.1), 30px 30px 40px rgba(0,0,0,0.15); /* Deep shadow */

    border-radius: 2px;
    transform: rotate(-1deg); /* Slight organic tilt */
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Dark mode adjustment: Keep the card light (like real paper) or dim it slightly */
[data-theme="dark"] .contact-form-container {
    /*background-color: #e0e0e0;*/
    box-shadow: 0 1px 1px rgba(0,0,0,0.2), 30px 30px 50px rgba(0,0,0,0.5);
}

.contact-form-container:hover {
    transform: rotate(0deg) scale(1.01);
    z-index: 10;
}

/* The Internal Double Border (Postcard Edge) */
.contact-form-container::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 1px solid rgba(0,0,0,0.1);
    outline: 2px solid rgba(0,0,0,0.8);
    outline-offset: -8px;
    pointer-events: none;
    z-index: 1;
}

/* A CSS "Stamp" in the corner */
.postcard-stamp {
    position: absolute;
    top: 40px;
    right: 40px;
    width: 80px;
    height: 90px;
    border: 2px dotted #d1d1d1;
    background: radial-gradient(circle, rgba(0,0,0,0.05) 20%, transparent 20%);
    background-size: 10px 10px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(5deg);
    opacity: 0.6;
}

    .postcard-stamp i {
        font-size: 2rem;
        color: #ccc;
    }

/* --- THE FORM INPUTS (XHOSA PATTERN) --- */
.contact-form {
    position: relative;
    z-index: 5;
}

.form-row {
    display: flex;
    gap: 2rem;
}

.form-group {
    position: relative; /* For floating label */
    margin-bottom: 3rem; /* Extra space for the complex border */
    width: 100%;
}

    .form-group.half-width {
        width: 50%;
    }

.form-control {
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 15px 0 10px 0;
    font-size: 1.2rem;
    font-family: var(--font-secondary); /* Serif looks great on postcards */
    color: #0a0a0a; /* Enforce dark text on card */
    outline: none;
    box-shadow: none;
    /* THE XHOSA PATTERN BORDER STACK */
    background-image:
    /* 1. Top Line: Dotted (1px height) */
    linear-gradient(to right, #0a0a0a 50%, transparent 50%),
    /* 2. Middle Line: Thin Solid (1px height) */
    linear-gradient(to right, #0a0a0a, #0a0a0a),
    /* 3. Bottom Line: Thick Solid (3px height) */
    linear-gradient(to right, #0a0a0a, #0a0a0a);
    background-size: 6px 1px, /* Dotted size */
    100% 1px, /* Middle width */
    100% 3px; /* Bottom width */

    background-position: left 0 bottom 7px, /* Top line position */
    left 0 bottom 4px, /* Middle line position */
    left 0 bottom 0px; /* Bottom line position */

    background-repeat: repeat-x, no-repeat, no-repeat;
    transition: background-size 0.4s ease, background-image 0.4s ease;
}

    /* Animate the Pattern on Focus */
    .form-control:focus {
        /* Change color to highlight */
        background-image: linear-gradient(to right, var(--color-highlight) 50%, transparent 50%), linear-gradient(to right, var(--color-highlight), var(--color-highlight)), linear-gradient(to right, var(--color-highlight-dark), var(--color-highlight-dark));
        /* Optional: Animate lines growing from center? 
       Simple color change is often more elegant for this pattern. */
    }

/* Floating Label Styles */
.floating-label {
    position: absolute;
    top: 15px;
    left: 0;
    font-size: 1.1rem;
    color: #888;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    font-family: var(--font-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

/* When input has focus or has content (using placeholder-shown trick) */
.form-control:focus ~ .floating-label,
.form-control:not(:placeholder-shown) ~ .floating-label {
    top: -15px;
    font-size: 0.75rem;
    color: var(--color-highlight-dark);
    font-weight: 700;
}

textarea.form-control {
    min-height: 120px;
    resize: none;
}

/* Button on Postcard */
.contact-form .btn-awwward {
    width: 100%;
    margin-top: 1rem;
    border-color: #0a0a0a;
    color: #0a0a0a;
    font-family: var(--font-primary);
}

    .contact-form .btn-awwward:hover {
        color: #f4f1ea;
        border-color: var(--color-highlight);
    }

/* Mobile Adjustments */
@media (max-width: 992px) {
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 4rem;
    }

    .contact-form-container {
        padding: 2.5rem;
        transform: rotate(0deg);
    }

        .contact-form-container::after {
            display: none; /* Simplify on mobile */
        }

    .postcard-stamp {
        display: none;
    }
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.alert {
    max-width: 100%;
    margin: 0 auto 2rem auto;
    text-align: center;
    padding: 1rem;
    border-radius: 8px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 15. Responsive Design */
@media (max-width: 992px) {
    h1 {
        font-size: 4rem;
    }

    h2 {
        font-size: 3rem;
    }

    .section-title {
        font-size: 3rem;
    }

    .section-subtitle {
        font-size: 1.2rem;
    }

    .nav-menu a {
        font-size: 3rem;
    }

    .home-banner h1 {
        font-size: 3rem;
        flex-direction: column;
    }

    .service-content-inner ul {
        grid-template-columns: 1fr;
    }

    .service-title h3 {
        font-size: 2rem;
    }

    .contact-layout {
        grid-template-columns: 1fr;
    }

    .contact-info {
        text-align: center;
    }

        .contact-info .section-title, .contact-info .section-subtitle {
            text-align: center;
        }

        .contact-info p {
            margin-left: auto;
            margin-right: auto;
        }

    .values-wrapper {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .cursor-dot, .cursor-outline {
        display: none;
    }
}

@media (max-width: 576px) {
    .theme-switcher {
        left: 15px;
        top: 15px;
    }

    .menu-toggle {
        right: 15px;
        top: 15px;
    }

    .sticky-footer {
        flex-direction: column;
        gap: 10px;
        text-align: center;
        padding: 10px 20px;
    }

    .footer-lines {
        padding: 0 15px;
    }

    .page-section {
        padding: 60px 15px;
    }

    #contact.page-section {
        padding-bottom: 150px;
    }

    .nav-menu a {
        font-size: 2.5rem;
    }

    .nav-border-lines {
        left: 15px;
        right: 15px;
    }

    .nav-border-top {
        top: 15px;
    }

    .nav-border-bottom {
        bottom: 15px;
    }

    h1 {
        font-size: 2.8rem;
    }

    h2 {
        font-size: 2rem;
    }

    .section-title {
        font-size: 2.2rem;
    }

    .section-subtitle {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .home-content {
        padding: 20px 15px 100px 15px;
    }

    .home-banner h1 {
        font-size: 2.2rem;
        flex-direction: column;
    }

    .bit-explanation p {
        font-size: 0.95rem;
        line-height: 1.5;
    }

        .bit-explanation p:last-child {
            font-size: 1rem;
        }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .form-group.half-width {
        width: 100%;
    }

    .service-title h3 {
        font-size: 1.5rem;
    }

    .service-number {
        margin-right: 1rem;
    }

    .service-icon {
        font-size: 1.5rem;
    }

    .service-content-inner {
        padding: 0 1rem;
    }

        .service-content-inner ul {
            padding-left: 20px;
        }

    .contact-form-container {
        padding: 1.5rem;
    }

    .about-philosophy-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .philosophy-card {
        padding: 1.5rem;
    }

    .values-wrapper {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .value-item {
        min-height: 150px;
    }

    .value-item-front .value-icon {
        font-size: 2rem;
    }

    .value-item-front h4 {
        font-size: 1.1rem;
    }

    .value-item-back p {
        font-size: 0.9rem;
    }

    .photo-frame-border {
        --line-thick-height: 2px;
        --line-thin-height: 1px;
        --line-extra-height: 1px;
        --line-gap: 3px;
    }

    .frame-edge-top {
        top: 5px;
    }

    .frame-edge-bottom {
        bottom: 5px;
    }

    .frame-edge-left {
        left: 5px;
    }

    .frame-edge-right {
        right: 5px;
    }
}

/* GLOBAL STARS - FALLBACK */
.stars-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
    overflow: hidden;
}

[data-theme="dark"] .stars-wrapper {
    opacity: 1;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle var(--duration) ease-in-out infinite;
    opacity: var(--opacity);
}

@keyframes twinkle {
    0%, 100% {
        opacity: var(--opacity);
        transform: scale(1);
    }

    50% {
        opacity: 0.2;
        transform: scale(0.5);
    }
}