/* ============================================
   Indra Ferdianto — Personal Portfolio
   Modern, Clean, Professional Design
   Light & Dark Theme Support
   ============================================ */

/* ---- Theme Variables ---- */
:root {
    /* Light theme (default) */
    --bg: #fafafa;
    --bg-elevated: #ffffff;
    --bg-subtle: #f4f4f5;
    --border: #e4e4e7;
    --border-strong: #d4d4d8;
    --text: #18181b;
    --text-muted: #71717a;
    --text-subtle: #a1a1aa;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-soft: rgba(37, 99, 235, 0.08);
    --accent-2: #06b6d4;            /* cyan — gradient mid */
    --accent-3: #14b8a6;            /* teal — gradient end */
    --success: #16a34a;
    --grid-line: rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 12px 32px -8px rgba(0, 0, 0, 0.08), 0 4px 8px -4px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] {
    --bg: #0a0a0a;
    --bg-elevated: #141414;
    --bg-subtle: #1a1a1a;
    --border: #262626;
    --border-strong: #404040;
    --text: #fafafa;
    --text-muted: #a1a1aa;
    --text-subtle: #71717a;
    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --accent-soft: rgba(96, 165, 250, 0.12);
    --accent-2: #22d3ee;            /* cyan dark-mode */
    --accent-3: #2dd4bf;            /* teal dark-mode */
    --success: #4ade80;
    --grid-line: rgba(255, 255, 255, 0.035);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 32px -8px rgba(0, 0, 0, 0.5), 0 4px 8px -4px rgba(0, 0, 0, 0.3);
}

/* ---- Global reduced-motion blanket (must be early) ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- Focus-visible outlines for keyboard accessibility ---- */
*:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: inherit;
}

a:focus-visible,
button:focus-visible,
.nav-item:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 8px;
}

.btn-primary-custom:focus-visible,
.btn-outline-custom:focus-visible,
.form-control-custom:focus-visible,
.contact-row:focus-visible,
.repo-card:focus-visible,
.service-cta:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.sidebar-toggle-btn:focus-visible,
.theme-toggle-btn:focus-visible,
.back-to-top:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 8px;
}

.social-links a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 8px;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
    /* Reserve top safe area for scroll progress bar */
}

/* ============================================
   AMBIENT BACKGROUND LAYERS
   ============================================ */
/* All three layers are fixed full-viewport, low z-index, pointer-events: none */
.bg-mesh,
.bg-grid,
.bg-noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

/* Layer 1: ambient gradient mesh — slow drift */
.bg-mesh {
    background:
        radial-gradient(circle at 18% 22%, rgba(37, 99, 235, 0.08), transparent 45%),
        radial-gradient(circle at 82% 14%, rgba(6, 182, 212, 0.06), transparent 50%),
        radial-gradient(circle at 70% 85%, rgba(34, 197, 94, 0.05), transparent 55%);
    animation: meshDrift 30s ease-in-out infinite alternate;
}

[data-theme="dark"] .bg-mesh {
    background:
        radial-gradient(circle at 18% 22%, rgba(96, 165, 250, 0.10), transparent 45%),
        radial-gradient(circle at 82% 14%, rgba(34, 211, 238, 0.08), transparent 50%),
        radial-gradient(circle at 70% 85%, rgba(74, 222, 128, 0.05), transparent 55%);
}

@keyframes meshDrift {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    50%  { transform: translate3d(-20px, 30px, 0) scale(1.05); }
    100% { transform: translate3d(20px, -10px, 0) scale(1); }
}

/* Layer 2: subtle grid lines (signature element) */
.bg-grid {
    background-image:
        linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
    background-size: 80px 80px;
    background-position: -1px -1px;
    /* Mask: stronger at edges, faded center for legibility */
    -webkit-mask-image: radial-gradient(ellipse at center, transparent 30%, black 100%);
            mask-image: radial-gradient(ellipse at center, transparent 30%, black 100%);
    opacity: 0.6;
}

/* Layer 3: noise grain — adds depth, kills banding */
.bg-noise {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0   0 0 0 0 0   0 0 0 0 0   0 0 0 0.4 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
    background-size: 200px 200px;
    opacity: 0.025;
    mix-blend-mode: overlay;
}

[data-theme="dark"] .bg-noise {
    opacity: 0.04;
}

/* Make all real content sit above ambient layers */
.mobile-topbar,
.sidebar,
.main-wrapper,
.scroll-progress,
.back-to-top {
    position: relative;
    z-index: 1;
}

.sidebar { z-index: 30; }
.mobile-topbar { z-index: 40; }
.scroll-progress { z-index: 100; }

/* ============================================
   SCROLL PROGRESS BAR
   ============================================ */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--accent) 25%,
        var(--accent-2) 55%,
        var(--accent-3) 80%,
        transparent 100%);
    background-size: 200% 100%;
    background-position: 0 0;
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.6);
    transition: width 0.08s linear;
    pointer-events: none;
}

[data-theme="dark"] .scroll-progress {
    box-shadow: 0 0 16px rgba(96, 165, 250, 0.7);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover {
    color: var(--accent-hover);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); }

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100vh;
    background: linear-gradient(180deg,
        var(--bg-elevated) 0%,
        var(--bg-subtle) 100%);
    border-right: 1px solid var(--border);
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
}

[data-theme="dark"] .sidebar {
    background: linear-gradient(180deg,
        rgba(20, 20, 20, 0.92) 0%,
        rgba(15, 15, 15, 0.95) 100%);
    border-right-color: rgba(255, 255, 255, 0.06);
}

.sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 32px 24px;
}

/* Profile block */
.profile-block {
    text-align: center;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.avatar-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 16px;
}

.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--bg-elevated);
    box-shadow: var(--shadow-md);
}

.status-dot {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 14px;
    height: 14px;
    background-color: var(--success);
    border: 3px solid var(--bg-elevated);
    border-radius: 50%;
}

.profile-name {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px;
    color: var(--text);
}

.profile-role {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 12px;
    line-height: 1.5;
}

.profile-meta {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background-color: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 11px;
    color: var(--text-muted);
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.nav-item i {
    font-size: 16px;
    width: 18px;
    text-align: center;
}

.nav-item:hover {
    background-color: var(--bg-subtle);
    color: var(--text);
}

.nav-item.active {
    background-color: var(--accent-soft);
    color: var(--accent);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    background-color: var(--accent);
    border-radius: 0 3px 3px 0;
}

/* Sidebar footer */
.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border);
    margin-top: 16px;
}

.theme-toggle-wrap {
    margin-bottom: 16px;
}

.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    background-color: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    justify-content: center;
}

.theme-toggle-btn:hover {
    background-color: var(--bg);
    color: var(--text);
    border-color: var(--border-strong);
}

.icon-light, .icon-dark { font-size: 14px; }

/* Icon shows the TARGET theme (what you'll switch to on click).
   Dark active  -> show SUN  (click to go light)
   Light active -> show MOON (click to go dark) */
.icon-light, .icon-dark { display: none; }
[data-theme="dark"] .icon-light { display: inline-block; }
[data-theme="light"] .icon-dark { display: inline-block; }

.social-links {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 14px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background-color: var(--bg-subtle);
    color: var(--text-muted);
    font-size: 14px;
    transition: all 0.2s ease;
}

.social-links a:hover {
    background-color: var(--accent);
    color: #fff;
    transform: translateY(-2px);
}

.copyright {
    text-align: center;
    font-size: 11px;
    color: var(--text-subtle);
    margin: 0;
}

/* ============================================
   MOBILE TOPBAR
   ============================================ */
.mobile-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 999;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.brand-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: var(--text);
}

.brand-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent);
    border-radius: 50%;
}

.sidebar-toggle-btn,
.mobile-topbar .theme-toggle-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    background-color: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-backdrop.active {
    display: block;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: 300px;
    padding: 0 64px;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.section {
    padding: 96px 0;
    width: 100%;
    position: relative;
    border-bottom: none;
}

/* Subtle gradient fade divider — replaces hard border line */
.section:not(:last-of-type)::after {
    content: "";
    position: absolute;
    left: 5%;
    right: 5%;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--border) 20%,
        var(--border-strong) 50%,
        var(--border) 80%,
        transparent 100%);
    pointer-events: none;
}

.section:last-of-type::after {
    display: none;
}

.section-hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Section header */
.section-header {
    margin-bottom: 56px;
    position: relative;
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 16px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Decorative leading line for section labels */
.section-label::before {
    content: "";
    width: 28px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent));
}

.section-title {
    font-size: clamp(26px, 3.2vw, 40px);
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text);
    text-wrap: balance;
    max-width: 22ch;
}

/* Italic accent option for section titles (apply via class) */
.section-title em {
    font-style: italic;
    font-weight: 500;
    color: var(--text-muted);
    font-family: 'Space Grotesk', serif;
}

/* ============================================
   HERO
   ============================================ */
.section-hero {
    position: relative;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
}

/* Animated background orbs — fully inside viewport, soft blend */
.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 1;
    will-change: transform;
    /* Smooth circular fade — no hard edge */
}

.hero-orb-1 {
    width: 520px;
    height: 520px;
    background: radial-gradient(circle at center,
        rgba(37, 99, 235, 0.35) 0%,
        rgba(37, 99, 235, 0.18) 35%,
        rgba(37, 99, 235, 0) 70%);
    top: 8%;
    right: 12%;
    animation: float-orb 14s ease-in-out infinite;
}

.hero-orb-2 {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle at center,
        rgba(6, 182, 212, 0.22) 0%,
        rgba(6, 182, 212, 0.10) 40%,
        rgba(6, 182, 212, 0) 70%);
    bottom: 10%;
    right: 35%;
    animation: float-orb 18s ease-in-out infinite reverse;
}

[data-theme="dark"] .hero-orb-1 {
    background: radial-gradient(circle at center,
        rgba(96, 165, 250, 0.32) 0%,
        rgba(96, 165, 250, 0.15) 35%,
        rgba(96, 165, 250, 0) 70%);
}

[data-theme="dark"] .hero-orb-2 {
    background: radial-gradient(circle at center,
        rgba(34, 211, 238, 0.22) 0%,
        rgba(34, 211, 238, 0.10) 40%,
        rgba(34, 211, 238, 0) 70%);
}

@keyframes float-orb {
    0%, 100%   { transform: translate(0, 0) scale(1); }
    33%        { transform: translate(-30px, 40px) scale(1.05); }
    66%        { transform: translate(40px, -20px) scale(0.95); }
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px 8px 14px;
    background: linear-gradient(135deg,
        var(--bg-elevated) 0%,
        var(--bg-subtle) 100%);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 28px;
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-tag:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.pulse-dot {
    width: 7px;
    height: 7px;
    background-color: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.6); }
    70% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); }
    100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

.hero-title {
    font-size: clamp(40px, 6.5vw, 72px);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.035em;
    margin: 0 0 24px;
    color: var(--text);
    /* Optical refinement on supporting browsers */
    font-feature-settings: "ss01", "cv11";
    text-wrap: balance;
}

/* Gradient fill on accent phrases — animated shimmer */
.text-accent {
    background: linear-gradient(120deg,
        var(--accent) 0%,
        var(--accent-2) 45%,
        var(--accent-3) 75%,
        var(--accent) 100%);
        var(--accent) 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: gradientShift 8s ease-in-out infinite;
    /* Fallback color if gradient unsupported */
    background-color: var(--accent);
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

.underline-accent {
    position: relative;
    white-space: nowrap;
    display: inline-block;
}

/* Hand-drawn animated underline (SVG-style stroke) */
.underline-accent::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 2px;
    height: 10px;
    background: linear-gradient(90deg,
        var(--accent) 0%,
        var(--accent-2) 60%,
        var(--accent-3) 100%);
    opacity: 0.22;
    border-radius: 4px;
    transform-origin: left center;
    animation: underlineGrow 1.2s 0.8s cubic-bezier(.2,.8,.2,1) backwards;
    z-index: -1;
}

@keyframes underlineGrow {
    from { transform: scaleX(0); opacity: 0; }
    to   { transform: scaleX(1); opacity: 0.22; }
}

.wave {
    display: inline-block;
    transform-origin: 70% 70%;
    animation: wave 2.5s infinite;
}

@keyframes wave {
    0%, 60%, 100% { transform: rotate(0); }
    10%, 30% { transform: rotate(14deg); }
    20% { transform: rotate(-8deg); }
    40% { transform: rotate(14deg); }
    50% { transform: rotate(-4deg); }
}

.hero-subtitle {
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 720px;
    margin: 0 0 36px;
    text-align: justify;
    hyphens: auto;
}

.hero-subtitle strong {
    color: var(--text);
    font-weight: 600;
}

.subtitle-accent {
    color: var(--accent);
    font-style: italic;
    font-weight: 500;
}

/* Rotating roles */
.hero-roles {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    font-size: 15px;
    flex-wrap: wrap;
}

.roles-prefix {
    color: var(--text-muted);
}

.roles-rotator {
    position: relative;
    display: inline-block;
    height: 1.6em;
    overflow: hidden;
    min-width: 240px;
}

.role-item {
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent);
    font-weight: 600;
    font-family: 'Space Grotesk', sans-serif;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.role-item.active {
    opacity: 1;
    transform: translateY(0);
}

.role-item.exit {
    opacity: 0;
    transform: translateY(-100%);
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 64px;
}

/* Buttons */
.btn-primary-custom {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    background-color: var(--text);
    color: var(--bg) !important;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid var(--text);
    position: relative;
    overflow: hidden;
    transition: background-color 0.2s ease, border-color 0.2s ease,
                color 0.2s ease, box-shadow 0.3s ease,
                transform 0.25s cubic-bezier(.2,.8,.2,1);
    will-change: transform;
}

/* Shimmer sweep on hover */
.btn-primary-custom::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg,
        transparent 30%,
        rgba(255, 255, 255, 0.18) 50%,
        transparent 70%);
    transform: translateX(-120%);
    transition: transform 0.7s cubic-bezier(.2,.8,.2,1);
    pointer-events: none;
}

.btn-primary-custom:hover {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff !important;
    box-shadow: 0 8px 24px -8px rgba(37, 99, 235, 0.5),
                0 4px 8px -2px rgba(0, 0, 0, 0.1);
}

.btn-primary-custom:hover::before {
    transform: translateX(120%);
}

[data-theme="dark"] .btn-primary-custom:hover {
    box-shadow: 0 8px 24px -8px rgba(96, 165, 250, 0.6),
                0 4px 8px -2px rgba(0, 0, 0, 0.4);
}

.btn-outline-custom {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    background-color: transparent;
    color: var(--text) !important;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    transition: background-color 0.2s ease, border-color 0.2s ease,
                box-shadow 0.3s ease,
                transform 0.25s cubic-bezier(.2,.8,.2,1);
    will-change: transform;
}

.btn-outline-custom:hover {
    background-color: var(--bg-subtle);
    border-color: var(--text);
    box-shadow: var(--shadow-md);
}

/* ============================================
   HERO TERMINAL (Signature)
   ============================================ */
.hero-terminal {
    margin-top: 48px;
    margin-bottom: 56px;
    max-width: 100%;
    width: 100%;
    background: linear-gradient(180deg,
        rgba(20, 20, 20, 0.96) 0%,
        rgba(10, 10, 10, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    box-shadow:
        0 24px 64px -16px rgba(0, 0, 0, 0.5),
        0 8px 16px -4px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: relative;
}

[data-theme="light"] .hero-terminal {
    background: linear-gradient(180deg,
        #1f1f23 0%,
        #18181b 100%);
    border-color: rgba(255, 255, 255, 0.05);
}

/* Subtle glow on hover/focus */
.hero-terminal::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 12px;
    padding: 1px;
    background: linear-gradient(135deg,
        rgba(96, 165, 250, 0.4),
        rgba(34, 211, 238, 0.3),
        transparent 60%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
            mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.hero-terminal:hover::before {
    opacity: 1;
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.terminal-dot.dot-r { background: #ff5f56; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1); }
.terminal-dot.dot-y { background: #ffbd2e; }
.terminal-dot.dot-g { background: #27c93f; }

.terminal-title {
    flex: 1;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.02em;
    user-select: none;
}

.terminal-body {
    padding: 24px 28px 26px;
    font-family: 'JetBrains Mono', 'Menlo', monospace;
    font-size: 14.5px;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.85);
}

.terminal-line {
    white-space: pre-wrap;
    word-break: break-word;
}

.terminal-line.t-out {
    color: rgba(255, 255, 255, 0.6);
    padding-left: 0;
}

.t-prompt {
    color: #4ade80;
    font-weight: 600;
    margin-right: 8px;
    user-select: none;
}

.t-cmd       { color: #fff; }
.t-key       { color: #93c5fd; }
.t-str       { color: #fbbf24; }
.t-bool      { color: #f472b6; font-weight: 500; }

.t-typing {
    color: #fff;
}

.t-cursor {
    display: inline-block;
    color: #4ade80;
    animation: terminalCursor 1s steps(2) infinite;
    margin-left: 2px;
    font-weight: 700;
}

@keyframes terminalCursor {
    0%, 50%   { opacity: 1; }
    50.01%, 100% { opacity: 0; }
}

/* Stats */
.hero-meta {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    padding-top: 36px;
    border-top: 1px solid var(--border);
    align-items: stretch;
}

.hero-stats {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
}

.stat-item {
    display: flex;
    align-items: baseline;
    gap: 14px;
    padding-bottom: 16px;
    border-bottom: 1px dashed var(--border);
}

.stat-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.stat-num {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    letter-spacing: -0.02em;
    min-width: 70px;
}

.stat-num span {
    color: var(--accent);
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

/* Activity Heatmap Card */
.activity-card {
    background: linear-gradient(180deg,
        var(--bg-elevated) 0%,
        var(--bg-subtle) 100%);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .activity-card {
    background: linear-gradient(180deg,
        rgba(24, 24, 27, 0.65) 0%,
        rgba(20, 20, 23, 0.65) 100%);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.activity-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.activity-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.activity-source {
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted);
    margin-top: 2px;
    letter-spacing: 0.04em;
}

.activity-source a {
    color: var(--accent);
    text-decoration: none;
}

.activity-source a:hover { text-decoration: underline; }

.activity-legend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.legend-cell,
.activity-cell {
    width: 11px;
    height: 11px;
    border-radius: 2px;
    background-color: var(--heat-0);
    display: inline-block;
}

/* Heatmap intensity levels — solid fills, no borders, blend with card bg */
:root {
    --heat-0: rgba(15, 23, 42, 0.06);
    --heat-1: rgba(37, 99, 235, 0.28);
    --heat-2: rgba(37, 99, 235, 0.5);
    --heat-3: rgba(37, 99, 235, 0.75);
    --heat-4: #2563eb;
}

[data-theme="dark"] {
    --heat-0: rgba(255, 255, 255, 0.05);
    --heat-1: rgba(96, 165, 250, 0.25);
    --heat-2: rgba(96, 165, 250, 0.5);
    --heat-3: rgba(96, 165, 250, 0.75);
    --heat-4: #60a5fa;
}

.legend-cell.lvl-0,
.activity-cell.lvl-0 { background-color: var(--heat-0); }
.legend-cell.lvl-1,
.activity-cell.lvl-1 { background-color: var(--heat-1); }
.legend-cell.lvl-2,
.activity-cell.lvl-2 { background-color: var(--heat-2); }
.legend-cell.lvl-3,
.activity-cell.lvl-3 { background-color: var(--heat-3); }
.legend-cell.lvl-4,
.activity-cell.lvl-4 { background-color: var(--heat-4); }

/* Grid: 7 rows (days) x N cols (weeks) */
.activity-grid {
    display: grid;
    grid-template-rows: repeat(7, 11px);
    grid-auto-flow: column;
    grid-auto-columns: 11px;
    gap: 3px;
    overflow-x: auto;
    overflow-y: hidden;
    margin-bottom: 14px;
    padding-bottom: 4px;
    scrollbar-width: thin;
}

.activity-grid::-webkit-scrollbar { height: 4px; }
.activity-grid::-webkit-scrollbar-track { background: transparent; }
.activity-grid::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.activity-cell {
    transition: transform 0.18s ease, opacity 0.4s ease, background-color 0.3s ease;
    opacity: 0;
    cursor: default;
}

.activity-cell.appear { opacity: 1; }

.activity-cell:hover {
    transform: scale(1.5);
    z-index: 2;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* LED text mode — pulse animation for active cells */
.activity-grid.led-mode .activity-cell.lvl-4 {
    animation: ledPulse 2.4s ease-in-out infinite;
}

.activity-grid.led-mode .activity-cell.lvl-3 {
    animation: ledPulse 2.4s ease-in-out infinite;
    animation-delay: 0.3s;
}

@keyframes ledPulse {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; box-shadow: 0 0 8px var(--heat-4); }
}

.activity-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 20px;
    font-size: 12px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.activity-loading .spinner {
    width: 12px;
    height: 12px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.activity-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 8px;
}

.activity-footer i {
    margin-right: 4px;
    color: var(--accent);
}

.activity-footer strong {
    color: var(--text);
    font-weight: 600;
}

/* ============================================
   ABOUT
   ============================================ */
.lead-text {
    font-size: clamp(16px, 1.2vw, 18px);
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 20px;
    text-align: justify;
    hyphens: auto;
}

.body-text {
    font-size: 15px;
    line-height: 1.75;
    color: var(--text-muted);
    margin-bottom: 16px;
    text-align: justify;
    hyphens: auto;
}

.body-text strong, .lead-text strong {
    color: var(--text);
    font-weight: 600;
}

.info-card {
    background-color: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.info-card-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 0 0 16px;
    font-family: 'JetBrains Mono', monospace;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 14px;
}

.info-list li:last-child { border-bottom: none; }

.info-list li span {
    color: var(--text-muted);
}

.info-list li strong {
    color: var(--text);
    font-weight: 500;
}

.text-success-custom {
    color: var(--success) !important;
}

/* ============================================
   SKILLS
   ============================================ */
.skill-group {
    background-color: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
    height: 100%;
}

.skill-group-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 24px;
}

.skill-group-title i {
    color: var(--accent);
    font-size: 18px;
}

.skill-item {
    margin-bottom: 18px;
}

.skill-item:last-child { margin-bottom: 0; }

.skill-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.skill-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.skill-level {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 100px;
    color: #fff;
}

/* Skill level badge: default style; tier color set by JS */
.skill-level[data-level^="9"],
.skill-level[data-level="100"] {
    background-color: #16a34a; /* Expert: green */
}
.skill-level[data-level^="8"] {
    background-color: #2563eb; /* Proficient: blue */
}
.skill-level[data-level^="7"] {
    background-color: #f59e0b; /* Competent: amber */
}
.skill-level[data-level^="6"],
.skill-level[data-level^="5"] {
    background-color: #f97316; /* Familiar: orange */
}
.skill-level[data-level^="4"],
.skill-level[data-level^="3"],
.skill-level[data-level^="2"],
.skill-level[data-level^="1"]:not([data-level="100"]) {
    background-color: #ef4444; /* Learning: red */
}

.skill-bar {
    width: 100%;
    height: 6px;
    background-color: var(--bg-subtle);
    border-radius: 100px;
    overflow: hidden;
}

.skill-bar-fill {
    height: 100%;
    border-radius: 100px;
    width: 0;
    transition: width 1.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
}

/* Skill bar fill colors per tier (set by JS) */
.skill-bar-fill.tier-expert {
    background: linear-gradient(90deg, #16a34a, #22c55e);
}
.skill-bar-fill.tier-proficient {
    background: linear-gradient(90deg, #2563eb, #3b82f6);
}
.skill-bar-fill.tier-competent {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}
.skill-bar-fill.tier-familiar {
    background: linear-gradient(90deg, #f97316, #fb923c);
}
.skill-bar-fill.tier-learning {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

/* Skill level badge colors per tier (set by JS) */
.skill-level.tier-expert { background-color: #16a34a; }
.skill-level.tier-proficient { background-color: #2563eb; }
.skill-level.tier-competent { background-color: #f59e0b; }
.skill-level.tier-familiar { background-color: #f97316; }
.skill-level.tier-learning { background-color: #ef4444; }

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 32px;
}

.tech-tag {
    padding: 6px 14px;
    background-color: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.tech-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
}

/* ============================================
   TIMELINE / EXPERIENCE
   ============================================ */
.timeline {
    position: relative;
    padding-left: 56px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 19px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent) 0%, var(--border) 80%, transparent);
}

.timeline-item {
    position: relative;
    padding-bottom: 36px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-marker {
    position: absolute;
    left: -56px;
    top: 4px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bg-elevated), var(--bg));
    border: 2px solid var(--accent);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 16px;
    box-shadow: 0 0 0 4px var(--bg), var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-item:hover .timeline-marker {
    transform: scale(1.08);
    box-shadow: 0 0 0 4px var(--bg), 0 0 0 8px var(--accent-soft), var(--shadow-md);
}

.timeline-content {
    background-color: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.25s ease;
    position: relative;
}

.timeline-content::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 18px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid var(--border);
}

.timeline-content::after {
    content: '';
    position: absolute;
    left: -7px;
    top: 18px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid var(--bg-elevated);
}

.timeline-content:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.timeline-content:hover::before {
    border-right-color: var(--accent);
}

.timeline-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    align-items: center;
}

.timeline-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.timeline-date i { font-size: 12px; }

.timeline-tag {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    background-color: var(--accent-soft);
    color: var(--accent);
    border-radius: 4px;
}

/* Tag color variants */
.timeline-tag.tag-fulltime {
    background-color: rgba(22, 163, 74, 0.12);
    color: #16a34a;
}

.timeline-tag.tag-contract {
    background-color: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.timeline-tag.tag-founder {
    background-color: rgba(6, 182, 212, 0.12);
    color: #0891b2;
}

.timeline-tag.tag-author {
    background-color: rgba(236, 72, 153, 0.12);
    color: #db2777;
}

[data-theme="dark"] .timeline-tag.tag-fulltime { color: #4ade80; }
[data-theme="dark"] .timeline-tag.tag-contract { color: #fbbf24; }
[data-theme="dark"] .timeline-tag.tag-founder { color: #22d3ee; }
[data-theme="dark"] .timeline-tag.tag-author { color: #f472b6; }

.timeline-title {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 4px;
    color: var(--text);
}

.timeline-company {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.timeline-company i {
    color: var(--accent);
    font-size: 14px;
}

.timeline-loc {
    color: var(--text-subtle);
}

.timeline-desc {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-muted);
    margin: 0 0 14px;
}

.timeline-highlights {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
}

.timeline-highlights li {
    position: relative;
    padding-left: 22px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text);
    margin-bottom: 6px;
}

.timeline-highlights li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 14px;
    height: 2px;
    background-color: var(--accent);
    border-radius: 2px;
}

.timeline-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
}

.timeline-tech span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    padding: 3px 9px;
    background-color: var(--bg-subtle);
    color: var(--text-muted);
    border-radius: 4px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.timeline-content:hover .timeline-tech span {
    border-color: var(--border-strong);
}

/* ============================================
   SERVICES
   ============================================ */
.service-card {
    height: 100%;
    background: linear-gradient(180deg,
        var(--bg-elevated) 0%,
        var(--bg-subtle) 100%);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.25s ease,
                box-shadow 0.35s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .service-card {
    background: linear-gradient(180deg,
        rgba(24, 24, 27, 0.7) 0%,
        rgba(20, 20, 23, 0.7) 100%);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.service-card:hover {
    border-color: var(--accent);
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.service-card:hover::before {
    opacity: 1;
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(-5deg);
    background-color: var(--accent);
    color: #fff;
}

.service-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background-color: var(--accent-soft);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 18px;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                background-color 0.3s ease,
                color 0.3s ease;
}

.service-card h5 {
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 10px;
    color: var(--text);
}

.service-card p {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-muted);
    margin: 0 0 18px;
    flex-grow: 1;
}

.service-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
    transition: gap 0.25s ease, color 0.2s ease;
    align-self: flex-start;
    width: 100%;
}

.service-cta i {
    transition: transform 0.25s ease;
    font-size: 14px;
}

.service-card:hover .service-cta {
    gap: 10px;
}

.service-card:hover .service-cta i {
    transform: translateX(4px);
}

/* ============================================
   CONTACT
   ============================================ */
.contact-info {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.contact-intro {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.contact-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background-color: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text) !important;
    transition: all 0.2s ease;
}

.contact-row:hover {
    border-color: var(--accent);
    transform: translateX(4px);
}

.contact-row-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background-color: var(--accent-soft);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.contact-row small {
    display: block;
    font-size: 11px;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 2px;
}

.contact-row strong {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

/* Form */
.contact-form {
    background-color: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
}

.form-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Mobile form: 16px font to prevent iOS zoom */
/* Mobile form: 16px font to prevent iOS zoom */
.form-control-custom {
    width: 100%;
    padding: 12px 14px;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 16px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-control-custom::placeholder {
    color: var(--text-subtle);
}

.form-control-custom:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-control-custom.is-valid {
    border-color: #16a34a;
}

.form-control-custom.is-valid:focus {
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.form-control-custom.is-invalid {
    border-color: #ef4444;
}

.form-control-custom.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-control-custom.flash-highlight {
    animation: flashHighlight 1.2s ease;
}

@keyframes flashHighlight {
    0%, 100% { background-color: var(--bg); }
    30% { background-color: var(--accent-soft); border-color: var(--accent); }
}

.form-feedback {
    display: block;
    font-size: 12px;
    color: #ef4444;
    margin-top: 6px;
    min-height: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.25s ease, opacity 0.25s ease, margin-top 0.25s ease;
}

.form-feedback.show {
    max-height: 40px;
    opacity: 1;
    margin-top: 6px;
}

.char-counter {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-subtle);
    text-transform: none;
    letter-spacing: 0;
}

.char-counter.near-limit {
    color: #f59e0b;
    font-weight: 600;
}

.form-status {
    margin-top: 14px;
    padding: 0 14px;
    font-size: 13px;
    border-radius: 8px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}

.form-status.success,
.form-status.error {
    max-height: 60px;
    opacity: 1;
    padding: 12px 14px;
}

.form-status.success {
    background-color: rgba(22, 163, 74, 0.1);
    border: 1px solid rgba(22, 163, 74, 0.3);
    color: #16a34a;
}

.form-status.error {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.form-status i {
    margin-right: 6px;
}

/* ============================================
   FOOTER
   ============================================ */
.main-footer {
    padding: 28px 0;
    text-align: center;
    border-top: 1px solid var(--border);
}

.main-footer p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

/* ============================================
   BACK TO TOP
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 96px;
    right: 32px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background-color: var(--text);
    color: var(--bg) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.9);
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
    z-index: 100;
    border: 1px solid var(--border);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.back-to-top:hover {
    background-color: var(--accent);
    color: #fff !important;
    border-color: var(--accent);
    transform: translateY(-3px) scale(1.05);
}

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Stagger delay for grid children */
.row .reveal:nth-child(2).visible { transition-delay: 0.08s; }
.row .reveal:nth-child(3).visible { transition-delay: 0.16s; }
.row .reveal:nth-child(4).visible { transition-delay: 0.24s; }
.row .reveal:nth-child(5).visible { transition-delay: 0.32s; }
.row .reveal:nth-child(6).visible { transition-delay: 0.4s; }

.timeline .reveal:nth-child(2).visible { transition-delay: 0.1s; }
.timeline .reveal:nth-child(3).visible { transition-delay: 0.2s; }
.timeline .reveal:nth-child(4).visible { transition-delay: 0.3s; }

/* Hero stagger */
.section-hero .reveal:nth-child(2).visible { transition-delay: 0.1s; }
.section-hero .reveal:nth-child(3).visible { transition-delay: 0.2s; }
.section-hero .reveal:nth-child(4).visible { transition-delay: 0.3s; }
.section-hero .reveal:nth-child(5).visible { transition-delay: 0.4s; }
.section-hero .reveal:nth-child(6).visible { transition-delay: 0.5s; }

/* Service cards stagger */
.service-card.reveal.visible { transition-delay: 0ms; }
.service-card.reveal.visible:nth-child(2) { transition-delay: 0.08s; }
.service-card.reveal.visible:nth-child(3) { transition-delay: 0.16s; }
.service-card.reveal.visible:nth-child(4) { transition-delay: 0.24s; }
.service-card.reveal.visible:nth-child(5) { transition-delay: 0.32s; }
.service-card.reveal.visible:nth-child(6) { transition-delay: 0.40s; }

/* Service cards stagger */
.service-card.reveal.visible { transition-delay: 0ms; }
.service-card.reveal.visible:nth-child(2) { transition-delay: 0.08s; }
.service-card.reveal.visible:nth-child(3) { transition-delay: 0.16s; }
.service-card.reveal.visible:nth-child(4) { transition-delay: 0.24s; }
.service-card.reveal.visible:nth-child(5) { transition-delay: 0.32s; }
.service-card.reveal.visible:nth-child(6) { transition-delay: 0.40s; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto !important; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .hero-orb,
    .pulse-dot,
    .wave,
    .activity-grid.led-mode .activity-cell,
    .text-accent,
    .underline-accent::after,
    .bg-mesh,
    .t-cursor,
    .hero-particle-canvas {
        animation: none !important;
    }
    .activity-cell {
        opacity: 1 !important;
        transition: none !important;
    }
    .skill-bar-fill,
    .btn-primary-custom,
    .btn-outline-custom,
    .btn-primary-custom::before {
        transition: none !important;
    }
    .text-accent {
        background: none !important;
        -webkit-text-fill-color: var(--accent) !important;
        color: var(--accent) !important;
    }
    .text-accent { background-position: 0% 50% !important; }
    .hero-particle-canvas { opacity: 0.15 !important; }
}

/* ============================================
   HERO PARTICLE CANVAS (lightweight abstract)
   ============================================ */
.hero-particle-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.55;
}

[data-theme="dark"] .hero-particle-canvas {
    opacity: 0.40;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (min-width: 1600px) {
    .main-content {
        padding: 0 96px;
    }
}

@media (max-width: 1199.98px) {
    .hero-meta {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .hero-stats {
        flex-direction: row;
        gap: 24px;
    }
    .stat-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        flex: 1;
        border-bottom: none;
        padding-bottom: 0;
    }
    .stat-num { min-width: 0; }
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .main-content {
        margin-left: 0;
        padding: 60px 24px 0;
    }

    .section {
        padding: 64px 0;
    }

    .section-hero {
        min-height: calc(100vh - 60px);
    }

    .hero-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    /* Compact timeline on tablet */
    .timeline { padding-left: 44px; }
    .timeline::before { left: 15px; }
    .timeline-marker {
        left: -44px;
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    /* Terminal: smaller on tablet */
    .hero-terminal {
        margin-top: 36px;
        margin-bottom: 44px;
    }
    .terminal-body {
        font-size: 12.5px;
        padding: 16px 18px 18px;
    }

    /* Lighter ambient layers on smaller screens */
    .bg-grid {
        background-size: 60px 60px;
        opacity: 0.5;
    }
}

@media (max-width: 575.98px) {
    .hero-stats {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .stat-num { font-size: 28px; }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-primary-custom,
    .btn-outline-custom {
        justify-content: center;
    }

    /* Timeline more compact on phone */
    .timeline { padding-left: 36px; }
    .timeline::before { left: 11px; }
    .timeline-marker {
        left: -36px;
        width: 26px;
        height: 26px;
        font-size: 11px;
    }
    .timeline-content { padding: 18px; }
    .timeline-content::before,
    .timeline-content::after { display: none; }

    /* Terminal: phone tweaks */
    .terminal-bar { padding: 10px 12px; }
    .terminal-title { font-size: 11px; }
    .terminal-body {
        font-size: 11.5px;
        padding: 14px 14px 16px;
    }

    /* Disable mesh drift animation on small to save battery */
    .bg-mesh { animation: none; }
}

/* ============================================
   GitHub / Open Source Section — 3 equal panels
   ============================================ */

.gh-grid {
    margin-top: 8px;
    --gh-panel-h: 560px;
}

/* Panel = card with fixed height + flex column; body scrolls */
.gh-panel {
    display: flex;
    flex-direction: column;
    height: var(--gh-panel-h);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    position: relative;
}

.gh-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        var(--accent) 0%,
        var(--accent-2) 50%,
        var(--accent-3) 100%);
    opacity: 0.7;
    z-index: 2;
}

/* Override: currently widget uses full accent bar */
.now-widget.gh-panel::before {
    opacity: 0.9;
}

.gh-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.gh-section-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
    letter-spacing: -0.01em;
    min-width: 0;
}

.gh-section-title > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gh-section-title i {
    color: var(--accent);
    font-size: 17px;
    flex-shrink: 0;
}

.gh-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.gh-link:hover { color: var(--accent); }
.gh-link i { font-size: 10.5px; }

.gh-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

/* Panel body = scroll area */
.gh-panel-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 16px 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.gh-panel-body::-webkit-scrollbar { width: 8px; }
.gh-panel-body::-webkit-scrollbar-track { background: transparent; }
.gh-panel-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
.gh-panel-body::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
    background-clip: padding-box;
    border: 2px solid transparent;
}

/* ---- Repo list (vertical) ---- */

.repo-list,
.push-list,
.now-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.repo-list { gap: 10px; }

.repo-item { display: block; }

.repo-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    position: relative;
}

.repo-card:hover {
    transform: translateY(-1px);
    border-color: var(--accent);
    background: rgba(96, 165, 250, 0.04);
}

.repo-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.repo-card-head > i:first-child {
    color: var(--accent);
    font-size: 14px;
    flex-shrink: 0;
}

.repo-name {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.repo-arrow {
    color: var(--text-muted);
    font-size: 12px;
    transition: transform 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.repo-card:hover .repo-arrow {
    color: var(--accent);
    transform: translate(2px, -2px);
}

.repo-desc {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-soft);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.repo-no-desc {
    color: var(--text-muted);
    font-style: italic;
    opacity: 0.7;
}

.repo-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    color: var(--text-muted);
}

.repo-lang {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-soft);
}

.repo-lang-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.repo-stat {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.repo-stat i { font-size: 11px; opacity: 0.7; }

.repo-updated { margin-left: auto; }

/* ---- Now widget items ---- */

.now-list { gap: 14px; }

.now-item {
    display: flex;
    gap: 11px;
    align-items: flex-start;
}

.now-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(96, 165, 250, 0.1);
    color: var(--accent);
    font-size: 13px;
    margin-top: 1px;
}

.now-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.now-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.now-value {
    font-size: 13px;
    line-height: 1.45;
    color: var(--text);
}

/* ---- Push items ---- */

.push-list { gap: 0; }

.push-item {
    padding: 12px 0;
    border-bottom: 1px dashed var(--border);
}

.push-item:last-child { border-bottom: none; padding-bottom: 4px; }
.push-item:first-child { padding-top: 0; }

.push-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.push-icon {
    color: var(--accent-3);
    font-size: 13px;
    flex-shrink: 0;
}

.push-repo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.push-repo:hover { color: var(--accent); }

.push-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.push-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    color: var(--text-muted);
    margin-bottom: 5px;
    padding-left: 21px;
}

.push-sep { opacity: 0.5; }

.push-branch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.push-branch i { font-size: 10.5px; opacity: 0.7; }

.push-msg {
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-soft);
    padding-left: 21px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-style: italic;
    opacity: 0.85;
}

/* ---- Loading / empty states ---- */

.repo-loading,
.repo-empty,
.push-loading,
.push-empty,
.now-loading,
.now-empty {
    list-style: none;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12.5px;
    padding: 24px 8px;
    text-align: center;
}

.repo-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 32px 16px;
}

.repo-empty i { font-size: 24px; opacity: 0.5; }

.repo-empty-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--accent);
    text-decoration: none;
    font-size: 11.5px;
    margin-top: 4px;
}

.repo-empty-link:hover { text-decoration: underline; }

/* Spinner */
.spinner {
    display: inline-block;
    width: 13px;
    height: 13px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: -2px;
    margin-right: 4px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Responsive ---- */

@media (max-width: 991px) {
    .gh-grid {
        --gh-panel-h: 480px;
    }
    .gh-grid > [class*="col-"] + [class*="col-"] {
        margin-top: 16px;
    }
}

@media (max-width: 575px) {
    .gh-grid { --gh-panel-h: 420px; }
    .gh-section-head { padding: 14px 14px 12px; }
    .gh-panel-body { padding: 12px 12px 14px; }
    .gh-section-title { font-size: 14px; }
}
