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

:root {
    --bg:           #0d1117;
    --bg-dark:      #010409;
    --bg-card:      #161b22;
    --bg-card-h:    #1c2128;
    --accent:       #00ff41;
    --accent-dim:   rgba(0,255,65,0.08);
    --accent-glow:  rgba(0,255,65,0.25);
    --accent-border:rgba(0,255,65,0.2);
    --text:         #e6edf3;
    --text-dim:     #8b949e;
    --text-muted:   #484f58;
    --border:       #21262d;
    --border-h:     #30363d;
    --takstud:      #8b5cf6;
    --uplift:       #f97316;
    --cli:          #00ff41;
    --mono:         'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    --sans:         'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius:       14px;
    --shadow:       0 8px 32px rgba(0,0,0,0.5);
    --shadow-g:     0 0 24px rgba(0,255,65,0.12);
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* =============================================
   NAVBAR
   ============================================= */
.navbar {
    position: fixed; top: 0; width: 100%; z-index: 100;
    padding: 18px 0;
    transition: padding .3s, background .3s, border-color .3s;
}
.navbar.scrolled {
    padding: 10px 0;
    background: rgba(1,4,9,0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}
.nav-container {
    max-width: 1200px; margin: 0 auto; padding: 0 28px;
    display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
    font-family: var(--mono); font-size: 1.05rem; font-weight: 700; color: var(--accent);
    user-select: none;
}
.nav-logo .prompt { color: var(--text-dim); }
.blink-cursor { animation: blink 1s step-end infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

.nav-links { display: flex; list-style: none; gap: 28px; align-items: center; }
.nav-links a {
    font-family: var(--mono); font-size: .85rem; color: var(--text-dim);
    text-decoration: none; transition: color .2s;
}
.nav-links a:hover { color: var(--accent); }
.nav-links .nav-cta {
    color: var(--accent);
    border: 1px solid var(--accent-border);
    padding: 6px 18px; border-radius: 7px;
    transition: background .2s, box-shadow .2s;
}
.nav-links .nav-cta:hover { background: var(--accent-dim); box-shadow: var(--shadow-g); }

.menu-toggle {
    display: none; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer; padding: 4px;
}
.menu-toggle span { width: 22px; height: 2px; background: var(--accent); border-radius: 2px; transition: .3s; }

/* =============================================
   HERO
   ============================================= */
.hero {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden; background: var(--bg-dark);
}
#matrix-canvas { position: absolute; inset: 0; opacity: .05; pointer-events: none; }

.hero-content {
    position: relative; z-index: 1;
    width: 100%; max-width: 680px; padding: 24px;
    text-align: center;
}

/* Terminal */
.terminal-window {
    background: var(--bg-card);
    border: 1px solid var(--border-h);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow), var(--shadow-g);
    margin-bottom: 28px;
    text-align: left;
}
.terminal-header {
    background: #161b22;
    padding: 10px 16px;
    display: flex; align-items: center; gap: 8px;
    border-bottom: 1px solid var(--border);
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red    { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green  { background: #28c840; }
.terminal-title { margin-left: 8px; font-family: var(--mono); font-size: .78rem; color: var(--text-dim); }

.terminal-body { padding: 20px 24px 24px; }
.terminal-line { font-family: var(--mono); font-size: .88rem; color: var(--accent); margin-bottom: 4px; }
.t-prompt { color: var(--accent); }
.t-cmd { color: var(--text); margin-left: 8px; }
.t-cursor { color: var(--accent); animation: blink .8s step-end infinite; margin-left: 2px; }

.terminal-output {
    display: none; margin-top: 18px; padding-top: 18px;
    border-top: 1px solid var(--border);
}
.terminal-output.visible { display: block; animation: fadeSlide .4s ease; }
@keyframes fadeSlide { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }

.out-line { display: flex; gap: 10px; font-family: var(--mono); font-size: .84rem; margin-bottom: 9px; align-items: baseline; }
.out-key  { color: var(--text-dim); min-width: 56px; }
.out-sep  { color: var(--text-muted); }
.out-val  { color: var(--text); }
.out-online { color: var(--accent); display: flex; align-items: center; gap: 6px; }
.out-online i { font-size: .5rem; animation: pulse-dot 2s infinite; }
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:.4} }

/* Hero actions */
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 13px 26px; border-radius: 9px; text-decoration: none;
    font-family: var(--mono); font-size: .9rem; font-weight: 600;
    transition: transform .25s, box-shadow .25s, background .25s;
}
.btn-primary { background: var(--accent); color: var(--bg-dark); }
.btn-primary:hover { background: #00d836; transform: translateY(-3px); box-shadow: 0 8px 28px rgba(0,255,65,.35); }
.btn-outline { background: transparent; color: var(--accent); border: 1px solid var(--accent-border); }
.btn-outline:hover { background: var(--accent-dim); transform: translateY(-3px); box-shadow: var(--shadow-g); }

.scroll-hint {
    position: absolute; bottom: 30px; left: 50%;
    transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    animation: bounce 2.2s ease-in-out infinite;
    opacity: .5;
}
.scroll-hint span { font-family: var(--mono); font-size: .7rem; color: var(--text-dim); letter-spacing: .1em; }
.scroll-arrow {
    width: 18px; height: 18px;
    border-right: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
    transform: rotate(45deg);
}
@keyframes bounce { 0%,100%{transform:translateX(-50%) translateY(0)} 50%{transform:translateX(-50%) translateY(7px)} }

/* =============================================
   SECTIONS
   ============================================= */
.section { padding: 96px 0; }
.section-dark { background: var(--bg-dark); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 28px; }

.section-header { text-align: center; margin-bottom: 60px; }
.section-tag {
    display: inline-block; font-family: var(--mono); font-size: .78rem;
    color: var(--accent); background: var(--accent-dim);
    border: 1px solid var(--accent-border);
    padding: 4px 14px; border-radius: 5px; margin-bottom: 14px;
}
.section-header h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.section-sub { margin-top: 10px; font-size: .95rem; color: var(--text-dim); }

/* =============================================
   ABOUT
   ============================================= */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }

.about-text p { color: var(--text-dim); font-size: 1.02rem; margin-bottom: 16px; line-height: 1.78; }
.about-text strong { color: var(--text); font-weight: 700; }

.about-quote {
    font-family: var(--mono); font-size: .9rem; color: var(--accent);
    border-left: 2px solid var(--accent); padding-left: 16px;
    margin: 24px 0; font-style: italic; opacity: .8;
}
.about-badges { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; background: var(--accent-dim);
    border: 1px solid var(--accent-border);
    color: var(--accent); border-radius: 20px;
    font-size: .78rem; font-family: var(--mono);
}

.about-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px 18px;
    display: flex; align-items: center; gap: 14px;
    transition: border-color .3s, transform .3s, box-shadow .3s;
}
.stat-card:hover { border-color: var(--accent-border); transform: translateY(-3px); box-shadow: var(--shadow-g); }
.stat-icon {
    width: 46px; height: 46px; min-width: 46px;
    background: var(--accent-dim); border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; color: var(--accent);
}
.stat-num { font-size: 1.8rem; font-weight: 900; font-family: var(--mono); color: var(--accent); line-height: 1; }
.stat-label { font-size: .78rem; color: var(--text-dim); margin-top: 3px; }

/* =============================================
   SKILLS
   ============================================= */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.skill-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px 18px; transition: border-color .3s, transform .3s, box-shadow .3s;
}
.skill-card:hover { border-color: var(--accent-border); transform: translateY(-4px); box-shadow: var(--shadow-g); }
.skill-icon {
    font-size: 1.9rem; color: var(--accent); margin-bottom: 10px;
    font-family: var(--mono); font-weight: 700; line-height: 1; height: 32px;
    display: flex; align-items: center;
}
.sk-kotlin,.sk-c { font-size: 1.6rem; }
.sk-fire { font-size: 1.6rem; }
.skill-name { font-size: .85rem; font-weight: 700; color: var(--text); margin-bottom: 10px; font-family: var(--mono); }
.skill-bar { height: 4px; background: var(--border-h); border-radius: 2px; overflow: hidden; }
.skill-fill {
    height: 100%; background: linear-gradient(90deg, var(--accent), #00cc35);
    border-radius: 2px; width: 0;
    transition: width 1.6s cubic-bezier(.4,0,.2,1) .1s;
}
.skill-fill.animate { width: var(--w); }
.skill-pct { font-family: var(--mono); font-size: .75rem; color: var(--text-muted); margin-top: 6px; text-align: right; }

/* =============================================
   PROJECTS
   ============================================= */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 22px; }

.project-card {
    position: relative;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 18px;
    overflow: hidden; display: flex; flex-direction: column;
    transition: transform .3s, border-color .3s, box-shadow .3s;
}
.project-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.project-card[data-color="takstud"]:hover { border-color: rgba(139,92,246,.4); box-shadow: 0 8px 36px rgba(139,92,246,.15); }
.project-card[data-color="uplift"]:hover  { border-color: rgba(249,115,22,.4); box-shadow: 0 8px 36px rgba(249,115,22,.15); }
.project-card[data-color="cli"]:hover     { border-color: rgba(0,255,65,.3);   box-shadow: 0 8px 36px rgba(0,255,65,.12); }

.project-glow {
    position: absolute; top: 0; left: 0; right: 0; height: 2px;
    opacity: 0; transition: opacity .3s;
}
.project-card[data-color="takstud"] .project-glow { background: linear-gradient(90deg, transparent, #8b5cf6, transparent); }
.project-card[data-color="uplift"]  .project-glow { background: linear-gradient(90deg, transparent, #f97316, transparent); }
.project-card[data-color="cli"]     .project-glow { background: linear-gradient(90deg, transparent, #00ff41, transparent); }
.project-card:hover .project-glow { opacity: 1; }

.project-header { padding: 24px 24px 0; display: flex; justify-content: space-between; align-items: flex-start; }
.project-icon {
    width: 58px; height: 58px; border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: #fff;
}
.takstud-icon { background: linear-gradient(135deg, #6d28d9, #8b5cf6); }
.uplift-icon  { background: linear-gradient(135deg, #ea580c, #f97316); }
.cli-icon     { background: linear-gradient(135deg, #005c1e, #00aa2c); color: var(--accent); }

.project-badge {
    display: flex; align-items: center; gap: 6px;
    font-family: var(--mono); font-size: .72rem; color: var(--accent);
    background: var(--accent-dim); border: 1px solid var(--accent-border);
    padding: 4px 10px; border-radius: 20px;
}
.dot-pulse {
    width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
    animation: pulse 2.2s infinite;
}
@keyframes pulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(0,255,65,.5); }
    50%      { box-shadow: 0 0 0 6px rgba(0,255,65,0); }
}

.project-body { padding: 18px 24px; flex: 1; }
.project-platform { font-family: var(--mono); font-size: .75rem; color: var(--text-dim); margin-bottom: 8px; }
.project-platform i { margin-right: 5px; }
.project-body h3 { font-size: 1.45rem; font-weight: 800; color: var(--text); margin-bottom: 4px; letter-spacing: -.01em; }
.project-sub { font-family: var(--mono); font-size: .8rem; color: var(--accent); opacity: .8; margin-bottom: 14px; }
.project-desc { font-size: .9rem; color: var(--text-dim); line-height: 1.7; margin-bottom: 16px; }

.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.tag {
    font-size: .73rem; font-family: var(--mono);
    padding: 3px 10px; background: var(--bg);
    border: 1px solid var(--border-h); border-radius: 5px; color: var(--text-muted);
}

.project-features { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.project-features li { font-size: .84rem; color: var(--text-dim); display: flex; align-items: center; gap: 9px; }
.project-features li i { color: var(--accent); font-size: .72rem; flex-shrink: 0; }

.project-actions {
    padding: 18px 24px;
    border-top: 1px solid var(--border);
    display: flex; gap: 10px;
}
.btn-dl {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 10px 16px; background: var(--accent); color: var(--bg-dark);
    text-decoration: none; border-radius: 9px;
    font-family: var(--mono); font-size: .83rem; font-weight: 700;
    transition: background .25s, transform .25s, box-shadow .25s;
}
.btn-dl:hover { background: #00d836; transform: translateY(-2px); box-shadow: 0 5px 18px rgba(0,255,65,.3); }
.btn-gh {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 10px 16px; background: transparent;
    color: var(--text-dim); border: 1px solid var(--border-h);
    text-decoration: none; border-radius: 9px;
    font-family: var(--mono); font-size: .83rem;
    transition: all .25s;
}
.btn-gh:hover { border-color: var(--accent-border); color: var(--text); background: var(--accent-dim); }

/* =============================================
   EDUCATION / TIMELINE
   ============================================= */
.timeline { position: relative; max-width: 760px; margin: 0 auto; }
.timeline::before {
    content: ''; position: absolute;
    left: 27px; top: 0; bottom: 0; width: 2px;
    background: linear-gradient(to bottom, var(--accent) 60%, transparent);
}
.timeline-item { display: flex; gap: 24px; margin-bottom: 36px; }

.tl-icon {
    width: 56px; height: 56px; min-width: 56px; border-radius: 50%;
    background: var(--bg-card); border: 2px solid var(--border-h);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; color: var(--text-dim); z-index: 1;
    transition: border-color .3s, color .3s;
}
.tl-icon.current { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 12px rgba(0,255,65,.2); }

.tl-content {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 22px 24px; flex: 1;
    transition: border-color .3s, box-shadow .3s;
}
.tl-content:hover { border-color: var(--accent-border); box-shadow: var(--shadow-g); }

.tl-tag {
    display: inline-block; font-family: var(--mono); font-size: .73rem;
    color: var(--text-dim); background: var(--bg);
    border: 1px solid var(--border-h); padding: 2px 10px;
    border-radius: 5px; margin-bottom: 10px;
}
.current-tag { color: var(--accent); background: var(--accent-dim); border-color: var(--accent-border); }

.tl-content h3 { font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.tl-org { display: block; font-family: var(--mono); font-size: .82rem; color: var(--accent); opacity: .75; margin-bottom: 10px; }
.tl-org i { margin-right: 5px; }
.tl-content p { font-size: .88rem; color: var(--text-dim); line-height: 1.68; }

/* =============================================
   CONTACT
   ============================================= */
.contact-grid { display: flex; flex-direction: column; gap: 12px; max-width: 600px; margin: 0 auto; }
.contact-card {
    display: flex; align-items: center; gap: 16px; padding: 16px 20px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); text-decoration: none;
    transition: border-color .3s, transform .3s, box-shadow .3s;
}
.contact-card:hover { border-color: var(--accent-border); transform: translateX(5px); box-shadow: var(--shadow-g); }
.cc-icon {
    width: 46px; height: 46px; min-width: 46px; border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; color: #fff;
}
.cc-icon.gmail   { background: linear-gradient(135deg,#ea4335,#c5221f); }
.cc-icon.linkedin{ background: linear-gradient(135deg,#0077b5,#005885); }
.cc-icon.github  { background: linear-gradient(135deg,#333,#24292e); }
.cc-info { flex: 1; }
.cc-platform { font-size: .72rem; font-family: var(--mono); color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.cc-handle   { font-size: .92rem; font-weight: 600; color: var(--text); font-family: var(--mono); margin-top: 2px; }
.cc-arrow { color: var(--text-muted); font-size: .85rem; transition: color .3s, transform .3s; }
.contact-card:hover .cc-arrow { color: var(--accent); transform: translateX(4px); }

/* =============================================
   FOOTER
   ============================================= */
.footer { background: var(--bg-dark); border-top: 1px solid var(--border); padding: 44px 0; }
.footer-inner { text-align: center; }
.footer-logo { font-family: var(--mono); font-size: 1.15rem; font-weight: 700; color: var(--accent); margin-bottom: 10px; }
.footer-logo .prompt { color: var(--text-dim); }
.footer-quote { font-family: var(--mono); font-size: .83rem; color: var(--text-dim); font-style: italic; margin-bottom: 10px; }
.footer-copy { font-size: .78rem; color: var(--text-muted); }
.footer-copy i { color: #f85149; margin: 0 2px; }

/* =============================================
   SCROLL ANIMATIONS
   ============================================= */
.fade-in {
    opacity: 0; transform: translateY(28px);
    transition: opacity .65s cubic-bezier(.4,0,.2,1), transform .65s cubic-bezier(.4,0,.2,1);
}
.fade-in.visible { opacity: 1; transform: none; }

/* staggered children */
.projects-grid .project-card.fade-in:nth-child(1) { transition-delay: 0s; }
.projects-grid .project-card.fade-in:nth-child(2) { transition-delay: .1s; }
.projects-grid .project-card.fade-in:nth-child(3) { transition-delay: .2s; }
.about-stats .stat-card { transition: all .3s; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
    .about-grid { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-links.open {
        display: flex; flex-direction: column; position: fixed;
        top: 58px; left: 0; width: 100%;
        background: rgba(1,4,9,.96); backdrop-filter: blur(16px);
        padding: 24px 28px; border-bottom: 1px solid var(--border);
        gap: 20px; z-index: 99;
    }
    .menu-toggle { display: flex; }
    .projects-grid { grid-template-columns: 1fr; }
    .hero-content { padding: 90px 16px 24px; }
    .terminal-body { padding: 16px; }
    .out-line { flex-wrap: wrap; }
}
@media (max-width: 540px) {
    .about-stats { grid-template-columns: 1fr 1fr; }
    .skills-grid  { grid-template-columns: 1fr 1fr; }
    .hero-actions { flex-direction: column; }
    .btn { justify-content: center; }
    .project-actions { flex-direction: column; }
    .btn-dl, .btn-gh { width: 100%; }
}
