/* ═══════════════════════════════════════
   COMPONENTS
   Ken.AI Personal Website
   Industrial Supply Chain Theme
   Light Theme Only
   ═══════════════════════════════════════ */

/* ── Navigation ── */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--nav-bg-solid);
    border-bottom: 1px solid var(--metal-border);
    z-index: 1000;
    transition: background var(--transition-base);
}

.nav.scrolled {
    background: var(--nav-bg-solid);
    border-bottom-color: var(--border-accent);
}

.nav-inner {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 28px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: 'Oswald', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
}

.nav-logo span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 28px;
    list-style: none;
    align-items: center;
}

.nav-links a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    transition: color var(--transition-fast);
    position: relative;
    padding: 4px 0;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
    opacity: 1;
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
}

.nav-cta {
    font-family: 'Oswald', sans-serif;
    font-size: 12px;
    font-weight: 500;
    padding: 8px 18px;
    border-radius: 2px;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    cursor: pointer;
    transition: all var(--transition-fast);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-cta:hover {
    background: var(--accent);
    color: #fff;
    opacity: 1;
}

/* Nav progress bar - simplified solid line */
.nav-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.1s linear;
}

/* Mobile menu */
.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 2px;
}

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

    .nav-cta {
        display: none;
    }

    .nav-toggle {
        display: block;
    }

    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--nav-bg-solid);
        padding: 20px 28px;
        gap: 16px;
        border-bottom: 1px solid var(--metal-border);
        animation: fadeInDown 0.3s ease;
    }

    .nav-links.open .nav-cta-mobile {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 12px;
        color: var(--accent);
        padding: 10px 0;
        font-family: 'Oswald', sans-serif;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
}

/* ── Buttons ── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border-radius: 2px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    position: relative;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    transition: width var(--transition-base);
}

.btn-primary:hover {
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover::before {
    width: 100%;
    opacity: 0;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-radius: 2px;
    border: 1px solid var(--border-accent);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    letter-spacing: 0.02em;
}

.btn-secondary:hover {
    color: var(--text-primary);
    border-color: var(--accent);
    background: var(--accent-dim);
    opacity: 1;
}

.btn-sm {
    padding: 10px 20px;
    font-size: 13px;
}

/* ── Cards (with technical corner markers) ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--metal-border);
    border-radius: var(--radius-md);
    padding: 28px;
    transition: border-color var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
    position: relative;
    overflow: hidden;
}

/* Technical corner markers */
.card::before,
.card::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-color: var(--metal-border);
    border-style: solid;
    transition: all var(--transition-base);
}

.card::before {
    top: 0;
    left: 0;
    border-width: 2px 0 0 2px;
}

.card::after {
    bottom: 0;
    right: 0;
    border-width: 0 2px 2px 0;
}

.card:hover {
    border-color: var(--metal-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.card:hover::before,
.card:hover::after {
    width: 16px;
    height: 16px;
    border-color: var(--accent);
}

.card-glow::before {
    /* Override default corner marker for glow variant */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.card-glow:hover::before {
    opacity: 1;
}

.card-glow::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 8px;
    height: 8px;
    border: 2px solid var(--metal-border);
    border-width: 0 2px 2px 0;
    transition: all var(--transition-base);
}

.card-glow:hover::after {
    width: 16px;
    height: 16px;
    border-color: var(--accent);
}

/* 3D tilt card */
.card-3d {
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* ── Quadrant Cards ── */
.qcard {
    background: var(--bg-card);
    border: 1px solid var(--metal-border);
    border-left: 3px solid transparent;
    border-radius: var(--radius-md);
    padding: 28px;
    transition: all var(--transition-base);
    cursor: default;
    position: relative;
}

.qcard::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 6px;
    border: 1px solid var(--metal-border);
    border-width: 0 1px 1px 0;
    transition: all var(--transition-base);
}

.qcard:hover {
    border-color: var(--metal-accent);
    transform: translateX(2px);
}

.qcard:hover::before {
    width: 10px;
    height: 10px;
    border-color: var(--q-color, var(--accent));
}

.qcard-number {
    font-family: 'Oswald', sans-serif;
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 8px;
    display: block;
    color: var(--text-muted);
}

.qcard h3 {
    font-size: 18px;
    margin-bottom: 6px;
    font-weight: 700;
}

.qcard .metaphor {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: block;
    font-style: normal;
}

.qcard p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Quadrant-specific left border */
.qcard.c4 {
    border-left-color: var(--q4-color);
}

.qcard.c4 .qcard-number,
.qcard.c4 h3 {
    color: var(--q4-color);
}

.qcard.c3 {
    border-left-color: var(--q3-color);
}

.qcard.c3 .qcard-number,
.qcard.c3 h3 {
    color: var(--q3-color);
}

.qcard.c2 {
    border-left-color: var(--q2-color);
}

.qcard.c2 .qcard-number,
.qcard.c2 h3 {
    color: var(--q2-color);
}

.qcard.c1 {
    border-left-color: var(--q1-color);
}

.qcard.c1 .qcard-number,
.qcard.c1 h3 {
    color: var(--q1-color);
}

/* ── Pyramid Flow ── */
.pyramid-flow {
    display: flex;
    flex-direction: column-reverse;
    /* Note: HTML is L6 -> L1, so reverse if we want bottom up. Actually, we coded L6 at the top, L1 at the bottom in HTML. We should just use column. */
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 48px;
    width: 100%;
}

.p-layer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px 24px;
    border-radius: 4px;
    text-align: center;
    transition: transform var(--transition-base), border-color var(--transition-base);
    background: var(--bg-card);
    border: 1px solid var(--metal-border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.p-layer:hover {
    transform: translateY(-4px);
    border-color: var(--metal-accent);
}

.p-layer .p-name {
    font-family: 'Oswald', sans-serif;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--text-primary);
}

.p-layer .p-sub {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Pyramid stacked widths */
.p-layer.l1 {
    width: 100%;
    max-width: 700px;
    border-bottom: 4px solid var(--q4-color, #2563eb);
}

.p-layer.l2 {
    width: 90%;
    max-width: 630px;
    border-bottom: 4px solid #8b5cf6;
}

.p-layer.l3 {
    width: 80%;
    max-width: 560px;
    border-bottom: 4px solid var(--q3-color, #d97706);
}

.p-layer.l4 {
    width: 70%;
    max-width: 490px;
    border-bottom: 4px solid #14b8a6;
}

.p-layer.l5 {
    width: 60%;
    max-width: 420px;
    border-bottom: 4px solid var(--q2-color, #059669);
}

.p-layer.l6 {
    width: 50%;
    max-width: 350px;
    border-bottom: 4px solid var(--q1-color, #dc2626);
}

/* ── Insight Box ── */
.insight-box {
    background: var(--bg-card);
    border: 1px solid var(--metal-accent);
    border-radius: var(--radius-md);
    padding: 32px 36px;
    position: relative;
}

.insight-box::before {
    content: attr(data-label);
    position: absolute;
    top: -1px;
    left: 24px;
    background: var(--bg-deep);
    padding: 0 12px;
    font-family: 'Oswald', sans-serif;
    font-size: 10px;
    letter-spacing: 0.15em;
    color: var(--accent);
    text-transform: uppercase;
}

.insight-box p {
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 15px;
    line-height: 1.9;
}

.insight-box .em {
    color: var(--accent);
    font-weight: 600;
}

/* ── Skill Tags ── */
.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tag {
    font-family: 'Oswald', sans-serif;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 2px;
    background: var(--bg-elevated);
    border: 1px solid var(--metal-border);
    color: var(--text-secondary);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    transition: all var(--transition-fast);
}

.skill-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.skill-tag.accent {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

/* ── Code Block Visual ── */
.code-visual {
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    min-height: 280px;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
    border: 1px solid var(--metal-border);
}

.code-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, var(--accent-dim) 0%, transparent 70%);
}

.code-block {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.8;
    color: var(--text-secondary);
    white-space: pre;
    position: relative;
    z-index: 1;
}

.code-block .kw {
    color: var(--accent);
}

.code-block .fn {
    color: var(--q2-color);
}

.code-block .str {
    color: var(--q3-color);
}

.code-block .cmt {
    color: var(--text-muted);
}

/* ── CTA Section ── */
.cta-section {
    padding: 100px 0;
    text-align: center;
    position: relative;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: var(--metal-border);
}

.cta-section h2 {
    font-size: clamp(28px, 3.5vw, 40px);
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.cta-section p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 36px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.cta-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── Footer ── */
.footer {
    padding: 48px 0;
    border-top: 1px solid var(--metal-border);
    text-align: center;
}

.footer p {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

.footer .footer-quote {
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-style: normal;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
}

/* ── Contact Modal ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--modal-overlay);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--metal-accent);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
    animation: fadeInUp 0.4s ease;
}

.modal::before,
.modal::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border-color: var(--accent);
    border-style: solid;
}

.modal::before {
    top: 0;
    left: 0;
    border-width: 2px 0 0 2px;
}

.modal::after {
    top: 0;
    right: 0;
    border-width: 2px 2px 0 0;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal h3 {
    font-size: 22px;
    margin-bottom: 8px;
}

.modal p {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.modal-qr-single {
    display: flex;
    justify-content: center;
}

.modal-qr-img {
    width: 220px;
    height: 220px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

/* ── Mobile Fixed CTA ── */
.mobile-cta {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 20px;
    background: var(--nav-bg-solid);
    border-top: 1px solid var(--metal-border);
    z-index: 999;
}

.mobile-cta .btn-primary {
    width: 100%;
    justify-content: center;
}

@media (max-width: 768px) {
    .mobile-cta {
        display: block;
    }

    .footer {
        padding-bottom: 80px;
    }
}

/* ── Page Content ── */
.page-hero {
    padding: calc(var(--nav-height) + 60px) 0 60px;
    position: relative;
}

.page-hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: -200px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-dim) 0%, transparent 70%);
    pointer-events: none;
}

.breadcrumb {
    font-family: 'Oswald', sans-serif;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 24px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.breadcrumb a {
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.breadcrumb a:hover {
    color: var(--accent);
    opacity: 1;
}

.breadcrumb .sep {
    opacity: 0.4;
}

/* ── Grid Layouts ── */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

@media (max-width: 900px) {
    .grid-5 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .grid-3 {
        grid-template-columns: 1fr;
    }

    .grid-5 {
        grid-template-columns: 1fr;
    }
}

/* ── Resource Items ── */
.res-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.res-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.res-list .dot {
    width: 4px;
    height: 4px;
    background: var(--accent);
    flex-shrink: 0;
}

.res-badge {
    font-family: 'Oswald', sans-serif;
    font-size: 9px;
    padding: 3px 8px;
    border-radius: 2px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    flex-shrink: 0;
    border: 1px solid;
}

.res-badge.tier1 {
    border-color: var(--q1-color);
    color: var(--q1-color);
}

.res-badge.tier2 {
    border-color: var(--q2-color);
    color: var(--q2-color);
}

.res-badge.tier3 {
    border-color: var(--q3-color);
    color: var(--q3-color);
}

/* ── Utility Classes (inline-style replacements) ── */
.page-title-compact {
    font-size: clamp(28px, 4vw, 44px);
}

.section-pt-40 {
    padding-top: 40px;
}

.mb-72 {
    margin-bottom: 72px;
}

.mb-48 {
    margin-bottom: 48px;
}

.mb-32 {
    margin-bottom: 32px;
}

.mb-24 {
    margin-bottom: 24px;
}

.mb-20 {
    margin-bottom: 20px;
}

.mb-16 {
    margin-bottom: 16px;
}

.my-72-32 {
    margin: 72px 0 32px;
}

.my-64-32 {
    margin: 64px 0 32px;
}

.my-64 {
    margin: 64px 0;
}

.my-48 {
    margin: 48px 0;
}

.text-center-mt-40 {
    text-align: center;
    margin-top: 40px;
}

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

.text-primary {
    color: var(--text-primary);
}

.text-accent {
    color: var(--accent);
}

.fs-22 {
    font-size: 22px;
}

.fs-17-mb-12 {
    font-size: 17px;
    margin-bottom: 12px;
}

.fs-12-text-muted {
    font-size: 12px;
    color: var(--text-muted);
}

.fs-12-text-muted-mt-12 {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
}

.fs-11 {
    font-size: 11px;
}

.text-14-secondary-lh18 {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.mono-meta-note {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 12px;
}

.grid-1-gap-20-mb-72 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 72px;
}

.border-left-accent-3 {
    border-left: 3px solid var(--accent);
}

.modal-contact-divider {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-subtle);
}