/* ===== CSS Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #0b0f1a;
    color: #e4e8f1;
    line-height: 1.6;
    overflow-x: hidden;
}
a { color: #c9a84c; text-decoration: none; transition: color 0.2s ease; }
a:hover, a:focus { color: #dfc267; outline: 2px solid #c9a84c; outline-offset: 2px; }
img, svg { max-width: 100%; display: block; }
ul { list-style: none; }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; }

/* ===== Container ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Skip Link ===== */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: #c9a84c;
    color: #0b0f1a;
    padding: 8px 16px;
    z-index: 999;
    font-weight: 700;
}
.skip-link:focus { top: 0; }

/* ===== Header ===== */
.site-header {
    background: #121726;
    border-bottom: 2px solid #2a3040;
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.6rem;
    font-weight: 800;
    color: #e4e8f1;
}
.brand-icon { font-size: 2rem; }
.brand-text { letter-spacing: -0.5px; }

/* ===== Navigation ===== */
.primary-nav { display: flex; align-items: center; }
.nav-toggle { display: none; background: none; border: none; padding: 8px; cursor: pointer; }
.hamburger { display: block; width: 28px; height: 3px; background: #e4e8f1; position: relative; transition: background 0.2s; }
.hamburger::before, .hamburger::after { content: ''; position: absolute; width: 100%; height: 100%; background: #e4e8f1; left: 0; transition: transform 0.3s; }
.hamburger::before { top: -9px; }
.hamburger::after { top: 9px; }
.nav-toggle[aria-expanded="true"] .hamburger { background: transparent; }
.nav-toggle[aria-expanded="true"] .hamburger::before { transform: translateY(9px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .hamburger::after { transform: translateY(-9px) rotate(-45deg); }
.nav-menu {
    display: flex;
    gap: 28px;
    align-items: center;
}
.nav-menu a {
    font-size: 0.95rem;
    font-weight: 500;
    padding: 4px 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s;
}
.nav-menu a:hover, .nav-menu a:focus { border-bottom-color: #c9a84c; }
.nav-sep { border-left: 2px solid #2a3040; padding-left: 16px; }
@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #121726;
        flex-direction: column;
        gap: 0;
        padding: 16px 24px;
        border-top: 2px solid #2a3040;
    }
    .nav-menu.open { display: flex; }
    .nav-menu a { display: block; padding: 12px 0; border: none; width: 100%; }
    .nav-sep { border-left: none; padding-left: 0; }
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    font-weight: 700;
    font-size: 1rem;
    padding: 14px 36px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    border: 2px solid transparent;
    text-align: center;
}
.btn-primary {
    background: #c9a84c;
    color: #0b0f1a;
    border-color: #c9a84c;
}
.btn-primary:hover, .btn-primary:focus {
    background: #dfc267;
    border-color: #dfc267;
    color: #0b0f1a;
}

/* ===== Hero ===== */
.hero {
    padding: 100px 0 80px;
    background: linear-gradient(135deg, #0b0f1a 0%, #161e30 100%);
}
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}
.hero-title {
    font-size: 3.2rem;
    color: #ffffff;
    letter-spacing: -1px;
}
.accent { color: #c9a84c; }
.hero-sub { font-size: 1.2rem; color: #b0b9d0; margin: 20px 0 32px; max-width: 480px; }
.code-window {
    background: #1a2238;
    padding: 24px;
    border-radius: 12px;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 1rem;
    color: #cbd5e1;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    border: 1px solid #2a3040;
}
.code-line { margin-bottom: 6px; }
.indent { padding-left: 16px; }
.indent2 { padding-left: 32px; }
.kw { color: #c9a84c; }
.type { color: #7dd3fc; }
.lit { color: #fbbf24; }
.str { color: #86efac; }
.fn { color: #a78bfa; }
@media (max-width: 768px) {
    .hero-grid { grid-template-columns: 1fr; gap: 40px; }
    .hero-title { font-size: 2.4rem; }
    .code-window { font-size: 0.85rem; }
}

/* ===== Sections ===== */
.section {
    padding: 80px 0;
}
.section-title {
    font-size: 2.2rem;
    margin-bottom: 48px;
    text-align: center;
    color: #ffffff;
}
.section-title.left { text-align: left; }

/* Work Cards */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}
.card {
    background: #1a2238;
    border-radius: 12px;
    padding: 32px 24px;
    border: 1px solid #2a3040;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 16px 32px rgba(0,0,0,0.5); }
.card-icon { font-size: 2.4rem; margin-bottom: 16px; }
.card h3 { font-size: 1.3rem; color: #ffffff; margin-bottom: 12px; }
.card p { color: #b0b9d0; font-size: 0.98rem; }
@media (max-width: 900px) {
    .grid-3 { grid-template-columns: 1fr; }
}

/* Expertise */
.expertise-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}
.expertise-item {
    background: #121726;
    padding: 32px;
    border-radius: 12px;
    border-left: 6px solid #c9a84c;
}
.ex-num { font-size: 2rem; font-weight: 800; color: #c9a84c; opacity: 0.7; display: block; margin-bottom: 8px; }
.expertise-item h3 { font-size: 1.3rem; color: #ffffff; margin-bottom: 10px; }
.expertise-item p { color: #b0b9d0; }
@media (max-width: 700px) {
    .expertise-grid { grid-template-columns: 1fr; }
}

/* Stats */
.stats {
    background: #121726;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
    text-align: center;
}
.stat-number {
    font-size: 3.2rem;
    font-weight: 800;
    color: #c9a84c;
    display: inline;
}
.stat-suffix { font-size: 2rem; font-weight: 700; color: #c9a84c; }
.stat-label { display: block; font-size: 1rem; color: #b0b9d0; margin-top: 8px; }
@media (max-width: 700px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Contact */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}
.contact-details { margin-top: 20px; }
.contact-details li { margin-bottom: 12px; color: #b0b9d0; }
.contact-details strong { color: #ffffff; }
.contact-details a { color: #c9a84c; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; color: #e4e8f1; }
.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    background: #1a2238;
    border: 2px solid #2a3040;
    border-radius: 6px;
    color: #e4e8f1;
    transition: border-color 0.2s;
}
.form-group input:focus, .form-group textarea:focus { border-color: #c9a84c; outline: none; }
.form-group textarea { resize: vertical; }
@media (max-width: 768px) {
    .contact-layout { grid-template-columns: 1fr; }
}

/* ===== Footer ===== */
.site-footer {
    background: #0b0f1a;
    border-top: 2px solid #2a3040;
    padding: 32px 0;
    margin-top: 40px;
}
.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.footer-brand { font-size: 1.3rem; font-weight: 700; color: #e4e8f1; display: flex; align-items: center; gap: 8px; }
.footer-links { display: flex; gap: 24px; }
.footer-links a { font-size: 0.95rem; }
.footer-legal { font-size: 0.85rem; color: #7a83a0; }

/* ===== Legal Pages ===== */
.legal-page {
    padding-top: 60px;
    padding-bottom: 80px;
}
.legal-container {
    max-width: 800px;
    margin: 0 auto;
}
.legal-title {
    font-size: 2.4rem;
    color: #ffffff;
    margin-bottom: 8px;
}
.legal-updated {
    color: #7a83a0;
    margin-bottom: 32px;
    font-size: 0.95rem;
}
.legal-container h2 {
    font-size: 1.5rem;
    color: #ffffff;
    margin-top: 36px;
    margin-bottom: 14px;
}
.legal-container p {
    font-size: 1rem;
    color: #c8ccdb;
    margin-bottom: 16px;
    line-height: 1.7;
}
.legal-container ul {
    list-style: disc;
    padding-left: 24px;
    margin-bottom: 16px;
}
.legal-container li {
    font-size: 1rem;
    color: #c8ccdb;
    margin-bottom: 8px;
    line-height: 1.6;
}

/* ===== Animations ===== */
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ===== Responsive fallbacks ===== */
@media (max-width: 480px) {
    .hero-title { font-size: 2rem; }
    .section-title { font-size: 1.8rem; }
    .stat-number { font-size: 2.4rem; }
    .container { padding: 0 16px; }
}