/* 
   KSNXRL — Clean Developer Portfolio
*/

/* ── Reset & Base ── */
:root {
    --bg: #ffffff;
    --text: #111111;
    --muted: #666666;
    --border: #e5e5e5;
    --card-bg: #fafafa;
    --card-hover-bg: #f5f5f5;
    --header-bg: rgba(255, 255, 255, 0.85);
    --font: 'Google Sans', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: 0.3s ease;
}

[data-theme="dark"] {
    --bg: #0d0d0d;
    --text: #f0f0f0;
    --muted: #999999;
    --border: #262626;
    --card-bg: #141414;
    --card-hover-bg: #1f1f1f;
    --header-bg: rgba(13, 13, 13, 0.85);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background var(--transition), color var(--transition);
}

/* ── Utilities ── */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.theme-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: 12px;
    border: none;
    cursor: pointer;
    outline: none;
    padding: 0;
    transition: background 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.switch-handle {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--bg);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

html[data-theme="dark"] .theme-switch {
    background: #4a4a4a;
}

html[data-theme="dark"] .switch-handle {
    transform: translateX(20px);
    background: #ffffff;
}

/* ── Header ── */
#site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition), border-color var(--transition);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

.header-nav a {
    font-size: 14px;
    font-weight: 400;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.15s;
}

.header-nav a:hover {
    color: var(--text);
}

/* ── Hero ── */
#hero {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 120px 32px 80px;
    background-image: 
        linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    background-position: center bottom;
}

[data-theme="dark"] #hero {
    background-image: 
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
}

.hero-title {
    font-size: clamp(3rem, 10vw, 6rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 16px;
}

.hero-sub {
    font-size: 18px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}

.hero-desc {
    font-size: 16px;
    color: var(--muted);
    max-width: 500px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    margin-top: 32px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--text);
    color: var(--bg);
    border: 1px solid var(--text);
}

.btn-primary:hover {
    background: transparent;
    color: var(--text);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

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

/* ── Sections ── */
.section-title {
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 32px;
}

/* ── Products ── */
#products {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px 80px;
}

.category-block {
    margin-bottom: 48px;
}

.category-block:last-child {
    margin-bottom: 0;
}

.category-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
}

.product-card {
    display: block;
    padding: 28px 24px;
    background: var(--bg);
    text-decoration: none;
    color: var(--text);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.product-card:hover {
    background: var(--card-bg);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    gap: 12px;
}

.product-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}

.badge {
    font-size: 11px;
    font-weight: 500;
    color: var(--muted);
    background: var(--border);
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.product-card p {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}

/* ── Tech Stack ── */
#tech-stack {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px 80px;
}

.tech-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.tech-pill {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    transition: background var(--transition);
}

.tech-pill:hover {
    background: var(--card-hover-bg);
    border-color: var(--text);
}

/* ── About ── */
#about {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px 100px;
}

.about-content {
    display: flex;
    align-items: center;
    gap: 24px;
}

.about-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.about-text {
    font-size: 16px;
    line-height: 1.7;
    color: var(--muted);
}

/* ── Contact ── */
#contact {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px 100px;
}

.contact-box {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 40px;
    border-radius: 12px;
    max-width: 600px;
}

.contact-text {
    font-size: 16px;
    color: var(--muted);
    margin-bottom: 24px;
    line-height: 1.6;
}

.contact-link {
    color: var(--text);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: var(--border);
    text-underline-offset: 4px;
    transition: text-decoration-color var(--transition);
}

.contact-link:hover {
    text-decoration-color: var(--text);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-input,
.contact-textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    outline: none;
    transition: border-color var(--transition);
}

.contact-input:focus,
.contact-textarea:focus {
    border-color: var(--text);
}

.contact-textarea {
    resize: vertical;
    min-height: 120px;
}

/* ── Footer ── */
#site-footer {
    border-top: 1px solid var(--border);
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-copy {
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    font-size: 13px;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.15s;
}

.footer-links a:hover {
    color: var(--text);
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .header-inner {
        padding: 0 20px;
    }

    .header-nav {
        gap: 20px;
    }

    #hero {
        padding: 100px 20px 60px;
        min-height: 60vh;
    }

    .hero-title {
        font-size: clamp(2.5rem, 14vw, 4rem);
    }

    #products {
        padding: 0 20px 60px;
    }

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

    #about {
        padding: 0 20px 60px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 12px;
        padding: 16px 20px;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
        flex-wrap: wrap;
    }
}
