/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
    --bg:           #0a0a0a;
    --surface:      #111111;
    --border:       #2a2a2a;
    --text:         #e8e8e8;
    --muted:        #888888;
    --accent:       #a855f7;
    --accent-green: #4ade80;
    --font:         'JetBrains Mono', monospace;
    --header-h:     64px;
    --sidebar-w:    56px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.7;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

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

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem 0 calc(var(--sidebar-w) + 2rem);
}

.logo-link {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text);
    transition: color 0.2s;
}

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

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

.header-nav {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    font-size: 0.85rem;
    color: var(--muted);
    transition: color 0.2s;
}

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

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    transition: all 0.3s;
}

/* ============================================================
   LEFT SIDEBAR
   ============================================================ */
.social-sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    width: var(--sidebar-w);
    height: calc(100vh - var(--header-h));
    z-index: 90;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 2rem;
    gap: 1.2rem;
    border-right: 1px solid var(--border);
    background: var(--bg);
}

.sidebar-icon {
    color: var(--muted);
    transition: color 0.2s, transform 0.2s;
}

.sidebar-icon:hover {
    color: var(--accent);
    transform: scale(1.15);
}

.sidebar-line {
    flex: 1;
    width: 1px;
    background: var(--border);
    margin-top: 0.5rem;
}

/* ============================================================
   MAIN & SECTIONS
   ============================================================ */
main {
    margin-left: var(--sidebar-w);
}

.section {
    padding: 6rem 4rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* ============================================================
   SECTION HEADING PATTERN
   ============================================================ */
.section-heading {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 3rem;
}

.section-heading h2 {
    font-size: 1.5rem;
    font-weight: 600;
    white-space: nowrap;
    color: var(--text);
}

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

.heading-line {
    flex: 1;
    height: 1px;
    background: var(--border);
    max-width: 300px;
}

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

.section-header .section-heading {
    margin-bottom: 0;
    flex: 1;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-outline {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.6rem 1.4rem;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: var(--font);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.btn-outline:hover {
    background: var(--accent);
    color: #000;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero-section {
    min-height: calc(100vh - var(--header-h));
    display: flex;
    align-items: center;
    gap: 4rem;
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.hero-content {
    flex: 1;
    min-width: 0;
}

.hero-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--muted);
    border: 1px solid var(--border);
    padding: 0.35rem 0.8rem;
    margin-bottom: 1.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 6px var(--accent-green);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.hero-title {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
}

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

.hero-subtitle {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.8;
    max-width: 480px;
}

/* Hero Image */
.hero-image {
    flex: 0 0 340px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dot-grid {
    position: absolute;
    inset: -20px;
    background-image: radial-gradient(circle, #333 1px, transparent 1px);
    background-size: 20px 20px;
    z-index: 0;
    pointer-events: none;
}

.geo-frame {
    position: relative;
    z-index: 1;
    width: 280px;
    height: 320px;
}

.geo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(20%);
}

/* Geometric bracket decorations */
.geo-bracket {
    position: absolute;
    width: 48px;
    height: 48px;
    z-index: 2;
    pointer-events: none;
}

.geo-tl {
    top: -12px;
    left: -12px;
    border-top: 2px solid var(--accent);
    border-left: 2px solid var(--accent);
}

.geo-br {
    bottom: -12px;
    right: -12px;
    border-bottom: 2px solid var(--accent);
    border-right: 2px solid var(--accent);
}

/* ============================================================
   PROJECTS SECTION
   ============================================================ */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.project-card {
    border: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s;
}

.project-card:hover {
    border-color: var(--accent);
}

.card-img-wrap {
    overflow: hidden;
    height: 180px;
}

.card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.project-card:hover .card-img-wrap img {
    transform: scale(1.04);
}

.card-body {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 1;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tech-tags span {
    font-size: 0.7rem;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 0.15rem 0.5rem;
    opacity: 0.85;
}

.card-body h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.card-body p {
    font-size: 0.82rem;
    color: var(--muted);
    flex: 1;
    line-height: 1.6;
}

.live-btn {
    display: inline-block;
    margin-top: 0.5rem;
    font-size: 0.82rem;
    color: var(--accent);
    border: 1px solid var(--border);
    padding: 0.35rem 0.8rem;
    align-self: flex-start;
    transition: border-color 0.2s, color 0.2s;
}

.live-btn:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: #000;
}

/* ============================================================
   FEATURED PROJECT (KEARMONTUNG)
   ============================================================ */
.featured-project {
    border: 1px solid var(--accent);
    background: var(--surface);
    margin-bottom: 3rem;
    overflow: hidden;
}

.featured-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--accent-green);
    border-bottom: 1px solid var(--border);
    padding: 0.6rem 1.2rem;
    font-family: var(--font);
    letter-spacing: 0.05em;
}

/* Browser chrome bar */
.featured-browser-bar {
    background: #161616;
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.browser-dots {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.browser-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.browser-dots span:nth-child(1) { background: #ff5f57; }
.browser-dots span:nth-child(2) { background: #febc2e; }
.browser-dots span:nth-child(3) { background: #28c840; }

.browser-url {
    font-size: 0.72rem;
    color: var(--muted);
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 0.2rem 0.75rem;
    flex: 1;
    max-width: 320px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.featured-iframe-wrap {
    width: 100%;
    height: 520px;
    overflow: hidden;
    position: relative;
    background: var(--bg);
}

.featured-iframe-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 1440px;
    height: 900px;
    border: none;
    pointer-events: none;
    transform-origin: top left;
    transform: scale(var(--iframe-scale, 0.72));
}

/* Compact info bar below iframe */
.featured-info {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.featured-info-left {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex-shrink: 0;
}

.featured-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.featured-desc {
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.65;
    flex: 1;
    min-width: 180px;
}

/* ============================================================
   PROJECT TABS
   ============================================================ */
.project-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-family: var(--font);
    font-size: 0.85rem;
    padding: 0.6rem 1.4rem;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    margin-bottom: -1px;
}

.tab-btn:hover {
    color: var(--text);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 2.5rem;
}

.page-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-family: var(--font);
    font-size: 0.8rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.page-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.page-btn.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(168, 85, 247, 0.08);
}

/* ============================================================
   SKILLS SECTION
   ============================================================ */
.skills-section {
    background: var(--surface);
}

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

.skill-box {
    border: 1px solid var(--border);
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    padding: 1.5rem 1rem;
    transition: border-color 0.2s, transform 0.2s;
}

.skill-box:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
}

.skill-icon {
    font-size: 2rem;
    color: var(--muted);
    transition: color 0.2s;
}

.skill-box:hover .skill-icon {
    color: var(--accent);
}

.skill-label {
    font-size: 0.75rem;
    color: var(--muted);
    text-align: center;
}

/* ============================================================
   ABOUT SECTION
   ============================================================ */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text p {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.about-image {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-image img {
    width: 280px;
    height: 320px;
    object-fit: cover;
    position: relative;
    z-index: 1;
    filter: grayscale(20%);
}

/* ============================================================
   CONTACTS SECTION
   ============================================================ */
.contacts-section {
    background: var(--surface);
}

.contacts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.contacts-text p {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.8;
    max-width: 400px;
}

.contact-card {
    border: 1px solid var(--border);
    background: var(--bg);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.88rem;
    color: var(--text);
}

.contact-item .iconify {
    font-size: 1.1rem;
    color: var(--accent);
    flex-shrink: 0;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    margin-left: var(--sidebar-w);
    border-top: 1px solid var(--border);
    padding: 2rem 4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-logo .logo-link {
    font-size: 0.95rem;
    font-weight: 700;
}

.footer-copy {
    font-size: 0.78rem;
    color: var(--muted);
    text-align: center;
}

.footer-social {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-media-label {
    font-size: 0.78rem;
    color: var(--muted);
}

.footer-icon {
    color: var(--muted);
    transition: color 0.2s;
}

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

/* ============================================================
   FADE-IN ANIMATIONS
   ============================================================ */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   RESPONSIVE — 768px
   ============================================================ */
@media (max-width: 768px) {
    .social-sidebar {
        display: none;
    }

    .site-header {
        padding: 0 1.5rem;
    }

    .header-nav {
        display: none;
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 1rem 1.5rem;
        gap: 1rem;
        z-index: 99;
    }

    .header-nav.open {
        display: flex;
    }

    .menu-toggle {
        display: flex;
    }

    main {
        margin-left: 0;
    }

    .site-footer {
        margin-left: 0;
    }

    .section {
        padding: 4rem 1.5rem;
    }

    .hero-section {
        flex-direction: column;
        gap: 3rem;
        padding-top: 3rem;
        min-height: auto;
    }

    .hero-image {
        flex: none;
        width: 100%;
    }

    .geo-frame {
        width: 220px;
        height: 260px;
        margin: 0 auto;
    }

    .featured-iframe-wrap {
        height: 260px;
    }

    .featured-iframe-wrap iframe {
        width: 768px;
        height: 600px;
        transform: scale(var(--iframe-scale-mobile, 0.48));
    }

    .featured-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

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

    .skills-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 100%;
    }

    .about-grid,
    .contacts-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .about-image img {
        width: 200px;
        height: 240px;
        margin: 0 auto;
    }

    .site-footer {
        padding: 1.5rem;
        flex-direction: column;
        text-align: center;
    }
}

/* ============================================================
   RESPONSIVE — 480px
   ============================================================ */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.5rem;
    }

    .section-heading h2 {
        font-size: 1.2rem;
    }

    .skills-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}
