/* Refined Scrollable Contact Portfolio Styling */
.contact-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem;
}

.contact-hero {
    text-align: center;
    margin-bottom: 4rem;
}

.contact-hero h1 {
    font-size: 4rem;
    font-weight: 800;
    background: linear-gradient(to right, #ffffff, #a2b0d8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    margin-bottom: 1rem;
    line-height: 1.2;
    letter-spacing: -0.04em;
}

[data-theme="light"] .contact-hero h1 {
    background: linear-gradient(to right, #1d1d1f, #86868b);
    -webkit-background-clip: text;
    background-clip: text;
}

.contact-hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

/* Flat Connection Section (No border/backdrop) */
.contact-main-flat {
    margin-bottom: 5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (min-width: 768px) {
    .contact-main-flat {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        gap: 4rem;
    }
    
    .contact-main-flat .panel-text {
        flex: 1.1;
    }
    
    .contact-main-flat .contact-grid {
        flex: 0.9;
    }
}

.contact-main-flat h2 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.contact-main-flat p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 1.08rem;
    margin: 0;
}

/* Connection Cards Grid */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    width: 100%;
}

@media (min-width: 480px) {
    .contact-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.contact-item-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--nav-border);
    border-radius: 18px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: transform 0.45s var(--apple-spring), 
                border-color 0.3s ease, 
                background-color 0.3s ease, 
                box-shadow 0.3s ease;
    will-change: transform;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.02), 0 5px 15px rgba(0,0,0,0.15);
}

[data-theme="light"] .contact-item-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 5px 15px rgba(0,0,0,0.02);
}

.contact-item-card:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .contact-item-card:hover {
    border-color: rgba(0, 102, 204, 0.2);
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.04);
}

.contact-item-card:active {
    transform: scale(0.97) translateY(0);
}

.contact-icon-wrapper {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

[data-theme="light"] .contact-icon-wrapper {
    background: rgba(0, 102, 204, 0.08);
}

.contact-item-card:hover .contact-icon-wrapper {
    background: var(--accent-blue);
    color: #ffffff;
}

.contact-card-content {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    text-align: left;
}

.contact-card-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.contact-card-value {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-all;
}

/* Copy Animation Indicator */
.contact-copy-checkmark {
    position: absolute;
    right: 1.25rem;
    color: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.contact-item-card.copied .contact-copy-checkmark {
    opacity: 1;
    transform: scale(1);
}

.contact-item-card.copied {
    border-color: rgba(16, 185, 129, 0.4) !important;
    background: rgba(16, 185, 129, 0.03) !important;
}

[data-theme="light"] .contact-item-card.copied {
    background: rgba(16, 185, 129, 0.05) !important;
}

/* SECTION HEADINGS */
.portfolio-section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin: 5rem 0 3rem 0;
    letter-spacing: -0.02em;
}

/* CAPABILITY GRID */
.capabilities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 8rem;
}

.capability-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--nav-border);
    border-radius: 24px;
    padding: 2.25rem;
    display: flex;
    flex-direction: column;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02),
                0 10px 30px rgba(0, 0, 0, 0.05);
    transition: transform 0.6s var(--apple-spring), 
                border-color 0.4s var(--apple-ease), 
                box-shadow 0.4s var(--apple-ease);
}

[data-theme="light"] .capability-card {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
}

.capability-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--card-border-hover);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .capability-card:hover {
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.04);
}

.capability-card h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.capability-card p {
    font-size: 0.98rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0;
}

/* INTERACTIVE CSS GRAPHICS */
.card-graphic {
    width: 100%;
    height: 100px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--nav-border);
    border-radius: 14px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

[data-theme="light"] .card-graphic {
    background: rgba(0, 0, 0, 0.01);
}

.capability-card:hover .card-graphic {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="light"] .capability-card:hover .card-graphic {
    background: rgba(0, 0, 0, 0.02);
}

/* /* Graphic 1: Automation (Creative Diagonal Node Pipeline) */
.workflow-container {
    width: 140px;
    height: 60px;
    position: relative;
}

.wf-node {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid var(--nav-border);
    position: absolute;
    z-index: 5;
    transition: all 0.3s ease;
}

[data-theme="light"] .wf-node {
    background: rgba(0, 0, 0, 0.1);
}

.wf-node.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    box-shadow: 0 0 12px var(--accent-blue);
    animation: nodeGlow 2s infinite alternate;
}

.wf-node.node-src { left: 0; top: 24px; }
.wf-node.node-top { left: 60px; top: 4px; }
.wf-node.node-bot { left: 60px; top: 44px; }
.wf-node.node-dest { left: 120px; top: 24px; }

.wf-path {
    position: absolute;
    height: 1.5px;
    background: rgba(255, 255, 255, 0.1);
    transform-origin: left center;
    z-index: 1;
}

[data-theme="light"] .wf-path {
    background: rgba(0, 0, 0, 0.08);
}

.wf-path.path-src-top {
    left: 10px; top: 29px; width: 54px;
    transform: rotate(-18deg);
}

.wf-path.path-src-bot {
    left: 10px; top: 29px; width: 54px;
    transform: rotate(18deg);
}

.wf-path.path-top-dest {
    left: 70px; top: 9px; width: 54px;
    transform: rotate(18deg);
}

.wf-path.path-bot-dest {
    left: 70px; top: 49px; width: 54px;
    transform: rotate(-18deg);
}

.wf-pulse {
    position: absolute;
    top: -1.5px;
    left: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-blue);
    box-shadow: 0 0 8px var(--accent-blue);
    animation: lineFlow 2s infinite linear;
}

.wf-pulse.delay-1 { animation-delay: 0.3s; }
.wf-pulse.delay-2 { animation-delay: 1s; }
.wf-pulse.delay-3 { animation-delay: 1.3s; }

@keyframes nodeGlow {
    0% { transform: scale(1); box-shadow: 0 0 6px var(--accent-blue); }
    100% { transform: scale(1.15); box-shadow: 0 0 14px var(--accent-blue); }
}

@keyframes lineFlow {
    0% { left: 0; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { left: 100%; opacity: 0; }
}

/* Graphic 2: High-Speed Gauge (Fixed) */
.gauge-box {
    position: relative;
    width: 80px;
    height: 40px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.gauge-arc {
    width: 80px;
    height: 40px;
    border-top-left-radius: 40px;
    border-top-right-radius: 40px;
    border: 3.5px solid rgba(255, 255, 255, 0.08);
    border-bottom: none;
    box-sizing: border-box;
    position: absolute;
    bottom: 0;
    z-index: 1;
}

[data-theme="light"] .gauge-arc {
    border-color: rgba(0, 0, 0, 0.05);
}

/* Static blue gauge segment highlight (80% filled to show peak performance) */
.gauge-fill-arc {
    width: 80px;
    height: 40px;
    border-top-left-radius: 40px;
    border-top-right-radius: 40px;
    border: 3.5px solid var(--accent-blue);
    border-bottom: none;
    box-sizing: border-box;
    position: absolute;
    bottom: 0;
    z-index: 2;
    clip-path: polygon(0% 100%, 0% 0%, 82% 0%, 50% 100%);
    opacity: 0.9;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.gauge-needle {
    width: 2px;
    height: 34px;
    background: #ffffff;
    position: absolute;
    bottom: 0;
    left: calc(50% - 1px);
    transform-origin: bottom center;
    transform: rotate(-60deg);
    animation: needleRotate 2s ease-in-out infinite alternate;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
    z-index: 3;
}

[data-theme="light"] .gauge-needle {
    background: #1d1d1f;
    box-shadow: none;
}

.gauge-label {
    position: absolute;
    bottom: -15px;
    font-size: 0.6rem;
    font-weight: 700;
    font-family: monospace;
    color: var(--text-tertiary);
    z-index: 4;
}

@keyframes needleRotate {
    0% { transform: rotate(-70deg); }
    100% { transform: rotate(70deg); }
}

/* Graphic 3: Smart Error Editor (Warning Alert Badge) */
.editor-graphic-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.mini-editor {
    width: 140px;
    height: 60px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 8px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

[data-theme="light"] .mini-editor {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.04);
}

.editor-bar-row {
    display: flex;
    gap: 4px;
    align-items: center;
}

.editor-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

[data-theme="light"] .editor-dot {
    background: rgba(0, 0, 0, 0.15);
}

.editor-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

[data-theme="light"] .editor-bar {
    background: rgba(0, 0, 0, 0.05);
}

.editor-bar.w-1 { width: 30px; }
.editor-bar.w-2 { width: 50px; }
.editor-bar.w-3 { width: 40px; }

.editor-bar.interactive-check {
    width: 65px;
    background: #ef4444;
    animation: codeFixer 4s infinite steps(1);
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.3);
}

.editor-alert-badge {
    position: absolute;
    top: 15px;
    right: calc(50% - 78px);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    animation: alertBadgeToggle 4s infinite steps(1);
    z-index: 10;
}

.editor-alert-badge svg {
    width: 11px;
    height: 11px;
}

.editor-alert-badge .alert-warning {
    animation: warningShow 4s infinite steps(1);
}

.editor-alert-badge .alert-success {
    animation: successShow 4s infinite steps(1);
}

@keyframes warningShow {
    0%, 20% { display: block; opacity: 1; }
    40%, 100% { display: none; opacity: 0; }
}

@keyframes successShow {
    0%, 20% { display: none; opacity: 0; }
    40%, 100% { display: block; opacity: 1; }
}

@keyframes codeFixer {
    0%, 20% { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.3); }
    40%, 100% { background: #10b981; box-shadow: 0 0 6px rgba(16, 185, 129, 0.3); }
}

@keyframes alertBadgeToggle {
    0%, 20% {
        background: #ef4444;
        box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
    }
    40%, 100% {
        background: #10b981;
        box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
    }
}

/* Graphic 4: Layout Grid (Glow highlight scale upgrade) */
.mini-layout-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 6px;
    width: 100px;
}

.layout-item {
    height: 24px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    animation: layoutGrow 3s infinite alternate ease-in-out;
}

[data-theme="light"] .layout-item {
    background: rgba(0, 0, 0, 0.015);
    border-color: rgba(0, 0, 0, 0.03);
}

.layout-item.delay {
    animation-delay: 1.5s;
}

@keyframes layoutGrow {
    0% {
        transform: scale(1);
        background: rgba(255, 255, 255, 0.04);
        border-color: rgba(255, 255, 255, 0.05);
        box-shadow: none;
    }
    100% {
        transform: scale(1.05);
        background: rgba(59, 130, 246, 0.22);
        border-color: var(--accent-blue);
        box-shadow: 0 0 12px rgba(59, 130, 246, 0.45);
    }
}

[data-theme="light"] @keyframes layoutGrow {
    0% {
        transform: scale(1);
        background: rgba(0, 0, 0, 0.015);
        border-color: rgba(0, 0, 0, 0.03);
    }
    100% {
        transform: scale(1.05);
        background: rgba(0, 102, 204, 0.12);
        border-color: rgba(0, 102, 204, 0.5);
    }
}

/* Graphic 5: Data Connections (Database Stack Columns) */
.db-stack {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.db-column {
    width: 16px;
    height: 38px;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    padding: 2px 0;
    box-sizing: border-box;
    animation: dbPulse 2s infinite alternate ease-in-out;
}

[data-theme="light"] .db-column {
    border-color: rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.01);
}

.db-column.col-2 {
    animation-delay: 0.6s;
    height: 48px;
}

.db-column.col-3 {
    animation-delay: 1.2s;
    height: 42px;
}

.db-disk {
    height: 3px;
    background: rgba(255, 255, 255, 0.25);
    margin: 0 2px;
    border-radius: 1px;
}

[data-theme="light"] .db-disk {
    background: rgba(0, 0, 0, 0.15);
}

@keyframes dbPulse {
    0% {
        border-color: rgba(255, 255, 255, 0.15);
        background: rgba(255, 255, 255, 0.02);
        box-shadow: none;
    }
    100% {
        border-color: var(--accent-blue);
        background: rgba(59, 130, 246, 0.25);
        box-shadow: 0 0 15px rgba(59, 130, 246, 0.65), inset 0 0 8px rgba(59, 130, 246, 0.4);
    }
}

[data-theme="light"] @keyframes dbPulse {
    0% {
        border-color: rgba(0, 0, 0, 0.1);
        background: rgba(0, 0, 0, 0.01);
    }
    100% {
        border-color: rgba(0, 102, 204, 0.55);
        background: rgba(0, 102, 204, 0.15);
        box-shadow: 0 0 10px rgba(0, 102, 204, 0.25);
    }
}

/* Graphic 6: Secure Operations (Security Core Enlarged) */
.secure-core-container {
    position: relative;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.secure-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent-blue);
    box-shadow: 0 0 14px var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    z-index: 2;
}

.secure-circle svg {
    width: 14px;
    height: 14px;
    stroke-width: 3px;
}

.secure-ring {
    position: absolute;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 1.8px dashed rgba(59, 130, 246, 0.5);
    animation: rotateRing 15s linear infinite;
    z-index: 1;
}

.secure-pulse {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--accent-blue);
    opacity: 0;
    animation: ringPulse 2s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;
    z-index: 0;
}

@keyframes rotateRing {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes ringPulse {
    0% {
        width: 28px;
        height: 28px;
        opacity: 0.8;
    }
    100% {
        width: 74px;
        height: 74px;
        opacity: 0;
    }
}
