@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@500;700&family=DM+Sans:wght@400;500;600;700&display=swap');

/* 
==================================================================
                    CSS VARIABLES & FOUNDATION
==================================================================
*/

:root {
    /* Typography Families */
    --font-display: 'Rubik', sans-serif;     /* Headings, hero titles */
    --font-main: 'DM Sans', sans-serif;      /* Body text, general use */

    /* Typography Scale - Responsive font sizes */
    --text-xs: 0.75rem;     /* 12px - captions, meta info */
    --text-sm: 0.875rem;    /* 14px - small text, tags */
    --text-base: 1rem;      /* 16px - body text */
    --text-lg: 1.125rem;    /* 18px - large body text */
    --text-xl: 1.25rem;     /* 20px - small headings */
    --text-2xl: 1.5rem;     /* 24px - section headings */
    --text-3xl: 1.875rem;   /* 30px - page headings */
    --text-4xl: 2.25rem;    /* 40px - hero headings */
    --text-5xl: 3.5rem;     /* 48px - large hero (name) */

    /* Line Heights */
    --leading-tight: 1.2;
    --leading-normal: 1.5;
    --leading-relaxed: 1.6;
    
    /* === PRIMARY BRAND COLORS === */
    --nav-bg: #1b2022;
    --hero-bg: #2b343e;
    --hero-title-text: rgb(243, 245, 242);
    --blue-button: #56758c;
    --blue-button-hover: #4a6578;
    --sage-green: rgba(202, 221, 186, 0.78);
    --sage-green-lighter: rgba(196, 230, 186, 0.815);
    --sage-green-darker: rgba(174, 193, 159, 0.78);
    --sage-blue: rgba(190, 207, 228, 0.664);

    /* === BACKGROUND COLORS === */
    --bg-light: #e6ebf52e;
    --bg-dark: #30281a;
    --bg-soft: rgb(211 213 219 / 16%);
    --bg-soft-blue: #f6f8fa;
    --bg-white: white;
    --bg-transparent: transparent;
    --bg-hero-fullscreen: rgb(33, 33, 33);
    --bg-technical-work: var(--text-main);

    /* === TEXT COLORS === */
    --text-main: #2A2620;
    --text-muted: #505d6b;
    --text-light: #F9F8F4;
    --text-technical-work: #F9F8F4;
    --text-tech-line: var(--bg-soft-blue);
    --text-full-name: var(--text-technical-work);

    /* === ACCENT & UTILITY COLORS === */
    --accent: #b9f1cfb9;

    /* === FORM & INPUT COLORS === */
    --form-bg: #ffffffe8;
    --form-border: #d6d3d1;
    --form-focus: #4a6578a1;
    --form-input-bg: #ffffff;

    /* === FOOTER COLORS === */
    --footer-bg: #1b1d1d;
    --footer-border: #505d6b59;

    /* === TAG COLORS === */
    --tag-default-bg: #E2E8F0;
    --tag-tech-bg: rgba(157, 164, 180, 0.15);
    --tag-tech-text: #3e3f4a;
    --tag-tech-border: rgba(62, 64, 74, 0.08);

    /* === GREEN VARIANTS === */
    --green-project: #4a6b47;

    /* === SHADOW COLORS === */
    --shadow-light: rgba(42, 38, 32, 0.06);
    --shadow-medium: rgba(42, 38, 32, 0.082);
    --shadow-dark: rgba(42, 38, 32, 0.04);
    --shadow-button: rgba(8, 32, 56, 0.284);
    --shadow-button-hover: rgba(8, 32, 56, 0.2);
    --shadow-video-hover: rgba(8, 32, 56, 0.076);
    --shadow-automation: rgba(0, 0, 0, 0.08);
    --shadow-overlay-light: rgba(0, 0, 0, 0.1);
    --shadow-overlay-medium: rgba(0, 0, 0, 0.2);
    --shadow-overlay-dark: rgba(0, 0, 0, 0.3);
    --shadow-hero-text: rgba(15, 20, 28, 0.235);

    /* === LIGHTBOX & OVERLAY === */
    --lightbox-overlay: rgba(0, 0, 0, 0.85);

    /* === GLASS EFFECT COLORS === */
    --glass-bg-primary: rgba(255, 255, 255, 0.2);
    --glass-bg-secondary: rgba(255, 255, 255, 0.1);
    --glass-text: rgba(255, 255, 255, 0.675);

    /* Border Radius */
    --radius: 0.65rem;
    --radius-lg: 0.75rem;

    /* Shadows */
    --shadow: 0 4px 12px var(--shadow-light);
    --shadow-lg: 0 8px 20px var(--shadow-medium);
}


/* === DARK MODE (AUTO-DETECTED) === */
@media (prefers-color-scheme: dark) {
    :root {
        /* PRIMARY BRAND COLORS - Dark Mode */
        --nav-bg: #0f1419;
        --hero-bg: #3a4562;
        --hero-title-text: rgb(248, 250, 252);
        --blue-button: #66a5da;
        --blue-button-hover: #2d384e;
        --sage-green: rgb(158 202 178 / 85%);
        --sage-green-lighter: rgba(144, 198, 169, 0.9);
        --sage-green-darker: rgba(118, 168, 139, 0.8);
        --sage-blue: rgb(173 204 234 / 75%);

        /* BACKGROUND COLORS - Dark Mode */
        --bg-light: #202730;
        --bg-dark: #0d1117;
        --bg-soft: rgb(93 101 113 / 15%);
        --bg-soft-blue: #dfe6f321;
        --bg-white: #2d3748;
        --bg-hero-fullscreen: #212324;
        --bg-technical-work: white;

        /* TEXT COLORS - Dark Mode */
        --text-main: #e2e8f0;
        --text-muted: #8998ad8c;
        --text-light: #edeff1;
        --text-technical-work: #f8fafc;
        --text-tech-line: var(--sage-blue);
        --text-full-name: var(--text-technical-work);

        /* ACCENT & UTILITY COLORS - Dark Mode */
        --accent: #86bc9f;

        /* FORM & INPUT COLORS - Dark Mode */
        --form-bg: rgb(28 31 37 / 95%);
        --form-border: #0a0d0d;
        --form-focus: #3e84bc;
        --form-input-bg: #c7ced7;

        /* FOOTER COLORS - Dark Mode */
        --footer-bg: #0d1117;
        --footer-border: rgba(94, 108, 132, 0.3);

        /* TAG COLORS - Dark Mode */
        --tag-default-bg: rgba(100, 116, 139, 0.25);
        --tag-tech-bg: rgb(188 192 208 / 27%);
        --tag-tech-text: #e5f6ff;
        --tag-tech-border: rgb(164 180 203 / 61%);

        /* GREEN VARIANTS - Dark Mode */
        --green-project: #71b896;

        /* SHADOW COLORS - Dark Mode */
        --shadow-light: rgba(0, 0, 0, 0.25);
        --shadow-medium: rgba(0, 0, 0, 0.35);
        --shadow-dark: rgba(0, 0, 0, 0.15);
        --shadow-button: rgba(0, 0, 0, 0.4);
        --shadow-button-hover: rgba(0, 0, 0, 0.3);
        --shadow-video-hover: rgba(0, 0, 0, 0.2);
        --shadow-automation: rgba(0, 0, 0, 0.3);
        --shadow-overlay-light: rgba(0, 0, 0, 0.2);
        --shadow-overlay-medium: rgba(0, 0, 0, 0.4);
        --shadow-overlay-dark: rgba(0, 0, 0, 0.6);
        --shadow-hero-text: rgba(0, 0, 0, 0.6);

        /* LIGHTBOX & OVERLAY - Dark Mode */
        --lightbox-overlay: rgba(0, 0, 0, 0.9);

        /* GLASS EFFECT COLORS - Dark Mode */
        --glass-bg-primary: rgba(45, 55, 68, 0.4);
        --glass-bg-secondary: rgba(30, 35, 41, 0.3);
        --glass-text: rgba(226, 232, 240, 0.9);
    }
}



/* 
==================================================================
                       GLOBAL BASE STYLES
==================================================================
*/

body {
    font-family: var(--font-main);
    font-weight: 500;
    font-size: var(--text-base);
    color: var(--text-main);
    background-color: var(--bg-light);
    line-height: var(--leading-normal);
    margin: 0;
    padding: 0;
}

/* Typography Utility Classes */
.serif {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.accent-link {
    color: var(--blue-button);
    text-decoration: none;
    transition: color .2s ease, transform .2s ease;
    font-weight: 500;
}

.accent-link:hover {
    color: var(--blue-button-hover);
    text-decoration: underline;
    transform: translateY(-1px);
}

/* Layout Containers */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.content-section {
    padding: 4rem 1.5rem;
    color: var(--text-main);
}

.content-section.darker {
    background-color: var(--bg-soft);
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

/* Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 
==================================================================
                       REUSABLE COMPONENTS
==================================================================
*/

/* Buttons - Consolidated all button styles */
.button,
.view-project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    font-weight: 600;
    font-size: var(--text-sm);
    border: 2px solid var(--blue-button);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.button {
    background-color: var(--bg-light);
    color: var(--blue-button);
    font-size: var(--text-sm);
    padding: 0.6rem 1.25rem;
}

.view-project-link {
    background: var(--bg-white);
    color: var(--blue-button);
    border-color: var(--blue-button);
    font-size: var(--text-base);
    padding: 0.4rem 1.5rem;
    box-shadow: 0px 3px 1px var(--shadow-button);
}

.button:hover {
    background-color: var(--blue-button);
    color: var(--text-light);
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.view-project-link:hover {
    background: var(--blue-button);
    color: var(--text-light);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0px 4px 1px var(--shadow-button-hover);
}

/* Color variants for buttons */
.view-project-link.blue {
    color: var(--blue-button);
    border-color: var(--blue-button);
}

.view-project-link.blue:hover {
    color: var(--text-light);
}

.view-project-link.green {
    color: var(--green-project);
    border-color: var(--green-project);
}

.view-project-link.green:hover {
    background: var(--green-project);
    color: var(--text-light);
}

.view-project-link::after {
    content: '→';
    transition: transform 0.3s ease, color 0.3s ease;
}

.view-project-link:hover::after {
    transform: translateX(4px);
    color: var(--text-light);
}

/* Tags - Consolidated all tag styles */
.tag {
    color: var(--nav-bg);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    padding: 0.2rem 0.6rem;
    border-radius: 1.25rem;
    box-shadow: none;
    background-color: var(--tag-default-bg); /* fallback */
    transition: background-color 0.2s ease;
}

.tag.green {
    background-color: var(--sage-green);
}

.tag.blue {
    background-color: var(--sage-blue);
}

/* Tech tags - specific styling for tech section */
.tech-tags .tag {
    background: var(--tag-tech-bg);
    color: var(--tag-tech-text);
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.25rem 0.55rem;
    border-radius: 1rem;
    letter-spacing: 0.01em;
    border: 1px solid var(--tag-tech-border);
}

/* === Lightbox Styles: Global Overlay Version === */

.lightbox {
  position: relative;
  display: inline-block;
}

.lightbox-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
  cursor: zoom-in;
}

.lightbox-img:hover {
  transform: scale(1.015);
}

/* === Global Lightbox Overlay === */
#global-lightbox-overlay {
  position: fixed;
  inset: 0;
  background: var(--lightbox-overlay);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 9999;
}

#global-lightbox-overlay.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#global-lightbox-overlay img,
#global-lightbox-overlay video {
  display: block;
  width: auto;
  height: auto;
  max-width: 88vw;
  max-height: 88vh;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* === Lightbox Fade-In Compatible === */
.fade-lightbox {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.fade-lightbox.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 
==================================================================
                  HEADER & NAVIGATION
==================================================================
*/

.header {
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 50;
    background: var(--nav-bg);
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--text-xl);
    color: var(--text-light);
    letter-spacing: 0.01em;
    text-decoration: none;
    transition: all 0.3s ease;
}

.brand-name:hover {
    color: var(--accent);
    transform: translateY(-1px);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-item {
    position: relative;
}

.nav-link {
    position: relative;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: var(--text-sm);
    letter-spacing: 0.025em;
    color: var(--text-light);
    transition: color 0.2s ease;
    text-decoration: none;
    padding-bottom: 0.2rem;
}

.nav-link:hover {
    color: var(--accent);
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -0.2rem;
    width: 100%;
    height: 1px;
    background-color: var(--accent);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.2s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
}

.nav-link.active {
    color: var(--accent);
}

.dropdown-menu {
    display: none;
}

/* 
==================================================================
                    HERO SECTIONS
==================================================================
*/

.hero-section {
    background: var(--hero-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    text-align: center;
    padding-top: 7rem;
    padding-bottom: 1rem;
}

/* WhiteVault attribution */
.art-attribution {
    position: absolute;
    bottom: 20px;
    left: 20px;
    font-size: 0.75rem;
    color: var(--text-main);
    z-index: 10;
    opacity: 0.4;
    font-style: italic;
}

.hero-section.fullscreen {
    min-height: 100vh;
    padding-top: 5rem;
    background-color: var(--bg-hero-fullscreen);
    color: var(--text-full-name);
}

.hero-section.fullscreen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('rhonda.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    pointer-events: none;
    opacity: 0.3;
    mix-blend-mode: overlay;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 56rem;
    margin: 0 auto;
}

.hero-construction-notice {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--glass-bg-primary), var(--glass-bg-secondary));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius);
    padding: 0.5rem 1rem;
    font-size: var(--text-xs);
    color: var(--glass-text);
    opacity: 1;
    font-weight: 500;
    text-shadow: 0 1px 2px var(--shadow-overlay-dark);
    box-shadow: 0 2px 8px var(--shadow-overlay-light);
    z-index: 10;
    font-style: italic;
}

/* Hero Typography */
.hero-title {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    color: var(--hero-title-text);
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: var(--leading-tight);
}

.hero-title.name {
    font-size: var(--text-5xl);
    color: var(--text-hero-name);
    font-weight: 800;
    letter-spacing: 0.03em;
    text-shadow: -2px 2px 3px var(--shadow-hero-text);
}

.hero-subtitle {
    font-size: var(--text-2xl);
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 1rem;
    margin-top: -0.25rem;
}

.hero-description {
    max-width: 40rem;
    color: var(--text-light);
    font-size: var(--text-lg);
    margin: 0 auto 1.25rem;
    font-weight: 500;
    opacity: 0.5;
    line-height: var(--leading-relaxed);
}

.hero-badge-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 0.75rem;
    margin-bottom: 2.5rem;
}

.hero-badge {
    background-color: var(--sage-green-lighter);
    padding: 0.45rem 1rem;
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--nav-bg);
}

/* 
==================================================================
                  INDEX PAGE - PROJECT SHOWCASE
==================================================================
*/

/* WhiteVault fan-art attribution */
.art-attribution {
    position: absolute;
    bottom: 20px;
    left: 20px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    z-index: 10;
}

#work {
    scroll-margin-top: 3.5rem;
}

/* Section Headers - Consolidated multiple similar classes */
.section-header {
    text-align: center;
}

/* .section-header.technical-work  */

.section-header-title,
.category-section h2 {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.4rem;
    text-align: center;
}

.section-header-title.technical-work {
    color: var(--text-technical-work);
}

.section-header-title.technologies {
    font-size: var(--text-2xl);
}

.section-header-subtitle {
    font-size: var(--text-base);
    font-weight: 400;
    color: var(--text-light);
    text-align: center;
    max-width: 500px;
    margin: 0.4rem auto 0 auto;
    line-height: 1;
    letter-spacing: 0.3px;
    opacity: 0.9;
}

.section-header-underline {
    width: 80px;
    height: 4px;
    border-radius: 2px;
    background-color: var(--text-muted);
    margin: 0 auto;
    margin-top: -0.25rem;
    opacity: 0.5;
    margin-bottom: 2rem;
}

.category-section {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
    background-color: var(--text-muted);
    color: var(--text-light)
}

/* Project Layout */
.project-container {
    max-width: 65rem;
    margin: 0 auto;
}

.project-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.project-layout-reverse .project-content {
    order: 2;
}

.project-layout-reverse .project-visual {
    order: 1;
}

.project-title {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.project-description {
    margin-bottom: 1.25rem;
    line-height: var(--leading-relaxed);
    font-size: 1.05rem;
    font-weight: 400;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

/* Project Visuals */
.project-visual {
    background: var(--bg-transparent);
    border-radius: var(--radius-lg);
    padding: 2rem;
    height: 24rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.3s ease;
}

.project-video-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0;
}

.preview-video {
    width: 100%;
    height: auto;
    max-width: 600px;
    border-radius: var(--radius);
    display: block;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.preview-video:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px var(--shadow-video-hover);
}

.media-caption {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: 0.65rem;
    text-align: center;
    line-height: 1.4;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    word-wrap: break-word;
}

/* Tech Stack Section */
.tech-stack-section {
    padding: 2rem 1.5rem;
    padding-bottom: 3rem;
}

.tech-stack-grid {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 2rem;
    margin-top: 1.5rem;
    margin-bottom: 0;
    margin-left: auto;
    margin-right: auto;
    max-width: 65rem;
}

.tech-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    flex: 1 1 30%;
}

.tech-group-title {
    font-size: var(--text-sm);
    font-weight: 600;
    margin-bottom: 0;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
}

.tech-stack-preview {
    text-align: center;
    padding: 1.3rem 1rem;
    background-color: var(--blue-button-hover);
}

.tech-stack-line {
    font-size: var(--text-sm);
    color: var(--text-tech-line);
    opacity: 0.6;
    line-height: 0.5;
    font-style: italic;
}

/* 
==================================================================
                   PROJECT DETAIL PAGES
==================================================================
*/

.project-detail-container {
    max-width: 75rem;
    margin: 0 auto;
}

/* Section Titles and Content - Consolidated similar classes */
.section-title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-main);
    line-height: var(--leading-tight);
}

.challenge-text,
.feature-description,
.automation-description {
    margin-bottom: 1rem;
    line-height: var(--leading-relaxed);
    font-size: var(--text-base);
    font-weight: 400;
}

.challenge-text-final,
.feature-description-final {
    margin-bottom: 1.5rem;
    line-height: var(--leading-relaxed);
    font-size: var(--text-base);
    font-weight: 400;
}

.feature-description-final {
    margin-bottom: 2rem;
}

/* Media and Diagrams */
.diagram-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 2rem 0;
}

.diagram-container .lightbox {
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
}

.diagram-container .architecture-diagram {
    display: block;
    margin: 0 auto;
}

.architecture-diagram {
    width: 100%;
    max-width: 500px;
    height: auto;
    margin-bottom: 1rem;
    display: block;
    background-color: var(--bg-soft-blue);
    border: 1px solid var(--sage-green-darker)
}

.media-placeholder {
    background: var(--bg-soft);
    border-radius: var(--radius-lg);
    padding: 3rem;
    text-align: center;
    border: 1px solid var(--shadow-light);
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-placeholder div {
    color: var(--text-muted);
}

.media-title {
    color: var(--text-main);
    font-weight: 600;
    font-size: var(--text-lg);
    margin: 0.5rem 0;
}

.media-description {
    margin: 0.5rem 0;
    font-size: var(--text-sm);
}

/* How It Works Section */
.how-it-works-section {
    margin: 3rem 0;
}

.how-it-works-text h2 {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-main);
    line-height: var(--leading-tight);
}

/* Smart Automation Section */
.smart-automation-wrapper {
    margin-top: 4rem;
    margin-bottom: 3rem;
}

.automation-title {
    font-size: var(--text-xl);
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.automation-caption {
    color: var(--text-muted);
    font-style: italic;
    font-size: var(--text-sm);
    margin: 0;
}

.smart-automation-flex {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    flex-wrap: wrap;
}

.smart-automation-box {
    width: 100%;
    max-width: 800px;
    background-color: var(--bg-soft);
    border-left: 3px solid var(--hero-bg);
    border-radius: 5px;
    padding: 1rem;
}

.smart-automation-image-container {
    flex: 0 0 auto;
    max-width: 360px;
    text-align: center;
    margin-top: 1rem;
}

.automation-diagram {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px var(--shadow-automation);
    margin-bottom: 0.5rem;
}

/* Technical Implementation Sections - Consolidated multiple tech section classes */
.tech-implementation-section,
.tech-section-container {
    margin: 4rem 0;
}

.tech-section-header {
    margin-bottom: 2rem;
}

.tech-section-attribution {
    font-size: var(--text-sm);
    color: var(--text-main);
    font-style: italic;
    margin-top: -0.5rem;
    font-weight: 400;
}

.tech-section,
.feature-block,
.tech-compact-card,
.feature-highlight {
    padding: 1.5rem;
    background-color: var(--bg-soft-blue);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border-left: 3px solid var(--blue-button);
}

.tech-section {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.feature-highlight {
    background: var(--bg-light);
    padding: 2rem;
}

.tech-section-title,
.feature-block-title,
.tech-compact-card h3,
.feature-highlight-title {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-main);
    line-height: var(--leading-tight);
    margin-bottom: 0.75rem;
}

.tech-compact-card h3,
.feature-block-title {
    font-size: var(--text-lg);
}

.tech-section-title {
    position: relative;
    display: inline-block;
}

.tech-section-title::after {
    content: '';
    display: block;
    width: 2.5rem;
    height: 2px;
    background-color: var(--text-muted);
    opacity: 0.5;
    margin-top: 0.5rem;
    border-radius: 2px;
}

.tech-features,
.feature-block-text,
.tech-compact-card p,
.feature-highlight-text {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-weight: 400;
    color: var(--text-main);
    line-height: var(--leading-relaxed);
    font-size: var(--text-base);
}

.feature-block-text,
.tech-compact-card p {
    font-size: var(--text-sm);
    margin: 0;
    display: block;
}

.tech-features p {
    line-height: var(--leading-relaxed);
}

.feature-label {
    font-weight: 600;
    color: var(--text-main);
}

/* Grid Layouts for Tech Sections */
.dialogue-tech-grid,
.tech-compact-grid,
.features-highlight {
    display: grid;
    gap: 2rem;
    margin-top: 1.5rem;
}

.dialogue-tech-grid,
.tech-compact-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.features-highlight {
    grid-template-columns: 1fr 1fr;
    margin: 2rem 0;
}

.tech-compact-grid {
    gap: 1.5rem;
}

/* Compact Technical Implementation Section */
.compact-tech-section {
    margin: 1rem 0rem;
}

/* Results Section */
.results-section {
    margin-top: 3rem;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.result-card {
    padding: 1.5rem;
    border-left: 3px solid var(--sage-green-darker);
    background-color: var(--bg-soft);
    border-radius: 4px;
    box-shadow: 0 1px 2px var(--shadow-dark);
}

.result-card h3 {
    font-weight: 600;
    font-size: var(--text-xl);
    margin-bottom: 0.5rem;
    margin-top: -0.75rem;
}

.result-card p {
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    margin: 0;
    min-height: 4rem;
    font-weight: 400;
}

/* Project Navigation */
.nav-section {
    padding: 2rem 1.5rem;
    text-align: center;
}

.nav-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* 
==================================================================
                   SPECIFIC PROJECT PAGES
==================================================================
*/

/* Data Persistence Page */
.persistence-tech-section {
    margin: 4rem 0;
    padding: 3rem;
    background: var(--bg-soft);
    border-radius: var(--radius-lg);
}

.persistence-features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

/* Innovations Section */
.innovations-section {
    margin: 3rem 0;
}

.innovation-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
}

.innovation-card {
    background: var(--bg-soft);
    padding: 1.5rem;
    border-radius: var(--radius);
    border-left: 3px solid var(--sage-green-darker);
}

.innovation-card h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.innovation-card p {
    color: var(--text-main);
    line-height: var(--leading-relaxed);
    font-size: var(--text-base);
    margin-bottom: 0.75rem;
    font-weight: 400;
}

.innovation-note {
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-style: italic;
    display: block;
}

/* Key Innovations Highlight Boxes */
.innovation-highlight,
.highlight-box {
    background: var(--bg-soft);
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin: 2rem 0;
}

.innovation-highlight h3,
.highlight-box h3 {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.innovation-highlight p,
.highlight-box p {
    margin-bottom: 1rem;
    line-height: var(--leading-relaxed);
    font-size: var(--text-base);
    font-weight: 400;
}

.highlight-note {
    color: var(--text-muted);
    font-size: var(--text-sm);
    margin-bottom: 0 !important;
}

/* World Editor Page */
.world-features-section {
    margin: 4rem 0rem;
}

.terrain-grid .lightbox-img {
    height: 400px;
    object-fit: cover;
    object-position: center;
}

/* 
==================================================================
                        ABOUT PAGE
==================================================================
*/

.about-page-section {
    padding-top: 8rem;
    padding-bottom: 8rem;
}

.about-narrow {
    max-width: 75rem;
    margin: 0 auto;
}

.about-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
    margin-top: 4rem;
}

.about-photo-container {
    display: flex;
    justify-content: center;
}

.about-photo {
    width: 18rem;
    height: 22rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    object-fit: cover;
}

.clean-bio {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.bio-section {
    position: relative;
}

.bio-header {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--blue-button);
    margin-bottom: 1rem;
    letter-spacing: 0.01em;
}

.bio-section p {
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    margin: 0 0 0.8rem 0;
    color: var(--text-main);
    font-weight: 400;
}

.bio-section p:last-child {
    margin-bottom: 0;
}

/* 
==================================================================
                       CONTACT PAGE
==================================================================
*/

.contact-page .footer-button {
    display: none;
}

.contact-main-section {
    padding-top: 9rem;
    padding-bottom: 5rem;
}

.contact-form-wrapper {
    max-width: 42rem;
    margin: 0 auto;
}

.contact-form-card {
    background-color: var(--form-bg);
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: 0 2px 5px 0 var(--shadow-overlay-light), 0 1px 2px 0 var(--shadow-overlay-medium);
}

.contact-title {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--text-main);
}

.contact-description,
.contact-email-info {
    color: var(--text-main);
    margin-bottom: 1rem;
    line-height: var(--leading-relaxed);
}

.contact-email-info {
    margin-bottom: 2rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--form-border);
    border-radius: var(--radius);
    font-family: var(--font-main);
    transition: all 0.08s ease;
    background-color: var(--form-input-bg);
}

.form-input:focus,
.form-textarea:focus {
    outline: 2px solid var(--form-focus);
    box-shadow: var(--shadow);
}

.form-textarea {
    resize: vertical;
}

.send-button {
    background-color: var(--blue-button);
    color: var(--text-light);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.send-button:hover {
    background-color: var(--blue-button-hover);
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.send-button:focus {
    outline: 2px solid var(--blue-button);
    outline-offset: 2px;
}

/* Thank You Page */
.thank-you-page {
    background-color: var(--bg-light);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    text-align: center;
}

.thank-you-card {
    background-color: var(--bg-soft);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    box-shadow: 0 4px 12px var(--shadow-light);
    max-width: 32rem;
    width: 100%;
    border: 2px solid var(--footer-border);
}

.thank-you-card h1 {
    font-size: var(--text-2xl);
    font-weight: 600;
    margin-bottom: 1rem;
}

.thank-you-card p {
    font-size: var(--text-base);
    line-height: var(--leading-relaxed);
    margin-bottom: 2rem;
    color: var(--text-muted);
}

.return-link {
    display: inline-block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--blue-button);
    text-decoration: none;
    border-bottom: 1px solid var(--bg-transparent);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.return-link:hover {
    color: var(--blue-button-hover);
    border-color: currentColor;
}

/* 
==================================================================
                          FOOTER
==================================================================
*/

.footer {
    background: var(--footer-bg);
    padding: 4rem 0;
    text-align: center;
    color: var(--text-light);
    border-top: none;
}

.footer h3 {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

.footer p {
    margin-top: 2rem;
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.footer-button {
    display: inline-block;
    background-color: var(--sage-green);
    color: var(--text-light);
    font-size: var(--text-base);
    font-weight: 600;
    padding: 1rem 2.5rem;
    border-radius: 2rem 1rem 2rem 1rem;
    text-decoration: none;
    position: relative;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border: 3px solid var(--text-main);
    letter-spacing: 0.05em;
    transform: rotate(-2deg);
}

.footer-button::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background-color: var(--blue-button);
    border-radius: 2rem 1rem 2rem 1rem;
    z-index: -1;
    transition: all 0.3s ease;
    transform: rotate(4deg);
}

.footer-button:hover {
    background-color: var(--sage-green);
    color: var(--text-main);
    transform: rotate(1deg) scale(1.03);
}

.footer-button:hover::before {
    transform: rotate(-2deg) scale(1.02);
    background-color: var(--accent);
}

/* Footer Button Dark Mode Fix */
@media (prefers-color-scheme: dark) {
    .footer-button {
        background-color: var(--sage-green);
        color: var(--footer-bg);
        border: 3px solid var(--text-light);
    }
    
    .footer-button::before {
        background-color: var(--blue-button);
    }
    
    .footer-button:hover {
        background-color: var(--sage-green-lighter);
        color: var(--footer-bg);
    }
    
    .footer-button:hover::before {
        background-color: var(--accent);
    }
}

/* 
==================================================================
                   UTILITY CLASSES
==================================================================
*/

/* Typography Size Utilities */
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.text-4xl { font-size: var(--text-4xl); }
.text-5xl { font-size: var(--text-5xl); }

/* Spacing Utilities */
.py-16 { padding: 4rem 0; }
.py-20 { padding: 5rem 0; }

/* Line Height Utilities */
.leading-relaxed { line-height: var(--leading-relaxed); }

/* 
==================================================================
                        RESPONSIVE BREAKPOINTS
==================================================================
*/

/* Tablet Layout (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .content-grid {
        gap: 2rem;
    }

    .tech-stack-grid {
        flex-direction: row;
        justify-content: space-between;
        gap: 2rem;
    }
}

/* Mobile Navigation and Typography (max-width: 768px) */
@media (max-width: 768px) {
    .nav-links {
        gap: 1.5rem; /* Reduced from 2rem */
    }
    
    .nav-link {
        font-size: var(--text-sm);
        padding: 0.25rem 0.5rem; /* Reduced from 0.5rem 0.75rem */
    }
    
    .nav-link::after {
        width: 70%; /* Make underline shorter than full width */
        left: 15%; /* Center the shorter underline under text */
    }
    .brand-name {
        font-size: var(--text-lg);
    }

    .header {
        padding: 1.25rem 0;
    }

    /* Layout Adjustments */
    .content-grid,
    .project-layout,
    .results-grid,
    .about-content-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .project-layout-reverse .project-content,
    .project-layout-reverse .project-visual {
        order: 1;
    }

    .project-layout-reverse .project-visual {
        order: 2;
    }

    /* Tech Stack */
    .tech-stack-grid {
        flex-direction: row;
        justify-content: space-between;
        gap: 2rem;
    }

    /* Data Persistence Responsive */
    .persistence-tech-section {
        padding: 2rem;
    }

    .tech-compact-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .innovation-cards {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .compact-tech-section,
    .innovations-section {
        margin: 4rem 0;
    }

    .features-highlight {
        grid-template-columns: 1fr;
    }

    /* Smart Automation */
    .smart-automation-flex {
        flex-direction: column;
        align-items: center;
        text-align: left;
    }

    .smart-automation-box,
    .smart-automation-image-container {
        max-width: 100%;
    }

    /* Project Videos - Better mobile viewing */
    .project-visual {
        padding: 0.5rem;
        height: auto;
        margin-top: 0;
    }
    
    .preview-video {
        max-width: 100%;
        width: 100%;
        height: auto;
        min-height: 200px;
        object-fit: cover;
        margin-top: 1rem;
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-lg);
    }
    
    .project-video-link {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }
    
    .project-layout {
        gap: 1rem;
    }
    
    .project-content {
        order: 2;
    }
    
    .project-visual {
        order: 1;
        margin-bottom: 1rem;
    }
    
    /* Override reverse layout on mobile */
    .project-layout-reverse .project-content {
        order: 2;
    }
    
    .project-layout-reverse .project-visual {
        order: 1;
    }

    .project-tags,
    .view-project-link {
        z-index: 2;
        position: relative;
    }

    .project-visual {
        z-index: 1;
        position: relative;
    }

    /* Tighter content sections */
    .content-section {
        padding: 1.5 1rem;
    }

    .about-photo {
        margin-bottom: 1rem;
    }

    .how-it-works-section.content-grid {
        grid-template-rows: auto auto;
    }
    
    .how-it-works-text {
        order: 1;
    }
    
    .diagram-container {
        order: 2;
        margin-top: 0rem;
        margin-bottom: 0rem;
    }

    .section-title {
        margin-top: 1.5rem;
    }
}

/* Small Mobile (max-width: 640px) */
@media (max-width: 640px) {
    .contact-form-card {
        padding: 2rem;
    }
    
    .nav-buttons {
        align-items: center;
    }
    
    /* Typography Scaling */
    .hero-title {
        font-size: var(--text-3xl);
    }
    
    .hero-title.name {
        font-size: var(--text-4xl);
        color: var(--hero-title-text);
    }
    
    .hero-subtitle {
        font-size: var(--text-xl);
    }
    
    .hero-description {
        font-size: var(--text-base);
    }
    
    .section-title {
        font-size: var(--text-xl);
    }

    .section-header-title {
        font-size: var(--text-2xl);
    }

    .project-title {
        font-size: var(--text-2xl);
    }

    .automation-title {
        font-size: var(--text-lg);
    }
    
    .media-placeholder {
        min-height: 200px;
        padding: 2rem;
    }

    .project-visual {
        padding: 0;
        height: auto;
    }

    .architecture-diagram {
        max-width: 100%;
    }
    
    .footer h3 {
        font-size: var(--text-xl);
    }

    .tech-section {
        gap: 1.25rem;
    }

    .tech-section-title {
        font-size: var(--text-base);
    }

    .clean-bio {
        gap: 2.5rem;
    }
    
    .bio-header {
        font-size: var(--text-lg);
    }

    /* Contact Form */
    .form-row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Project Videos - Even smaller screens */
    .preview-video {
        min-height: 180px;
        border-radius: var(--radius-lg);
    }

    /* Even tighter spacing for small screens */
    .content-section {
        padding: 2rem 0.75rem;
        padding-bottom: 2.5rem;
    }
    
    /* Compact project containers */
    .project-container {
        padding: 0 0.5rem;
    }
    
    /* Reduce hero padding */
    .hero-section {
        padding-top: 6rem;
        padding-bottom: 0.5rem;
    }

    .about-page-section {
        padding-top: 7rem;
        padding-bottom: 5rem;
    }
}