/* ==========================================================================
   Design tokens - dark, technical aesthetic inspired by getartcraft.com
   ========================================================================== */
:root {
    --bg: #0a0a0c;
    --bg-rgb: 10, 10, 12;
    --bg-elevated: #111114;
    --bg-elevated-2: #17171a;
    --border: #27272a;
    --border-strong: #3a3a3e;
    --text: #f2f2f3;
    --text-dim: #a8a8ad;
    --text-dimmer: #86868c;
    --accent: #3b82f6;
    --accent-strong: #60a5fa;
    --accent-soft: rgba(59, 130, 246, 0.12);
    --accent-glow: rgba(59, 130, 246, 0.35);
    --mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
    --sans: "Space Grotesk", "Inter", Arial, sans-serif;
    --body: "Inter", Arial, sans-serif;
}

/* "Light" mode - same layout/structure, but the exact palette from the
   original (main branch) portfolio: grey gradient body, white text, yellow accent. */
:root[data-theme="light"] {
    --bg: #3b3f41;
    --bg-rgb: 59, 63, 65;
    --bg-elevated: #6c757d;
    --bg-elevated-2: #5a6268;
    --border: #52585c;
    --border-strong: #6b7176;
    --text: #ffffff;
    --text-dim: #e6e6e6;
    --text-dimmer: #999999;
    --accent: #ffc107;
    --accent-strong: #ffc107;
    --accent-soft: rgba(255, 193, 7, 0.15);
    --accent-glow: rgba(255, 193, 7, 0.5);
}

html {
    scroll-padding-top: 76px;
    scroll-behavior: smooth;
    color-scheme: dark;
}

html[data-theme="light"] body {
    background: linear-gradient(90deg, #333, #414547) !important;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--body);
    background: var(--bg) !important;
    color: var(--text);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--sans);
    color: var(--text) !important;
}

/* Heading entrance animations */
h1, h2, h3, h4, h5 {
    animation: fadeInDown 0.6s ease-out;
}

h1 {
    animation: fadeInDown 0.8s ease-out;
}

h2 {
    animation-delay: 0.2s;
}

/* Stagger animation delays for card grids */
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }

/* Visible scrollbar on the dark background (Firefox + WebKit/Chromium) */
html {
    scrollbar-color: var(--border-strong) var(--bg);
    scrollbar-width: thin;
}

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background-color: var(--border-strong);
    border-radius: 6px;
    border: 3px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--accent);
}

p {
    color: var(--text-dim);
}

a {
    transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
    color: var(--accent-strong) !important;
}

/* Animation Keyframes */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px var(--accent-glow); }
    50% { box-shadow: 0 0 20px var(--accent-glow); }
}

@keyframes rotateIn {
    from { opacity: 0; transform: rotate(-10deg) scale(0.9); }
    to { opacity: 1; transform: rotate(0) scale(1); }
}

.animate-fade-in-up { animation: fadeInUp 0.6s ease-out; }
.animate-fade-in-down { animation: fadeInDown 0.6s ease-out; }
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-rotate-in { animation: rotateIn 0.6s ease-out; }
.animate-slide-in-left { animation: slideInLeft 0.6s ease-out; }
.animate-slide-in-right { animation: slideInRight 0.6s ease-out; }

/* Profile image + text entrance animations (used on hero portraits/intro copy) */
.profile-animate {
    animation: fadeInUp 0.8s ease-out, float 3s ease-in-out infinite;
    animation-delay: 0.2s;
}

.text-animate {
    animation: slideInLeft 0.6s ease-out;
}

section {
    padding: 64px 30px;
    animation: fadeInUp 0.8s ease-out;
    border-bottom: 1px solid var(--border);
}

section:last-of-type {
    border-bottom: none;
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.navbar {
    background: rgba(var(--bg-rgb), 0.92) !important;
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    box-shadow: none;
    padding-top: 14px;
    padding-bottom: 14px;
}

.navbar-brand {
    font-weight: bold;
}

.navbar-nav .nav-link {
    color: var(--text-dim) !important;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 500 !important;
    padding: 8px 14px !important;
}

.navbar-nav .nav-link:hover {
    color: var(--accent-strong) !important;
}

.navbar-nav .nav-link.active {
    color: var(--text) !important;
}

.nav-link:hover {
    text-decoration: none;
}

.navbar-toggler {
    border-color: var(--border) !important;
}

/* Theme toggle button */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin-left: auto;
    margin-right: 8px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-dim);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

@media (min-width: 768px) {
    .theme-toggle {
        order: 2;
        margin-left: 16px;
        margin-right: 0;
    }
}

/* ==========================================================================
   Section header - "01 / LABEL" kicker used across every section
   ========================================================================== */
.section-kicker {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    margin-bottom: 36px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-dimmer);
}

.section-kicker .index {
    color: var(--text-dim);
}

.section-title {
    font-weight: 700;
    text-transform: none;
    letter-spacing: -0.01em;
}

.section-title em {
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    font-weight: 400;
    color: var(--accent-strong);
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero-eyebrow {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.text-gradient-primary {
    color: var(--text);
}

.title-underline {
    position: relative;
}

.bg-warning-soft {
    background: var(--accent-soft);
}

/* Profile photo frame - bordered panel with corner brackets, like a viewfinder */
.profile-frame {
    position: relative;
    display: inline-block;
    max-width: 320px;
    width: 100%;
    padding: 18px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.profile-frame::before,
.profile-frame::after {
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    border: 2px solid var(--accent);
    pointer-events: none;
}

.profile-frame::before {
    top: -1px;
    left: -1px;
    border-right: none;
    border-bottom: none;
}

.profile-frame::after {
    bottom: -1px;
    right: -1px;
    border-left: none;
    border-top: none;
}

.profile-photo {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 4px;
    filter: grayscale(15%);
}

.profile-frame-label {
    display: block;
    margin-bottom: 12px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dimmer);
    text-align: left;
}

.profile-frame-status {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
    margin-top: 14px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #4caf50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

/* Bootstrap's bg-dark utility is used directly on several <section> wrappers;
   tie it to the theme so those sections don't stay dark in light mode. */
.bg-dark {
    background-color: var(--bg) !important;
}

/* ==========================================================================
   Cards / panels
   ========================================================================== */
.card {
    background-color: var(--bg-elevated) !important;
    border: 1px solid var(--border) !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    transition: border-color 0.25s ease, transform 0.25s ease;
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--accent) !important;
    box-shadow: 0 8px 20px var(--accent-glow) !important;
}

.card.bg-secondary {
    background-color: var(--bg-elevated) !important;
}

.card-title {
    font-family: var(--sans);
}

.card-text {
    color: var(--text-dim);
}

.icon-lg {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border: 1px solid var(--border);
    transition: border-color 0.25s ease, transform 0.25s ease;
}

.card:hover .icon-lg {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    animation: pulse 0.6s ease-in-out;
    transform: scale(1.1);
}

/* Numbered panel index, e.g. skill/service cards */
.panel-index {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-dimmer);
    letter-spacing: 0.08em;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 4px !important;
    transition: all 0.2s ease;
}

.btn.rounded-pill {
    border-radius: 4px !important;
}

.btn-warning,
.btn-warning:focus {
    background-color: var(--text) !important;
    border-color: var(--text) !important;
    color: var(--bg) !important;
    font-weight: 600;
}

.btn-warning:hover {
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
    color: var(--bg) !important;
}

.btn-outline-light {
    color: var(--text) !important;
    border-color: var(--border-strong) !important;
    background: transparent !important;
}

.btn-outline-light:hover {
    background-color: var(--bg-elevated-2) !important;
    border-color: var(--text) !important;
    color: var(--text) !important;
}

.btn-outline-warning {
    color: var(--accent-strong) !important;
    border-color: var(--accent) !important;
    background: transparent !important;
}

.btn-outline-warning:hover {
    background-color: var(--accent-soft) !important;
    color: var(--accent-strong) !important;
}

.btn-info {
    background-color: transparent !important;
    border: 1px solid var(--accent) !important;
    color: var(--accent-strong) !important;
}

.btn-info:hover {
    background-color: var(--accent-soft) !important;
    color: var(--accent-strong) !important;
}

.btn {
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3) !important;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

/* ==========================================================================
   Badges / tags
   ========================================================================== */
.badge {
    font-family: var(--mono);
    font-weight: 500 !important;
    letter-spacing: 0.02em;
    border-radius: 4px !important;
    animation: rotateIn 0.6s ease-out;
    transition: all 0.3s ease;
}

.badge.bg-warning.text-dark {
    background-color: var(--accent-soft) !important;
    color: var(--accent-strong) !important;
    border: 1px solid var(--accent-glow);
}

.badge:hover, .tag:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px var(--accent-glow) !important;
    border-color: var(--accent);
}

/* ==========================================================================
   Timeline (Education)
   ========================================================================== */
.timeline {
    border-left: 2px solid var(--border);
    margin-left: 10px;
}

.timeline-item {
    position: relative;
    padding-left: 24px;
    margin-bottom: 30px;
}

.timeline-item .date {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-dimmer);
    transition: color 0.3s ease;
}

.timeline-item:hover .date {
    color: var(--accent);
}

.timeline-item h4 {
    margin-top: 4px;
    color: var(--text) !important;
    transition: color 0.3s ease;
}

.timeline-item:hover h4 {
    color: var(--accent-strong) !important;
}

.timeline-item p {
    margin-top: 6px;
}

.timeline-item:before {
    content: "";
    position: absolute;
    left: -6px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--bg);
    border: 2px solid var(--accent);
    transition: all 0.3s ease;
}

.timeline-item:hover:before {
    background-color: var(--accent);
    box-shadow: 0 0 10px 3px var(--accent-glow);
    transform: scale(1.2);
}

/* ==========================================================================
   Experience list
   ========================================================================== */
#experience .mb-5 {
    transition: all 0.3s ease;
    padding: 15px 0 15px 15px;
    border-left: 4px solid transparent;
    margin-left: 0;
}

#experience .mb-5:hover {
    border-left-color: var(--accent);
    padding-left: 20px;
    box-shadow: inset 0 0 0 1px var(--accent-soft);
}

#experience .mb-5 .date {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.04em;
    color: var(--accent-strong) !important;
    transition: all 0.3s ease;
}

#experience .mb-5:hover .date {
    font-weight: bold;
    letter-spacing: 0.08em;
}

#experience .mb-5 h4 {
    color: var(--text) !important;
    font-weight: 700;
    transition: all 0.3s ease;
}

#experience .mb-5:hover h4 {
    color: var(--accent-strong) !important;
    text-shadow: 0 0 10px var(--accent-soft);
}

#experience .mb-5 ul li {
    color: var(--text-dim);
    transition: all 0.3s ease;
}

#experience .mb-5:hover ul li {
    color: var(--text);
    margin-left: 8px;
}

#experience .mb-5 p strong {
    color: var(--text);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    background-color: var(--bg);
    color: var(--text-dim);
    border-top: 1px solid var(--border);
    padding: 56px 0 24px;
    font-size: 14px;
}

.site-footer .footer-brand {
    font-family: var(--sans);
    font-weight: 700;
    color: var(--text);
    font-size: 18px;
}

.site-footer .footer-tagline {
    color: var(--text-dimmer);
    max-width: 320px;
    margin-top: 10px;
}

.site-footer h6 {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dimmer);
    margin-bottom: 14px;
}

.site-footer ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.site-footer ul li {
    margin-bottom: 10px;
}

.site-footer a {
    color: var(--text-dim);
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--text) !important;
}

.footer-bottom {
    border-top: 1px solid var(--border);
    margin-top: 40px;
    padding-top: 20px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-dimmer);
}

/* Legacy footer fallback (project layout keeps a simple bar) */
footer.bg-dark {
    background-color: var(--bg) !important;
    border-top: 1px solid var(--border);
    color: var(--text-dimmer) !important;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* ==========================================================================
   Images
   ========================================================================== */
.project-img,
.profile,
.profile-lug {
    width: 400px;
    height: 350px;
    object-fit: cover;
    transition: all 0.3s ease;
    animation: fadeInUp 0.8s ease-out;
}

.project-img {
    margin-right: 10px;
    border-radius: 50%;
}

.project-img:hover {
    transform: scale(1.05) rotateY(5deg);
    box-shadow: 0 10px 25px var(--accent-glow);
}

.profile:hover,
.profile-lug:hover {
    transform: scale(1.03);
    box-shadow: 0 10px 30px var(--accent-glow);
}

img[alt*="Certificate"], img[alt*="certificate"] {
    animation: fadeInUp 0.8s ease-out;
    transition: all 0.3s ease;
}

img[alt*="Certificate"]:hover, img[alt*="certificate"]:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   Scroll ruler - decorative scroll-position indicator (right edge)
   ========================================================================== */
.scroll-ruler {
    position: fixed;
    top: 100px;
    bottom: 28px;
    right: 20px;
    width: 70px;
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.scroll-ruler-percent {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.05em;
    color: var(--accent-strong);
    margin-bottom: 8px;
    white-space: nowrap;
}

.scroll-ruler-track {
    position: relative;
    flex: 1;
    width: 1px;
    background: var(--border);
}

.scroll-ruler-fill {
    position: absolute;
    top: 0;
    left: -1px;
    width: 3px;
    height: 0%;
    background: var(--accent);
    transition: height 0.08s linear;
}

.scroll-ruler-tick {
    position: absolute;
    left: 0;
    width: 8px;
    height: 1px;
    background: var(--border-strong);
    transform: translateY(-0.5px);
}

.scroll-ruler-tick.major {
    width: 12px;
    background: var(--text-dimmer);
}

.scroll-ruler-tick-label {
    position: absolute;
    left: 18px;
    top: -5px;
    font-family: var(--mono);
    font-size: 9px;
    color: var(--text-dimmer);
}

.scroll-ruler-labels span {
    position: absolute;
    left: 28px;
    writing-mode: vertical-rl;
    transform: translateY(-50%) rotate(180deg);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-dimmer);
    white-space: nowrap;
    transition: color 0.2s ease;
}

.scroll-ruler-labels span.active {
    color: var(--accent-strong);
}

@media (max-width: 1300px) {
    .scroll-ruler {
        display: none;
    }
}

/* ==========================================================================
   Back to top
   ========================================================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--accent);
    border: none;
    color: var(--bg);
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px var(--accent-glow);
    animation: fadeInUp 0.6s ease-out;
}

.back-to-top:hover {
    background-color: var(--bg-elevated);
    color: var(--accent);
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--accent-glow);
}

.back-to-top.show {
    display: flex;
}

@media (max-width: 768px) {
    .back-to-top {
        width: 42px;
        height: 42px;
        bottom: 20px;
        right: 20px;
        font-size: 18px;
    }
}

/* ==========================================================================
   Contact form
   ========================================================================== */
#contact .form-control {
    background-color: var(--bg-elevated) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    border-radius: 4px;
    transition: border-color 0.2s ease;
}

#contact .form-control:focus {
    background-color: var(--bg-elevated) !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 0.2rem var(--accent-soft) !important;
    color: var(--text) !important;
}

#contact .btn-outline-warning:hover {
    box-shadow: 0 4px 12px var(--accent-glow) !important;
}

#contact .form-control::placeholder {
    color: var(--text-dim) !important;
    opacity: 1;
}

#contact .form-label {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.btn-outline-warning.copied::after {
    content: " Copied!";
    animation: fadeInUp 0.3s ease-out;
}

/* ==========================================================================
   Skill level indicators
   ========================================================================== */
.skill-level {
    display: inline-block;
    margin-left: 5px;
    font-family: var(--mono);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background-color: var(--accent-soft);
    color: var(--accent-strong);
}

.skill-level.beginner {
    background-color: rgba(154, 154, 158, 0.15);
    color: var(--text-dim);
}

.skill-level.intermediate {
    background-color: rgba(59, 130, 246, 0.15);
    color: var(--accent-strong);
}

.skill-level.expert {
    background-color: rgba(76, 175, 80, 0.15);
    color: #4caf50;
}

/* ==========================================================================
   Misc
   ========================================================================== */
.text-justify {
    text-align: justify;
}

.text-info,
.text-warning {
    color: var(--accent-strong) !important;
}

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

.text-secondary,
.text-muted {
    color: var(--text-dim) !important;
}

@media (max-width: 768px) {
    .btn { transition: all 0.2s ease; }
    .card:hover { transform: translateY(-4px); }

    .animate-slide-in-left,
    .animate-slide-in-right {
        animation: fadeInUp 0.6s ease-out !important;
    }

    .section-kicker {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}
