/* =========================================================
   THEME VARIABLES (OPAQUE SURFACES — NO BLEED-THROUGH)
   ========================================================= */

:root {
    --bg: #0b1220;

    /* SOLID surfaces */
    --panel: #111a2b;
    --panel2: #16213a;

    --text: #e5e7eb;
    --muted: #c7cbd6;
    --muted2: #9aa3b2;
    --border: #27324a;

    --shadow: 0 18px 36px rgba(0, 0, 0, 0.45);

    --accentA: #ff6fae;
    --accentB: #7c4dff;

    --radius: 20px;
    --radius2: 24px;
    --max: 1120px;

    --focus: 0 0 0 3px rgba(124, 77, 255, .35);
}

/* LIGHT MODE */
[data-theme="light"] {
    --bg: #f5f7fb;

    --panel: #ffffff;
    --panel2: #f2f4f8;

    --text: #111827;
    --muted: #374151;
    --muted2: #6b7280;
    --border: #e5e7eb;

    --shadow: 0 16px 32px rgba(0, 0, 0, 0.12);

    --focus: 0 0 0 3px rgba(124, 77, 255, .25);
}

/* =========================================================
   BASE
   ========================================================= */

* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
    background:
        radial-gradient(1200px 600px at 80% 0%, rgba(255, 111, 174, .18), transparent 60%),
        radial-gradient(900px 500px at 10% 20%, rgba(124, 77, 255, .16), transparent 55%),
        var(--bg);
    color: var(--text);
    line-height: 1.55;
}

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

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace
}

.container {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 20px;
}

/* Accessibility */
.skip-link {
    position: absolute;
    left: -999px;
}

.skip-link:focus {
    left: 16px;
    top: 16px;
    padding: 10px 14px;
    background: var(--panel2);
    border-radius: 12px;
    box-shadow: var(--focus);
    z-index: 9999;
}

/* =========================================================
   HEADER / NAV
   ========================================================= */

header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
    background: linear-gradient(to bottom, rgba(0, 0, 0, .4), rgba(0, 0, 0, 0));
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="light"] header {
    background: linear-gradient(to bottom, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0));
    border-bottom: 1px solid var(--border);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand .logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accentA), var(--accentB));
    display: grid;
    place-items: center;
    box-shadow: 0 10px 22px rgba(0, 0, 0, .35);
}

.brand .logo svg {
    width: 100%;
    height: 100%
}

.brand .name {
    font-weight: 800
}

.brand .tag {
    font-size: 12px;
    color: var(--muted2)
}

.navlinks {
    display: flex;
    gap: 10px;
    align-items: center;
}

.navlinks a {
    padding: 10px 14px;
    border-radius: 14px;
    color: var(--muted);
}

.navlinks a:hover,
.navlinks a[aria-current="page"] {
    background: var(--panel2);
    color: var(--text);
}

/* =========================================================
   BUTTON SYSTEM (UNIFIED)
   ========================================================= */

.btn,
.iconbtn {
    height: 44px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 500;
}

.btn {
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    cursor: pointer;
}

.btn:hover {
    background: var(--panel2)
}

.btn:focus {
    outline: none;
    box-shadow: var(--focus)
}

.btn.primary {
    border: none;
    background: linear-gradient(135deg, var(--accentA), var(--accentB));
    color: white;
    box-shadow: 0 12px 26px rgba(0, 0, 0, .4);
}

.iconbtn {
    width: 44px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    background: var(--panel);
}

/* =========================================================
   LAYOUT
   ========================================================= */

main {
    padding: 36px 0 72px
}

.hero {
    display: grid;
    grid-template-columns: 1.25fr .75fr;
    gap: 26px;
}

@media(max-width:900px) {
    .hero {
        grid-template-columns: 1fr
    }
}

/* =========================================================
   CARDS (FULLY OPAQUE — FIXED)
   ========================================================= */

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius2);
    box-shadow: var(--shadow);
}

.card.pad {
    padding: 26px
}

.mini.card.pad {
    box-shadow: none
}

/* =========================================================
   TYPOGRAPHY
   ========================================================= */

h1 {
    margin: 14px 0 10px;
    font-size: clamp(34px, 4.2vw, 52px);
    line-height: 1.05;
}

.page-title {
    font-size: 24px
}

.page-hero {
    font-size: clamp(30px, 4vw, 44px)
}

.lead {
    color: var(--muted);
    max-width: 62ch;
}

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--panel2);
    border-radius: 999px;
    font-size: 13px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accentA), var(--accentB));
}

/* =========================================================
   PROJECTS
   ========================================================= */

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

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

@media(max-width:680px) {
    .project-grid {
        grid-template-columns: 1fr
    }
}

.project {
    display: flex;
    flex-direction: column;
    transition: transform .15s ease;
}

.project:hover {
    transform: translateY(-2px)
}

.project img {
    width: 100%;
    display: block
}

.project .body {
    padding: 16px
}

.project h3 {
    margin: 0 0 6px
}

.project p {
    color: var(--muted)
}

.stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge {
    font-size: 12px;
    padding: 7px 9px;
    border-radius: 999px;
    background: var(--panel2);
    border: 1px solid var(--border);
    color: var(--muted);
}

.project .actions {
    padding: 0 16px 16px;
    display: flex;
    gap: 10px;
}

/* =========================================================
   FORMS
   ========================================================= */

.input,
.select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
}

.input:focus,
textarea:focus {
    outline: none;
    box-shadow: var(--focus);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media(max-width:780px) {
    .form-grid {
        grid-template-columns: 1fr
    }
}

/* =========================================================
   MODAL (OPAQUE)
   ========================================================= */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .75);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-backdrop[aria-hidden="false"] {
    display: flex
}

.modal {
    background: var(--bg);
    border-radius: 24px;
    border: 1px solid var(--border);
    width: min(920px, 100%);
    max-height: 85vh;
    overflow: auto;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .6);
}

.modal-top {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
}

.modal .inner {
    padding: 18px
}

/* =========================================================
   FOOTER
   ========================================================= */

footer {
    border-top: 1px solid var(--border);
    padding: 26px 0;
    color: var(--muted2);
}

.footer-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

/* Home: Tech stack grouping */
.stack-card {
    margin-top: 18px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--panel2);
}

.stack-title {
    font-weight: 700;
    letter-spacing: .2px;
    margin-bottom: 12px;
}

.stack-groups {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width:780px) {
    .stack-groups {
        grid-template-columns: 1fr;
    }
}

.stack-group {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px;
}

.stack-label {
    font-size: 12px;
    color: var(--muted2);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    font-size: 12px;
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--panel2);
    color: var(--muted);
}

/* ===== Technical Snapshot ===== */
.tech-list {
    list-style: none;
    padding-left: 0;
    margin-top: 12px;
}

.tech-list li {
    margin-bottom: 8px;
    line-height: 1.5;
}