/* reset & base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* Prevent horizontal scroll on mobile only */
@media (max-width: 768px) {
    html,
    body {
        overflow-x: hidden;
        width: 100%;
    }
}

:root {
    /* Palette - Strengthened for Contrast */
    --bg-base: #fdfcfb;       /* Warm Porcelain */
    --bg-card: #ffffff;       /* Pure White Matte */
    
    /* Text - Darkened for readability */
    --text-main: #4a4a52;     /* Darker Charcoal (was #5d5d65) */
    --text-head: #1a1a20;     /* Almost Black (was #2a2a35) */
    
    /* Accents - Saturated for visibility */
    --accent-pink: #ea8bb5;   /* Stronger Pink (was #eeaeca) */
    --accent-rose: #c74b70;   /* Deep Rose/Magenta (was #d67b96) */
    --accent-glow: #ffd1e0;   /* For subtle glows */
    
    --shadow-soft: 0 15px 35px rgba(199, 75, 112, 0.15);
    --border-delicate: 1px solid rgba(199, 75, 112, 0.2);
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.7; 
    color: var(--text-main);
    /* INTENSIFIED BACKGROUND GRADIENT */
    background: 
        radial-gradient(circle at 0% 0%, rgba(255, 192, 215, 0.6) 0%, transparent 60%),
        radial-gradient(circle at 100% 100%, rgba(255, 230, 200, 0.5) 0%, transparent 50%),
        var(--bg-base);
    background-attachment: fixed;
}

/* utility */
.col-span-2 {
    grid-column: span 2;
}

/* containers */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* sections & typography */
.section {
    padding: 5rem 0;
}

.bg-light {
    background: rgba(255, 255, 255, 0.6);
}

.text-center {
    text-align: center;
}

.grid {
    display: grid;
}

.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.gap {
    gap: 2.5rem;
}

/* About: UPDATED WEIGHT */
#about p {
    font-family: 'Inter', sans-serif;
    margin-bottom: 1rem;
    font-weight: 400; /* Increased from 300 */
    color: var(--text-main);
}

/* headings */
h2.section-title {
    font-size: 2.5rem;
    font-weight: 400; /* Thinner, more elegant */
    margin-bottom: 1rem;
    background: linear-gradient(90deg, var(--accent-rose), var(--accent-pink));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.02em;
}
p.section-sub {
    font-size: 1.125rem;
    color: #666670;
    margin-bottom: 3rem;
    font-weight: 400; /* Increased from 300 */
}

/* navbar */
.navbar {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    padding: 1.5rem 0;
    z-index: 100;
    transition: all .3s ease;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    padding: 1rem 0;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700; /* Heavier logo */
    color: var(--text-head);
    text-decoration: none;
    letter-spacing: 0.05em;
}

.logo .accent {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: var(--accent-rose); /* Darker accent */
    margin-left: 0.25rem;
    vertical-align: middle;
}

.nav-links a {
    margin-left: 2rem;
    color: var(--text-head); /* Darker text */
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500; /* Heavier */
    transition: color .2s;
}

.nav-links a:hover {
    color: var(--accent-rose);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-head);
    font-size: 1.5rem;
    cursor: pointer;
}

/* hero */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Stacks content vertically */
    justify-content: center;
    /* Centers vertically */
    align-items: center;
    /* Centers horizontally */
    padding-top: 100px;
    /* IMPORTANT: Pushes content down so it's not hidden by navbar */
    padding-bottom: 4rem;
    padding-left: 1rem;
    padding-right: 1rem;
    background-size: cover;
    background-position: center;
    text-align: center;
    /* Ensures text is centered */
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 240, 245, 0.7), rgba(253, 252, 251, 0.4));
    backdrop-filter: blur(3px);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    /* Prevents text from stretching too wide */
    margin: 0 auto;
}

.tagline {
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-rose);
    margin-bottom: 1.5rem;
    display: block;
}

.hero-title {
    font-size: 2.5rem;
    /* Reduced from 3.5rem to fit better */
    line-height: 1.2;
    margin-bottom: 1.5rem;
    font-weight: 700;
    color: var(--text-head);
}

.hero-sub {
    font-size: 1.2rem;
    max-width: 650px;
    margin: 0 auto 2.5rem;
    color: #555;
    font-weight: 500;
}

/* Fix for squeezed buttons */
.hero-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    /* Allows wrapping on tiny screens */
    gap: 1.5rem;
    /* Adds consistent space between buttons */
    margin-top: 1rem;
}

.hero-buttons a {
    margin: 0;
    /* Reset old margins, use gap instead */
    white-space: nowrap;
    /* Prevents button text from breaking awkwardly */
}

/* responsive images */
.about-image-wrapper img,
.process-image-wrapper img {
    width: 100%;
    height: auto;
    border-radius: 1rem;
    display: block;
    margin-top: 1.5rem;
    box-shadow: var(--shadow-soft);
}

img {
    max-width: 100%;
    height: auto;
}

/* cards & services */
.card {
    background: var(--bg-card);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05), 0 5px 15px -5px rgba(199, 75, 112, 0.1);
    border: var(--border-delicate);
    transition: transform .3s ease, box-shadow .3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -5px rgba(199, 75, 112, 0.2);
}

.service {
    padding: 3rem 2rem;
    text-align: center;
}

.service-icon {
    display: block;
    font-size: 2.5rem;
    color: var(--accent-pink); /* Pink instead of cyan */
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #f76a98, #f9dbe5);
    -webkit-background-clip: text;
    color: transparent;
    filter: drop-shadow(0 4px 6px rgba(214, 123, 150, 0.2));
}

.service h3 {
    font-size: 1.35rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-head);
}

.service p {
    color: var(--text-main);
    font-weight: 400; /* Heavier */
}

/* stats */
.stats {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--accent-rose);
}

.stat-label {
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    font-weight: 600;
}

/* service CTA */
.service-cta {
    margin-top: 4rem;
}

.cta-block {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 4rem 3rem;
    border-radius: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: var(--shadow-soft);
}

.cta-block::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(238, 174, 202, 0.3), transparent);
    z-index: 0;
}

.cta-block > * {
    position: relative;
    z-index: 1;
}

.cta-block .btn {
    margin-top: 2rem;
}

/* projects */
.project .thumb {
    width: 100%;
    aspect-ratio: 3/2;
    overflow: hidden;
    position: relative;
}

.project .thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(199, 75, 112, 0.1); 
    mix-blend-mode: multiply;
    transition: opacity 0.3s;
}

.project:hover .thumb::after {
    opacity: 0;
}

.project img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project:hover img {
    transform: scale(1.03);
}

.project h3 {
    font-size: 1.25rem;
    margin: 1.5rem 1.5rem .5rem;
    color: var(--text-head);
    font-weight: 600;
}

.project .tags {
    margin: 0 1.5rem .5rem;
}

.project .tags span {
    display: inline-block;
    background: rgba(238, 174, 202, 0.15);
    color: var(--accent-rose);
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: .35rem .75rem;
    border-radius: 2rem;
    margin-right: .35rem;
}

.project p {
    color: #555;
    margin: 0 1.5rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 400;
}

/* UPDATED: Stronger Link Color */
.project-link {
    display: block;
    margin: 0 1.5rem 1.5rem;
    color: var(--accent-rose); /* Deep pink */
    text-decoration: none;
    font-weight: 700; /* Bold */
}

.project-link:hover {
    text-decoration: underline;
    text-decoration-color: var(--accent-pink);
}

/* process */
.process-list {
    list-style: none;
    counter-reset: step;
}

.process-list li {
    position: relative;
    padding-left: 4rem;
    margin-bottom: 2.5rem;
}

.process-list li::before {
    counter-increment: step;
    content: "0" counter(step);
    position: absolute;
    left: 0;
    top: -5px;
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--accent-rose); /* Darker number */
    font-family: 'Inter', sans-serif;
}

.process-list li::after {
    content: "";
    position: absolute;
    left: 1rem;
    top: 2.5rem;
    bottom: -1rem;
    width: 2px; /* Thicker line */
    background: rgba(199, 75, 112, 0.15); /* Pinkish line */
}

.process-list li:last-child::after {
    display: none;
}

.process-list h4 {
    font-size: 1.25rem;
    margin-bottom: .5rem;
    color: var(--text-head);
    font-weight: 600;
}

.process-list p {
    color: #555;
    font-weight: 400;
}

/* contact form override */
#contact .contact-form input,
#contact .contact-form textarea {
    background: #ffffff;
    border: 1px solid #ccc;
    color: var(--text-head);
    width: 100%;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s;
    font-weight: 500;
}

#contact .contact-form input:focus,
#contact .contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-rose);
    box-shadow: 0 0 0 3px rgba(199, 75, 112, 0.15);
}

/* contact info & social */
.contact-info .info-item {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    font-weight: 500;
}

.contact-info i {
    margin-right: 1rem;
    color: #fff;
    background: var(--accent-rose); /* Solid bg */
    padding: 0.75rem;
    border-radius: 50%;
}

.social a {
    margin-right: 1rem;
    color: #888;
    text-decoration: none;
    transition: color 0.2s;
}

.social a i {
    font-size: 1.5rem;
}

.social a:hover {
    color: var(--accent-rose);
}

/* footer */
.footer {
    padding: 4rem 0 2rem;
    background: #f8f6f6;
    color: #666;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.footer-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.footer-brand p {
    max-width: 300px;
    margin-top: 1rem;
    font-size: 0.9rem;
    line-height: 1.6;
    font-weight: 500;
}

.footer-links a,
.footer-legal a {
    margin-right: 1.5rem;
    color: inherit;
    text-decoration: none;
    transition: color .2s;
    font-size: 0.9rem;
    font-weight: 500;
}

.footer-links a:hover,
.footer-legal a:hover {
    color: var(--accent-rose);
}

.footer-social a {
    margin-right: 1rem;
    color: #999;
}

.footer-social a:hover {
    color: var(--accent-rose);
}

.footer-bottom {
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: 2rem;
    margin-top: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

/* buttons */
.btn {
    display: inline-block;
    padding: .85rem 2rem;
    border-radius: 2rem;
    font-weight: 600; /* Bolder button text */
    text-decoration: none;
    transition: all .3s ease;
    letter-spacing: 0.02em;
}

/* UPDATED: Much stronger pink gradient */
.btn-primary {
    background: linear-gradient(135deg, #e06c9f 0%, #c74b70 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(199, 75, 112, 0.4);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(199, 75, 112, 0.5);
    background: linear-gradient(135deg, #d65b90 0%, #b03a5d 100%);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--accent-rose); /* Thicker border */
    color: var(--accent-rose);
}

.btn-outline:hover {
    background: rgba(199, 75, 112, 0.08);
}

.btn-leaflet {
    border: 2px solid var(--accent-pink);
    color: var(--accent-rose); /* Darker text */
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* scroll-to-top button */
.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: none;
    background: var(--accent-rose); /* Solid dark pink */
    color: #fff;
    width: 3rem;
    height: 3rem;
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(199, 75, 112, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.scroll-top:hover {
    transform: translateY(-3px);
    background: #b03a5d;
}

/* Interaction Studies Styles */
.studies-list {
    max-width: 800px;
    margin: 0 auto;
}

.study-item {
    display: flex;
    align-items: flex-start;
    background: #ffffff;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 1rem;
    border: var(--border-delicate);
    box-shadow: 0 4px 20px rgba(0,0,0,0.02);
    transition: transform 0.2s, box-shadow 0.2s;
}

.study-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(199, 75, 112, 0.15);
}

.study-thumbnail {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    margin-right: 1.5rem;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.study-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.study-content {
    flex: 1;
}

.study-content h4 {
    font-size: 1.15rem;
    color: var(--text-head);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.study-content p {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    font-weight: 400;
}

.study-link {
    display: inline-block;
    color: var(--accent-rose);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.2s;
}

.study-link:hover {
    color: var(--accent-pink);
    text-decoration: underline;
}

.study-link.coming-soon {
    color: #ccc;
    cursor: default;
}

/* overlay gallery */
.gallery-item img {
    cursor: pointer;
    transition: transform .3s;
    border-radius: 0.5rem;
}

.gallery-item img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-soft);
}

.gallery-grid {
    margin-top: 3rem;
}

/* full-screen overlay */
.gallery-overlay {
    position: fixed;
    inset: 0;
    background: rgba(253, 252, 251, 0.98); 
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
}

.overlay-image {
    max-width: 90%;
    max-height: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
}

.overlay-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 2.5rem;
    color: var(--text-head);
    cursor: pointer;
    user-select: none;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.overlay-close:hover {
    opacity: 1;
    color: var(--accent-rose);
}

.gallery-grid .video-container {
    grid-column: 1 / -1;
    position: relative;
    padding-top: 56.25%;
    margin-top: 1rem;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

#projects .grid+.grid {
    margin-top: 4rem;
}

/* Gradient text for just one nav item - intensified */
.nav-links a.gradient-link {
    background: linear-gradient(90deg, var(--accent-rose), #e91e63);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    font-weight: 700;
}

/* Lab Pagination Links */
.lab-pagination {
    text-align: center;
    margin-bottom: 4rem;
    font-family: 'Inter', sans-serif; 
    font-size: 1rem;
    word-spacing: 0.2rem;
}

.lab-pagination .page-link {
    color: #888;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    transition: all 0.2s ease-in-out;
    font-weight: 500;
}

.lab-pagination .page-link:not(.active):hover {
    background: #fff;
    color: var(--accent-rose);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.lab-pagination .page-link.active {
    color: var(--text-head);
    font-weight: 700;
    cursor: default;
}

.lab-pagination .page-link.inactive {
    color: #e0e0e0;
    cursor: not-allowed;
}

.lab-pagination .page-link:not(:last-child)::after {
    content: "";
    display: none;
}

/* Lab entry styles */
.lab-entry {
    border-bottom: 1px solid #eee;
    padding-bottom: 4rem;
    margin-bottom: 4rem;
}

.lab-header .lab-date {
    display: block;
    color: var(--accent-rose);
    font-size: .875rem;
    margin-bottom: .5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lab-header .lab-title {
    font-size: 2rem;
    margin: 0 0 1.5rem;
    color: var(--text-head);
    font-weight: 700;
}

.lab-content p {
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    color: var(--text-main);
    font-weight: 400;
}

.lab-graph img {
    width: 100%;
    display: block;
    border-radius: 0.5rem;
    border: 1px solid #eee;
}

.lab-share i {
    margin-top: 1.5rem;
    font-size: 1.25rem;
    color: var(--accent-rose);
    cursor: pointer;
    transition: transform 0.2s;
}
.lab-share i:hover {
    transform: scale(1.1);
}

/* newspaper‐style inline image */
.lab-inline-img {
    float: right;
    width: 40%;
    margin: 0 0 1.5rem 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-soft);
}

/*wide central image */
.lab-wide-img {
    width: 95%;
    margin: 0 0 1.5rem 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-soft);
}

.lab-content::after {
    content: "";
    display: table;
    clear: both;
}

/* Overlay arrows */
.overlay-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    color: var(--accent-rose);
    background: #fff;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10001;
    user-select: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.overlay-nav:hover {
    transform: translateY(-50%) scale(1.1);
    background: var(--accent-rose);
    color: #fff;
}

.overlay-prev {
    left: 2rem;
}

.overlay-next {
    right: 2rem;
}

.lab-content ul,
.lab-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    font-weight: 400;
}

.lab-content li {
    margin-bottom: 0.75rem;
}

/* Styles for Alice-01 Glitching Chat Button */
.alice-chat-button-container {
    display: flex;
    justify-content: flex-end;
    padding: 20px 0;
    min-height: 60px;
}

#aliceChatButton {
    display: inline-block;
    opacity: 1;
    width: 220px;
    height: 36px;
    background-color: #fff;
    color: var(--accent-rose);
    border: 2px solid var(--accent-rose); /* Thicker border */
    box-shadow: 0 4px 15px rgba(199, 75, 112, 0.3);
    text-align: center;
    line-height: 32px; /* Adjusted for border */
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s ease-in-out;
    animation: gentlePulse 3s infinite alternate;
}

#aliceChatButton:hover {
    background-color: var(--accent-rose);
    color: #fff;
    box-shadow: 0 0 20px rgba(199, 75, 112, 0.6);
}

@keyframes gentlePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(199, 75, 112, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(199, 75, 112, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(199, 75, 112, 0);
    }
}

/* Restricted Access */
.restricted-access-container {
    background-color: #fff;
    padding: 2.5rem;
    border-radius: 1rem;
    border: var(--border-delicate);
    box-shadow: 0 15px 40px rgba(0,0,0,0.05);
    max-width: 450px;
    margin: 40px auto;
    text-align: center;
}

.restricted-access-container h3 {
    color: var(--text-head);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

#accessCodeInput {
    padding: 1rem;
    margin-right: 0;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 0.5rem;
    font-family: 'Inter', sans-serif;
    width: 100%;
    max-width: 100%;
    text-align: center;
    letter-spacing: 0.2em;
    font-weight: 600;
    color: var(--text-head);
}

#accessCodeInput:focus {
    border-color: var(--accent-rose);
    outline: none;
}

#submitCodeButton {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(90deg, #e06c9f, #c74b70);
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    transition: opacity 0.2s;
}

#submitCodeButton:hover {
    opacity: 0.9;
}

.access-message.success {
    color: var(--accent-rose);
    font-weight: 600;
}

.access-message.error {
    color: #d67b7b;
}

/* Fix image-graph */
.image-graph {
    float: right;
    width: 550px;
    height: 310px;
    margin: 0 0 0 1.5rem;
    border-radius: 1rem;
    object-fit: cover;
    box-shadow: var(--shadow-soft);
}

/* Mobile Responsive Breakpoint - COMPLETE FIX */
@media (max-width: 768px) {

    /* 1. NAVIGATION FIXES (Hamburger Menu) */
    .nav-toggle {
        display: block;
        /* Show the button */
        z-index: 101;
    }

    .nav-links {
        display: none;
        /* Hide menu by default */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        /* Solid background */
        backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);

        /* Stack links vertically */
        flex-direction: column;
        align-items: center;
        padding: 2rem 0;
    }

    .nav-links.open {
        display: flex;
        /* Show menu when open */
    }

    .nav-links a {
        margin: 1rem 0;
        display: block;
        color: var(--text-head);
    }

    /* 2. HERO FIXES (Spacing & Buttons) */
    .hero-title {
        font-size: 2.25rem;
        /* Smaller font */
    }

    .hero-buttons {
        flex-direction: column;
        /* Stack buttons */
        gap: 1rem;
    }

    .hero-buttons a {
        width: 100%;
        max-width: 300px;
        text-align: center;
    }

    /* 3. GRID & LAYOUT FIXES (Projects, Services, etc.) */
    /* This forces ALL grids to stack in a single column */
    .grid,
    .cols-2,
    .cols-3,
    .cols-4 {
        grid-template-columns: 1fr !important;
        gap: 3rem !important;
        /* Adds breathing room between stacked items */
    }

    /* 4. FOOTER & CONTACT FIXES */
    .footer-container {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .contact-info .info-item {
        justify-content: center;
        /* Center contact info */
    }

    /* 5. IMAGE UTILITIES (for sub-pages) */
    .image-graph,
    .lab-inline-img {
        float: none !important;
        width: 100% !important;
        height: auto !important;
        margin: 1.5rem 0 !important;
    }
}

.studies-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 3rem;
}

.page-arrow {
    background: #fff;
    border: 1px solid #eee;
    color: var(--accent-rose);
    font-size: 1.25rem;
    cursor: pointer;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.page-arrow:hover:not(:disabled) {
    transform: translateY(-2px);
    background: var(--accent-rose);
    color: #fff;
    border-color: var(--accent-rose);
}

.page-arrow:disabled {
    color: #e0e0e0;
    cursor: not-allowed;
    background: #fafafa;
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Inter', sans-serif;
}

.page-number {
    background: none;
    border: none;
    color: #999;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.page-number:hover:not(.active) {
    color: var(--accent-rose);
}

.page-number.active {
    color: var(--text-head);
    font-weight: 700;
    cursor: default;
    border-bottom: 2px solid var(--accent-rose);
}

.page-separator {
    color: #ccc;
}

/* Studies wrapper */
.studies-wrapper {
    position: relative;
    min-height: 400px;
}

.studies-page {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.studies-page.fade-out {
    opacity: 0;
}

.studies-page.hidden {
    display: none;
}

.cv-link {
    color: var(--accent-rose);
    text-decoration: underline;
    text-decoration-style: solid;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
    transition: color 0.2s ease;
    font-weight: 600;
}

.cv-link:hover {
    color: #a03050;
}

/* FEATURE PROJECT BANNER */

.featured-project-banner {

    display: block;
    position: relative;
    margin: 3rem 0 4rem 0;
    height: 360px;

    border-radius: 1.5rem;
    overflow: hidden;

    background-image: url("../graphics/tos_banner.jpg");
    background-size: cover;
    background-position: center;

    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);

    transition: transform .3s ease, box-shadow .3s ease;
}

.featured-project-banner:hover {

    transform: translateY(-6px);
    box-shadow: 0 35px 70px rgba(0, 0, 0, 0.25);
}



/* text block */

.featured-content {

    position: relative;
    z-index: 2;

    max-width: 520px;
    padding: 3rem;
    color: white;
}

/* title */

.featured-content h3 {

    font-size: 2.2rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

/* text */

.featured-content p {

    opacity: 0.9;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* tags */

.featured-tags span {

    display: inline-block;
    margin-right: .5rem;
    margin-bottom: .5rem;

    background: rgba(255, 255, 255, 0.15);
    padding: .3rem .7rem;
    border-radius: 20px;
    font-size: .75rem;
    letter-spacing: .05em;
}

.featured-project-banner {
    text-decoration: none;
    color: inherit;
}

.featured-project-banner:hover {
    text-decoration: none;
}

/* button */

.featured-button {

    font-weight: 600;
    color: #ffd1e0;
}

/* --------------------------------------------------- */
/* MOBILE OVERRIDES */
/* --------------------------------------------------- */

@media (max-width: 768px) {
    /* 1. Release the fixed height so the box can stretch */
    .featured-project-banner {
        height: auto;
        min-height: 360px; /* Keeps it from looking too squished if there isn't much text */
        margin: 2rem 0 3rem 0; /* Slightly tighter margins for mobile flow */
    }

    /* 2. Reduce the heavy padding so text doesn't hit invisible walls */
    .featured-content {
        padding: 2rem 1.5rem; 
        max-width: 100%;
    }

    /* 3. Scale down the typography just enough to fit comfortably */
    .featured-content h3 {
        font-size: 1.8rem;
    }

    .featured-content p {
        font-size: 0.95rem;
    }
    
    /* 4. Ensure tags wrap nicely if they run out of horizontal space */
    .featured-tags {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
}