/* -------------------------------------------------
   Root variables (colors, spacing, utilities)
   ------------------------------------------------- */
:root {
    /* Colors */
    --primary: #080808;
    /* black background */
    --white: #f6f6f6;
    /* white text */
    --gray: #A5A5A5;
    --dark-gray: #333333;
    --dark-gray-btn: #222222;
    --darker-gray-hover: #111111;
    --orange: #E85002;

    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 32px;
    --spacing-lg: 48px;
    --spacing-xl: 64px;
    --spacing-xxl: 96px;

    /* Margins */
    --mdMargin: 96px;
    --lgMargin: 240px;
    --smMargin: 48px;
    --xSmMargin: 32px;
}

/* -------------------------------------------------
   Global resets & base styles
   ------------------------------------------------- */
* {
    box-sizing: border-box;
    font-weight: 300;
}

html {
    scroll-behavior: smooth;
    overscroll-behavior: none;
}

body {
    font-family: "Bricolage Grotesque", sans-serif;
    background-color: var(--primary);
    color: var(--white);
    overscroll-behavior-y: none;
    transition: background-color 0.5s, color 0.5s, opacity 0.5s ease-in-out;
    position: relative;
    opacity: 0;
}

body.loaded {
    opacity: 1;
}

body.essence-page,
body.locked-page,
body.essence-mode {
    overflow: hidden;
}

/* B-Side Mobile Scroll Fixes */
.bside-page {
    /* Prevent Safari from bouncing the whole body */
    overscroll-behavior-y: none;
    -webkit-overflow-scrolling: touch;
}

.bside-page .autoScrollGallery {
    /* Tell Safari we are handling the vertical pan */
    touch-action: pan-y;
    /* Prevent unexpected horizontal shifts */
    overflow-x: hidden;
    width: 100%;
}

/* Fade transitions for mode switching */
.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

.fade-in {
    opacity: 1;
    transition: opacity 0.5s ease-in;
}

.randomMover {
    height: 100vh;
    overflow-y: hidden;
}

.modes {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.speachMode {
    color: white;
    font-size: 18px;
}

.modes .flexBox {
    gap: 12px;
    align-items: center;
    justify-content: flex-start;
}

.modeIcon {
    width: 32px;
    height: 12px;
    border-radius: 100rem;
    background-color: rgba(255, 255, 255, 0.319);
    transition: background-color 0.3s, transform 0.3s;
}

/* Speech Mode Active States */
.modes {
    cursor: pointer;
}

.modes.active .modeIcon {
    background: var(--active-gradient, var(--orange));
    box-shadow: 0 0 15px var(--active-color, var(--orange));
}

@keyframes speaking-wave {

    0%,
    100% {
        transform: scaleY(1);
    }

    25% {
        transform: scaleY(0.4);
    }

    50% {
        transform: scaleY(0.8);
    }

    75% {
        transform: scaleY(0.5);
    }
}

/* Highlighted Word */
.word-highlight {
    color: var(--active-color, var(--orange)) !important;
    background: var(--active-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 1 !important;
    transition: all 0.2s ease;
    display: inline;
}

/* -------------------------------------------------
   Typography scale
   ------------------------------------------------- */
h1 {
    font-size: 56px;
    line-height: 1.2;
}

h2 {
    font-size: 32px;
    line-height: 1.3;
}

h3 {
    font-size: 24px;
    line-height: 1.4;
}

h4 {
    font-size: 18px;
    line-height: 1.5;
}

h5 {
    font-size: 14px;
    line-height: 1.5;
}

h6 {
    font-size: 18px;
    line-height: 1.4;
}

p {
    font-size: 24px;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: var(--white);
}

/* -------------------------------------------------
   Text size utilities
   ------------------------------------------------- */
.lgTxt {
    font-size: 56px;
    text-wrap: balance;
    line-height: 1.1;
}

.mdTitle {
    font-size: 32px;
    line-height: 1.3;
}

.mdTxt {
    font-size: 2rem;
    line-height: 1.5;
}

.smTxt {
    font-size: 18px;
    line-height: 1.5;
}

.xSmTxt {
    font-size: 14px;
    line-height: 1.5;
}

.imageFLip {
    position: relative;
    width: 100%;
    height: 600px;
    background: black;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* stacked media */
.imageFLip img,
.imageFLip video {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    flex-shrink: 1;
    transform-origin: center;
}

/* -------------------------------------------------
   Width utilities (gap = 16px)
   ------------------------------------------------- */
.w-100 {
    width: 100%;
}

.w-90 {
    width: 90%;
}

.w-80 {
    width: calc(80% - 16px);
}

.w-70 {
    width: calc(70% - 16px);
}

.w-60 {
    width: calc(60% - 16px);
}

.w-50 {
    width: calc(50% - 16px);
}

.w-40 {
    width: calc(40% - 16px);
}

.w-30 {
    width: calc(30% - 16px);
}

.w-20 {
    width: calc(20% - 16px);
}

.w-10 {
    width: calc(10% - 16px);
}

.w-05 {
    width: calc(5% - 16px);
}

/* -------------------------------------------------
   Flex utilities
   ------------------------------------------------- */
.flexBox {
    display: flex;
}

.flexBox.align-start {
    align-items: flex-start;
}

.flexBox.align-center {
    align-items: center;
}

.flexBox.justify-between {
    justify-content: space-between;
}

.flexBox.gap-sm {
    gap: var(--spacing-sm);
}

.flexBox.gap-xs {
    gap: var(--spacing-xs);
}

/* -------------------------------------------------
   Spacing helpers (keep existing names for layout)
   ------------------------------------------------- */
.xSmMargin {
    height: var(--xSmMargin);
}

.smMargin {
    height: var(--spacing-sm);
}

.mdMargin {
    height: var(--mdMargin);
}

.lgMargin {
    height: var(--lgMargin);
}

.hero {
    height: 90vh;
    padding-bottom: 56px;
    position: relative;
    z-index: 2;
    /* Ensure text is above canvas */
}

.hero h1 {
    position: absolute;
    font-size: 2.8vw;
    line-height: 2.8vw;
    bottom: 56px;
    max-width: 70%;
    text-wrap: balance;
    padding-top: 0;
    /* Reset padding from previous h1 style */
}

.hero p {
    position: absolute;
    right: 0;
    bottom: 56px;
    font-size: 18px;
    width: fit-content;
    text-wrap: balance;
}

/* -------------------------------------------------
   Project Hero section
   ------------------------------------------------- */

#heroTop {
    padding-top: 40vh;
    text-wrap: balance;
}

.IntroChat {
    padding-top: 156px;
    font-size: 56px;
    line-height: 1.1;
}

.IntroChat a {
    font-size: 1.8vw;
    line-height: 110%;
    display: inline-block;
}

/* -------------------------------------------------
   Navigation & menu overlay
   ------------------------------------------------- */
.nav {
    padding: 56px 48px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 88888800;
    transition: transform 0.3s ease;
    pointer-events: none;
}

.nav.hidden {
    transform: translateY(-100%);
}

.nav-brand {
    color: var(--white);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: var(--spacing-md);
    pointer-events: auto;
}

.nav-links a {
    color: var(--white);
    text-decoration: none;
    transition: opacity 0.2s;
}

.nav-links a:hover {
    opacity: 0.6;
}

/* Top Navigation */
.topNav {
    position: fixed;
    padding-bottom: 16px;
    padding-top: 16px;
    padding-left: 56px;
    padding-right: 56px;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3333333;
    background: linear-gradient(to bottom, var(--primary), rgba(0, 0, 0, 0));
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topNav .flexBox {
    justify-content: space-between;
    display: flex;
    flex-direction: row;
    width: 100%;
    align-items: center;
}

.nav-center {
    display: flex;
    align-items: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 50%;
    margin-top: -12px;
    /* Adjust for text height */
    width: fit-content;
    height: auto;
    gap: 32px;
    /* More space between text */
    z-index: 20;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 32px;
    /* Space between Resume and Speech */
}

.pill-background {
    display: none;
    /* Hide the old pill */
}

/* New Sliding Underline */
.nav-underline {
    position: absolute;
    bottom: -8px;
    left: 0;
    height: 2px;
    background-color: var(--white);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0;
    /* JS will set this */
    pointer-events: none;
}

.nav-pill-link {
    position: relative;
    z-index: 1;
    padding: 0;
    /* Remove padding */
    transition: opacity 0.3s;
    text-decoration: none;
    opacity: 0.5;
    /* Default dimmed */
}

.nav-pill-link.active {
    opacity: 1;
    /* Active bright */
}

.nav-pill-link:hover {
    opacity: 1;
}

.nav-pill-link h6 {
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 0;
}

.topNav a {
    color: white;
    font-weight: 400;
    font-size: 18px;
    width: fit-content;
}

.topNav h6 {
    font-size: 18px;
    font-weight: 400;
}

.bottomContent a {
    color: var(--white);
    font-size: 18px;
}

.bottomContent a:hover {
    opacity: 0.6;
}

.menu {
    position: fixed;
    inset: 0;
    padding: 48px;
    z-index: 88888800;
    transform: translateY(-100%);
    transition: transform 1s ease;
    background: var(--white);
    color: var(--primary);
}

.menu.active {
    transform: translateY(0);
}

.menuDot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--white);
    position: fixed;
    top: 40px;
    right: 48px;
    z-index: 88888801;
    cursor: pointer;
}

.menuLinks {
    display: flex;
    flex-direction: column;
    position: absolute;
    left: 48px;
    top: 120px;
}

.menuLinks a {
    font-size: 8vw;
    line-height: 1;
    font-weight: 100;
    color: var(--primary);
    text-decoration: none;
    transition: opacity 0.2s;
}

.menuLinks a:hover {
    opacity: 0.6;
}

.socials {
    display: flex;
    justify-content: space-between;
    position: absolute;
    left: 48px;
    right: 48px;
    bottom: 48px;
}

.socials a {
    font-size: 14pt;
    font-weight: 300;
    color: var(--primary);
    text-decoration: none;
}

.socials a:hover {
    text-decoration: underline;
}

.heroSection {
    width: 100%;
    height: 100vh;
    background: var(--primary);
    padding: var(--spacing-md);
    color: var(--white);
}

/* -------------------------------------------------
   Chat UI (Essence)
   ------------------------------------------------- */
.aiBox,
.responseBox {
    color: var(--white);
}

.responseBox {
    position: fixed;
    top: 0px;
    left: 48px;
    right: 48px;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    height: calc(100% - 56px);
    width: auto;
    max-width: none;
    z-index: 2;
    box-sizing: border-box;
    background-color: var(--primary);
}

.aiMsg,
.userMsg {
    display: flex;
    flex-direction: column;
}

.userMsg .msg-wrapper,
.aiMsg .msg-wrapper {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
}

/* Staggered slide-in animations */
.label-col {
    width: 20%;
    position: relative;
    animation: slideIn 0.6s ease forwards;
}

.msgContent {
    padding-bottom: 64px;
    width: 80%;
    position: relative;
    animation: slideIn 0.8s ease 0.15s forwards;
    /* Delayed start */
    opacity: 0;
    /* Start hidden */
    overflow-wrap: break-word;
    word-break: break-word;
}

@keyframes slideIn {
    from {
        top: 40px;
        opacity: 0;
    }

    to {
        top: 0;
        opacity: 1;
    }
}

/* Thinking indicator */
.thinking-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 24px 0;
    opacity: 0.6;
}

.thinking-indicator .dot-pulse {
    width: 12px;
    height: 12px;
    background-color: var(--white);
    border-radius: 50%;
    animation: dotPulse 1.4s infinite ease-in-out;
}

.thinking-indicator .dot-pulse:nth-child(1) {
    animation-delay: 0s;
}

.thinking-indicator .dot-pulse:nth-child(2) {
    animation-delay: 0.2s;
}

.thinking-indicator .dot-pulse:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {

    0%,
    60%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    30% {
        opacity: 1;
        transform: scale(1);
    }
}

.response-card {
    padding-top: 8vh;
}

.aiMsg h6,
.userMsg h6 {
    font-size: 24px;
    padding-left: 28px;
    padding-bottom: 14px;
    padding-top: 14px;
    border-radius: 12px;
    padding-right: 28px;
    width: fit-content;
    margin-bottom: 32px;
    color: #0a0a0a;
    border-radius: 100rem;
    text-transform: uppercase;
}

.userMsg h6 {
    background-color: transparent;
    color: #ffffff;
    padding-left: 0;
    position: relative;
    display: flex;
    align-items: center;
}

/* Particle effect for User label */
.userMsg h6::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background-color: transparent;
    border: 2px solid #ffffff;
    border-radius: 50%;
    margin-right: 16px;
}

.aiMsg h6 {
    background-color: transparent;
    color: #ffffff;
    padding-left: 0;
    position: relative;
    display: flex;
    align-items: center;
}

/* Particle effect for AI label */
.aiMsg h6::before,
.dot::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background-color: #ffffff;
    border-radius: 50%;
    margin-right: 12px;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    animation: pulse-white 2s infinite;
}

.dot::before {
    margin-bottom: 0;
    vertical-align: middle;
}

@keyframes pulse-white {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(255, 255, 255, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

.clipping {
    position: relative;
    overflow: hidden;
}

.clipping .captions {
    position: absolute;
    bottom: -120px;
    padding: 16px;
    font-size: 18px;
    transition: bottom 0.5s ease;
    text-wrap: balance;
}

.clipping:hover .captions {
    bottom: 0;
    transition: bottom 0.5s ease;
}


.chat-card {
    margin-bottom: 32px;
}

.aiMsg p,
.userMsg p {
    width: 100%;
    font-size: 56px;
    line-height: 72px;
    margin-bottom: 32px;
}

.aiMsg p:last-child,
.userMsg p:last-child {
    margin-bottom: 0;
}

.aiMsg.long-response p,
.userMsg.long-response p {
    font-size: 56px;
    line-height: 72px;
}

.aiMsg a {
    color: white;
    text-decoration: underline;
}

.essence-tooltip {
    position: absolute;
    left: 0;
    color: white;
    padding: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    background-color: var(--primary);
    padding: 12px;
    border: 1px solid var(--white);
    text-wrap: balance;
    width: auto;
}

.essence-tooltip p {
    text-wrap: balance;
    width: 400px;
}

.inputBox {
    position: fixed;
    bottom: 0;
    left: 48px;
    right: 48px;
    /* Constrain right side */
    transform: none;
    padding: 0;
    /* Remove padding if not needed, or keep internal padding */
    width: auto;
    /* Let left/right control width */
    height: 56px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    background-color: var(--primary);
    z-index: 10;
}

.inputBox input[type="text"] {
    flex: 1;
    font-size: 32px;
    /* Larger to match chat */
    color: white;
    background: transparent;
    border: none;
    outline: none;
}

.inputBox ::placeholder {
    color: white;
    opacity: 0.5;
}

.send {
    margin-left: 12px;
    padding-right: 0;
    font-size: 24px;
    /* Larger send button */
    color: white;
    cursor: pointer;
}

/* Prompt cards */
.promptContainer {
    display: flex;
    gap: var(--spacing-sm);
    margin: var(--spacing-sm) 0 56px;
}

.promptBtn {
    flex: 1;
    background: var(--dark-gray-btn);
    color: var(--white);
    cursor: pointer;
    transition: background 0.2s;
    padding: var(--spacing-md);
}

.promptBtn:hover {
    background: var(--orange);
}

.no-bullets {
    list-style: none;
    padding: 0;
    margin: 0;
}

.no-bullets li {
    font-size: 24px;
    line-height: 1.4;
    margin-bottom: 8px;
}

/* Skills */
.skillsContainer {
    display: flex;
    justify-content: space-between;
    gap: var(--spacing-sm);
    padding-bottom: 64px;
    padding-top: 64px;
}

.skillsColumn {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.skillsContainer h4 {
    font-size: 32px;
    line-height: 1.2;
    color: var(--white);
}

.skillsets .w-80 {
    padding-right: 96px;
    text-wrap: balance;
}

.spaceTop {
    margin-top: 196px;
}

.spaceBottom {
    margin-bottom: 196px;
}

/* Projects grid */
.content {
    padding-left: 56px;
    padding-right: 56px;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.project-full {
    grid-column: 1/-1;
}

.moreWorks {
    overflow: hidden;
    height: 80vh;
    margin-left: 56px;
    margin-right: 56px;
    border-top: 1px solid var(--white);
}

.moreWorks video,
.moreWorks img {
    width: 100%;
}

.moreWorks h1 {
    text-wrap: balance;
}

.project h3 {
    text-align: left;
    padding-top: 16px;
    font-size: 24px;
    font-weight: 400;
}

.project h2 {
    padding-top: 16px;
}

.project .w-50 {
    gap: 0;
    width: 50%;
}

.project .flexBox {
    gap: 5%;
}

.highlight {
    color: var(--hl-color);
}

/*
Slider effect
*/
.carousel {
    position: relative;
    width: 100%;
    padding: 20px 0;
}

.carousel-track {
    display: flex;
    gap: 32px;
    transition: transform 0.4s ease;
}

.card {
    flex: 0 0 40%;
    /* ~2.2 cards on big screens */
    max-width: 700px;
    /* comfortable but not huge */
    padding: 32px;
    background: #141414;
    font-size: 1.1rem;
    color: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.card .flexBox {
    flex-direction: row;
}

.card h4 {
    padding-top: 0px !important;
    text-wrap: balance !important;
}

.card h3 {
    text-wrap: balance !important;
    padding-top: 0 !important;
}

.profileIcon {
    overflow: hidden;
    width: 32px;
    height: 32px;
    margin-right: 32px;
}

.profileIcon img {
    height: 100%;
    object-fit: cover;
}

.carousel-btn {
    position: absolute;
    padding: 10px 32px;
    border: none;
    border-radius: 100rem;
    cursor: pointer;
    font-size: 16px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    font-weight: 500;
    transition: opacity 0.2s ease;
    z-index: 100;
    cursor: none;
    width: fit-content;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
}

.carousel:hover .carousel-btn {
    opacity: 1;
}

/* -------------------------------------------------
   Drawers/Accordion
   ------------------------------------------------- */
.drawers {
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 24px;
}

.drawers .flexBox {
    justify-content: space-between;
    align-items: center;
}

.drawers .headers {
    font-size: 24px;
    line-height: 1.4;
    padding-bottom: 8px;
}

.drawers .plus {
    position: relative;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.hr {
    background-color: var(--white);
    height: 1px;
    width: 100%;
}

.drawers .plusBar1,
.drawers .plusBar2 {
    position: absolute;
    background-color: var(--white);
    transition: opacity 0.3s ease;
}

.drawers .plusBar1 {
    width: 24px;
    height: 2px;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.drawers .plusBar2 {
    width: 2px;
    height: 24px;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
}

.drawers .expandContent {
    display: none;
    padding-top: 24px;
    overflow: hidden;
}

.drawers.expanded .expandContent {
    display: block;
}


/* Media wrappers */
.mediaWrapper {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    width: 100%;
    margin-top: 32px;
}

.mediaWrapper>div {
    flex: 1 1 calc(50% - 8px);
}

.mediaWrapper img,
.mediaWrapper video {
    width: 100%;
    display: block;
}

/* Articles layout (index) */
.articles .flexBox {
    align-items: start;
}

.articles h1 {
    text-wrap: balance;
    padding-bottom: 56px;
}

.articles h3 {
    padding-right: 18px;
}

.case-study {
    overflow-x: hidden;
}

.case-study-wrapper {
    color: white;
    box-sizing: border-box;
}

.case-study-wrapper .split-view-title,
.split-view-title {
    font-size: 24px;
    color: white;
    padding-bottom: 18px;
    padding-top: 32px;
}

.wideTitle {
    font-size: 64px;
    line-height: 64px;
    padding-top: 124px;
    padding-bottom: 124px;
    text-wrap: balance;
}

.case-study-body {
    padding-bottom: 124px;
    margin-bottom: 0;
}

.case-study-wrapper .split-view-paragraph,
.split-view-paragraph {
    font-size: 22px !important;
    line-height: 1.2 !important;
    color: white !important;
}

.split-view-container {
    max-width: 60%;
    margin: auto;
}

.case-study-header {
    font-size: 112px;
    line-height: 124px;
    margin-top: 56px;
    margin-bottom: 24px;
    font-weight: 600;
    text-transform: uppercase;
    text-wrap: balance;
    padding-bottom: 56px;
}

.case-study-flex-text {
    display: flex;
    gap: 32px;
    font-size: 18px;
    margin-bottom: 48px;
    flex-wrap: wrap;
    color: white;
}

.case-study-flex-text a {
    text-decoration: underline;
    color: white;
}

.separator-line {
    display: none;
    /* Removed as requested */
    width: 100%;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.2);
    margin-bottom: 64px;
    margin-top: 66px;
}

.separator-line.bottomSpace {
    margin-top: 124px;
}

.pwdSpace {
    position: fixed;
    left: 0;
    right: 0;
    width: 60%;
    margin: auto;
    bottom: 32px;
}

.pwdSpace h2 {
    font-size: 32px;
    text-align: center;
    padding: 32px;
    text-wrap: balance;
}

.pwdSpace a {
    text-decoration: underline;
}

.footer {
    color: white;
    padding-bottom: 56px;
    font-size: 124px;
}

/* XL screens (desktop) → ~2–3 in view */
@media (min-width: 1600px) {
    .card {
        flex: 0 0 33%;
        /* 3 across, 1 peeking */
        max-width: 800px;
    }
}

/* L screens (laptops) → 2 cards visible */
@media (min-width: 1100px) and (max-width: 1599px) {
    .card {
        flex: 0 0 45%;
        /* just under 2.5 across */
        max-width: 780px;
    }
}

/* M screens → 1.5 cards visible */
@media (min-width: 800px) and (max-width: 1099px) {
    .card {
        flex: 0 0 65%;
        max-width: 750px;
    }
}

/* S screens → 1 full card */
@media (max-width: 799px) {
    .card {
        flex: 0 0 90%;
        max-width: none;
    }
}


/* Mobile adjustments (≤930px) */
@media screen and (max-width: 930px) {
    .hero h2 {
        font-size: 24px;
        max-width: 100%;
        position: relative;
        margin-top: 156px;
    }

    .hero {
        height: 90vh;
    }

    .hero h1 {
        position: absolute;
        bottom: 48px;
        max-width: 100%;
        font-size: 28px;
        line-height: 1.3;
        padding: 0;
        padding-bottom: 32px;
    }

    .hero p {
        position: absolute;
        right: auto;
        bottom: 0;
        margin-top: 16px;
        font-size: 16px;
        padding-bottom: 32px;
    }

    .topNav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: fit-content;
    }

    .nav-center {
        padding-left: 16px;
        padding-right: 16px;
        width: 100%;
        justify-content: space-between;
    }

    .inputBox {
        position: fixed;
        width: 100%;
        left: 0;
        right: 0;
        bottom: 0;
    }

    .locked-page {
        overflow: hidden !important;
    }

    .articles .w-40 {
        padding-bottom: 56px;
    }

    h1,
    h2 {
        font-size: 24px;
    }

    h3 {
        font-size: 18px;
    }

    .mdMargin {
        height: 56px;
    }

    .topNav h6 {
        font-size: 24px;
        line-height: 32px;
    }

    .topnav a {
        margin-right: 0;
    }

    .dot::before {
        margin: 0;
        margin-right: 8px;
    }

    .nav-left {
        gap: 12px;
    }

    /* Stack flex layouts vertically */
    .flexBox {
        flex-direction: column;
    }

    .project,
    .essence-project-grid.project,
    .project .flexBox {
        gap: 56px !important;
    }

    .btn-row {
        width: 100%;
        display: flex;
        flex-wrap: nowrap;
        gap: 4px;
        /* Tighter gap for mobile */
    }

    .sort-btn {
        flex: 1;
        padding: 8px 0;
        /* Remove side padding to fit text */
        font-size: 16px;
        /* Match other interface buttons */
        text-align: center;
        white-space: nowrap;
    }

    .sort-btn.run-sort-btn {
        flex: 4;
        /* Takes 50% of 8 total parts */
    }

    .w-05,
    .w-10 {
        display: none !important;
    }

    .aiMsg p,
    .userMsg p {
        font-size: 24px;
        line-height: 32px;
        width: 100%;
    }

    .IntroChat {
        text-wrap: balance;
        word-break: normal;
    }

    .nav-right,
    .nav-brand {
        display: none;
    }

    .aiMsg a,
    .userMsg a {
        font-size: 24px;
        line-height: 32px;
    }

    .send {
        font-size: 18px;
        padding-right: 16px;
    }

    .response-card {
        padding-top: 48px;
    }

    .msgContent {
        padding-bottom: 64px;
        width: 100%;
    }

    .userMsg .msg-wrapper,
    .aiMsg .msg-wrapper {
        flex-direction: column;
        width: 100%;
    }

    .label-col {
        width: 100%;
    }

    .responseBox {
        z-index: 1;
        height: calc(100% - 150px);
        top: 64px;
        left: 0;
        right: 0;
        padding-left: 16px;
        padding-right: 16px;
        width: 100%;
        position: fixed;
    }

    .spaceTop {
        margin-top: 56px;
    }

    .spaceBottom {
        margin-bottom: 56px;
    }

    .modes {
        display: none;
    }

    .modeIcon {
        height: 12px;
        width: 12px;
    }

    .modes .flexBox {
        flex-direction: row;
        gap: 12px;
    }

    .speachMode {
        font-size: 18px;
        color: white;
    }

    .inputBox input[type="text"] {
        font-size: 18px;
        margin-left: 12px;
    }

    .inputBox::placeholder {
        font-size: 18px;
    }

    .promptContainer {
        flex-direction: column;
    }

    .skillsContainer {
        flex-wrap: wrap;
    }

    .skillsColumn {
        min-width: 45%;
    }

    .imageFLip {
        position: relative;
        width: 100%;
        height: 300px;
        background: black;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* All width classes become full width on mobile */
    .w-100,
    .w-80,
    .w-70,
    .w-60,
    .w-50,
    .w-40,
    .w-30 {
        width: 100% !important;
    }

    .skillsets .w-80 {
        padding-right: 0;
    }

    /* Adjust content padding for mobile */
    .content {
        padding-left: 16px;
        padding-right: 16px;
    }

    .footer {
        font-size: 56px;
        padding-bottom: 0px !important;
    }

    footer h1 {
        padding-bottom: 16px !important;
    }

    .lgMargin {
        height: 56px;
    }

    .project {
        gap: 56px !important;
    }

    .project h2 {
        padding-bottom: 0px;
    }

    .project>*:last-child {
        padding-bottom: 10vh;
    }

    .articles h1 {
        padding-top: 10vh;
    }

    #heroTop {
        width: 100%;
        text-wrap: wrap;
        padding-bottom: 32px;
    }

    .moreWorks {
        margin-left: 16px;
        margin-right: 16px;
        box-sizing: border-box;
        height: 60vh;
    }

    .moreWorks video {
        width: 100%;
    }

    .drawers .flexBox {
        flex-direction: row;
    }

    .drawers {
        padding-top: 56px;
        padding-bottom: 56px;
    }

    .case-study h4{
        margin-bottom: 32px !important;
    }

    .case-study .lgTxt{
        font-size: 24px;
    }

    br:nth-child(even){
        display: none;
    }

    .drawers .mdTxt {
        font-size: 18px;
    }

    /* .breif {
        padding-top: 10vh;
    } */

    .moreWorks h1 {
        width: 100%;
        text-wrap: wrap;
    }

    .moreWorks{
         border-top: 0px solid transparent;
    }
}

/* -------------------------------------------------
   Utility: hide scrollbars
   ------------------------------------------------- */
::-webkit-scrollbar {
    width: 0;
}

/* Case Study Specific Styles */
.duoBrid {
    width: 132px;
    height: auto;
}

.case-study h4 {
    font-size: 18px;
    padding-top: 32px;
    margin-bottom: 64px;
    width: 100%;
    display: block;
}

/* -------------------------------------------------
   404 Error page (New Two Balls Version)
   ------------------------------------------------- */
.error-page {
    display: block;
    overflow: hidden;
    background-color: var(--primary);
}

.error-page .modes {
    opacity: 0.2;
    cursor: not-allowed;
    pointer-events: none;
}

.error-page #gameContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

#gameCanvas {
    width: 100%;
    height: 100%;
}

.error-page .ball {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    z-index: 2000;
    /* Higher than text */
    pointer-events: none;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

#ball-white {
    background-color: #000000 !important;
    border: none;
}

#ball-black {
    background-color: #FFFFFF !important;
    border: none;
}

#ball-gray {
    background-color: #A5A5A5 !important;
    border: none;
}

#ball-darkgray {
    background-color: #000000 !important;
    border: none;
}

.error-page .errorMessage {
    position: fixed;
    bottom: 16px;
    left: 56px;
    right: 56px;
    z-index: 1000;
}

.error-page .big-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.error-page .large-err {
    font-size: 56px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-weight: 500;
    margin: 0;
    color: black;
    mix-blend-mode: difference;
    pointer-events: auto;
    user-select: text;
}

/* Removed anchor styles as text is now static */

.error-page .err-content p {
    font-size: 18px;
    margin-bottom: 8px;
    color: black;
    mix-blend-mode: difference;
    pointer-events: auto;
    user-select: text;
}

.error-page .error-link {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 4px;
    pointer-events: auto;
    cursor: pointer;
}


/* -------------------------------------------------
   Sorting Visualization
   ------------------------------------------------- */
.sorting-wrapper {
    width: 100%;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.boxes-container {
    display: flex;
    gap: 20px;
    width: 100%;
}

.sort-box {
    padding: 10px;
    display: flex;
    flex-direction: column;
}

.sort-box h4 {
    text-align: center;
    margin-bottom: 10px;
    color: var(--white);
}

.bars-container {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 150px;
    width: 100%;
    gap: 2px;
    border-bottom: 1px solid white;
}

.controls-container {
    display: flex;
    flex-direction: column;
    align-items: left;
    gap: 15px;
    margin-top: 10px;
}

.stats-log {
    font-family: monospace;
    font-size: 14px;
    color: var(--gray);
}

.btn-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.sort-btn {
    padding: 8px 16px;
    cursor: pointer;
    border: 1px solid var(--white);
    border-radius: 100rem;
    background-color: transparent;
    color: var(--white);
    transition: all 0.2s;
}

.sort-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sort-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Sorting Bars */
.sort-bar {
    width: 100%;
    color: white;
    /* Default text color, overridden if bright */
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s ease;
}

.sort-bar.text-dark {
    color: #000;
}

.sort-bar.text-light {
    color: #fff;
}

/* Sorting Bar Gradients */
.sort-bar.blue {
    background: linear-gradient(0deg, #03001e 0%, #3f2b96 50%, #a8c0ff 100%);
    border-top-left-radius: 100rem;
    border-top-right-radius: 100rem;
    color: black;
}

.sort-bar.green {
    background: linear-gradient(0deg, #03001e 0%, #00b09b 50%, #96c93d 100%);
    border-top-left-radius: 100rem;
    border-top-right-radius: 100rem;
    color: black;
}

.sort-bar {
    position: relative;
    /* Ensure no flex centering text inside */
    display: block !important;
    transition: all 0.1s ease;
}

.sort-bar-label {
    position: absolute;
    top: -20px;
    /* Adjust 8px above the bar */
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: bold;
    color: white;
    /* Or variable based on theme */
    padding-bottom: 8px;
    /* Extra padding if needed */
}

.sort-bar.red {
    background: linear-gradient(0deg, #03001e 0%, #fc4a1a 50%, #f7b733 100%);
    border-top-left-radius: 100rem;
    border-top-right-radius: 100rem;
    color: white;
}

.sort-bar.teal {
    background: linear-gradient(0deg, #03001e 0%, #7303c0 50%, #ec38bc 100%);
    border-top-left-radius: 100rem;
    border-top-right-radius: 100rem;
    color: black;
}

/* -------------------------------------------------
   World Clocks Responsive
   ------------------------------------------------- */
.world-clocks-container {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    justify-content: space-between;
}

.world-clock-item {
    flex: 1 1 calc(25% - 32px);
    min-width: 150px;
    max-width: 100%;
}

@media screen and (max-width: 930px) {
    .world-clock-item {
        flex: 1 1 calc(50% - 32px);
        /* 2 per row */
    }

    .error-page .errorMessage {
        position: fixed;
        bottom: 16px;
        left: 16px;
        right: 16px;
        z-index: 1000;
        text-wrap: balance;
        pointer-events: none;
    }
}

@media screen and (max-width: 480px) {
    .world-clocks-container {
        gap: 16px;
    }

    .world-clock-item {
        flex: 1 1 calc(50% - 16px);
    }
}