
:root {
    --bs-primary: #ff6b47;
    --bs-primary-rgb: 255, 107, 71;
    --bs-body-bg: #0b0b0b;
    --bs-body-color: #ffffff;
    --bs-border-color: rgba(255, 255, 255, 0.1);
    --bs-link-color: #ff6b47;
    --bs-link-hover-color: #ff8564;
    --bs-secondary-color: rgba(255, 255, 255, 0.62);
    --bs-secondary-rgb: 170, 170, 170;
    --bs-heading-color: #ffffff;
    --bs-emphasis-color: #ffffff;
    --bs-card-color: #ffffff;

    --accent: #ff6b47;
    --accent-2: #ff9d85;
    --accent-3: #ffb86b;
    --glass: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.1);
    --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background: #0b0b0b;
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 26px 26px;
    overflow-x: hidden;
}

body.is-loading {
    overflow: hidden;
}

::selection {
    background: rgba(255, 107, 71, 0.45);
    color: #ffffff;
}

.btn-primary {
    --bs-btn-bg: #ff6b47;
    --bs-btn-border-color: #ff6b47;
    --bs-btn-hover-bg: #ff8564;
    --bs-btn-hover-border-color: #ff8564;
    --bs-btn-active-bg: #ff8564;
    --bs-btn-active-border-color: #ff8564;
    color: #ffffff !important;
}

.card,
.form-control,
.form-select,
.progress,
.alert,
.dropdown-menu {
    background-color: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.form-select option {
    background: #161616;
}

.form-control::placeholder {
    color: #888888;
}

.form-control,
.form-select {
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, transform 0.3s var(--ease-out);
}

.form-control:focus,
.form-select:focus {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 107, 71, 0.6);
    color: #ffffff;
    box-shadow: 0 0 0 0.25rem rgba(255, 107, 71, 0.15), 0 10px 30px -10px rgba(255, 107, 71, 0.35);
    transform: translateY(-2px);
}

.errorlist {
    list-style: none;
    padding: 0;
    margin: 6px 0 0;
    color: #fca5a5;
    font-size: 13px;
}

/* =========================================================
   preloader & page transitions
   ========================================================= */

.preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0b0b0b;
    transition: opacity 0.6s ease, visibility 0.6s ease, clip-path 0.9s var(--ease-out);
    clip-path: circle(150% at 50% 50%);
}

.preloader-logo {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    height: 48px;
}

.preloader-logo span {
    width: 10px;
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(180deg, var(--accent-2), var(--accent));
    animation: loader-bars 0.9s ease-in-out infinite;
}

.preloader-logo span:nth-child(2) { animation-delay: 0.15s; }
.preloader-logo span:nth-child(3) { animation-delay: 0.3s; }

@keyframes loader-bars {
    0%, 100% { transform: scaleY(0.3); opacity: 0.5; }
    50% { transform: scaleY(1); opacity: 1; }
}

body.is-loaded .preloader {
    opacity: 0;
    visibility: hidden;
    clip-path: circle(0% at 50% 50%);
}

.page-content,
.site-footer {
    position: relative;
    z-index: 1;
    transition: opacity 0.28s ease, transform 0.28s ease, filter 0.28s ease;
}

body.is-leaving .page-content,
body.is-leaving .site-footer {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(4px);
}

/* =========================================================
   background scene
   ========================================================= */

.bg-scene {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-scene canvas {
    position: absolute;
    inset: 0;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.35;
    will-change: transform;
}

.blob-1 {
    width: 520px;
    height: 520px;
    top: -140px;
    right: -120px;
    background: radial-gradient(circle, #ff6b47 0%, transparent 70%);
    animation: blob-float-1 18s ease-in-out infinite;
}

.blob-2 {
    width: 460px;
    height: 460px;
    top: 45%;
    left: -160px;
    background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
    opacity: 0.22;
    animation: blob-float-2 22s ease-in-out infinite;
}

.blob-3 {
    width: 380px;
    height: 380px;
    bottom: -120px;
    right: 30%;
    background: radial-gradient(circle, #ffb86b 0%, transparent 70%);
    opacity: 0.18;
    animation: blob-float-3 26s ease-in-out infinite;
}

@keyframes blob-float-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-80px, 60px) scale(1.15); }
    66% { transform: translate(40px, 120px) scale(0.9); }
}

@keyframes blob-float-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(140px, -80px) scale(1.2); }
}

@keyframes blob-float-3 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-120px, -60px) scale(1.1); }
}

.cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 0;
    width: 420px;
    height: 420px;
    margin: -210px 0 0 -210px;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle, rgba(255, 107, 71, 0.13) 0%, transparent 65%);
    opacity: 0;
    transition: opacity 0.4s ease, width 0.3s ease, height 0.3s ease, margin 0.3s ease;
}

.cursor-glow.active {
    opacity: 1;
}

.cursor-glow.hovering {
    width: 560px;
    height: 560px;
    margin: -280px 0 0 -280px;
    background: radial-gradient(circle, rgba(255, 107, 71, 0.2) 0%, transparent 65%);
}

.scroll-progress {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1100;
    height: 3px;
    background: linear-gradient(270deg, var(--accent), var(--accent-3), #8b5cf6);
    transform: scaleX(0);
    transform-origin: right;
    box-shadow: 0 0 12px rgba(255, 107, 71, 0.7);
}

/* =========================================================
   reveal on scroll
   ========================================================= */

[data-reveal] {
    opacity: 0;
    transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out), filter 0.9s var(--ease-out);
    will-change: opacity, transform;
}

[data-reveal="up"] { transform: translateY(46px); }
[data-reveal="down"] { transform: translateY(-46px); }
[data-reveal="left"] { transform: translateX(-70px); }
[data-reveal="right"] { transform: translateX(70px); }
[data-reveal="zoom"] { transform: scale(0.85); filter: blur(6px); }
[data-reveal="flip"] { transform: perspective(800px) rotateX(35deg) translateY(30px); }

[data-reveal].revealed {
    opacity: 1;
    transform: none;
    filter: none;
}

/* =========================================================
   navbar
   ========================================================= */

.site-navbar {
    background: rgba(10, 10, 10, 0.55);
    backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid transparent;
    transition: transform 0.45s var(--ease-out), background 0.3s ease, padding 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    padding-block: 16px;
}

.site-navbar.scrolled {
    background: rgba(10, 10, 10, 0.85);
    border-bottom-color: rgba(255, 255, 255, 0.08);
    padding-block: 8px;
    box-shadow: 0 10px 40px -20px rgba(0, 0, 0, 0.9);
}

.site-navbar.nav-hidden {
    transform: translateY(-110%);
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* logo animations only move/scale it — never filters, so the logo itself stays untouched */
.brand-img {
    height: 46px;
    width: auto;
    transition: transform 0.4s var(--ease-spring), height 0.3s ease;
}

.brand-logo:hover .brand-img {
    transform: scale(1.08);
}

.site-navbar.scrolled .brand-img {
    height: 38px;
}

@keyframes logo-float {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -8px; }
}

/* two-section switch: programming / filmmaking */

.section-switch {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 4px;
    margin-inline-start: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.section-switch a {
    position: relative;
    z-index: 1;
    padding: 6px 14px;
    border-radius: 999px;
    color: #b7b7b7;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.section-switch a.active,
.section-switch a:hover {
    color: #ffffff;
}

.section-switch-pill {
    position: absolute;
    top: 4px;
    bottom: 4px;
    right: 4px;
    width: calc(50% - 4px);
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), #ff8a5c);
    box-shadow: 0 6px 20px -6px rgba(255, 107, 71, 0.8);
    transition: transform 0.5s var(--ease-spring);
}

.section-switch-pill.is-film {
    transform: translateX(-100%);
}

@media (max-width: 575.98px) {
    .section-switch a span {
        display: none;
    }

    .section-switch a {
        padding: 6px 16px;
    }
}

.brand-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse-dot 2s ease-out infinite;
}

@keyframes pulse-dot {
    0% { box-shadow: 0 0 0 0 rgba(255, 107, 71, 0.7); }
    100% { box-shadow: 0 0 0 12px rgba(255, 107, 71, 0); }
}

.site-navbar .nav-link {
    position: relative;
    transition: color 0.25s ease;
}

.site-navbar .nav-link:not(.dropdown-toggle)::after {
    content: '';
    position: absolute;
    right: var(--bs-navbar-nav-link-padding-x, 0.5rem);
    left: var(--bs-navbar-nav-link-padding-x, 0.5rem);
    bottom: 2px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.35s var(--ease-out);
}

.site-navbar .nav-link:hover::after,
.site-navbar .nav-link.active::after {
    transform: scaleX(1);
}

.site-navbar .nav-link.active {
    color: #ffffff;
}

.nav-cta {
    border-radius: 999px;
    padding-inline: 16px;
    border-color: rgba(255, 107, 71, 0.5);
}

.nav-cta:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.dropdown-menu {
    animation: dropdown-in 0.25s var(--ease-out);
    backdrop-filter: blur(12px);
}

@keyframes dropdown-in {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to { opacity: 1; transform: none; }
}

.page-content {
    padding-top: 90px;
}

/* =========================================================
   buttons
   ========================================================= */

.btn {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transform: scale(0);
    animation: ripple 0.65s ease-out forwards;
    pointer-events: none;
}

@keyframes ripple {
    to { transform: scale(1); opacity: 0; }
}

.btn-glow {
    box-shadow: 0 10px 30px -10px rgba(255, 107, 71, 0.7);
}

.btn-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: skewX(-20deg);
    animation: shine 3.5s ease-in-out infinite;
}

@keyframes shine {
    0%, 60% { left: -75%; }
    100% { left: 130%; }
}

.btn-glow:hover {
    box-shadow: 0 16px 40px -10px rgba(255, 107, 71, 0.9);
}

.magnetic {
    transition: transform 0.35s var(--ease-spring), box-shadow 0.3s ease;
}

.btn-arrow i {
    transition: transform 0.3s var(--ease-out);
}

.btn-arrow:hover i {
    transform: translateX(-5px);
}

.link-underline {
    color: #ffffff;
    text-decoration: none;
}

.link-underline i {
    transition: transform 0.3s var(--ease-out);
}

.link-underline:hover {
    color: var(--accent-2);
}

.link-underline:hover i {
    transform: translateX(-6px);
}

/* =========================================================
   hero
   ========================================================= */

.hero-section {
    position: relative;
    padding: 50px 0 80px;
    min-height: calc(100vh - 90px);
    display: flex;
    align-items: center;
}

.hero-section .hello {
    color: #cfcfcf;
    font-size: 20px;
    margin-bottom: 4px;
}

.wave-hand {
    display: inline-block;
    transform-origin: 70% 70%;
    animation: wave 2.4s ease-in-out infinite;
}

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

.text-shimmer {
    background: linear-gradient(90deg, #ffffff 0%, #ffffff 35%, var(--accent-2) 50%, #ffffff 65%, #ffffff 100%);
    background-size: 250% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: shimmer 5s linear infinite;
}

@keyframes shimmer {
    from { background-position: 100% 0; }
    to { background-position: -150% 0; }
}

.hero-title {
    min-height: 1.6em;
    color: var(--accent-2);
}

.typed-caret {
    display: inline-block;
    width: 3px;
    height: 1.1em;
    margin-inline-start: 4px;
    vertical-align: middle;
    background: var(--accent);
    border-radius: 2px;
    animation: caret 0.9s steps(1) infinite;
}

@keyframes caret {
    50% { opacity: 0; }
}

.hero-section .bio {
    color: #aaaaaa;
    line-height: 2;
    max-width: 620px;
}

.hero-visual {
    position: relative;
    width: min(360px, 85vw);
    aspect-ratio: 34 / 36;
    --px: 0;
    --py: 0;
}

.hero-ring {
    position: absolute;
    inset: -18px;
    border-radius: 44px;
    background: conic-gradient(from var(--angle, 0deg), var(--accent), transparent 30%, #8b5cf6, transparent 65%, var(--accent-3), var(--accent));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    padding: 2px;
    opacity: 0.8;
    animation: ring-spin 6s linear infinite;
    translate: calc(var(--px) * -10px) calc(var(--py) * -10px);
    transition: translate 0.4s ease-out;
}

@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes ring-spin {
    to { --angle: 360deg; }
}

.hero-image {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 32px;
    background: linear-gradient(180deg, #ff7c5c 0%, #d94c2b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 30px 80px -30px rgba(255, 107, 71, 0.6);
    animation: float 6s ease-in-out infinite;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes float {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -16px; }
}

.image-placeholder {
    color: rgba(255, 255, 255, 0.9);
    font-size: 72px;
    font-weight: 800;
}

.float-badge {
    position: absolute;
    z-index: 2;
    padding: 10px 16px;
    border-radius: 16px;
    background: rgba(20, 20, 20, 0.75);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 15px 40px -15px rgba(0, 0, 0, 0.8);
    transition: translate 0.4s ease-out;
}

.float-badge i {
    color: var(--accent);
}

.badge-a {
    top: 12%;
    right: -14%;
    animation: bob 4s ease-in-out infinite;
    translate: calc(var(--px) * 22px) calc(var(--py) * 22px);
}

.badge-b {
    bottom: 14%;
    left: -12%;
    animation: bob 5s ease-in-out infinite 0.8s;
    translate: calc(var(--px) * 30px) calc(var(--py) * 30px);
}

.badge-b i {
    color: #fbbf24;
}

.badge-c {
    top: -4%;
    left: 6%;
    font-family: monospace;
    animation: bob 4.5s ease-in-out infinite 1.4s;
    translate: calc(var(--px) * -18px) calc(var(--py) * -18px);
}

@keyframes bob {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-12px) rotate(-3deg); }
}

.scroll-hint {
    position: absolute;
    bottom: 18px;
    left: 50%;
    width: 26px;
    height: 42px;
    margin-left: -13px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 14px;
}

.scroll-hint span {
    position: absolute;
    top: 8px;
    left: 50%;
    width: 4px;
    height: 8px;
    margin-left: -2px;
    border-radius: 2px;
    background: var(--accent);
    animation: scroll-dot 1.8s ease-in-out infinite;
}

@keyframes scroll-dot {
    0% { opacity: 0; transform: translateY(0); }
    30% { opacity: 1; }
    100% { opacity: 0; transform: translateY(16px); }
}

/* ---------- hero code window (Python hello world) ---------- */

.code-window {
    position: absolute;
    right: -24%;
    bottom: -9%;
    z-index: 3;
    width: 270px;
    direction: ltr;
    text-align: left;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(17, 17, 21, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(14px);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 107, 71, 0.08),
                0 0 40px -10px rgba(97, 175, 239, 0.25);
    font-family: Consolas, 'Cascadia Code', 'Courier New', monospace;
    translate: calc(var(--px) * 26px) calc(var(--py) * 18px);
    transition: translate 0.4s ease-out, box-shadow 0.4s ease;
    animation: cw-in 0.9s var(--ease-spring) 1.1s backwards, cw-bob 6s ease-in-out 2s infinite;
}

@keyframes cw-in {
    from { opacity: 0; transform: translateY(30px) scale(0.85) rotate(4deg); }
}

@keyframes cw-bob {
    0%, 100% { transform: translateY(0) rotate(-1deg); }
    50% { transform: translateY(-10px) rotate(0.5deg); }
}

.code-window.done {
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(152, 195, 121, 0.35),
                0 0 50px -8px rgba(152, 195, 121, 0.35);
}

.cw-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.cw-dot { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.cw-dot:nth-child(2) { background: #febc2e; }
.cw-dot:nth-child(3) { background: #28c840; }

.cw-title {
    margin-left: 6px;
    color: #9da5b4;
    font-size: 12px;
}

.cw-title i {
    color: #f7d13a;
}

.cw-run {
    margin-left: auto;
    padding: 2px 9px;
    border-radius: 6px;
    background: rgba(40, 200, 64, 0.15);
    color: #7ee08f;
    font-size: 11px;
    transition: transform 0.15s ease, background 0.2s ease;
}

.cw-run.pressed {
    transform: scale(0.88);
    background: rgba(40, 200, 64, 0.45);
    box-shadow: 0 0 16px rgba(40, 200, 64, 0.6);
}

.cw-editor {
    display: flex;
    min-height: 118px;
    padding: 10px 0;
    font-size: 12.5px;
    line-height: 1.75;
    transition: opacity 0.4s ease, filter 0.4s ease;
}

.code-window.clearing .cw-editor,
.code-window.clearing .cw-output {
    opacity: 0;
    filter: blur(4px);
}

.cw-lines {
    margin: 0;
    padding: 0 10px 0 12px;
    list-style: none;
    counter-reset: line;
    color: #4b5263;
    text-align: right;
    user-select: none;
}

.cw-lines li {
    counter-increment: line;
}

.cw-lines li::before {
    content: counter(line);
}

.cw-code {
    flex: 1;
    margin: 0;
    padding: 0 12px 0 0;
    overflow: hidden;
    color: #abb2bf;
    font: inherit;
    white-space: pre;
}

.cw-code code {
    font: inherit;
    color: inherit;
}

.cw-cursor {
    display: inline-block;
    width: 7px;
    height: 1.15em;
    vertical-align: text-bottom;
    background: #528bff;
    animation: caret 0.9s steps(1) infinite;
}

.tk-kw { color: #c678dd; }
.tk-fn { color: #61afef; }
.tk-pa { color: #e5c07b; }
.tk-st { color: #98c379; }
.tk-br { color: #d19a66; }
.tk-bi { color: #56b6c2; }
.tk-cm { color: #7f848e; font-style: italic; }

.cw-output {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 0;
    padding: 0 12px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.35);
    border-top: 1px solid transparent;
    font-size: 12px;
    transition: max-height 0.45s var(--ease-out), padding 0.45s var(--ease-out), border-color 0.3s ease, opacity 0.4s ease;
}

.cw-output.show {
    max-height: 70px;
    padding: 9px 12px 11px;
    border-top-color: rgba(255, 255, 255, 0.07);
}

.cw-prompt {
    color: #7f848e;
}

.cw-result {
    min-height: 1.4em;
    color: #98c379;
    font-weight: 700;
}

.code-window.done .cw-result::after {
    content: ' ✓';
    color: #28c840;
}

@media (max-width: 1199.98px) {
    .code-window { right: -8%; }
}

@media (max-width: 991.98px) {
    .hero-visual {
        margin-bottom: 220px;
    }

    .code-window {
        right: 50%;
        bottom: auto;
        top: calc(100% + 28px);
        width: min(320px, 90vw);
        translate: 50% 0;
    }
}

/* =========================================================
   tilt cards
   ========================================================= */

.tilt {
    --rx: 0deg;
    --ry: 0deg;
    --gx: 50%;
    --gy: 50%;
    transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));
    transform-style: preserve-3d;
    transition: transform 0.5s var(--ease-out), border-color 0.3s ease, box-shadow 0.3s ease;
}

.tilt.tilting {
    transition: transform 0.08s linear, border-color 0.3s ease, box-shadow 0.3s ease;
}

.tilt-glare {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(circle at var(--gx) var(--gy), rgba(255, 255, 255, 0.18), transparent 55%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tilt.tilting .tilt-glare {
    opacity: 1;
}

/* =========================================================
   stats
   ========================================================= */

.stats-strip {
    padding: 10px 0 50px;
}

.stat-card {
    padding: 26px 16px;
    border-radius: 22px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(8px);
    transition: transform 0.4s var(--ease-out), border-color 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 107, 71, 0.4);
}

.stat-num {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--accent-3));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.stat-num small {
    font-size: 0.5em;
}

.stat-label {
    color: #9a9a9a;
    font-size: 14px;
    margin-top: 4px;
}

/* =========================================================
   sections
   ========================================================= */

.section {
    position: relative;
    padding: 64px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.section-title {
    position: relative;
    display: inline-block;
    margin-bottom: 36px;
    padding-bottom: 10px;
    color: var(--accent);
}

.section-title::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(270deg, var(--accent), transparent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 1s var(--ease-out) 0.3s;
}

.section-title.revealed::after {
    transform: scaleX(1);
}

.section-title i {
    display: inline-block;
    animation: icon-pop 3s ease-in-out infinite;
}

@keyframes icon-pop {
    0%, 85%, 100% { transform: scale(1) rotate(0); }
    90% { transform: scale(1.25) rotate(-12deg); }
    95% { transform: scale(1.1) rotate(8deg); }
}

/* skills */

.skill-row {
    padding: 16px 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: border-color 0.3s ease, transform 0.3s var(--ease-out);
}

.skill-row:hover {
    border-color: rgba(255, 107, 71, 0.3);
    transform: translateY(-3px);
}

.skill-percent {
    color: var(--accent-2);
    font-weight: 700;
}

.skill-bar {
    height: 10px;
    border-radius: 10px;
    overflow: visible;
}

.skill-bar-fill {
    position: relative;
    width: 0;
    border-radius: 10px;
    background: linear-gradient(90deg, #ff6b47 0%, #ff9d85 50%, #ff6b47 100%);
    background-size: 200% 100%;
    transition: width 1.6s var(--ease-out);
    animation: bar-flow 2.5s linear infinite;
    box-shadow: 0 0 14px rgba(255, 107, 71, 0.55);
    overflow: visible;
}

.skill-bar-fill::after {
    content: '';
    position: absolute;
    left: -6px;
    top: 50%;
    width: 12px;
    height: 12px;
    margin-top: -6px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(255, 107, 71, 0.4), 0 0 16px rgba(255, 107, 71, 0.9);
}

@keyframes bar-flow {
    to { background-position: -200% 0; }
}

/* projects */

.project-card {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
}

.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 107, 71, 0.8), transparent 40%, transparent 60%, rgba(139, 92, 246, 0.6));
    -webkit-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;
}

.project-card:hover {
    box-shadow: 0 30px 60px -25px rgba(255, 107, 71, 0.45);
}

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

.project-image-wrap {
    overflow: hidden;
}

.project-image {
    height: 210px;
    object-fit: cover;
    transition: transform 0.8s var(--ease-out), filter 0.5s ease;
}

.project-card:hover .project-image {
    transform: scale(1.08);
    filter: saturate(1.2);
}

.tag-pill,
.badge.text-bg-secondary {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 107, 71, 0.1) !important;
    border: 1px solid rgba(255, 107, 71, 0.25);
    color: var(--accent-2) !important;
    font-size: 12px;
    text-decoration: none;
    transition: background 0.25s ease, transform 0.25s var(--ease-spring);
}

.tag-pill:hover,
.badge.text-bg-secondary:hover {
    background: rgba(255, 107, 71, 0.25) !important;
    transform: translateY(-2px) scale(1.05);
}

/* testimonials */

.testimonial-card {
    position: relative;
    height: 100%;
    margin: 0;
    padding: 28px;
    border-radius: 24px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: transform 0.4s var(--ease-out), border-color 0.3s ease, box-shadow 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 107, 71, 0.4);
    box-shadow: 0 25px 50px -25px rgba(255, 107, 71, 0.5);
}

.testimonial-quote {
    position: absolute;
    top: 18px;
    left: 22px;
    font-size: 42px;
    color: rgba(255, 107, 71, 0.15);
}

.testimonial-stars {
    color: #fbbf24;
    display: flex;
    gap: 3px;
}

.testimonial-stars i {
    animation: star-pop 0.5s var(--ease-spring) both;
}

.testimonial-stars i:nth-child(2) { animation-delay: 0.08s; }
.testimonial-stars i:nth-child(3) { animation-delay: 0.16s; }
.testimonial-stars i:nth-child(4) { animation-delay: 0.24s; }
.testimonial-stars i:nth-child(5) { animation-delay: 0.32s; }

@keyframes star-pop {
    from { transform: scale(0) rotate(-45deg); opacity: 0; }
    to { transform: none; opacity: 1; }
}

.testimonial-card blockquote {
    margin: 0;
    flex: 1;
    color: #d6d6d6;
    line-height: 2;
}

.testimonial-card figcaption {
    display: flex;
    align-items: center;
    gap: 12px;
}

.testimonial-card figcaption small {
    display: block;
    color: #9a9a9a;
}

.testimonial-avatar {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    box-shadow: 0 0 0 3px rgba(255, 107, 71, 0.2);
}

.marquee {
    overflow: hidden;
    padding-block: 12px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.marquee-track {
    display: flex;
    width: max-content;
    animation: marquee 40s linear infinite;
}

.marquee-track .testimonial-card {
    width: 360px;
    margin-inline-end: 24px;
}

.marquee:hover .marquee-track {
    animation-play-state: paused;
}

@keyframes marquee {
    to { transform: translateX(50%); }
}

.client-cta {
    margin-top: 32px;
    text-align: center;
    color: #9a9a9a;
}

/* experience timeline */

.timeline {
    position: relative;
    padding-inline-start: 40px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.timeline-line {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 11px;
    width: 2px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
}

.timeline-progress {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, var(--accent), #8b5cf6);
    transform: scaleY(0);
    transform-origin: top;
    box-shadow: 0 0 12px rgba(255, 107, 71, 0.7);
}

.timeline-item {
    position: relative;
}

.timeline-dot {
    position: absolute;
    top: 26px;
    right: -36px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #0b0b0b;
    border: 3px solid var(--accent);
    animation: pulse-dot 2.2s ease-out infinite;
}

.experience-card {
    border-radius: 20px;
    transition: transform 0.4s var(--ease-out), border-color 0.3s ease;
}

.experience-card .card-title {
    color: #ffffff;
}

.experience-card .card-text {
    color: #c9c9c9 !important;
    line-height: 1.9;
    white-space: pre-line;
}

.experience-card:hover {
    transform: translateX(-8px);
    border-color: rgba(255, 107, 71, 0.35);
}

/* contact */

.glass-card {
    padding: 32px;
    border-radius: 28px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
}

.contact-form {
    max-width: 720px;
}

/* =========================================================
   toasts
   ========================================================= */

.toast-stack {
    position: fixed;
    top: 90px;
    left: 20px;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(420px, calc(100vw - 40px));
}

.toast-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 0;
    padding: 14px 18px;
    border-radius: 16px;
    backdrop-filter: blur(14px);
    background: rgba(25, 25, 25, 0.92) !important;
    border: 1px solid var(--glass-border);
    border-inline-start: 4px solid var(--accent);
    color: #ffffff !important;
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.9);
    animation: toast-in 0.6s var(--ease-spring);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.toast-item.alert-success { border-inline-start-color: #22c55e; }
.toast-item.alert-danger { border-inline-start-color: #ef4444; }
.toast-item.alert-warning { border-inline-start-color: #eab308; }
.toast-item.alert-info { border-inline-start-color: #38bdf8; }

.toast-item.hide {
    opacity: 0;
    transform: translateX(-60px);
}

.toast-close {
    border: none;
    background: none;
    color: #aaaaaa;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(-80px) scale(0.9); }
    to { opacity: 1; transform: none; }
}

/* =========================================================
   back to top
   ========================================================= */

.back-to-top {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 1050;
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background: rgba(20, 20, 20, 0.85);
    color: #ffffff;
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s var(--ease-spring), background 0.25s ease;
}

.back-to-top.show {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.back-to-top:hover {
    background: var(--accent);
}

.back-to-top:hover i {
    animation: arrow-up 0.6s ease infinite alternate;
}

@keyframes arrow-up {
    to { transform: translateY(-4px); }
}

.back-to-top svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.back-to-top circle {
    fill: none;
    stroke: var(--accent);
    stroke-width: 3;
    stroke-linecap: round;
}

/* =========================================================
   project detail / tag pages / resume
   ========================================================= */

.detail-container {
    padding: 40px 0 60px;
    max-width: 900px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    color: var(--accent);
    font-weight: 500;
    text-decoration: none;
}

.back-link i {
    transition: transform 0.3s var(--ease-out);
}

.back-link:hover i {
    transform: translateX(6px);
}

.full-project-image {
    width: 100%;
    box-shadow: 0 40px 80px -40px rgba(255, 107, 71, 0.5);
}

.project-content h3 {
    color: var(--accent);
    margin-bottom: 16px;
}

.rich-text {
    line-height: 1.8;
    color: #d1d1d1;
    margin-top: 20px;
}

.resume-frame {
    background: #1a1a1a;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

/* =========================================================
   auth & client area
   ========================================================= */

.auth-wrap {
    padding: 60px 0;
}

.auth-card {
    position: relative;
    border-radius: 28px;
    backdrop-filter: blur(14px);
    background: rgba(18, 18, 18, 0.7);
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: conic-gradient(from var(--angle, 0deg), var(--accent), transparent 25%, #8b5cf6, transparent 60%, var(--accent));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: ring-spin 5s linear infinite;
    pointer-events: none;
}

.auth-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    box-shadow: 0 15px 35px -12px rgba(255, 107, 71, 0.8);
    animation: float 5s ease-in-out infinite;
}

.auth-note {
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(255, 107, 71, 0.08);
    border: 1px dashed rgba(255, 107, 71, 0.35);
    color: #d6d6d6;
    font-size: 14px;
    line-height: 1.9;
}

.password-field {
    position: relative;
}

.password-field .form-control {
    padding-inline-end: 48px;
}

.password-field .form-control:focus {
    transform: none;
}

.password-toggle {
    position: absolute;
    top: 50%;
    inset-inline-end: 6px;
    width: 36px;
    height: 36px;
    margin-top: -18px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #9a9a9a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, transform 0.25s var(--ease-spring);
}

.password-toggle:hover {
    color: var(--accent-2);
    background: rgba(255, 107, 71, 0.1);
}

.password-toggle:active {
    transform: scale(0.88);
}

.password-toggle[aria-pressed="true"] {
    color: var(--accent);
}

.password-toggle i {
    animation: star-pop 0.35s var(--ease-spring);
}

.client-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
}

.client-project {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 18px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    transition: transform 0.3s var(--ease-out), border-color 0.3s ease;
}

.client-project:hover {
    transform: translateX(-6px);
    border-color: rgba(255, 107, 71, 0.35);
}

.status-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
}

.status-pill.ok {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
}

.status-pill.wait {
    background: rgba(234, 179, 8, 0.15);
    color: #fde047;
}

/* star rating input — DOM order 5..1, laid out LTR so 1 sits on the right */

.star-rating {
    position: relative;
    display: inline-flex;
    direction: ltr;
    gap: 6px;
}

.star-rating input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.star-rating label {
    font-size: 34px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.18);
    cursor: pointer;
    transition: color 0.2s ease, transform 0.25s var(--ease-spring);
}

.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label {
    color: #fbbf24;
    text-shadow: 0 0 18px rgba(251, 191, 36, 0.6);
}

.star-rating label:hover {
    transform: scale(1.25) rotate(-10deg);
}

.star-rating input:focus-visible + label {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: 6px;
}

/* =========================================================
   footer
   ========================================================= */

.site-footer {
    padding: 0 0 28px;
    margin-top: 40px;
    color: #777777;
    font-size: 14px;
}

.footer-wave {
    height: 60px;
    overflow: hidden;
    margin-bottom: 20px;
}

.footer-wave svg {
    width: 200%;
    height: 100%;
    animation: wave-move 12s linear infinite;
}

.footer-wave path {
    fill: rgba(255, 107, 71, 0.08);
}

@keyframes wave-move {
    to { transform: translateX(50%); }
}

/* =========================================================
   live chat widget (bottom right)
   ========================================================= */

.chat-widget {
    position: fixed;
    right: 24px;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    z-index: 1060;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 14px;
    direction: rtl;
}

/* never on top of videos that are playing full screen */
body.reels-open .chat-widget {
    display: none;
}

.chat-launcher {
    position: relative;
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    color: #ffffff;
    font-size: 24px;
    background: linear-gradient(135deg, var(--accent), #ff8a5c);
    box-shadow: 0 14px 34px -10px rgba(255, 107, 71, 0.85);
    cursor: pointer;
    transition: transform 0.35s var(--ease-spring), box-shadow 0.3s ease;
    animation: launcher-in 0.7s var(--ease-spring) 1.2s backwards;
}

.chat-launcher:hover {
    transform: scale(1.08) rotate(-6deg);
}

.chat-launcher::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(255, 107, 71, 0.6);
    animation: launcher-ring 2.6s ease-out infinite;
}

@keyframes launcher-in {
    from { opacity: 0; transform: scale(0) rotate(-90deg); }
}

@keyframes launcher-ring {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.6); opacity: 0; }
}

.chat-launcher-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.35s var(--ease-spring), opacity 0.25s ease;
}

.chat-launcher .is-close-icon {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

.chat-widget.is-open .chat-launcher .is-open-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

.chat-widget.is-open .chat-launcher .is-close-icon {
    opacity: 1;
    transform: none;
}

.chat-widget.is-open .chat-launcher::before {
    animation: none;
    opacity: 0;
}

.chat-launcher-dot {
    position: absolute;
    right: 3px;
    bottom: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #6b6b6b;
    border: 2px solid #0b0b0b;
}

.chat-widget.is-online .chat-launcher-dot {
    background: #22c55e;
}

.chat-unread {
    position: absolute;
    top: -4px;
    left: -4px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ef4444;
    border: 2px solid #0b0b0b;
    font-size: 12px;
    font-weight: 800;
    line-height: 18px;
    animation: unread-pop 0.5s var(--ease-spring);
}

.chat-launcher.has-unread {
    animation: launcher-shake 3s ease-in-out infinite;
}

@keyframes unread-pop {
    from { transform: scale(0); }
}

@keyframes launcher-shake {
    0%, 88%, 100% { transform: rotate(0); }
    91% { transform: rotate(-14deg); }
    94% { transform: rotate(12deg); }
    97% { transform: rotate(-6deg); }
}

.chat-panel {
    width: min(370px, calc(100vw - 32px));
    height: min(540px, calc(100vh - 140px));
    height: min(540px, calc(100dvh - 140px));
    display: flex;
    flex-direction: column;
    border-radius: 24px;
    overflow: hidden;
    background: rgba(16, 16, 16, 0.94);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(18px);
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 107, 71, 0.08);
    transform-origin: bottom right;
    opacity: 0;
    transform: translateY(16px) scale(0.92);
    transition: opacity 0.25s ease, transform 0.35s var(--ease-spring);
}

.chat-widget.is-open .chat-panel {
    opacity: 1;
    transform: none;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(255, 107, 71, 0.25), rgba(139, 92, 246, 0.15));
    border-bottom: 1px solid var(--glass-border);
}

.chat-avatar {
    position: relative;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
}

.chat-avatar-dot {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #6b6b6b;
    border: 2px solid #1a1a1a;
}

.chat-widget.is-online .chat-avatar-dot {
    background: #22c55e;
    animation: online-pulse 2s ease-out infinite;
}

@keyframes online-pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    100% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}

.chat-header-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.chat-header-text small {
    color: #bdbdbd;
    font-size: 12px;
}

.chat-icon-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    transition: background 0.2s ease;
}

.chat-icon-btn:hover {
    background: rgba(255, 255, 255, 0.18);
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: thin;
}

.chat-msg {
    max-width: 82%;
    padding: 9px 13px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-line;
    word-wrap: break-word;
}

.chat-msg small {
    display: block;
    margin-top: 2px;
    font-size: 10px;
    opacity: 0.6;
}

.chat-msg.owner {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.08);
    border-start-start-radius: 4px;
}

.chat-msg.visitor {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--accent), #ff8a5c);
    border-start-end-radius: 4px;
}

.chat-msg.system {
    align-self: center;
    max-width: 92%;
    background: rgba(239, 68, 68, 0.15);
    color: #fecaca;
    font-size: 12px;
    text-align: center;
}

.chat-msg.is-new {
    animation: chat-bubble-in 0.4s var(--ease-spring);
}

@keyframes chat-bubble-in {
    from { opacity: 0; transform: translateY(10px) scale(0.94); }
}

.chat-compose {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--glass-border);
}

.chat-compose textarea {
    flex: 1;
    resize: none;
    padding: 10px 14px;
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
}

.chat-compose textarea:focus {
    outline: none;
    border-color: rgba(255, 107, 71, 0.55);
}

.chat-send {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    color: #ffffff;
    background: var(--accent);
    transition: transform 0.25s var(--ease-spring), opacity 0.2s ease;
}

.chat-send:hover {
    transform: scale(1.1) rotate(-12deg);
}

.chat-compose.sending .chat-send {
    opacity: 0.5;
}

.chat-body,
.chat-contact {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.chat-body::-webkit-scrollbar,
.chat-contact::-webkit-scrollbar {
    width: 6px;
}

.chat-body::-webkit-scrollbar-thumb,
.chat-contact::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
}

/* offline: the form gets all the room; old messages (if any) shrink to a short strip */
.chat-widget.needs-contact .chat-body {
    flex: 0 0 auto;
    max-height: 110px;
}

.chat-widget.needs-contact.is-empty .chat-body {
    display: none;
}

.chat-contact {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 16px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: chat-bubble-in 0.45s var(--ease-out);
}

.chat-widget.needs-contact:not(.is-empty) .chat-contact {
    border-top: 1px solid var(--glass-border);
}

/* the submit button always stays visible at the bottom of the form */
.chat-contact-actions {
    position: sticky;
    bottom: 0;
    margin: 4px -16px 0;
    padding: 12px 16px 14px;
    background: linear-gradient(0deg, rgba(16, 16, 16, 1) 70%, rgba(16, 16, 16, 0));
}

.chat-contact-intro {
    flex-shrink: 0;
    margin: 0;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.2);
    color: #e5e5e5;
    font-size: 13px;
    line-height: 1.9;
}

.chat-contact-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.chat-contact label,
.chat-contact-row {
    flex-shrink: 0;
}

.chat-contact-intro i {
    color: #fbbf24;
}

.chat-contact label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #bdbdbd;
}

.chat-contact input,
.chat-contact textarea {
    width: 100%;
    min-width: 0;
    padding: 9px 12px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    resize: none;
}

.chat-contact input:focus,
.chat-contact textarea:focus {
    outline: none;
    border-color: rgba(255, 107, 71, 0.55);
}

.chat-error {
    color: #fca5a5;
    min-height: 0;
}

.chat-error:empty {
    display: none;
}

.chat-note {
    margin: 0;
    padding: 10px 16px;
    font-size: 12px;
    color: #bbf7d0;
    background: rgba(34, 197, 94, 0.1);
    border-top: 1px solid rgba(34, 197, 94, 0.25);
}

@media (max-width: 575.98px) {
    .chat-widget {
        right: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }

    .chat-launcher {
        width: 54px;
        height: 54px;
        font-size: 22px;
    }
}

/* =========================================================
   responsive & reduced motion
   ========================================================= */

@media (max-width: 991.98px) {
    .hero-section {
        min-height: auto;
        text-align: center;
    }

    .hero-section .bio {
        margin-inline: auto;
    }

    .hero-section .actions {
        justify-content: center;
    }

    .scroll-hint,
    .cursor-glow {
        display: none;
    }

    .badge-a { right: -4%; }
    .badge-b { left: -4%; }
}

/* =========================================================
   mobile: bottom navigation bar + menu sheet
   ========================================================= */

.mnav,
.msheet,
.msheet-overlay {
    display: none;
}

@media (max-width: 991.98px) {
    :root {
        --mnav-h: 66px;
        --mnav-clear: calc(var(--mnav-h) + 26px + env(safe-area-inset-bottom, 0px));
    }

    /* no top bar on mobile — the bottom bar does everything */
    .site-navbar {
        display: none !important;
    }

    .page-content {
        padding-top: calc(14px + env(safe-area-inset-top, 0px));
    }

    /* ---- the bar ---- */
    .mnav {
        display: block;
        position: fixed;
        right: 12px;
        left: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        z-index: 1050;
        animation: mnav-in 0.8s var(--ease-spring) 0.9s backwards;
    }

    @keyframes mnav-in {
        from { transform: translateY(150%); }
    }

    body.reels-open .mnav {
        display: none;
    }

    .mnav-bar {
        position: relative;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        height: var(--mnav-h);
        padding: 0 4px;
        border-radius: 24px;
        background: rgba(16, 16, 16, 0.78);
        -webkit-backdrop-filter: blur(20px) saturate(160%);
        backdrop-filter: blur(20px) saturate(160%);
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }

    .mnav-item {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        min-width: 0;
        padding: 0;
        border: 0;
        background: none;
        color: #9a9a9a;
        font-family: inherit;
        font-size: 10.5px;
        font-weight: 600;
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
        transition: color 0.25s ease;
    }

    .mnav-item > i {
        font-size: 19px;
        transition: transform 0.35s var(--ease-spring), color 0.25s ease;
    }

    .mnav-item > span:last-child {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mnav-item.active {
        color: #ffffff;
    }

    .mnav-item.active > i {
        color: var(--accent);
        transform: translateY(-3px) scale(1.12);
    }

    .mnav-item.tapped > i,
    .mnav-item.tapped .mnav-fab,
    .mnav-item.tapped .mnav-burger {
        animation: mnav-tap 0.45s var(--ease-spring);
    }

    @keyframes mnav-tap {
        40% { transform: scale(0.8); }
    }

    .mnav-indicator {
        position: absolute;
        left: 0;
        bottom: 7px;
        width: 22px;
        height: 4px;
        border-radius: 4px;
        background: var(--accent);
        box-shadow: 0 0 12px rgba(255, 107, 71, 0.9);
        opacity: 0;
        transition: transform 0.55s var(--ease-spring), opacity 0.3s ease;
    }

    .mnav-indicator.show {
        opacity: 1;
    }

    /* raised center button: jumps to the other section */
    .mnav-center {
        justify-content: flex-end;
        padding-bottom: 9px;
        color: #ffffff;
    }

    .mnav-fab {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 56px;
        height: 56px;
        margin-top: -34px;
        margin-bottom: 1px;
        border-radius: 50%;
        border: 4px solid #0b0b0b;
        color: #ffffff;
        font-size: 21px;
        background: linear-gradient(135deg, var(--accent), #ff8a5c);
        box-shadow: 0 12px 26px -8px rgba(255, 107, 71, 0.9);
    }

    .mnav-fab::before {
        content: '';
        position: absolute;
        inset: -4px;
        border-radius: 50%;
        border: 2px solid rgba(255, 107, 71, 0.6);
        animation: launcher-ring 2.6s ease-out infinite;
    }

    .mnav-burger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        width: 20px;
        height: 19px;
    }

    .mnav-burger span {
        display: block;
        height: 2px;
        border-radius: 2px;
        background: currentColor;
        transition: transform 0.35s var(--ease-spring), opacity 0.25s ease, width 0.3s ease;
    }

    .mnav-burger span:nth-child(2) {
        width: 65%;
    }

    body.msheet-open [data-msheet-open] {
        color: #ffffff;
    }

    body.msheet-open .mnav-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
    body.msheet-open .mnav-burger span:nth-child(2) { opacity: 0; width: 0; }
    body.msheet-open .mnav-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

    /* ---- the sheet ---- */
    body.msheet-open {
        overflow: hidden;
    }

    .msheet-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1075;
        background: rgba(0, 0, 0, 0.55);
        -webkit-backdrop-filter: blur(4px);
        backdrop-filter: blur(4px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.35s ease;
    }

    body.msheet-open .msheet-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .msheet {
        display: block;
        position: fixed;
        right: 0;
        left: 0;
        bottom: 0;
        z-index: 1080;
        max-height: 86vh;
        max-height: 86dvh;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 4px 18px calc(22px + env(safe-area-inset-bottom, 0px));
        border-radius: 28px 28px 0 0;
        background: #131313;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.6);
        transform: translateY(105%);
        transition: transform 0.5s var(--ease-spring);
    }

    body.msheet-open .msheet {
        transform: translateY(0);
    }

    .msheet.dragging {
        transition: none;
    }

    body.msheet-open .msheet > * {
        animation: msheet-item 0.55s var(--ease-out) backwards;
    }

    body.msheet-open .msheet > *:nth-child(3) { animation-delay: 0.06s; }
    body.msheet-open .msheet > *:nth-child(4) { animation-delay: 0.12s; }
    body.msheet-open .msheet > *:nth-child(5) { animation-delay: 0.16s; }
    body.msheet-open .msheet > *:nth-child(6) { animation-delay: 0.2s; }
    body.msheet-open .msheet > *:nth-child(7) { animation-delay: 0.24s; }

    @keyframes msheet-item {
        from { opacity: 0; transform: translateY(18px); }
    }

    .msheet-handle {
        display: flex;
        justify-content: center;
        padding: 8px 0 6px;
    }

    .msheet-handle span {
        width: 44px;
        height: 5px;
        border-radius: 5px;
        background: rgba(255, 255, 255, 0.2);
    }

    .msheet-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 14px;
    }

    .msheet-head img {
        height: 42px;
        width: auto;
    }

    .msheet-close {
        width: 38px;
        height: 38px;
        border: 0;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.08);
        color: #ffffff;
    }

    .msheet-sections {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-bottom: 18px;
    }

    .msheet-section {
        display: flex;
        flex-direction: column;
        gap: 2px;
        padding: 14px;
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid var(--glass-border);
        color: #dddddd;
        text-decoration: none;
        transition: transform 0.3s var(--ease-spring);
    }

    .msheet-section:active {
        transform: scale(0.96);
    }

    .msheet-section i {
        margin-bottom: 6px;
        font-size: 22px;
        color: var(--accent);
    }

    .msheet-section small {
        color: #8a8a8a;
        font-size: 11px;
    }

    .msheet-section.active {
        color: #ffffff;
        background: linear-gradient(135deg, rgba(255, 107, 71, 0.25), rgba(139, 92, 246, 0.15));
        border-color: rgba(255, 107, 71, 0.5);
    }

    .msheet-label {
        margin: 0 0 8px;
        color: #7a7a7a;
        font-size: 12px;
        font-weight: 700;
    }

    .msheet-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 18px;
    }

    .msheet-grid a,
    .msheet-grid button {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        padding: 13px 6px;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.06);
        color: #d6d6d6;
        font-family: inherit;
        font-size: 12.5px;
        text-decoration: none;
        transition: transform 0.3s var(--ease-spring), border-color 0.2s ease;
    }

    .msheet-grid a:active,
    .msheet-grid button:active {
        transform: scale(0.94);
        border-color: rgba(255, 107, 71, 0.5);
    }

    .msheet-grid i {
        font-size: 18px;
        color: var(--accent-2);
    }

    .msheet-account {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .msheet-user {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 4px;
        color: #dddddd;
    }

    .msheet-avatar {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-weight: 800;
        background: linear-gradient(135deg, var(--accent), #8b5cf6);
    }

    /* ---- keep floating buttons above the bar ---- */
    .chat-widget {
        right: 16px;
        bottom: var(--mnav-clear);
    }

    .chat-launcher {
        width: 52px;
        height: 52px;
        font-size: 21px;
    }

    .chat-panel {
        width: calc(100vw - 32px);
        height: min(560px, calc(100vh - var(--mnav-clear) - 100px));
        height: min(560px, calc(100dvh - var(--mnav-clear) - 100px));
    }

    .back-to-top {
        left: 16px;
        bottom: var(--mnav-clear);
        width: 46px;
        height: 46px;
    }

    .site-footer {
        padding-bottom: calc(var(--mnav-clear) + 10px);
    }

    .toast-stack {
        top: calc(14px + env(safe-area-inset-top, 0px));
        right: 12px;
        left: 12px;
        max-width: none;
    }

    /* anchor jumps (#projects …) no longer need room for a top bar */
    [id] {
        scroll-margin-top: 12px;
    }

    .auth-wrap {
        padding: 30px 0;
    }
}

/* =========================================================
   small phones
   ========================================================= */

@media (max-width: 575.98px) {
    .section {
        padding: 46px 0;
    }

    .section-title {
        margin-bottom: 24px;
        font-size: 1.35rem;
    }

    .hero-section {
        padding: 18px 0 40px;
    }

    .hero-name {
        font-size: 2.3rem;
    }

    .hero-section .bio {
        font-size: 15px;
    }

    .float-badge {
        padding: 7px 11px;
        font-size: 12px;
    }

    .badge-a { right: 0; }
    .badge-b { left: 0; }

    .stats-strip {
        padding-bottom: 36px;
    }

    .stat-card {
        padding: 18px 8px;
        border-radius: 18px;
    }

    .glass-card {
        padding: 20px 16px;
        border-radius: 22px;
    }

    .skill-row {
        padding: 13px 14px;
    }

    .project-image {
        height: 190px;
    }

    .testimonial-card {
        padding: 22px 18px;
    }

    .marquee-track .testimonial-card {
        width: 280px;
        margin-inline-end: 14px;
    }

    .timeline {
        padding-inline-start: 30px;
    }

    .timeline-line {
        right: 7px;
    }

    .timeline-dot {
        right: -30px;
    }

    .experience-card:hover {
        transform: none;
    }

    .client-project {
        flex-wrap: wrap;
    }

    .client-head .btn {
        width: 100%;
    }

    .detail-container {
        padding: 20px 0 40px;
    }

    .hero-section .actions .btn-lg {
        padding: 10px 18px;
        font-size: 1rem;
    }
}

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

    [data-reveal] {
        opacity: 1;
        transform: none;
        filter: none;
    }
}
