/*
Theme Name: Nallison
Theme URI: https://example.com/nallison
Author: Nate Allison
Author URI: https://example.com
Description: A minimal WordPress theme with 8-point grid and major-third typography
Version: 1.0.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nallison
*/

/*
===========================
8-POINT GRID SYSTEM & MAJOR-THIRD TYPOGRAPHY
===========================
Grid: All spacing in multiples of 8px
Typography Scale: 1.25 ratio (Major Third)
Base: 16px (1rem)
===========================
*/

:root {
    /* Major Third Typographic Scale (1.25 ratio) */
    --font-size-xs: 0.64rem;    /* 10.24px */
    --font-size-sm: 0.8rem;      /* 12.8px */
    --font-size-base: 1rem;      /* 16px */
    --font-size-md: 1.25rem;     /* 20px */
    --font-size-lg: 1.563rem;    /* 25px */
    --font-size-xl: 1.953rem;    /* 31.25px */
    --font-size-2xl: 2.441rem;   /* 39px */
    --font-size-3xl: 3.052rem;   /* 48.8px */
    --font-size-4xl: 3.815rem;   /* 61px */

    /* 8-Point Grid Spacing */
    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 32px;
    --space-5: 40px;
    --space-6: 48px;
    --space-7: 56px;
    --space-8: 64px;
    --space-9: 72px;
    --space-10: 80px;
    --space-11: 88px;
    --space-12: 96px;
    --space-16: 128px;
    --space-20: 160px;
    --space-24: 192px;

    /* Colors */
    --color-text: #111111;
    --color-background: #ffffff;
    --color-accent: #0073aa;
    --color-muted: #666666;
    --color-border: #e5e5e5;
    --color-cta: #e8742c;
    --color-cta-dark: #c25a17;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px; /* Base font size */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-3);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--space-3);
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }
h5 { font-size: var(--font-size-md); }
h6 { font-size: var(--font-size-base); }

p {
    margin-bottom: var(--space-3);
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

a:hover {
    opacity: 0.8;
}

/* Navigation */
.hero-navigation {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: var(--space-3) 0;
    background: #ffffff;
    border-bottom: 2px solid #f0f0f0;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

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

.nav-menu {
    display: flex;
    gap: var(--space-4);
    align-items: center;
}

.nav-link {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: var(--space-1) var(--space-2);
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
    overflow: hidden;
    border-radius: 20px;
}

/* Blue bubble effect on hover */
.nav-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: #0073aa;
    transform: translate(-50%, -50%);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease;
    opacity: 0;
    z-index: -1;
}

.nav-link:hover::before {
    width: 120%;
    height: 120%;
    opacity: 0.15;
}

.nav-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 20px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: #0073aa;
    transform: translateY(-2px);
}

.nav-link:hover::after {
    border-color: rgba(0, 115, 170, 0.3);
    box-shadow: 0 4px 15px rgba(0, 115, 170, 0.2);
}

/* Active state with pulsing blue bubble */
.nav-link.active {
    color: white;
    background: linear-gradient(135deg, #0073aa, #005177);
    box-shadow: 0 4px 15px rgba(0, 115, 170, 0.3);
}

.nav-link.active::before {
    animation: pulse-bubble 2s ease-in-out infinite;
    opacity: 0.3;
    width: 100%;
    height: 100%;
}

@keyframes pulse-bubble {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.1;
    }
}

/* Ripple effect on click */
.nav-link.ripple::after,
.mobile-nav-link.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 115, 170, 0.5);
    transform: translate(-50%, -50%);
    animation: ripple-effect 0.8s ease-out;
}

@keyframes ripple-effect {
    to {
        width: 200%;
        height: 200%;
        opacity: 0;
    }
}

/* Centered Layout for Homepage */
.centered-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3);
    padding-top: calc(80px + var(--space-3)); /* Account for fixed nav */
}

.centered-content {
    text-align: center;
    position: relative;
}

/* Profile Image */
.profile-image-container {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-4);
    animation: scaleIn 0.8s ease-out;
}

.profile-image {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 5px solid #0073aa;
    box-shadow: 0 4px 20px rgba(0, 115, 170, 0.2);
    object-fit: cover;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: calc(var(--space-8) * -1);
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-arrow {
    font-size: var(--font-size-lg);
    color: var(--color-muted);
    opacity: 0.5;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Header Labels - Fun personality above the name */
.site-header-labels {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    animation: fadeInDown 1s ease-out;
}

.label-item {
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #1a1a1a;
    background: linear-gradient(135deg, #1a1a1a 0%, #4a4a4a 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

.label-item::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #4a4a4a, transparent);
    opacity: 0.5;
}

.label-separator {
    color: #4a4a4a;
    font-size: var(--font-size-xs);
    opacity: 0.7;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.7;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.site-name {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: clamp(4rem, 15vw, 8rem);
    font-weight: 900;
    font-style: italic;
    letter-spacing: -0.02em;
    line-height: 0.9;
    margin: 0;
    margin-bottom: var(--space-4);
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 2px 2px 4px rgba(0, 115, 170, 0.1);
    animation: fadeIn 1.2s ease-out 0.3s backwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.site-tagline {
    font-size: var(--font-size-md);
    font-weight: 500; /* Made bolder */
    color: var(--color-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin: 0;
    min-height: 1.5em; /* Prevent layout shift */
}

/* Typewriter Cursor Animation */
.typewriter-cursor {
    display: inline-block;
    font-weight: 100;
    animation: blink 1s infinite;
    color: var(--color-muted);
}

@keyframes blink {
    0%, 49% {
        opacity: 1;
    }
    50%, 100% {
        opacity: 0;
    }
}

/* Header */
.site-header {
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--color-border);
}

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

.site-title {
    font-size: var(--font-size-lg);
    font-weight: 500;
    margin: 0;
}

.site-title a {
    color: var(--color-text);
}

/* Navigation */
.main-navigation ul {
    list-style: none;
    display: flex;
    gap: var(--space-4);
    margin: 0;
    padding: 0;
}

.main-navigation a {
    color: var(--color-text);
    font-size: var(--font-size-base);
}

/* Main Content */
.site-main {
    padding: var(--space-8) 0;
    min-height: calc(100vh - 200px);
}

/* Footer */
.site-footer {
    padding: var(--space-4) 0;
    border-top: 1px solid var(--color-border);
    color: var(--color-muted);
    font-size: var(--font-size-sm);
}

.site-footer .container {
    text-align: center;
}

/* WordPress Core */
.aligncenter {
    display: block;
    margin: var(--space-3) auto;
}

.alignleft {
    float: left;
    margin-right: var(--space-3);
    margin-bottom: var(--space-2);
}

.alignright {
    float: right;
    margin-left: var(--space-3);
    margin-bottom: var(--space-2);
}

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

/* About Section */
.about-section {
    padding: var(--space-12) 0;
    background: #f8f9fa;
}

.section-title {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: clamp(2rem, 5vw, var(--font-size-3xl));
    font-weight: 700;
    font-style: italic;
    letter-spacing: -0.01em;
    text-align: center;
    margin-bottom: var(--space-7);
    padding-bottom: var(--space-4);
    color: var(--color-text);
    position: relative;
}

/* Decorative flourish: symmetric gradient lines flanking a center diamond */
.section-title::before {
    content: '';
    position: absolute;
    bottom: var(--space-3);
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    height: 1px;
    background:
        linear-gradient(90deg, transparent, rgba(0, 115, 170, 0.5)) left center / 90px 1px no-repeat,
        linear-gradient(90deg, rgba(0, 115, 170, 0.5), transparent) right center / 90px 1px no-repeat;
}

.section-title::after {
    content: '\2726'; /* ✦ — echoes the hero header-label separator */
    position: absolute;
    bottom: var(--space-3);
    left: 50%;
    transform: translate(-50%, 50%);
    font-size: var(--font-size-sm);
    font-style: normal;
    line-height: 1;
    color: #0073aa;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--space-8);
    align-items: start;
}

.about-image {
    position: sticky;
    top: calc(60px + var(--space-4));
}

.about-photo {
    width: 100%;
    max-width: 400px;
    border-radius: var(--space-2);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.about-intro {
    font-size: var(--font-size-lg);
    line-height: 1.8;
    margin-bottom: var(--space-3);
    color: var(--color-text);
}

.about-intro-secondary {
    font-size: var(--font-size-base);
    line-height: 1.8;
    margin-bottom: 0;
    color: var(--color-muted);
}

/* About tab bar */
.about-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.about-tab {
    font-family: inherit;
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text);
    background: #ffffff;
    border: 2px solid var(--color-border);
    border-radius: 30px;
    padding: var(--space-1) var(--space-3);
    cursor: pointer;
    transition: color 0.3s ease, background 0.3s ease,
                border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

.about-tab:hover {
    color: #0073aa;
    border-color: rgba(0, 115, 170, 0.4);
    transform: translateY(-2px);
}

.about-tab.active {
    color: #ffffff;
    background: linear-gradient(135deg, #0073aa, #005177);
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(0, 115, 170, 0.3);
}

.about-tab:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* About tab panels */
.about-panel {
    display: none;
}

.about-panel.active {
    display: block;
    animation: fadeInPanel 0.4s ease;
}

.about-panel:focus {
    outline: none;
}

@keyframes fadeInPanel {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Skills list inside each panel */
.about-skills {
    list-style: none;
    padding: 0;
    margin-top: var(--space-4);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-1) var(--space-5);
}

.about-skills li {
    padding: var(--space-1) 0;
    padding-left: var(--space-3);
    position: relative;
    color: var(--color-muted);
}

.about-skills li::before {
    content: "";
    position: absolute;
    left: 0;
    top: calc(var(--space-1) + 0.25em);
    width: 16px;
    height: 16px;
    background-color: #0073aa;
    -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='3'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M5%2013l4%204L19%207'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='3'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M5%2013l4%204L19%207'/%3E%3C/svg%3E") center / contain no-repeat;
}

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

.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-up.visible,
.fade-in-left.visible,
.fade-in-right.visible {
    opacity: 1;
    transform: translate(0);
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Entry Content */
.entry-header {
    margin-bottom: var(--space-4);
}

.entry-title {
    margin-bottom: var(--space-2);
}

.entry-meta {
    font-size: var(--font-size-sm);
    color: var(--color-muted);
    margin-bottom: var(--space-3);
}

.entry-content {
    margin-bottom: var(--space-6);
}

.entry-content > * {
    margin-bottom: var(--space-3);
}

.entry-content h2 {
    margin-top: var(--space-6);
    margin-bottom: var(--space-3);
}

.entry-content h3 {
    margin-top: var(--space-5);
    margin-bottom: var(--space-3);
}

/* Hamburger Menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-1);
    position: relative;
    z-index: 1002;
}

.hamburger-line {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--color-text);
    margin: 5px 0;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.98);
    z-index: 1001;
    padding-top: 80px;
}

.mobile-menu-overlay.active {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-5);
}

.mobile-nav-link {
    font-size: var(--font-size-lg);
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
    padding: var(--space-3);
    margin: var(--space-2);
    width: calc(100% - var(--space-4));
    text-align: center;
    transition: all 0.3s ease;
    border-radius: 30px;
    position: relative;
    overflow: hidden;
}

/* Mobile bubble effect */
.mobile-nav-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: #0073aa;
    transform: translate(-50%, -50%);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.mobile-nav-link:hover::before,
.mobile-nav-link:active::before {
    width: 100%;
    height: 100%;
}

.mobile-nav-link:hover,
.mobile-nav-link:active {
    color: white;
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 115, 170, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    :root {
        --font-size-3xl: 2.441rem;
        --font-size-2xl: 1.953rem;
    }

    /* Show hamburger menu, hide desktop nav */
    .mobile-menu-toggle {
        display: block;
    }

    .nav-menu {
        display: none !important;
    }

    .nav-container {
        justify-content: flex-end;
    }

    .profile-image {
        width: 100px;
        height: 100px;
        border-width: 3px;
    }

    .site-header-labels {
        flex-direction: column;
        gap: var(--space-1);
    }

    .label-separator {
        display: none;
    }

    .label-item {
        font-size: var(--font-size-xs);
    }

    .site-tagline {
        font-size: var(--font-size-base);
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .about-image {
        position: static;
        text-align: center;
    }

    .about-photo {
        max-width: 300px;
    }

    .about-skills {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 var(--space-2);
    }

    .site-main {
        padding: var(--space-5) 0;
    }
}

/* Portfolio Section */
.portfolio-section {
    padding: var(--space-12) 0;
    background: #f8f9fa;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
}

/* Each tile is a button wrapping an image; click opens the modal. */
.portfolio-item {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    border-radius: var(--space-2);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4 / 5;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-item:hover,
.portfolio-item:focus-visible {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.portfolio-item:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 3px;
}

.portfolio-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.portfolio-item:hover .portfolio-thumb,
.portfolio-item:focus-visible .portfolio-thumb {
    transform: scale(1.05);
}

.portfolio-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 2px;
    padding: var(--space-3);
    text-align: left;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.15) 45%, rgba(0, 0, 0, 0) 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.portfolio-item:hover .portfolio-overlay,
.portfolio-item:focus-visible .portfolio-overlay {
    opacity: 1;
}

.portfolio-overlay-title {
    color: #ffffff;
    font-size: var(--font-size-md);
    font-weight: 600;
    line-height: 1.2;
}

.portfolio-overlay-meta {
    color: rgba(255, 255, 255, 0.85);
    font-size: var(--font-size-sm);
}

/* Portfolio Modal */
.portfolio-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.portfolio-modal.open {
    display: flex;
    animation: fadeIn 0.25s ease;
}

.portfolio-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
}

.portfolio-modal-dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1000px;
    max-height: 90vh;
    background: #ffffff;
    border-radius: var(--space-2);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.25s ease;
}

.portfolio-modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-height: 90vh;
}

.portfolio-modal-image {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    background: #f5f8fb;
}

.portfolio-modal-image img {
    max-width: 100%;
    max-height: calc(90vh - var(--space-8));
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--space-1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.portfolio-modal-details {
    padding: var(--space-6);
    overflow-y: auto;
}

.portfolio-modal-details h3 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-2);
}

.portfolio-modal-meta {
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    color: #0073aa;
    margin-bottom: var(--space-3);
}

.portfolio-modal-desc {
    color: var(--color-muted);
    line-height: 1.8;
    margin: 0;
}

.portfolio-modal-tech {
    margin: var(--space-5) 0 0;
    font-size: var(--font-size-sm);
    color: var(--color-muted);
}

.portfolio-modal-close {
    position: absolute;
    top: var(--space-2);
    right: var(--space-2);
    z-index: 2;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #111111;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: background 0.2s ease, transform 0.2s ease;
}

.portfolio-modal-close:hover {
    background: #ffffff;
    transform: scale(1.05);
}

/* Tablet: two columns */
@media (max-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Small screens: stack the modal (image on top, details below) */
@media (max-width: 768px) {
    .portfolio-modal-body {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }

    .portfolio-modal-image {
        padding: var(--space-3);
    }

    .portfolio-modal-image img {
        max-height: 45vh;
    }
}

/* Services Section */
.services-section {
    padding: var(--space-12) 0;
    background: #ffffff;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-5);
}

.service-card {
    background: white;
    padding: var(--space-5);
    border-radius: var(--space-2);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s ease;
    text-align: center;
}

.service-card:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.service-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: var(--space-3);
}

.service-card h3 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-2);
}

.service-card p {
    color: var(--color-muted);
    margin-bottom: var(--space-3);
}

.service-card ul {
    list-style: none;
    padding: 0;
}

.service-card li {
    padding: var(--space-1) 0;
    color: var(--color-muted);
    font-size: var(--font-size-sm);
}

.service-card li:before {
    content: "✓";
    margin-right: var(--space-1);
    color: #10b981;
}

/* Featured Project Section */
.featured-section {
    padding: var(--space-12) 0;
    background: #ffffff;
}

.featured-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
    align-items: start;
}

.featured-visual {
    border-radius: var(--space-2);
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    background: #f5f8fb;
}

.featured-screenshot {
    display: block;
    width: 100%;
    height: auto;
}

.featured-placeholder {
    font-size: 5rem;
}

.featured-label {
    display: inline-block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #0073aa;
    margin-bottom: var(--space-2);
}

.featured-details h3 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-3);
}

.featured-details > p {
    color: var(--color-muted);
    line-height: 1.8;
    margin-bottom: var(--space-4);
}

.featured-highlights {
    list-style: none;
    padding: 0;
    margin-bottom: var(--space-4);
}

.featured-highlights li {
    padding: var(--space-1) 0;
    padding-left: var(--space-3);
    position: relative;
    color: var(--color-text);
}

.featured-highlights li::before {
    content: "";
    position: absolute;
    left: 0;
    top: calc(var(--space-1) + 0.3em);
    width: 16px;
    height: 16px;
    background-color: #0073aa;
    -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='3'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M5%2013l4%204L19%207'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='3'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M5%2013l4%204L19%207'/%3E%3C/svg%3E") center / contain no-repeat;
}

.featured-tags {
    display: block;
    font-size: var(--font-size-sm);
    color: #0073aa;
    margin-bottom: var(--space-4);
}

.featured-link {
    display: inline-block;
    font-weight: 600;
    color: #0073aa;
    transition: color 0.3s ease;
}

.featured-link:hover {
    color: #005177;
}

.featured-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
}

/* Match the orange CTA to the outlined pill's size and shape (scoped to this
   section so the shared .btn-cta elsewhere is unaffected). The 2px transparent
   border keeps its height equal to the pill, which has a real 2px border. */
.featured-actions .btn-cta {
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: var(--space-1) var(--space-3);
    border: 2px solid transparent;
    border-radius: 30px;
}

/* Testimonials Section */
.testimonials-section {
    padding: var(--space-12) 0;
    background: #f8f9fa;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-5);
    max-width: 900px;
    margin: 0 auto;
}

.testimonial-card {
    background: white;
    padding: var(--space-5);
    border-radius: var(--space-2);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: flex-start;
    gap: var(--space-5);
}

.testimonial-image {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 5px solid #0073aa;
    box-shadow: 0 4px 20px rgba(0, 115, 170, 0.2);
    object-fit: cover;
    flex-shrink: 0;
}

.testimonial-body {
    flex: 1;
}

.testimonial-content {
    margin-bottom: var(--space-4);
}

.testimonial-content p {
    font-size: var(--font-size-md);
    font-style: italic;
    line-height: 1.8;
    color: var(--color-text);
    margin-bottom: var(--space-3);
}

.testimonial-content p:last-child {
    margin-bottom: 0;
}

.testimonial-content p:first-of-type:before {
    content: '"';
}

.testimonial-content p:last-of-type:after {
    content: '"';
}

.testimonial-author {
    text-align: right;
}

.testimonial-author strong {
    display: block;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: var(--font-size-lg);
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #0073aa;
    margin-bottom: var(--space-1);
}

.testimonial-author span {
    display: block;
    color: var(--color-muted);
    font-size: var(--font-size-sm);
    font-style: italic;
    letter-spacing: 0.3px;
}

.testimonial-author strong:before {
    content: '— ';
    color: #0073aa;
    opacity: 0.6;
}

/* Contact Section */
.contact-section {
    padding: var(--space-12) 0;
    background: linear-gradient(135deg, #e6f1f7 0%, #ffffff 50%, #fdebd9 100%);
}

/* Contact Form */
.contact-intro {
    max-width: 680px;
    margin: 0 auto var(--space-5);
    text-align: center;
    color: var(--color-muted);
    font-size: var(--font-size-md);
    line-height: 1.6;
}

.contact-form {
    background: #ffffff;
    padding: var(--space-6);
    border-radius: var(--space-2);
    box-shadow: 0 10px 40px rgba(0, 115, 170, 0.08);
    max-width: 680px;
    margin: 0 auto;
}

.form-honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-alert {
    padding: var(--space-2) var(--space-3);
    border-radius: 6px;
    margin-bottom: var(--space-3);
    font-size: var(--font-size-base);
    line-height: 1.5;
}

.form-alert-success {
    background: #e8f5ee;
    color: #1f6b3a;
    border-left: 4px solid #2f9e5f;
}

.form-alert-error {
    background: #fdecea;
    color: #8a2e22;
    border-left: 4px solid #d54a3b;
}

.form-group {
    margin-bottom: var(--space-3);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: var(--space-2);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: var(--font-size-base);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0073aa;
}

.btn-submit {
    background: #0073aa;
    color: white;
    padding: var(--space-2) var(--space-4);
    border: none;
    border-radius: 4px;
    font-size: var(--font-size-base);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-submit:hover {
    background: #005177;
}

/* Footer Home */
.site-footer-home {
    padding: var(--space-4) 0;
    background: #1a1a1a;
    color: white;
    text-align: center;
}

.site-footer-home p {
    margin: 0;
}

/* Responsive Updates */
@media (max-width: 768px) {
    .featured-content,
    .portfolio-grid,
    .services-grid,
    .testimonials-grid {
        grid-template-columns: 1fr;
    }

    .testimonial-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .testimonial-image {
        width: 110px;
        height: 110px;
        border-width: 3px;
    }
}

/* Featured Project Case-Study Page */
.featured-project-page {
    background: #ffffff;
}

.project-hero {
    padding: var(--space-10) 0 var(--space-6);
    background: linear-gradient(135deg, #f5f8fb 0%, #ffffff 100%);
    border-bottom: 1px solid var(--color-border);
}

.project-back-link {
    display: block;
    font-size: var(--font-size-sm);
    color: var(--color-accent);
    margin-bottom: var(--space-4);
    transition: color 0.3s ease;
}

.project-back-link:hover {
    color: #005177;
}

.project-eyebrow {
    display: inline-block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-accent);
    margin-bottom: var(--space-2);
}

.project-title {
    font-size: var(--font-size-3xl);
    line-height: 1.15;
    margin: 0 0 var(--space-3);
    color: var(--color-text);
}

.project-tagline {
    font-size: var(--font-size-md);
    line-height: 1.7;
    color: var(--color-muted);
    max-width: 720px;
    margin: 0;
}

.project-meta-strip {
    padding: var(--space-5) 0;
    background: #f8f9fa;
    border-bottom: 1px solid var(--color-border);
}

.project-meta-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
}

.project-meta-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.project-meta-label {
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-muted);
}

.project-meta-value {
    font-size: var(--font-size-base);
    font-weight: 500;
    color: var(--color-text);
}

.project-stats-section {
    padding: var(--space-8) 0 var(--space-4);
}

.project-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
    max-width: 900px;
    margin: 0 auto;
}

.project-stat {
    text-align: center;
    padding: var(--space-5) var(--space-3);
    background: linear-gradient(135deg, #ffffff 0%, #f5f8fb 100%);
    border: 1px solid var(--color-border);
    border-radius: var(--space-2);
    box-shadow: 0 4px 16px rgba(0, 115, 170, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-stat:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 115, 170, 0.12);
}

.project-stat-number {
    display: block;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: var(--font-size-3xl);
    font-weight: 700;
    line-height: 1;
    color: var(--color-accent);
    margin-bottom: var(--space-2);
}

.project-stat-plus {
    font-size: 0.6em;
    vertical-align: super;
    margin-left: 2px;
    opacity: 0.8;
}

.project-stat-label {
    display: block;
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-muted);
    font-weight: 600;
}

.project-visual-section {
    padding: var(--space-8) 0 var(--space-4);
}

.project-visual {
    max-width: 960px;
    margin: 0 auto;
    border-radius: var(--space-2);
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    background: #f5f8fb;
}

.project-screenshot {
    display: block;
    width: 100%;
    height: auto;
}

.project-visual-placeholder {
    color: rgba(255, 255, 255, 0.85);
    font-size: var(--font-size-md);
    letter-spacing: 0.05em;
}

.project-body {
    padding: var(--space-6) 0 var(--space-12);
}

.project-prose {
    max-width: 760px;
    margin: 0 auto;
}

.project-prose h2 {
    font-size: var(--font-size-xl);
    margin: var(--space-6) 0 var(--space-3);
    color: var(--color-text);
}

.project-prose h2:first-child {
    margin-top: 0;
}

.project-prose p {
    font-size: var(--font-size-base);
    line-height: 1.8;
    color: var(--color-text);
    margin-bottom: var(--space-3);
}

.project-highlights {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-4);
}

.project-highlights li {
    position: relative;
    padding: var(--space-2) 0 var(--space-2) var(--space-4);
    line-height: 1.7;
    border-bottom: 1px solid var(--color-border);
}

.project-highlights li:last-child {
    border-bottom: none;
}

.project-highlights li::before {
    content: "";
    position: absolute;
    left: 0;
    top: calc(var(--space-2) + 0.45em);
    width: 14px;
    height: 14px;
    background-color: var(--color-accent);
    -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='3'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M5%2013l4%204L19%207'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='black'%20stroke-width='3'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M5%2013l4%204L19%207'/%3E%3C/svg%3E") center / contain no-repeat;
}

.project-highlights li strong {
    color: var(--color-text);
}

.project-pullquote {
    max-width: 760px;
    margin: var(--space-6) auto;
    padding: var(--space-5);
    border-left: 4px solid var(--color-accent);
    background: #f8f9fa;
    border-radius: 0 var(--space-2) var(--space-2) 0;
}

.project-pullquote p {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: var(--font-size-md);
    font-style: italic;
    line-height: 1.7;
    color: var(--color-text);
    margin: 0 0 var(--space-3);
}

.project-pullquote cite {
    font-style: normal;
    display: block;
    text-align: right;
}

.project-pullquote cite strong {
    display: block;
    color: var(--color-accent);
    font-size: var(--font-size-base);
}

.project-pullquote cite span {
    display: block;
    color: var(--color-muted);
    font-size: var(--font-size-sm);
    font-style: italic;
}

.project-cta {
    max-width: 760px;
    margin: var(--space-8) auto 0;
    padding: var(--space-5);
    text-align: center;
    background: #f8f9fa;
    border-radius: var(--space-2);
}

.project-cta p {
    font-size: var(--font-size-md);
    color: var(--color-text);
    margin: 0 0 var(--space-2);
}

.project-cta-link {
    display: inline-block;
    font-weight: 600;
    color: var(--color-accent);
    font-size: var(--font-size-md);
    transition: color 0.3s ease;
}

.project-cta-link:hover {
    color: #005177;
}

/* Shared CTA Button */
.btn-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-2) var(--space-4);
    background: linear-gradient(135deg, var(--color-cta) 0%, var(--color-cta-dark) 100%);
    color: #ffffff;
    font-family: inherit;
    font-size: var(--font-size-base);
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(232, 116, 44, 0.28);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.btn-cta:hover,
.btn-cta:focus {
    color: #ffffff;
    background: linear-gradient(135deg, #f08139 0%, var(--color-cta-dark) 100%);
    box-shadow: 0 8px 22px rgba(232, 116, 44, 0.4);
    transform: translateY(-2px);
}

.btn-cta:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(232, 116, 44, 0.28);
}

.btn-cta .btn-cta-arrow {
    display: inline-block;
    transition: transform 0.25s ease;
}

.btn-cta:hover .btn-cta-arrow,
.btn-cta:focus .btn-cta-arrow {
    transform: translateX(4px);
}

/* Outlined pill link — mirrors the About-section tab styling */
.btn-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-family: inherit;
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text);
    background: #ffffff;
    border: 2px solid var(--color-border);
    border-radius: 30px;
    padding: var(--space-1) var(--space-3);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.3s ease, background 0.3s ease,
                border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

.btn-pill:hover,
.btn-pill:focus {
    color: #0073aa;
    border-color: rgba(0, 115, 170, 0.4);
    box-shadow: 0 4px 15px rgba(0, 115, 170, 0.2);
    transform: translateY(-2px);
}

.btn-pill:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

@media (max-width: 768px) {
    .project-title {
        font-size: var(--font-size-2xl);
    }

    .project-meta-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-3);
    }

    .project-stats-grid {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }

    .project-stat {
        padding: var(--space-4) var(--space-3);
    }

    .project-stat-number {
        font-size: var(--font-size-2xl);
    }

}