/* Evidence Board Stylesheet for projects.html */
@import url('https://fonts.googleapis.com/css2?family=Anton&family=Roboto+Mono:ital,wght@0,400;0,700;1,400&family=Inter:wght@400;700;900&display=swap');

:root {
    --eb-bg: #09090b;
    --eb-foreground: #ffffff;
    --eb-primary: #ffffff;
    --eb-muted: rgba(255, 255, 255, 0.5);
    --eb-border: #272C31;
    --eb-card-bg: #1c1c1c;
    --eb-pin: #E6C07B;
}

body.eb-body {
    margin: 0;
    padding: 0;
    background-color: var(--eb-bg);
    color: var(--eb-foreground);
    font-family: Helvetica, Arial, sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
}

.eb-main {
    position: relative;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

@media (min-width: 768px) {
    .eb-main {
        padding: 5rem;
    }
}

/* Subtle Texture Background */
.eb-bg-pattern {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.05;
    pointer-events: none;
    background-image: radial-gradient(circle, var(--eb-foreground) 1px, transparent 1px);
    background-size: 32px 32px;
}

/* Header */
.eb-header {
    position: relative;
    z-index: 10;
    margin-bottom: 6rem;
    text-align: center;
}

.eb-title {
    font-size: 3.75rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    color: var(--eb-primary);
    text-transform: uppercase;
    font-style: italic;
    margin: 0;
    /* Option for a gritty font: */
    font-family: 'Anton', sans-serif;
}

.eb-subtitle {
    color: var(--eb-muted);
    margin-top: 1rem;
    letter-spacing: 0.4em;
    font-size: 0.65rem;
    text-transform: uppercase;
    opacity: 0.6;
    font-family: 'Roboto Mono', monospace;
}

/* Home button adaptation */
.eb-home-btn {
    position: absolute;
    top: 20px;
    left: 30px;
    z-index: 20;
    color: var(--eb-muted);
    text-decoration: none;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.eb-home-btn:hover {
    color: var(--eb-primary);
}

/* Layout Grid */
.eb-grid {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    padding: 0 1rem;
    align-items: start;
}

@media (min-width: 768px) {
    .eb-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .eb-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Cards Wrapper */
.eb-card-wrapper {
    display: block;
    text-decoration: none;
    color: inherit;
    max-width: 24rem;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    group: true;
}

/* Disable link effects implicitly */
@media (hover: hover) {

    .eb-card-wrapper:hover .eb-card,
    .eb-card-wrapper:focus .eb-card {
        transform: scale(1.05) var(--card-rotation, rotate(0deg));
        z-index: 10;
    }
}

/* The Investigation Card */
.eb-card {
    position: relative;
    background-color: var(--eb-card-bg);
    border-style: solid;
    border-width: 2px 1px 3px 2px;
    border-color: rgba(255, 255, 255, 0.08) rgba(255, 255, 255, 0.05) rgba(255, 255, 255, 0.05) rgba(255, 255, 255, 0.08);
    padding: 1.5rem;
    border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* The default rotation is applied via style override or classes */
}

.eb-video-container {
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.eb-video-container video,
.eb-video-container img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.aligned-video-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    overflow: visible !important;
    position: relative;
}

.aligned-video-card .eb-video-container {
    border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
    /* wobbly video frame */
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.55);
    position: relative;
    z-index: 1;
}

.aligned-video-card .eb-video-container video,
.aligned-video-card .eb-video-container img {
    border-radius: 0;
    width: 100%;
    height: auto;
    display: block;
}

.aligned-video-card .eb-pin {
    position: absolute;
    top: -8px;
    /* exactly half of 16px pin height */
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.aligned-video-card .eb-card-header {
    display: none;
}

/* Modal specific overrides for aligned video cards */
.eb-card-modal-content .aligned-video-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    overflow: visible !important;
}

.eb-card-modal-content .aligned-video-card .eb-video-container {
    border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.55);
    position: relative;
    z-index: 1;
}

.eb-card-modal-content .aligned-video-card .eb-pin {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.project-list {
    gap: 4.5rem !important;
}

/* --- DIARY & LEAKING NOTE CARDS THEME --- */

/* Add space inside the diary card for spirals */
.diary-card {
    padding-left: 2.2rem !important;
    position: relative;
    z-index: 2;
    /* Ensure it stays on top of the note card */
}

/* Spiral binding on the left edge */
.diary-spirals {
    position: absolute;
    left: 8px;
    top: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    z-index: 10;
    pointer-events: none;
}

.spiral-ring {
    width: 16px;
    height: 8px;
    border: 2px solid #a1a1aa;
    /* silver metal look */
    border-right: none;
    border-radius: 4px 0 0 4px;
    background: transparent;
    box-shadow: -1px 1px 2px rgba(0, 0, 0, 0.4);
    position: relative;
}

.spiral-ring::after {
    content: "";
    position: absolute;
    right: -2px;
    top: -1px;
    width: 3px;
    height: 6px;
    background: #09090b;
    /* hide behind page edge hole */
    border-radius: 1px;
}

/* Elastic strap on the right */
.diary-strap {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 25px;
    width: 10px;
    z-index: 4;
    border-radius: 2px;
    box-shadow: inset 1px 0 2px rgba(255, 255, 255, 0.2), 1px 0 3px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    opacity: 0.85;
}

/* Default strap colors by category */
.diary-strap.strap-blue {
    background-color: #3b82f6;
}

.diary-strap.strap-green {
    background-color: #22c55e;
}

.diary-strap.strap-pink {
    background-color: #ec4899;
}

/* Decorative tabs at the top of the diary card */
.diary-tab {
    position: absolute;
    top: -10px;
    width: 16px;
    height: 10px;
    border-radius: 3px 3px 0 0;
    z-index: 1;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
}

.diary-tab.tab-green {
    left: 45px;
    background-color: #86efac;
}

.diary-tab.tab-yellow {
    left: 65px;
    background-color: #fef08a;
}

.diary-tab.tab-pink {
    left: 85px;
    background-color: #fecdd3;
}

/* Leaking caption note styled as a sticky note tucked behind the diary */
.leaking-note-card {
    position: relative;
    z-index: 1;
    margin-top: -8px !important;
    /* pull it up behind the diary card */
    margin-left: 20px !important;
    /* shift right to leak out */
    padding: 1.25rem 1rem 1rem 1rem !important;
    border-radius: 2px 15px 4px 12px / 12px 4px 15px 2px !important;
    box-shadow: 2px 10px 18px rgba(0, 0, 0, 0.45) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), margin-top 0.3s;
}

/* Hover offset expansion animation on card wrapper */
@media (hover: hover) {
    .index-project-card:hover .leaking-note-card {
        transform: rotate(5deg) translate(8px, 6px) !important;
    }
}

/* Sticky note themes */
.leaking-note-card.theme-yellow {
    background-color: #fef08a !important;
    /* Pastel Yellow sticky note */
    color: #451a03 !important;
    border: 1px dashed #ca8a04 !important;
}

.leaking-note-card.theme-pink {
    background-color: #fecdd3 !important;
    /* Pastel Pink sticky note */
    color: #4c0519 !important;
    border: 1px dashed #f43f5e !important;
}

.leaking-note-card.theme-teal {
    background-color: #ccfbf1 !important;
    /* Pastel Teal/Blue sticky note */
    color: #042f2e !important;
    border: 1px dashed #14b8a6 !important;
}

/* On desktop, hide leaking notes inside the projects board grid view to prevent duplicated text */
body:not(.view-3d-active) .eb-grid .leaking-note-card {
    display: none !important;
}

/* Caption inner typography and details */
.project-caption .caption-title {
    margin-top: 0;
    margin-bottom: 6px;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.project-caption .caption-text {
    display: block;
    font-size: 0.72rem;
    font-family: 'Inter', sans-serif;
    line-height: 1.35;
    opacity: 0.95;
}

.project-caption .caption-repo-link {
    color: inherit;
    text-decoration: underline;
    font-size: 0.72rem;
    font-family: 'Roboto Mono', monospace;
    display: block;
    margin-top: 8px;
    font-weight: bold;
    letter-spacing: 0.05em;
}

.project-caption .caption-tags {
    display: block;
    font-size: 0.65rem;
    font-family: 'Roboto Mono', monospace;
    margin-top: 4px;
    opacity: 0.8;
}

/* Force all project-caption text to black for readability on colored sticky notes */
.project-caption,
.project-caption .caption-title,
.project-caption .caption-text,
.project-caption .caption-tags,
.project-caption .caption-repo-link {
    color: #000 !important;
}

/* Red Paperclip decoration on sticky note */
.leaking-note-card::before {
    content: "";
    position: absolute;
    top: -12px;
    right: 25px;
    width: 8px;
    height: 24px;
    border: 2px solid #ef4444;
    /* red metallic paperclip */
    border-radius: 5px;
    background: transparent;
    z-index: 5;
    transform: rotate(-15deg);
    box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* Rotations */
.eb-rotate-1 {
    --card-rotation: rotate(1deg);
    transform: rotate(1deg);
}

.eb-rotate-n1 {
    --card-rotation: rotate(-1deg);
    transform: rotate(-1deg);
}

.eb-rotate-2 {
    --card-rotation: rotate(2deg);
    transform: rotate(2deg);
}

.eb-rotate-n2 {
    --card-rotation: rotate(-2deg);
    transform: rotate(-2deg);
}

.eb-rotate-3 {
    --card-rotation: rotate(3deg);
    transform: rotate(3deg);
}

.eb-rotate-n3 {
    --card-rotation: rotate(-3deg);
    transform: rotate(-3deg);
}

/* The Pin */
.eb-pin {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--eb-pin);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(185, 152, 111, 0.2);
}

/* Content */
.eb-card-header {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--eb-primary);
    border-bottom: 1px solid var(--eb-border);
    padding-bottom: 0.75rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-family: 'Roboto Mono', monospace;
}

.eb-inner-box {
    background-color: transparent;
    padding: 0.5rem 0;
    border: none;
    border-radius: 0;
    margin-bottom: 0.75rem;
}

.eb-status-label {
    color: var(--eb-muted);
    font-size: 0.56rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 0.5rem 0;
    font-family: 'Inter', sans-serif;
}

.eb-status-value {
    color: var(--eb-primary);
    font-family: 'Roboto Mono', monospace;
    font-size: 1.125rem;
    letter-spacing: -0.025em;
    margin: 0;
    word-break: break-all;
}

.eb-description {
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    line-height: 1.625;
    margin-bottom: 1rem;
    font-family: 'Inter', sans-serif;
}

.eb-tags {
    font-size: 0.6rem;
    font-family: 'Roboto Mono', monospace;
    color: var(--eb-pin);
    border-top: 1px dashed var(--eb-border);
    padding-top: 0.5rem;
    opacity: 0.8;
}

/* Specific placeholders based on React Toolbox */
.eb-awaiting {
    opacity: 0.4;
    filter: grayscale(100%);
    transition: all 0.7s;
}

@media (hover: hover) {
    .eb-awaiting:hover {
        opacity: 1;
        filter: grayscale(0%);
    }
}

.eb-awaiting-box {
    height: 12rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--eb-border);
    border-radius: 1rem;
    color: rgba(255, 255, 255, 0.3);
}

.eb-awaiting-text {
    font-size: 0.625rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.3em;
    font-family: 'Roboto Mono', monospace;
}

/* Social Footer & Footer Navigation */
.eb-social-footer {
    width: 100%;
    max-width: 800px;
    margin: 5rem auto 2rem;
    text-align: center;
    border-top: 1px dashed var(--eb-border);
    padding-top: 3rem;
    position: relative;
    z-index: 10;
}

.eb-social-title {
    color: var(--eb-primary);
    font-family: 'Roboto Mono', monospace;
    font-size: 1.2rem;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.eb-social-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    align-items: center;
}

.eb-social-link {
    color: var(--eb-muted);
    font-size: 2rem;
    transition: color 0.3s, transform 0.3s;
    text-decoration: none;
    display: flex;
    align-items: center;
}

@media (hover: hover) {
    .eb-social-link:hover {
        color: var(--eb-primary);
        transform: translateY(-3px);
    }
}

.eb-social-img {
    filter: grayscale(100%) opacity(0.5);
    transition: filter 0.3s, transform 0.3s;
    height: 32px;
}

@media (hover: hover) {
    .eb-social-link:hover .eb-social-img {
        filter: grayscale(0%) opacity(1);
        transform: translateY(-3px);
    }
}

.eb-footer-text {
    color: var(--eb-muted);
    font-family: 'Roboto Mono', monospace;
    font-size: 0.7rem;
    margin-top: 4rem;
    opacity: 0.5;
}

/* --- 3D SPIRAL VIEW ADDITIONS --- */

.view-toggle-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.view-toggle-btn {
    background: transparent;
    border: 1px solid var(--eb-border);
    color: var(--eb-muted);
    padding: 0.5rem 1.25rem;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (hover: hover) {
    .view-toggle-btn:hover {
        color: var(--eb-primary);
        border-color: rgba(255, 255, 255, 0.4);
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
    }
}

.view-toggle-btn.active {
    color: var(--eb-bg);
    background-color: var(--eb-pin);
    border-color: var(--eb-pin);
    font-weight: bold;
}

.three-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    background-color: #09090b;
    outline: none;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.three-container.hidden {
    opacity: 0;
    pointer-events: none;
}

.three-labels-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
    transition: opacity 0.5s ease;
}

.three-labels-container.hidden {
    opacity: 0;
    pointer-events: none;
}

.three-label {
    position: absolute;
    transform: translate(-50%, -100%);
    margin-top: -15px;
    color: var(--eb-foreground);
    font-family: 'Roboto Mono', monospace;
    font-size: 0.65rem;
    background: rgba(9, 9, 11, 0.85);
    border: 1px solid var(--eb-border);
    padding: 4px 8px;
    border-radius: 3px;
    white-space: nowrap;
    pointer-events: none;
    letter-spacing: 0.05em;
    transition: border-color 0.3s, color 0.3s, background-color 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
}

.three-label.active {
    border-color: var(--eb-pin);
    color: var(--eb-pin);
    background: rgba(9, 9, 11, 0.95);
    font-weight: bold;
}

.three-label.center-label {
    border-color: var(--eb-pin);
    color: var(--eb-pin);
}

.three-summary-panel {
    position: fixed;
    bottom: 5%;
    left: 40px;
    width: 320px;
    max-height: 70vh;
    background: rgba(18, 18, 20, 0.85);
    border: 1px solid var(--eb-border);
    border-left: 3px solid var(--eb-pin);
    border-radius: 4px;
    padding: 1.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.7);
    z-index: 10;
    backdrop-filter: blur(10px);
    font-family: 'Roboto Mono', monospace;
    color: var(--eb-foreground);
    overflow-y: auto;
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(0);
}

.three-summary-panel.hidden {
    opacity: 0;
    transform: translateX(-100px);
    pointer-events: none;
}

.three-summary-header {
    font-size: 0.7rem;
    color: var(--eb-pin);
    margin-bottom: 0.5rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.three-summary-title {
    font-size: 1.15rem;
    font-weight: bold;
    color: var(--eb-foreground);
    margin: 0 0 1rem 0;
    border-bottom: 1px solid var(--eb-border);
    padding-bottom: 0.75rem;
    text-transform: uppercase;
}

.three-summary-row {
    margin-bottom: 0.75rem;
}

.three-summary-label {
    color: var(--eb-muted);
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.2rem;
}

.three-summary-value {
    color: var(--eb-foreground);
    font-size: 0.85rem;
    word-break: break-all;
}

.three-summary-desc {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    font-style: italic;
    margin: 1rem 0;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.three-summary-tags {
    font-size: 0.65rem;
    color: var(--eb-pin);
    border-top: 1px dashed var(--eb-border);
    padding-top: 0.75rem;
    opacity: 0.9;
}

.three-launch-btn {
    position: fixed;
    bottom: 40px;
    right: 40px;
    z-index: 10;
    background: var(--eb-card-bg);
    border: 1px solid var(--eb-pin);
    color: var(--eb-foreground);
    padding: 1rem 2rem;
    border-radius: 4px;
    text-decoration: none;
    font-family: 'Roboto Mono', monospace;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(230, 192, 123, 0.2);
    transition: opacity 0.5s ease, transform 0.3s, border-color 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.three-launch-btn.hidden {
    opacity: 0;
    transform: translate(20px, 20px) scale(0.95);
    pointer-events: none;
}

@media (hover: hover) {
    .three-launch-btn:hover {
        border-color: #ffffff;
        transform: scale(1.03);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.6), 0 0 25px rgba(255, 255, 255, 0.4);
    }
}

.three-launch-btn .launch-label {
    font-size: 0.6rem;
    color: var(--eb-pin);
    letter-spacing: 0.25em;
    text-transform: uppercase;
}

.three-launch-btn .launch-target-name {
    font-size: 1.1rem;
    font-weight: bold;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: 25px;
}

.three-launch-btn .launch-arrow {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    opacity: 0.7;
    transition: transform 0.3s;
}

@media (hover: hover) {
    .three-launch-btn:hover .launch-arrow {
        transform: translateY(-50%) translateX(5px);
        opacity: 1;
    }
}

.fade-out-view {
    opacity: 0 !important;
    pointer-events: none !important;
    height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
}

.eb-grid,
.eb-social-footer,
.eb-main>p {
    transition: opacity 0.5s ease;
}

body.view-3d-active .eb-header {
    margin-bottom: 2rem;
    pointer-events: auto;
}

body.view-3d-active .eb-main {
    padding-bottom: 2rem;
}

@media (max-width: 768px) {
    .three-summary-panel {
        top: auto;
        bottom: 150px;
        left: 15px;
        right: 15px;
        width: auto;
        max-height: 22vh;
        z-index: 11;
        padding: 1rem;
        font-size: 0.7rem;
    }

    .three-summary-panel .three-summary-title {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .three-summary-panel .three-summary-desc {
        font-size: 0.65rem;
        margin: 0.5rem 0;
        padding: 0.5rem;
    }

    .three-summary-panel .three-summary-row {
        margin-bottom: 0.5rem;
    }

    .three-summary-panel .three-summary-tags {
        padding-top: 0.5rem;
    }

    .three-launch-btn {
        left: 80px;
        right: 80px;
        bottom: 20px;
        min-height: 86px;
        max-height: 100px;
        padding: 0.75rem 1rem;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        box-sizing: border-box;
    }

    .three-launch-btn .launch-target-name {
        margin-right: 0;
        font-size: 0.95rem;
    }

    .three-launch-btn .launch-arrow {
        display: none !important;
        /* Hide arrow icon on mobile to save space */
    }
}

.view-toggle-btn.loading {
    color: var(--eb-muted);
    border-color: var(--eb-border);
    background-color: transparent;
    cursor: wait;
    pointer-events: none;
    animation: toggle-loading-pulse 1.5s infinite ease-in-out;
}

@keyframes toggle-loading-pulse {

    0%,
    100% {
        opacity: 0.6;
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.05);
    }

    50% {
        opacity: 1;
        box-shadow: 0 0 15px rgba(230, 192, 123, 0.3);
        border-color: var(--eb-pin);
        color: var(--eb-pin);
    }
}

/* --- MOBILE GRID VIEW CARD COLLAPSE & MODAL POPUP --- */

@media (max-width: 768px) {

    /* Shrink the page header elements on mobile displays */
    .eb-title {
        font-size: 2.2rem;
    }

    .eb-header {
        margin-bottom: 3.5rem;
    }

    .eb-subtitle {
        font-size: 0.55rem;
        letter-spacing: 0.25em;
    }

    /* Set grid columns to fit more cards in each row on mobile */
    body:not(.view-3d-active) .eb-grid,
    .project-list {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
        gap: 1.25rem;
        padding: 0;
    }

    /* Allow card wrappers to shrink on mobile */
    body:not(.view-3d-active) .eb-card-wrapper,
    .project-list .eb-card-wrapper {
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        cursor: pointer;
    }

    /* Shrink the card padding and text sizes */
    body:not(.view-3d-active) .eb-card,
    .project-list .eb-card {
        padding: 1rem 0.65rem;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    }

    body:not(.view-3d-active) .eb-card-header,
    .project-list .eb-card-header {
        font-size: 0.6rem;
        margin-bottom: 0.4rem;
        padding-bottom: 0.3rem;
        line-height: 1.25;
        letter-spacing: 0.05em;
    }

    .project-list .aligned-video-card .eb-card-header {
        display: block !important;
    }

    /* Reposition pin for smaller cards */
    body:not(.view-3d-active) .eb-card .eb-pin,
    .project-list .eb-card .eb-pin {
        width: 10px;
        height: 10px;
        top: -5px;
    }

    /* Hide card body components on mobile displays when in regular Grid View / Project List */
    body:not(.view-3d-active) .eb-grid .eb-card>*:not(.eb-card-header):not(.eb-pin),
    .project-list .eb-card>*:not(.eb-card-header):not(.eb-pin) {
        display: none !important;
    }

    /* Give aligned video cards a dark card background and borders on mobile when collapsed */
    .project-list .aligned-video-card {
        background-color: var(--eb-card-bg) !important;
        border-style: solid !important;
        border-width: 2px 1px 3px 2px !important;
        border-color: rgba(255, 255, 255, 0.08) rgba(255, 255, 255, 0.05) rgba(255, 255, 255, 0.05) rgba(255, 255, 255, 0.08) !important;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4) !important;
        padding: 1rem 0.65rem !important;
        overflow: visible !important;
        border-radius: 255px 15px 225px 15px/15px 225px 15px 255px !important;
    }

    /* Shrink the leaking note cards on mobile to fit columns nicely */
    body:not(.view-3d-active) .eb-grid .leaking-note-card,
    .project-list .leaking-note-card {
        display: block !important;
        padding: 0.8rem 0.5rem 0.5rem 0.5rem !important;
        margin-left: 10px !important;
        margin-top: -12px !important;
        /* pull it up slightly closer under the shrunken cover */
    }

    /* Override the broad hide-all-children rule for leaking note cards — restore .project-caption.
       Must chain .eb-card.leaking-note-card to match the specificity (0,4,0) of the hiding rule. */
    body:not(.view-3d-active) .eb-grid .eb-card.leaking-note-card>.project-caption,
    .project-list .eb-card.leaking-note-card>.project-caption {
        display: block !important;
    }

    body:not(.view-3d-active) .eb-grid .leaking-note-card .caption-title,
    .project-list .leaking-note-card .caption-title {
        display: none !important;
        /* hide the caption title on mobile */
    }

    body:not(.view-3d-active) .eb-grid .leaking-note-card .caption-text,
    .project-list .leaking-note-card .caption-text {
        font-size: 0.5rem !important;
        line-height: 1.3 !important;
    }

    body:not(.view-3d-active) .eb-grid .leaking-note-card .caption-repo-link,
    .project-list .leaking-note-card .caption-repo-link {
        display: block !important;
        /* show the repository link at the bottom */
        font-size: 0.5rem !important;
        margin-top: 6px !important;
        color: #000 !important;
        font-weight: bold;
    }

    /* Hide technology tags on mobile mini cards */
    body:not(.view-3d-active) .eb-grid .leaking-note-card .caption-tags,
    .project-list .leaking-note-card .caption-tags {
        display: none !important;
    }

    /* Ellipsis indicator for collapsed cards on both pages (covers only) */
    body:not(.view-3d-active) .eb-grid .eb-card:not(.leaking-note-card)::after,
    .project-list .eb-card:not(.leaking-note-card)::after {
        content: "• • •" !important;
        display: block !important;
        text-align: center !important;
        color: var(--eb-pin) !important;
        font-size: 0.65rem !important;
        margin-top: 0.5rem !important;
        letter-spacing: 0.3em !important;
    }

    /* Explicitly prevent dots on leaking note cards */
    .leaking-note-card::after {
        content: none !important;
        display: none !important;
    }

    /* Shrink the awaiting intel card height */
    body:not(.view-3d-active) .eb-grid .eb-awaiting-box {
        height: 2.5rem;
        border-radius: 0.5rem;
    }

    /* Specific overrides for More Projects card on mobile index page */
    .project-list .eb-card.eb-awaiting > .eb-awaiting-box {
        display: flex !important;
        height: auto !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        justify-content: center;
    }
    .project-list .eb-card.eb-awaiting .eb-awaiting-text {
        font-size: 0.6rem !important;
        line-height: 1.25 !important;
        letter-spacing: 0.05em !important;
        color: var(--eb-primary) !important;
        font-family: 'Roboto Mono', monospace;
        margin-bottom: 0.4rem;
        padding-bottom: 0.3rem;
        border-bottom: 1px solid var(--eb-border);
        width: 100%;
        text-align: center;
    }

    /* Disable dots on the awaiting intel card */
    body:not(.view-3d-active) .eb-awaiting::after {
        display: none !important;
    }
}

/* Modal Overlay Styles */
.card-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(9, 9, 11, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.card-modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}


.eb-card-modal-content {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 340px;
    box-sizing: border-box;
    padding: 0 20px;
}

.eb-card-modal-content .eb-card>*:not(.eb-card-header):not(.eb-pin) {
    display: block !important;
}

.eb-card-modal-content .leaking-note-card {
    display: none !important;
}

.eb-card-modal-content .index-project-card .leaking-note-card {
    display: block !important;
}

/* Hide ellipsis in modal */
.eb-card-modal-content .eb-card::after {
    display: none !important;
}

/* Remove card wrapper link outlines / scaling transitions in modal */
.eb-card-modal-content .eb-card-wrapper {
    cursor: default !important;
    width: 100%;
}

.eb-card-modal-content .eb-card-wrapper:hover .eb-card {
    transform: rotate(0deg) scale(1) !important;
    z-index: 1;
}

.eb-card-modal-content .eb-card {
    width: 100%;
    transform: rotate(0deg) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 30px rgba(230, 192, 123, 0.15);
    border-color: rgba(230, 192, 123, 0.4);
}

/* Close Hint Styling */
.modal-close-hint {
    margin-top: 2rem;
    color: var(--eb-muted);
    font-family: 'Roboto Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.25em;
    cursor: pointer;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    padding: 6px 12px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.4);
    transition: all 0.3s;
}

@media (hover: hover) {
    .modal-close-hint:hover {
        color: var(--eb-primary);
        border-color: var(--eb-primary);
        box-shadow: 0 0 8px rgba(255, 255, 255, 0.15);
    }
}

/* Handdrawn SVG Arrows */
.eb-status-value::before {
    content: "";
    display: inline-block;
    width: 18px;
    height: 12px;
    margin-right: 8px;
    vertical-align: middle;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M2 12c4-1 12 1 19 0M16 7c1.5 1.5 3.5 3.5 5 5-1.5 1.5-3.5 3.5-5 5'/></svg>");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.eb-card p[style*="text-align: center"] a::after {
    content: "";
    display: inline-block;
    width: 18px;
    height: 12px;
    margin-left: 8px;
    vertical-align: middle;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E6C07B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M22 12c-4 1-12-1-19 0M8 7C6.5 8.5 4.5 10.5 3 12c1.5 1.5 3.5 3.5 5 5'/></svg>");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Mobile Touch Optimization: Disable tap highlight flashing and touch-callouts/text selections */
.eb-card-wrapper,
.eb-card,
.leaking-note-card,
#three-container,
#three-container canvas,
.three-labels-container,
.three-label,
.card-modal-overlay,
.three-launch-btn {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
    outline: none !important;
}

#three-container,
#three-container canvas,
.three-label {
    user-select: none !important;
    -webkit-user-select: none !important;
}

/* 3D View Navigation Overlay Buttons */
.three-nav-btn {
    position: fixed;
    z-index: 100;
    top: 50%;
    transform: translateY(-50%);
    width: 54px;
    height: 54px;
    background: rgba(28, 28, 28, 0.75);
    border: 1.5px solid var(--eb-pin);
    color: var(--eb-pin);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px 4px 12px 4px / 4px 12px 4px 12px;
    /* wobbly tech frame matching cards */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 0 10px rgba(230, 192, 123, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.three-nav-btn.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) scale(0.8);
}

.three-prev-btn {
    left: 40px;
}

.three-next-btn {
    right: 40px;
}

@media (hover: hover) {
    .three-nav-btn:hover {
        color: #ffffff;
        border-color: #ffffff;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 255, 255, 0.45);
        transform: translateY(-50%) scale(1.08);
    }
}

/* Navigation buttons mobile positioning - overlaying the bottom Launch Button */
@media (max-width: 768px) {
    .three-nav-btn {
        top: auto;
        bottom: 20px;
        transform: none;
        width: 46px;
        height: 56px;
        font-size: 1.2rem;
        z-index: 105;
        /* higher than three-launch-btn */
        border-radius: 8px 3px 8px 3px / 3px 8px 3px 8px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
        box-sizing: border-box;
    }

    .three-nav-btn.hidden {
        opacity: 0;
        pointer-events: none;
        transform: scale(0.8);
    }

    .three-prev-btn {
        left: 20px;
    }

    .three-next-btn {
        right: 20px;
    }



    @media (hover: hover) {
        .three-nav-btn:hover {
            transform: scale(1.05);
        }
    }
}