/*
 * Portfolio Website - Main Styles
 * Modern, clean design with bento grid layout
 */

/* ===== BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Selection */
::selection {
    background-color: var(--accent-primary);
    color: white;
}

/* Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ===== NAVIGATION ===== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background-color: rgba(13, 15, 20, 0.8);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border-bottom: 1px solid var(--border-subtle);
}

[data-theme="light"] .navbar {
    background-color: rgba(246, 246, 248, 0.8);
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.nav-logo:hover {
    transform: scale(1.05);
}

.logo-icon {
    background-color: var(--accent-primary);
    color: white;
    padding: 0.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.logo-icon.small {
    padding: 0.375rem;
}

.nav-logo:hover .logo-icon {
    transform: rotate(12deg);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    color: var(--text-primary);
}

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

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
}

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

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-lang {
    background-color: var(--accent-light);
    color: var(--accent-primary);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--accent-border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-lang:hover {
    background-color: var(--accent-border);
    transform: translateY(-2px);
}

.btn-theme {
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 0.5rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-theme:hover {
    color: var(--accent-primary);
    transform: translateY(-2px);
}

[data-theme="dark"] .icon-sun {
    display: block;
}

[data-theme="dark"] .icon-moon {
    display: none;
}

[data-theme="light"] .icon-sun {
    display: none;
}

[data-theme="light"] .icon-moon {
    display: block;
}

/* ===== HERO SECTION ===== */
.hero {
    position: relative;
    padding: 5rem 0 8rem;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%236467f2' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
}

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

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: var(--accent-light);
    border: 1px solid var(--accent-border);
    border-radius: 9999px;
    width: fit-content;
    margin-bottom: 2rem;
}

.pulse-dot {
    position: relative;
    width: 0.5rem;
    height: 0.5rem;
    background-color: var(--accent-primary);
    border-radius: 50%;
}

.pulse-dot::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: var(--accent-primary);
    border-radius: 50%;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

.badge-text {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-primary);
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: -0.05em;
    font-style: italic;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    font-weight: 300;
    color: var(--text-secondary);
    max-width: 42rem;
    margin-bottom: 1rem;
}

.hero-description {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 42rem;
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary svg {
    transition: transform 0.3s ease;
}

.btn-primary:hover svg {
    transform: translateX(4px);
}

.btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: var(--bg-tertiary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.hero-terminal {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 400px;
}

.terminal-card {
    position: relative;
    aspect-ratio: 1;
    max-width: 600px;
    margin: 0 auto;
    border-radius: 1.5rem;
    overflow: hidden;
    border: 1px solid var(--border-default);
    background-image: linear-gradient(to top, rgba(13, 15, 20, 0.82), rgba(13, 15, 20, 0.06)), url('../images/hero.png');
    background-size: cover;
    background-position: center;
}

.terminal-card::before {
    content: '';
    position: absolute;
    inset: -4px;
    background: linear-gradient(135deg, var(--accent-primary), transparent);
    border-radius: 1.5rem;
    opacity: 0.2;
    filter: blur(20px);
    z-index: -1;
    transition: opacity 0.3s ease;
}

.terminal-card:hover::before {
    opacity: 0.3;
}

.terminal-content {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    right: 2rem;
}

.terminal-prompt {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.terminal-status {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* ===== ABOUT SECTION ===== */
.about-section {
    padding: 6rem 0;
    background-color: var(--bg-primary);
}

[data-theme="light"] .about-section {
    background-color: var(--bg-tertiary);
}

.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 3rem;
    gap: 2rem;
}

.section-header-content {
    flex-shrink: 0;
}

.section-title {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 900;
    font-style: italic;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
}

.section-divider {
    flex: 1;
    height: 1px;
    background-color: var(--border-subtle);
    display: none;
}

.section-header-center {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header-center .section-title {
    margin-bottom: 1rem;
}

/* ===== BENTO GRID ===== */

.bento-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    min-height: auto;
}

.bento-card {
    position: relative;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 1.5rem;
    padding: 1.4rem;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bento-card:hover {
    border-color: var(--border-default);
    box-shadow: var(--shadow-glow);
    transform: translateY(-4px);
}

.bento-card .card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.bento-card .card-icon svg {
    width: 2.5rem;
    height: 2.5rem;
    stroke: var(--accent-primary);
}

.bento-card h3 {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
    line-height: 1.18;
    text-wrap: balance;
}

.bento-card p {
    font-size: 0.98rem;
    color: var(--text-secondary);
    line-height: 1.45;
    max-width: 32ch;
}

.bento-card img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    border-radius: 1rem;
    margin-bottom: 0;
}

.card-copy {
    position: relative;
    z-index: 2;
}

.card-copy.center {
    text-align: center;
    margin-top: 0.4rem;
}

.card-copy.center p {
    margin: 0 auto;
}

.card-copy.bottom {
    margin-top: auto;
}

.bento-card.large {
    grid-column: span 2;
}

.bento-card.tall {
    grid-row: span 2;
}

.bento-card.with-accent {
    border-left: 4px solid var(--accent-primary);
}

/* Card variants */
.bento-card.card-devops {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
}

.bento-card.card-devops .card-copy {
    max-width: 53%;
}

.bento-card.card-devops h3 {
    font-size: 2rem;
}

.card-image-overlay {
    position: absolute;
    top: 0;
    right: 0;
    width: 52%;
    height: 100%;
    opacity: 0.16;
}

.card-image-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--bg-secondary), transparent 40%);
}

.card-image-overlay img {
    height: 100%;
    border-radius: 0;
}

.bento-card.card-homelab {
    justify-content: flex-start;
}

.bento-card.card-homelab .card-icon {
    display: none;
}

.card-image-frame {
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--accent-border);
    background-color: var(--bg-tertiary);
}

.bento-card.card-homelab .card-image-frame img {
    height: 180px;
}

.bento-card.card-homelab h3 {
    font-size: 3rem;
}

.bento-card.card-homelab p {
    max-width: 30ch;
    margin: 0 auto;
}

.bento-card.card-firefighting .card-icon svg {
    stroke: var(--color-red);
}

.bento-card.card-golf .card-icon svg {
    stroke: var(--color-emerald);
}

.bento-card.card-firefighting h3,
.bento-card.with-accent h3,
.bento-card.card-golf h3 {
    font-size: 1.7rem;
}

.bento-card.with-accent h3 {
    font-size: 1.45rem;
    line-height: 1.2;
}

.bento-card.with-accent p {
    font-size: 0.92rem;
    max-width: 34ch;
}

.bento-card.card-wide {
    grid-column: span 2;
}

/* ===== CONNECT SECTION ===== */
.connect-section {
    padding: 6rem 0;
    background-color: var(--bg-primary);
}

.connect-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.social-card {
    display: block;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 1.5rem;
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-card:hover {
    border-color: var(--border-default);
    transform: translateY(-8px);
    box-shadow: var(--shadow-glow);
}

.social-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    transition: transform 0.3s ease;
}

.social-card:hover .social-icon {
    transform: scale(1.1);
}

.social-icon svg {
    width: 2rem;
    height: 2rem;
    fill: currentColor;
}

.social-icon.github {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.social-icon.linkedin {
    background-color: var(--accent-light);
    color: var(--accent-primary);
}

.social-icon.instagram {
    background-color: rgba(236, 72, 153, 0.1);
    color: var(--color-pink);
}

.social-card h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.social-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ===== FOOTER ===== */
.footer {
    padding: 3rem 0;
    background-color: var(--bg-tertiary);
    border-top: 1px solid var(--border-subtle);
}

[data-theme="light"] .footer {
    background-color: var(--bg-secondary);
}

.footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-brand span {
    font-weight: 700;
    color: var(--text-primary);
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-link {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.footer-copyright {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.heart {
    color: var(--accent-primary);
}

/* ===== UTILITIES ===== */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

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

/* ===== RESPONSIVE ===== */
@media (min-width: 768px) {
    .section-divider {
        display: block;
    }

    .hero-container {
        grid-template-columns: 1fr 1fr;
    }

    .footer-container {
        flex-direction: row;
    }

    .bento-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 252px;
    }

    .bento-card {
        padding: 1.3rem;
    }

    .bento-card h3 {
        font-size: 1.45rem;
    }

    .bento-card p {
        font-size: 0.95rem;
    }

    .bento-card.card-devops h3 {
        font-size: 2rem;
    }

    .bento-card.card-homelab h3 {
        font-size: 2.9rem;
    }

    .bento-card.card-firefighting h3,
    .bento-card.with-accent h3,
    .bento-card.card-golf h3 {
        font-size: 1.65rem;
    }

    .bento-card.with-accent h3 {
        font-size: 1.42rem;
    }

    .bento-card.card-homelab .card-image-frame img {
        height: 170px;
    }
}

@media (max-width: 767px) {
    .nav-links {
        display: none;
    }

    .container {
        padding: 0 1rem;
    }

    .hero {
        padding: 3rem 0 5rem;
    }

    .about-section,
    .connect-section {
        padding: 4rem 0;
    }

    .bento-card {
        min-height: 200px;
    }

    .bento-card.card-wide {
        grid-column: span 1;
    }

    .bento-card h3,
    .bento-card.card-devops h3,
    .bento-card.card-homelab h3,
    .bento-card.card-firefighting h3,
    .bento-card.with-accent h3,
    .bento-card.card-golf h3 {
        font-size: 1.7rem;
    }

    .bento-card.card-devops .card-copy {
        max-width: 100%;
    }

    .card-image-overlay {
        position: static;
        width: 100%;
        height: 150px;
        opacity: 1;
        order: -1;
        border-radius: 1rem;
        overflow: hidden;
    }

    .card-image-overlay::after {
        background: linear-gradient(to top, rgba(13, 15, 20, 0.38), transparent 45%);
    }
}

/* Smooth content loading */
[data-loading="true"] {
    opacity: 0;
}

[data-loading="false"] {
    opacity: 1;
    transition: opacity 0.5s ease;
}
