/**
 * layout.css
 * ─────────────────────────────────────────────
 * Major structural layouts: header, nav, hero,
 * shared sections, about grid, footer.
 * Load AFTER base.css.
 */

/* ─────────────────────────────────────────────
   LANGUAGE TOGGLE SWITCH
   ───────────────────────────────────────────── */
.lang-toggle-wrapper {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
}
.lang-switch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}
.lang-switch__label--active {
    color: var(--gold);
    font-weight: 700;
}
.lang-switch__toggle {
    position: relative;
    width: 44px;
    height: 22px;
}
.lang-switch__toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.lang-switch__slider {
    position: absolute;
    inset: 0;
    background: var(--navy-light);
    border-radius: 22px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    transition: 0.3s;
}
.lang-switch__slider::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 14px;
    height: 14px;
    background: var(--gold);
    border-radius: 50%;
    transition: 0.3s;
}
.lang-switch__toggle input:checked + .lang-switch__slider::before {
    transform: translateX(22px);
}
.lang-switch__toggle input:checked + .lang-switch__slider {
    border-color: var(--gold);
}

/* ─────────────────────────────────────────────
   NAVIGATION / HEADER
   ───────────────────────────────────────────── */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(135deg, var(--navy-dark), var(--navy-medium));
    border-bottom: 2px solid var(--gold);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    width: 100%;
}

.navbar { padding: 1rem 0; }

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo / site name */
.logo-link,
.nav-logo h1 {
    font-family: 'Cinzel', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
    text-decoration: none;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow: 0 2px 12px rgba(212, 175, 55, 0.35);
    transition: color var(--transition), text-shadow var(--transition);
}
.logo-link:hover { color: var(--light-gold); }

/* Nav links list */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    transition: color var(--transition);
}

/* Underline slide-in on hover / active */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--gold), var(--crimson));
    transition: width var(--transition);
}
.nav-link:hover,
.nav-link--active { color: var(--gold); }
.nav-link:hover::after,
.nav-link--active::after { width: 100%; }

/* Hamburger button (hidden on desktop) */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.75rem;
    min-width: 44px;
    min-height: 44px;
}
.nav-toggle span {
    display: block;
    width: 26px;
    height: 2px;
    background: var(--gold);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}
.nav-toggle--active span:nth-child(1) { transform: translateY(7px)  rotate(45deg);  }
.nav-toggle--active span:nth-child(2) { opacity: 0; }
.nav-toggle--active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─────────────────────────────────────────────
   HERO SECTION
   ───────────────────────────────────────────── */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 6rem 2rem 8rem;
    background: linear-gradient(160deg,
        var(--navy-dark) 0%,
        #141e30        40%,
        #1a1a2e        70%,
        var(--navy-dark) 100%
    );
}

/* Diagonal grid pattern overlay */
.hero-bg-pattern {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        repeating-linear-gradient(45deg,
            rgba(212, 175, 55, 0.03) 0px, rgba(212, 175, 55, 0.03) 1px,
            transparent 1px, transparent 60px),
        repeating-linear-gradient(-45deg,
            rgba(139, 21, 56, 0.02) 0px, rgba(139, 21, 56, 0.02) 1px,
            transparent 1px, transparent 60px);
}

/* Radial glow behind content (animation in animations.css) */
.hero::before {
    content: '';
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 700px;
    height: 700px;
    background: radial-gradient(circle,
        rgba(212, 175, 55, 0.07) 0%,
        rgba(139, 21, 56, 0.04) 50%,
        transparent 72%
    );
    pointer-events: none;
    animation: pulseGlow 7s ease-in-out infinite;
}

.hero-inner {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 5rem;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
}

/* ── Hero photo ── */
.hero-photo-wrap {
    position: relative;
    flex-shrink: 0;
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.8s ease 0.2s, transform 0.8s ease 0.2s;
}
.hero-photo-wrap.is-visible { opacity: 1; transform: translateX(0); }

.hero-photo {
    width: 260px;
    height: 260px;
    border-radius: 20px;
    object-fit: cover;
    border: 3px solid var(--gold);
    box-shadow: 0 0 0 6px rgba(212, 175, 55, 0.08), 0 20px 60px rgba(0,0,0,0.5);
    transition: transform var(--transition), box-shadow var(--transition);
}
.hero-photo:hover {
    transform: translateY(-8px) rotate(1deg);
    box-shadow: 0 0 0 10px rgba(212, 175, 55, 0.14), 0 30px 80px rgba(0,0,0,0.6);
}

/* Spinning decorative ring (animation in animations.css) */
.hero-photo-ring {
    position: absolute;
    inset: -14px;
    border-radius: 26px;
    border: 1px solid rgba(212, 175, 55, 0.22);
    pointer-events: none;
    animation: spinRing 22s linear infinite;
}

/* ── Hero text ── */
.hero-text {
    flex: 1;
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.8s ease 0.4s, transform 0.8s ease 0.4s;
}
.hero-text.is-visible { opacity: 1; transform: translateX(0); }

.hero-eyebrow {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--crimson);
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 0.5rem;
}
.hero-name {
    font-size: clamp(2rem, 4vw, 3.2rem);
    color: var(--gold);
    line-height: 1.1;
    letter-spacing: 2px;
    margin-bottom: 0.6rem;
    text-shadow: 0 4px 20px rgba(212, 175, 55, 0.25);
}
.hero-title {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    letter-spacing: 1px;
}

/* Achievement badge */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: linear-gradient(135deg,
        rgba(212, 175, 55, 0.12),
        rgba(139, 21, 56, 0.08)
    );
    border: 1px solid var(--gold);
    border-radius: 8px;
    padding: 0.7rem 1.2rem;
    color: var(--gold);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}
.hero-badge-sub {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 2rem;
    max-width: 520px;
    line-height: 1.75;
}
.hero-summary-text {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1.75rem;
    max-width: 620px;
    line-height: 1.8;
}
.about-highlight {
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.18);
    border-radius: 14px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.8rem;
    max-width: 720px;
}
.about-highlight p {
    margin: 0;
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 1rem;
}

/* Hero CTA buttons */
.hero-ctas {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Scroll bounce indicator (animation in animations.css) */
.scroll-indicator {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}
.scroll-indicator span {
    display: block;
    width: 24px;
    height: 38px;
    border: 2px solid rgba(212, 175, 55, 0.4);
    border-radius: 12px;
    position: relative;
}
.scroll-indicator span::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: var(--gold);
    border-radius: 2px;
    animation: scrollBounce 2s infinite;
}

/* ─────────────────────────────────────────────
   SHARED SECTION STYLES
   ───────────────────────────────────────────── */
.portfolio-main { 
    background: transparent;
    margin-top: 0;
}

.section {
    padding: 6rem 0;
    border-top: 1px solid rgba(212, 175, 55, 0.15);
}
.section:first-of-type { 
    border-top: none;
    margin-top: 0;
}

.section-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Section header row with icon (WEDE / EBSY / APPR) */
.proj-section-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}
.proj-section-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid rgba(212, 175, 55, 0.4);
    background: linear-gradient(135deg,
        rgba(212, 175, 55, 0.12),
        rgba(139, 21, 56, 0.08)
    );
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--gold);
    flex-shrink: 0;
    transition: transform var(--transition), box-shadow var(--transition);
}
.proj-section-icon:hover {
    transform: rotate(12deg) scale(1.08);
    box-shadow: 0 0 18px rgba(212, 175, 55, 0.3);
}

/* Alternating background per section */
.proj-section--wede { background: linear-gradient(160deg, var(--navy-dark) 0%, #131c2a 100%); }
.proj-section--ebsy { background: linear-gradient(160deg, #0e1520 0%, var(--navy-medium) 100%); }
.proj-section--appr { background: linear-gradient(160deg, var(--navy-dark) 0%, #14101a 100%); }

/* CTA link below preview cards */
.section-cta {
    text-align: center;
    margin-top: 3rem;
}

/* ─────────────────────────────────────────────
   ABOUT ME SECTION
   ───────────────────────────────────────────── */
.about-section {
    background: linear-gradient(160deg, var(--navy-dark), var(--navy-medium));
}

.about-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3.5rem;
    margin-top: 3rem;
    align-items: start;
    /* Fade-in initial state — JS adds .is-visible */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.about-grid.is-visible { opacity: 1; transform: translateY(0); }

/* Left column */
.about-left {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.about-photo, .profile-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 14px;
    border: 3px solid var(--gold);
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    transition: transform var(--transition), box-shadow var(--transition);
}
.about-photo:hover, .profile-img:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 50px rgba(212, 175, 55, 0.2);
}

/* Contact card */
.contact-card {
    background: rgba(212, 175, 55, 0.04);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 12px;
    padding: 1.4rem;
}

/* Right column */
.about-role {
    font-family: 'Cinzel', serif;
    font-size: 1.35rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}
.about-bio {
    color: var(--text-secondary);
    line-height: 2.05;
    margin-bottom: 2rem;
    font-size: 1.03rem;
    max-width: 700px;
}

/* Skills rows */
.skills-block { margin-bottom: 1.8rem; }

.badges-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.6rem;
}

/* Languages grid */
.languages-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    margin-top: 0.6rem;
}

/* Contact / languages shared item row */
.contact-item,
.language-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: color var(--transition);
}
.contact-item:last-child { border-bottom: none; }
.contact-item i {
    color: var(--gold);
    font-size: 1rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}
.contact-item a {
    color: var(--gold);
    text-decoration: none;
    transition: color var(--transition);
}
.contact-item a:hover { color: var(--light-gold); }

.language-item {
    padding: 0.7rem 1rem;
    background: rgba(212, 175, 55, 0.04);
    border-left: 3px solid var(--gold);
    border-bottom: none;
    border-radius: 6px;
    justify-content: space-between;
}
.language-item:hover { background: rgba(212, 175, 55, 0.1); }
.lang-name  { font-weight: 600; color: var(--text-primary); font-size: 0.9rem; }
.lang-level { color: var(--gold); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 1px; }

/* ─────────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────────── */
.main-footer {
    background: linear-gradient(135deg, var(--navy-dark), #0a0d14);
    border-top: 2px solid var(--gold);
    padding: 2.5rem 2rem;
    margin-top: 0;
}

.footer-inner,
.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-copy,
.footer-content p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    letter-spacing: 0.5px;
}

/* Social icon buttons */
.footer-socials { display: flex; gap: 1rem; }

.social-btn,
.social-icon {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid rgba(212, 175, 55, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-size: 1.2rem;
    text-decoration: none;
    background: transparent;
    transition: all var(--transition);
}
.social-btn:hover,
.social-icon:hover {
    transform: translateY(-4px);
    border-color: var(--gold);
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.25);
    background: rgba(212, 175, 55, 0.08);
}

/* LinkedIn SVG icon — themed to gold */
.social-svg {
    width: 22px;
    height: 22px;
    filter: brightness(0) invert(1) sepia(1) saturate(2) hue-rotate(5deg);
    opacity: 0.75;
    transition: opacity var(--transition), filter var(--transition);
}
.social-btn--linkedin:hover .social-svg {
    opacity: 1;
    filter: brightness(0) saturate(100%) invert(75%) sepia(60%)
            saturate(500%) hue-rotate(5deg) brightness(95%);
}

/* ─────────────────────────────────────────────
   RESPONSIVE — LAYOUT MEDIA QUERIES
   ───────────────────────────────────────────── */

/* Tablet */
@media (max-width: 1024px) {
    .project-detailed-card {
        grid-template-columns: 1fr;
    }
    .project-media-carousel { min-height: 300px; }
    .carousel-main          { min-height: 300px; }
}

/* Medium screens */
@media (max-width: 900px) {
    body { font-size: 18px; }

    /* Hero stacks vertically */
    .hero-inner {
        flex-direction: column;
        text-align: center;
        gap: 2.5rem;
    }
    .hero-text, .hero-photo-wrap { transform: none !important; }
    .hero-ctas  { justify-content: center; }
    .hero-badge, .hero-badge-sub { margin-left: auto; margin-right: auto; }

    /* About grid stacks */
    .about-grid { grid-template-columns: 1fr; }
    .about-left {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 1.5rem;
    }
    .about-photo { width: 160px; height: 160px; }
    .contact-card { flex: 1; min-width: 220px; }
}

/* Mobile nav */
@media (max-width: 768px) {
    .nav-toggle { display: flex; }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--navy-dark);
        border-bottom: 2px solid var(--gold);
        flex-direction: column;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease;
    }
    .nav-menu--open { max-height: 90vh; overflow-y: auto; }
    .nav-menu li { border-top: 1px solid rgba(212, 175, 55, 0.1); }
    .nav-link { display: block; padding: 1rem 2rem; }

    /* Sections */
    .section { padding: 4rem 0; }
    .section-container { padding: 0 1.2rem; }

    /* Project cards */
    .project-detailed-card { padding: 1.2rem; gap: 1.2rem; }
    .project-media-carousel { min-height: 240px; }
    .carousel-main          { min-height: 240px; }

    /* About */
    .languages-grid { grid-template-columns: 1fr; }
}

/* Small phones */
@media (max-width: 480px) {
    .hero-photo { width: 180px; height: 180px; }
    .hero-name  { font-size: 1.8rem; }
    .preview-grid { grid-template-columns: 1fr; }
    .about-left   { flex-direction: column; align-items: center; }
    .about-photo  { width: 140px; height: 140px; }
    .footer-inner,
    .footer-container { flex-direction: column; text-align: center; }
}

/* External links grid responsive */
@media (max-width: 600px) {
    .external-links-grid {
        grid-template-columns: 1fr;
    }
}