/* ========== Tokens ========== */
:root {
    --bg: #10121a;
    --bg-panel: #171a24;
    --bg-panel-alt: #1d212c;
    --border: #2a2e3d;
    --text: #e7e7ec;
    --text-muted: #8b8fa3;
    --amber: #e9a23b;
    --amber-soft: rgba(233, 162, 59, 0.12);
    --teal: #5fd3c4;
    --pink: #e85d75;
    --font-display: "Space Grotesk", sans-serif;
    --font-mono: "JetBrains Mono", monospace;
    --font-body: "Inter", sans-serif;
    --radius: 14px;
    --max-width: 1120px;
}

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

html { scroll-behavior: smooth; }

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

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

::selection { background: var(--amber); color: #10121a; }

/* subtle code-grid ambience */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(233, 162, 59, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(233, 162, 59, 0.035) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    z-index: 0;
}

section, nav, footer { position: relative; z-index: 1; }

/* ========== Ambient moving background ========== */
.bg-orbs {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.22;
    will-change: transform;
}
.orb-amber {
    width: 420px; height: 420px;
    background: var(--amber);
    top: -10%; left: -8%;
    animation: drift1 26s ease-in-out infinite;
}
.orb-teal {
    width: 380px; height: 380px;
    background: var(--teal);
    bottom: -12%; right: -6%;
    animation: drift2 32s ease-in-out infinite;
}
.orb-pink {
    width: 300px; height: 300px;
    background: var(--pink);
    top: 40%; left: 55%;
    animation: drift3 22s ease-in-out infinite;
}
@keyframes drift1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(120px, 80px) scale(1.15); }
}
@keyframes drift2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-100px, -60px) scale(1.1); }
}
@keyframes drift3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-80px, 100px) scale(0.9); }
}

/* ========== Scroll progress ========== */
.scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--amber), var(--teal));
    z-index: 1000;
    transition: width 0.1s linear;
}

/* ========== Nav ========== */
nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 900;
    background: rgba(16, 18, 26, 0.75);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, background 0.3s ease;
}
nav.scrolled { border-bottom-color: var(--border); }

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
}
.logo span { color: var(--amber); }

.nav-links {
    display: flex;
    gap: 32px;
    font-family: var(--font-mono);
    font-size: 0.88rem;
}

.nav-link {
    position: relative;
    color: var(--text-muted);
    transition: color 0.25s ease;
    padding-bottom: 4px;
}
.nav-link::after {
    content: "";
    position: absolute;
    left: 0; bottom: 0;
    width: 0%;
    height: 2px;
    background: var(--amber);
    transition: width 0.25s ease;
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}
.nav-toggle span {
    width: 22px;
    height: 2px;
    background: var(--text);
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ========== Editor chrome (shared) ========== */
.editor-chrome {
    display: flex;
    align-items: center;
    gap: 7px;
    background: var(--bg-panel-alt);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 11px 16px;
}
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-red { background: #e8635d; }
.dot-yellow { background: #e9b64d; }
.dot-green { background: #5fbf6f; }
.chrome-title {
    margin-left: 8px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ========== Hero ========== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 110px 24px 60px;
}

.hero-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 48px;
    align-items: start;
    width: 100%;
}

.hero-visual { position: relative; }

.hero-image {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    overflow: hidden;
    aspect-ratio: 4 / 5;
    background: var(--bg-panel);
}
.hero-image .slide {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.1s ease;
}
.hero-image .slide.active { opacity: 1; }
.hero-image .slide.broken { display: none; }

.avatar-fallback {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 700;
    color: var(--bg);
    background: linear-gradient(135deg, var(--amber), var(--teal));
}
.hero-image.broken .avatar-fallback { display: flex; }
.hero-image.broken .slide { display: none; }

.slide-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
}
.slide-dots button {
    width: 7px; height: 7px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: var(--border);
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease;
}
.slide-dots button.active {
    background: var(--amber);
    transform: scale(1.3);
}

.status-chip {
    position: absolute;
    bottom: -18px;
    right: 18px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 14px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.pulse-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #5fbf6f;
    box-shadow: 0 0 0 0 rgba(95,191,111,0.6);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(95,191,111,0.55); }
    70% { box-shadow: 0 0 0 8px rgba(95,191,111,0); }
    100% { box-shadow: 0 0 0 0 rgba(95,191,111,0); }
}

.code-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 28px 30px 32px;
}

.code-comment {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--teal);
    margin-bottom: 14px;
}

.hero-name {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 5vw, 3.4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.08;
    margin-bottom: 14px;
}

.hero-role {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    color: var(--amber);
    margin-bottom: 20px;
    min-height: 1.4em;
}
.prompt { color: var(--teal); margin-right: 6px; }
.cursor { animation: blink 1s step-end infinite; color: var(--amber); }
@keyframes blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

.hero-desc {
    color: var(--text-muted);
    max-width: 46ch;
    margin-bottom: 28px;
}

.buttons { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }

.btn {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 13px 22px;
    border-radius: 8px;
    border: 1px solid transparent;
    display: inline-block;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn-primary {
    background: var(--amber);
    color: #171308;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(233, 162, 59, 0.28);
}
.btn-outline {
    border-color: var(--border);
    color: var(--text);
    background: transparent;
}
.btn-outline:hover {
    border-color: var(--teal);
    color: var(--teal);
    transform: translateY(-2px);
}
.btn-small { padding: 9px 16px; font-size: 0.78rem; }

.stack-row { display: flex; gap: 10px; flex-wrap: wrap; }
.stack-pill {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 5px 12px;
    border-radius: 999px;
}

.scroll-cue {
    position: absolute;
    bottom: 26px;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    padding-top: 6px;
}
.scroll-cue span {
    width: 4px; height: 8px;
    background: var(--amber);
    border-radius: 2px;
    animation: scrollcue 1.6s ease infinite;
}
@keyframes scrollcue {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(10px); }
}

/* ========== Sections ========== */
.section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 110px 24px;
}
.section-alt { background: var(--bg-panel); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-alt.section { max-width: 100%; }
.section-alt > * { max-width: calc(var(--max-width) - 48px); margin-left: auto; margin-right: auto; }

.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--teal);
    margin-bottom: 10px;
}
.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 3.4vw, 2.6rem);
    font-weight: 700;
    margin-bottom: 40px;
    letter-spacing: -0.02em;
}

/* About */
.about-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 48px;
}
.about-text { color: var(--text-muted); font-size: 1.05rem; }
.about-facts {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    border-left: 1px solid var(--border);
    padding-left: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.about-facts li span {
    display: block;
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

/* Skills */
.skill-container {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}
.skill-tag {
    font-family: var(--font-mono);
    font-size: 0.92rem;
    background: var(--bg-panel-alt);
    border: 1px solid var(--border);
    padding: 12px 18px;
    border-radius: 8px;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.tag-bracket { color: var(--amber); }
.skill-tag:hover {
    transform: translateY(-4px);
    border-color: var(--teal);
    box-shadow: 0 10px 24px rgba(95, 211, 196, 0.14);
}

/* Projects */
.projects {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 26px;
}
.project-card {
    background: var(--bg-panel);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.project-card:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(0,0,0,0.35); }
.project-body { padding: 24px 26px 28px; border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius) var(--radius); }
.project-body h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    margin-bottom: 10px;
}
.project-body p { color: var(--text-muted); font-size: 0.94rem; margin-bottom: 16px; }

.video-frame {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    margin-bottom: 18px;
    background: #000;
}
.project-video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.project-body .stack-row { margin-bottom: 18px; }
.project-card-pending { opacity: 0.7; }
.project-card-pending:hover { transform: none; box-shadow: none; }
.pending-output {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Resume */
.resume-text { color: var(--text-muted); margin-bottom: 26px; max-width: 50ch; }

/* Contact */
.contact-code {
    font-family: var(--font-mono);
    font-size: 0.98rem;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px 34px;
    line-height: 2.1;
    overflow-x: auto;
}
.kw { color: var(--pink); }
.var { color: var(--teal); }
.key { color: var(--amber); margin-left: 24px; }
.val { color: #b7d9c8; border-bottom: 1px dashed transparent; transition: border-color 0.2s ease, color 0.2s ease; }
.val:hover { color: var(--teal); border-color: var(--teal); }

/* Footer */
footer {
    text-align: center;
    padding: 34px 24px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

/* ========== Reveal animation ========== */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
    .reveal { opacity: 1; transform: none; }
}

/* ========== Responsive ========== */
@media (max-width: 900px) {
    .hero-inner { grid-template-columns: 1fr; }
    .hero-visual { max-width: 320px; margin: 0 auto; }
    .about-grid { grid-template-columns: 1fr; }
    .about-facts { border-left: none; border-top: 1px solid var(--border); padding-left: 0; padding-top: 20px; }
    .projects { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .nav-links {
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--bg-panel);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease;
    }
    .nav-links.open { max-height: 320px; }
    .nav-links li { border-top: 1px solid var(--border); }
    .nav-links li a { display: block; padding: 16px 24px; }
    .nav-toggle { display: flex; }
    .section { padding: 80px 20px; }
    .code-panel { padding: 22px 20px 26px; }
    .contact-code { padding: 22px 18px; font-size: 0.86rem; }
    .key { margin-left: 12px; }
}

