/* ============================================
   Khaled Almahamid — Flutter Developer Portfolio
   Theme: slate terminal / blueprint (distinct from generic “GitHub dark”)
   ============================================ */

/* Brand limes (Flutter app): primary #C1FF72, primaryDark #A1E54A */
:root {
    --lime: #c1ff72;
    --lime-dark: #a1e54a;
    --bg-primary: #070a0d;
    --bg-secondary: #0e1419;
    --bg-elevated: #121a22;
    --bg-nav: rgba(7, 10, 13, 0.82);
    --border-color: #1f2d3a;
    --border-strong: #2a3d4d;
    --text-primary: #e8eef4;
    --text-secondary: #8fa3b8;
    --accent: var(--lime);
    --accent-bright: var(--lime);
    --accent-hot: var(--lime-dark);
    --accent-muted: rgba(193, 255, 114, 0.15);
    --accent-glow: rgba(193, 255, 114, 0.28);
    --accent-rgb: 193, 255, 114;
    --warn: #ffb84d;
    --success: var(--lime-dark);
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
    --font-family: var(--font-sans);
    --radius-sm: 6px;
    --radius-md: 10px;
    --shadow-card: 0 18px 48px rgba(0, 0, 0, 0.45);
}

body.theme-light {
    --bg-primary: #f4f1eb;
    --bg-secondary: #ebe6dd;
    --bg-elevated: #ffffff;
    --bg-nav: rgba(244, 241, 235, 0.88);
    --border-color: #d4cdc2;
    --border-strong: #c4bbb0;
    --text-primary: #1a1f26;
    --text-secondary: #5c6570;
    /* Readable olive-lime for links, borders, small type on cream */
    --accent: #5a6d24;
    --accent-bright: var(--lime);
    --accent-hot: var(--lime-dark);
    --accent-muted: rgba(193, 255, 114, 0.22);
    --accent-glow: rgba(161, 229, 74, 0.32);
    --warn: #c77b00;
    --shadow-card: 0 16px 40px rgba(26, 31, 38, 0.08);
}

body.theme-light .navbar.scrolled {
    box-shadow: 0 8px 32px rgba(26, 31, 38, 0.08);
}

body.theme-light .hero {
    background: linear-gradient(165deg, var(--bg-primary) 0%, rgba(235, 230, 221, 0.4) 55%, var(--bg-primary) 100%);
}

body.theme-light .hero-grid {
    opacity: 0.35;
}

body.theme-light .navbar {
    background: rgba(252, 250, 246, 0.94);
    border-bottom-color: var(--border-strong);
}

body.theme-light .skill-card,
body.theme-light .service-card,
body.theme-light .project-card,
body.theme-light .experience-card,
body.theme-light .education-card,
body.theme-light .languages-card,
body.theme-light .tools-category-card,
body.theme-light .contact-panel {
    border-color: var(--border-strong);
    box-shadow:
        0 1px 0 rgba(26, 31, 38, 0.05),
        0 10px 28px rgba(26, 31, 38, 0.05);
}

body.theme-light .skill-card:hover,
body.theme-light .service-card:hover,
body.theme-light .project-card:hover,
body.theme-light .experience-card:hover,
body.theme-light .education-card:hover,
body.theme-light .languages-card:hover {
    box-shadow:
        0 1px 0 rgba(26, 31, 38, 0.06),
        0 16px 40px rgba(26, 31, 38, 0.09);
}

body.theme-light .tools-category-card:hover,
body.theme-light .contact-panel:hover {
    box-shadow:
        0 1px 0 rgba(26, 31, 38, 0.06),
        0 14px 36px rgba(26, 31, 38, 0.08);
}

body.theme-light .nav-action,
body.theme-light .nav-toggle {
    border-color: var(--border-strong);
    background: var(--bg-elevated);
}

body.theme-light .footer {
    border-top-color: var(--border-strong);
}

body.theme-light .form-group input,
body.theme-light .form-group textarea {
    border-color: var(--border-strong);
}

body.theme-light .btn-secondary {
    background: var(--bg-elevated);
}

html[dir="rtl"],
body.lang-ar,
body.lang-ar * {
    font-family: 'Cairo', var(--font-sans);
}

.mono {
    font-family: var(--font-mono);
    letter-spacing: -0.02em;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.65;
    overflow-x: hidden;
    background-image:
        radial-gradient(ellipse 100% 70% at 15% -10%, var(--accent-glow), transparent 50%),
        radial-gradient(ellipse 80% 50% at 100% 30%, rgba(255, 184, 77, 0.06), transparent 45%);
}

body.theme-light {
    background-image:
        radial-gradient(ellipse 90% 60% at 10% 0%, var(--accent-glow), transparent 55%),
        radial-gradient(ellipse 70% 40% at 95% 20%, rgba(255, 184, 77, 0.08), transparent 50%);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    top: 0;
    left: 1rem;
    z-index: 10001;
    padding: 0.65rem 1rem;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--bg-primary);
    background: var(--accent);
    border: 1px solid var(--accent-hot);
    border-radius: var(--radius-md);
    text-decoration: none;
    box-shadow: var(--shadow-card);
    transform: translateY(-120%);
    transition: transform 0.2s ease, outline-offset 0.15s ease;
}

.skip-link:focus {
    transform: translateY(1rem);
    outline: 2px solid var(--text-primary);
    outline-offset: 3px;
}

html[dir="rtl"] .skip-link,
body.rtl .skip-link {
    left: auto;
    right: 1rem;
}

#main {
    scroll-margin-top: 5.5rem;
}

section[id] {
    scroll-margin-top: 5.5rem;
}

/* ============================================
   Navigation
   ============================================ */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    min-height: 72px;
    display: flex;
    align-items: center;
    background-color: var(--bg-nav);
    backdrop-filter: blur(18px) saturate(1.15);
    border-bottom: 1px solid var(--border-color);
    transition: box-shadow 0.35s ease, background-color 0.35s ease, border-color 0.35s ease;
}

.navbar.scrolled {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    border-bottom-color: var(--border-strong);
}

.nav-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.65rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
}

.nav-logo {
    flex-shrink: 0;
    font-size: 1.2rem;
    font-weight: 800;
    font-family: var(--font-sans);
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.03em;
    line-height: 1;
    padding: 0.35rem 0;
}

.nav-logo:hover {
    color: var(--accent-bright);
}

.nav-menu {
    flex: 1 1 auto;
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem 1.35rem;
    align-items: center;
}

.nav-menu li {
    display: flex;
    align-items: center;
}

.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    line-height: 1;
    padding: 0.4rem 0;
    letter-spacing: 0.01em;
    transition: color 0.2s ease;
}

.nav-menu a:hover {
    color: var(--accent-bright);
}

.nav-trailing {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-elevated);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.nav-action:hover {
    border-color: var(--accent);
    background: var(--accent-muted);
    color: var(--accent-bright);
    box-shadow: 0 0 0 1px var(--accent-glow);
}

.nav-action:active {
    transform: scale(0.96);
}

.nav-action--lang {
    width: auto;
    min-width: 2.5rem;
    padding: 0 0.55rem;
}

.nav-action__lang {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1;
}

.nav-action__icon-slot {
    position: relative;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.nav-action__svg {
    position: absolute;
    inset: 0;
    width: 1.25rem;
    height: 1.25rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.nav-action__svg.active {
    opacity: 1;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-elevated);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

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

.nav-toggle-bar {
    display: block;
    width: 18px;
    height: 2px;
    margin: 0 auto;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle.active .nav-toggle-bar:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle.active .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active .nav-toggle-bar:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ============================================
   Hero
   ============================================ */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 7.25rem 1.5rem 4rem;
    overflow: hidden;
    background: linear-gradient(165deg, var(--bg-primary) 0%, rgba(14, 20, 25, 0.85) 50%, var(--bg-primary) 100%);
}

.hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.hero-grid {
    position: absolute;
    inset: -20%;
    background-image:
        linear-gradient(rgba(var(--accent-rgb), 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--accent-rgb), 0.05) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 65% at 50% 40%, black 20%, transparent 70%);
    opacity: 0.55;
}

body.theme-light .hero-grid {
    background-image:
        linear-gradient(rgba(var(--accent-rgb), 0.09) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--accent-rgb), 0.09) 1px, transparent 1px);
}

.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
}

.hero-orb-1 {
    width: min(55vw, 420px);
    height: min(55vw, 420px);
    background: var(--accent);
    top: 5%;
    right: -8%;
}

.hero-orb-2 {
    width: min(40vw, 320px);
    height: min(40vw, 320px);
    background: var(--warn);
    bottom: 10%;
    left: -5%;
    opacity: 0.12;
}

body.theme-light .hero-orb-1 {
    opacity: 0.22;
    background: var(--accent-bright);
}

body.theme-light .hero-orb-2 {
    opacity: 0.08;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
}

.hero-eyebrow {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 0.75rem;
    opacity: 0;
    animation: fadeInUp 0.75s ease forwards;
}

.hero-eyebrow::before {
    content: '● ';
    color: var(--success);
    font-size: 0.55rem;
    vertical-align: middle;
}

.hero-title {
    font-size: clamp(2.6rem, 6vw, 3.75rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    opacity: 0;
    animation: fadeInUp 0.75s ease 0.06s forwards;
}

body.theme-light .hero-title {
    background: linear-gradient(135deg, #0f1419 0%, #3d4a58 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-subtitle {
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 1.5rem;
    letter-spacing: 0.02em;
    opacity: 0;
    animation: fadeInUp 0.75s ease 0.12s forwards;
}

.hero-intro,
.hero-intro-secondary {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.75;
    max-width: 56ch;
    opacity: 0;
    animation: fadeInUp 0.75s ease 0.18s forwards;
}

.hero-tech {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
    line-height: 1.65;
    max-width: 52ch;
    margin-bottom: 0.25rem;
    opacity: 0;
    animation: fadeInUp 0.75s ease 0.24s forwards;
}

.hero-intro-secondary {
    animation-delay: 0.24s;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
    opacity: 0;
    animation: fadeInUp 0.75s ease 0.32s forwards;
}

.hero-buttons .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.72rem 1.35rem;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.btn:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-download {
    padding: 0.62rem 1rem;
    font-size: 0.88rem;
}

.btn-primary {
    background: linear-gradient(145deg, var(--accent-bright) 0%, var(--accent-hot) 100%);
    color: #0f1408;
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px var(--accent-glow);
}

body.theme-light .btn-primary {
    color: #0f1408;
    background: linear-gradient(145deg, var(--accent-bright) 0%, var(--accent-hot) 100%);
    box-shadow: 0 4px 24px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
}

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

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-muted);
    transform: translateY(-2px);
}

.btn-download .btn-icon {
    opacity: 0.85;
}

.btn-download:hover .btn-icon {
    opacity: 1;
}

/* ============================================
   Sections
   ============================================ */

.section {
    padding: 5rem 1.5rem;
    position: relative;
}

/* Section rhythm: void = page bg + divider; band = muted strip + lime wash (matches tools/contact DNA) */
.section-void {
    position: relative;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

body.theme-light .section-void {
    border-bottom-color: var(--border-strong);
}

.section-band {
    position: relative;
    border-bottom: 1px solid var(--border-color);
    background:
        linear-gradient(180deg, rgba(var(--accent-rgb), 0.042) 0%, transparent 40%),
        linear-gradient(180deg, rgba(14, 20, 25, 0.92) 0%, rgba(10, 14, 18, 0.5) 100%);
}

body.theme-light .section-band {
    border-bottom-color: var(--border-strong);
    background:
        linear-gradient(180deg, rgba(var(--accent-rgb), 0.08) 0%, transparent 42%),
        linear-gradient(180deg, #ebe6dd 0%, rgba(235, 230, 221, 0.88) 100%);
}

.section-tools::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.055) 0%, transparent 52%);
}

.section-tools .container {
    position: relative;
    z-index: 1;
}

.section-contact::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.065) 0%, transparent 36%);
}

body.theme-light .section-contact::before {
    background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.09) 0%, transparent 40%);
}

.section-contact .container {
    position: relative;
    z-index: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: clamp(1.65rem, 3.5vw, 2.1rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 2.5rem;
    color: var(--text-primary);
    position: relative;
    padding-bottom: 1.1rem;
    padding-left: 1rem;
    border-left: 3px solid var(--accent);
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

.section.is-visible .section-title,
.section-title.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: min(100%, 200px);
    height: 1px;
    background: linear-gradient(90deg, var(--accent), transparent);
}

.section-lead {
    max-width: 62ch;
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.65;
    margin: -1.25rem 0 2.25rem;
    padding-left: 1rem;
}

.section-lead--tight {
    margin-top: -1rem;
}

html[dir="rtl"] .section-lead,
body.rtl .section-lead {
    padding-left: 0;
    padding-right: 1rem;
    text-align: right;
}

html[dir="rtl"] .section-title,
[dir="rtl"] .section-title,
body.rtl .section-title {
    text-align: right;
    padding-left: 0;
    padding-right: 1rem;
    border-left: none;
    border-right: 3px solid var(--accent);
}

html[dir="rtl"] .section-title::after,
[dir="rtl"] .section-title::after,
body.rtl .section-title::after {
    left: auto !important;
    right: 0 !important;
    background: linear-gradient(270deg, var(--accent), transparent) !important;
}

/* ============================================
   About
   ============================================ */

.about-content {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: none;
    padding: 1.5rem 1.65rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.about-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-bright), transparent);
    opacity: 0.35;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.about-content:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-card), 0 0 0 1px var(--accent-muted);
}

.about-content:hover::before {
    opacity: 1;
}

body.theme-light .about-content:hover {
    border-color: var(--accent);
}

html[dir="rtl"] .about-content,
body.rtl .about-content {
    border-left: 1px solid var(--border-color);
    border-right: 3px solid var(--accent);
}

html[dir="rtl"] .about-content::before,
body.rtl .about-content::before {
    left: auto;
    right: 0;
}

.about-text {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.about-text:last-child {
    margin-bottom: 0;
}

body.theme-light .about-content {
    border-color: var(--border-strong);
    box-shadow:
        0 1px 0 rgba(26, 31, 38, 0.05),
        0 10px 28px rgba(26, 31, 38, 0.05);
}

body.theme-light .about-content:hover {
    box-shadow:
        0 1px 0 rgba(26, 31, 38, 0.06),
        0 16px 40px rgba(26, 31, 38, 0.09);
}

/* ============================================
   Skills
   ============================================ */

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.skill-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.35rem 1.35rem 1.25rem;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 0 0 0 transparent;
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-bright), transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.skill-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-card), 0 0 0 1px var(--accent-muted);
}

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

body.theme-light .skill-card:hover {
    border-color: var(--accent);
}

.skill-card-head {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-color);
}

html[dir="rtl"] .skill-card-head,
body.rtl .skill-card-head {
    flex-direction: row-reverse;
}

.skill-card-index {
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    line-height: 1;
}

.skill-category {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.35;
}

html[dir="rtl"] .skill-category,
body.rtl .skill-category {
    text-align: right;
}

.skill-tags {
    list-style: none;
}

.skill-tags li {
    padding: 0.4rem 0;
    color: var(--text-secondary);
    font-size: 0.92rem;
    border-bottom: 1px solid rgba(31, 45, 58, 0.85);
}

body.theme-light .skill-tags li {
    border-bottom-color: rgba(212, 205, 194, 0.9);
}

.skill-tags li:last-child {
    border-bottom: none;
}

/* ============================================
   Services
   ============================================ */

.section-services .section-title {
    margin-bottom: 1.35rem;
}

.section-services .section-lead {
    margin-top: 1rem;
    margin-bottom: 2.25rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.service-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem 1.65rem 1.4rem;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-bright), transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-card), 0 0 0 1px var(--accent-muted);
}

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

body.theme-light .service-card:hover {
    border-color: var(--accent);
}

.service-card-head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-color);
}

html[dir="rtl"] .service-card-head,
body.rtl .service-card-head {
    flex-direction: row-reverse;
}

.service-card-index {
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    line-height: 1;
}

.service-card-titles {
    flex: 1;
    min-width: 0;
}

.service-card-title {
    margin: 0 0 0.45rem;
    font-family: var(--font-sans);
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1.25;
}

html[dir="rtl"] .service-card-title,
body.rtl .service-card-title {
    text-align: right;
}

.service-card-subtitle {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent);
    line-height: 1.45;
    letter-spacing: 0.02em;
}

html[dir="rtl"] .service-card-subtitle,
body.rtl .service-card-subtitle {
    text-align: right;
}

.service-card-body {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

html[dir="rtl"] .service-card-body,
body.rtl .service-card-body {
    text-align: right;
}

@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Projects
   ============================================ */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.35rem 1.35rem 1.25rem;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-bright), transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-card), 0 0 0 1px var(--accent-muted);
}

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

.project-card--featured {
    border-color: rgba(var(--accent-rgb), 0.28);
    box-shadow: var(--shadow-card), 0 0 0 1px rgba(var(--accent-rgb), 0.12);
}

.project-card--featured::before {
    opacity: 0.65;
}

.project-card--featured:hover {
    border-color: rgba(var(--accent-rgb), 0.45);
    box-shadow: var(--shadow-card), 0 8px 28px rgba(var(--accent-rgb), 0.12);
}

body.theme-light .project-card:hover {
    border-color: var(--accent);
}

.project-card-head {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-color);
}

html[dir="rtl"] .project-card-head,
body.rtl .project-card-head {
    flex-direction: row-reverse;
}

.project-card-index {
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    line-height: 1;
}

.project-name {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.3;
}

html[dir="rtl"] .project-name,
body.rtl .project-name {
    text-align: right;
}

.project-card:hover .project-name {
    color: var(--accent-bright);
}

body.theme-light .project-card:hover .project-name {
    color: var(--accent);
}

.project-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.project-card-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem 0.5rem;
    margin-bottom: 0;
    min-width: 0;
}

.project-card-actions__stores {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    flex: 1 1 auto;
}

/* Compact controls so Android + App Store + View details stay on one row in narrow cards */
.project-card .project-card-actions .btn-store {
    padding: 0.45rem 0.55rem;
    font-size: 0.76rem;
    letter-spacing: 0.02em;
}

.project-card .project-card-actions .btn-store__svg {
    width: 15px;
    height: 15px;
}

.project-card .project-card-actions .project-open-detail {
    padding: 0.45rem 0.65rem;
    font-size: 0.78rem;
    white-space: nowrap;
}

.project-details--collapsed {
    display: none;
}

.btn-store {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 0.95rem;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn-store__icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.btn-store__svg {
    width: 18px;
    height: 18px;
    display: block;
}

html[dir="rtl"] .btn-store,
body.rtl .btn-store {
    flex-direction: row-reverse;
}

.btn-store--android {
    background: rgba(61, 220, 132, 0.12);
    border-color: rgba(61, 220, 132, 0.45);
    color: #8ef5c0;
}

body.theme-light .btn-store--android {
    color: #1b5c3a;
    background: rgba(61, 220, 132, 0.18);
    border-color: rgba(27, 92, 58, 0.35);
}

.btn-store--android:hover {
    transform: translateY(-2px);
    border-color: rgba(61, 220, 132, 0.75);
    background: rgba(61, 220, 132, 0.2);
}

.btn-store--ios {
    background: rgba(100, 180, 255, 0.1);
    border-color: rgba(100, 180, 255, 0.4);
    color: #a8d4ff;
}

body.theme-light .btn-store--ios {
    color: #1a4a7a;
    background: rgba(80, 150, 230, 0.14);
    border-color: rgba(26, 74, 122, 0.35);
}

.btn-store--ios:hover {
    transform: translateY(-2px);
    border-color: rgba(100, 180, 255, 0.7);
    background: rgba(100, 180, 255, 0.16);
}

.project-open-detail {
    flex: 0 0 auto;
    white-space: nowrap;
}

@media (max-width: 380px) {
    .project-card .project-card-actions {
        gap: 0.25rem;
    }

    .project-card .project-card-actions__stores {
        gap: 0.25rem;
    }

    .project-card .project-card-actions .btn-store {
        padding: 0.4rem 0.45rem;
        font-size: 0.72rem;
    }

    .project-card .project-card-actions .project-open-detail {
        padding: 0.4rem 0.5rem;
        font-size: 0.74rem;
    }
}

/* ============================================
   Project detail overlay
   ============================================ */

body.project-overlay-open {
    overflow: hidden;
}

.project-overlay {
    position: fixed;
    inset: 0;
    z-index: 10002;
}

.project-overlay[hidden] {
    display: none !important;
}

.project-overlay__backdrop {
    position: absolute;
    inset: 0;
    background: var(--bg-primary);
    opacity: 0.96;
    cursor: pointer;
}

body.theme-light .project-overlay__backdrop {
    background: var(--bg-primary);
    opacity: 1;
}

.project-overlay__panel {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-height: none;
    padding-top: env(safe-area-inset-top);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    box-sizing: border-box;
    background: var(--bg-elevated);
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
}

.project-overlay__header {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

html[dir="rtl"] .project-overlay__header,
body.rtl .project-overlay__header {
    justify-content: flex-start;
}

.project-overlay__close {
    font-size: 0.88rem;
    padding: 0.55rem 1rem;
}

.project-overlay__scroller {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.project-overlay__inner {
    width: 100%;
    max-width: 100%;
    min-height: min-content;
    padding: 1.5rem 1.5rem 2.5rem;
    box-sizing: border-box;
}

@media (min-width: 900px) {
    .project-overlay__inner {
        padding: 2rem clamp(1.5rem, 4vw, 3rem) 3rem;
    }
}

.project-overlay__title {
    margin: 0 0 0.65rem;
    font-size: clamp(1.35rem, 3.5vw, 1.85rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    line-height: 1.25;
}

html[dir="rtl"] .project-overlay__title,
body.rtl .project-overlay__title {
    text-align: right;
}

.project-overlay__desc {
    margin: 0 0 1.15rem;
    color: var(--text-secondary);
    font-size: 0.98rem;
    line-height: 1.65;
}

html[dir="rtl"] .project-overlay__desc,
body.rtl .project-overlay__desc {
    text-align: right;
}

.project-overlay__stores {
    margin-bottom: 1.35rem;
}

.project-overlay__stores .btn-store {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.project-overlay__shots {
    margin: 2rem 0 2rem;
    padding: 1.35rem 0 0;
    border-top: 1px solid var(--border-color);
}

.project-overlay__shots-title {
    margin: 0 0 1.15rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent);
}

html[dir="rtl"] .project-overlay__shots-title,
body.rtl .project-overlay__shots-title {
    text-align: right;
}

.project-overlay__shots-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem 1.25rem;
    width: 100%;
}

.project-shot {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.project-shot__placeholder {
    width: 100%;
    aspect-ratio: 9 / 19.5;
    max-height: min(52vh, 520px);
    margin: 0 auto;
    border-radius: 14px;
    border: 1px solid var(--border-strong);
    background:
        linear-gradient(165deg, rgba(var(--accent-rgb), 0.08) 0%, transparent 42%),
        linear-gradient(210deg, var(--bg-secondary) 0%, var(--bg-primary) 55%, var(--bg-secondary) 100%);
    background-color: var(--bg-secondary);
    box-shadow:
        inset 0 0 0 1px rgba(var(--accent-rgb), 0.12),
        0 12px 32px rgba(0, 0, 0, 0.35);
    position: relative;
    overflow: hidden;
}

.project-shot__placeholder::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(var(--accent-rgb), 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--accent-rgb), 0.06) 1px, transparent 1px);
    background-size: 24px 24px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, black 15%, transparent 65%);
    pointer-events: none;
}

.project-shot__placeholder::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 42%;
    transform: translate(-50%, -50%);
    width: 38%;
    height: 5px;
    border-radius: 999px;
    background: rgba(var(--accent-rgb), 0.22);
    border: 1px solid rgba(var(--accent-rgb), 0.35);
    box-shadow: 0 0 24px rgba(var(--accent-rgb), 0.15);
    pointer-events: none;
}

body.theme-light .project-shot__placeholder {
    box-shadow:
        inset 0 0 0 1px rgba(var(--accent-rgb), 0.18),
        0 10px 28px rgba(26, 31, 38, 0.1);
}

.project-shot__caption {
    margin: 0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
    text-align: center;
}

html[dir="rtl"] .project-shot__caption,
body.rtl .project-shot__caption {
    text-align: center;
}

@media (max-width: 700px) {
    .project-overlay__shots-grid {
        grid-template-columns: 1fr;
        max-width: 280px;
        margin-inline: auto;
    }

    .project-shot__placeholder {
        max-height: min(48vh, 440px);
    }
}

@media (min-width: 701px) and (max-width: 900px) {
    .project-overlay__shots-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.75rem;
    }
}

.project-overlay__inner .project-details {
    margin-top: 0;
}

.project-overlay__inner .project-highlights {
    margin-bottom: 0;
}

.project-highlights {
    margin: 0 0 0 1.25rem;
    padding: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

html[dir="rtl"] .project-highlights,
body.rtl .project-highlights {
    margin-left: 0;
    margin-right: 1.25rem;
}

.project-highlights li {
    margin-bottom: 0.35rem;
}

.project-tech-block {
    margin-top: 1.15rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.project-tech-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin: 0 0 0.65rem;
}

.project-tech-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.project-tech-list li {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    line-height: 1.2;
    padding: 0.32rem 0.62rem;
    border-radius: 999px;
    color: var(--accent-bright);
    background: var(--accent-muted);
    border: 1px solid rgba(var(--accent-rgb), 0.32);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

body.theme-light .project-tech-list li {
    color: var(--accent);
    border-color: rgba(var(--accent-rgb), 0.45);
    box-shadow: none;
}

.project-card:hover .project-tech-list li {
    border-color: rgba(var(--accent-rgb), 0.55);
    background: rgba(var(--accent-rgb), 0.12);
}

body.theme-light .project-card:hover .project-tech-list li {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.14);
}

.project-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
    margin: 0.5rem 0;
}

/* ============================================
   Experience
   ============================================ */

#experience .experience-card + .experience-card {
    margin-top: 1.35rem;
}

.experience-card {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: none;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    margin: 0;
    box-shadow: 0 0 0 0 transparent;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.experience-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-bright), transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.experience-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-card), 0 0 0 1px var(--accent-muted);
}

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

body.theme-light .experience-card:hover {
    border-color: var(--accent);
}

.experience-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.experience-head-row {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
}

html[dir="rtl"] .experience-head-row,
body.rtl .experience-head-row {
    flex-direction: row-reverse;
}

.experience-index {
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    line-height: 1;
    margin-top: 0.2rem;
}

.experience-head-text {
    flex: 1;
    min-width: 0;
}

html[dir="rtl"] .experience-company,
html[dir="rtl"] .experience-date,
body.rtl .experience-company,
body.rtl .experience-date {
    text-align: right;
}

.experience-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
    letter-spacing: -0.02em;
}

html[dir="rtl"] .experience-title,
body.rtl .experience-title {
    text-align: right;
}

.experience-company {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent);
}

.experience-date {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-top: 0.35rem;
    font-family: var(--font-mono);
}

.experience-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.experience-content ul {
    margin-left: 1.25rem;
    color: var(--text-secondary);
}

.experience-content li {
    margin-bottom: 0.5rem;
}

/* ============================================
   Education & Languages
   ============================================ */

.education-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 1.25rem;
    align-items: stretch;
}

.education-card,
.languages-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem 1.5rem 1.65rem;
    margin: 0;
    max-width: none;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 0 0 0 transparent;
}

.education-card::before,
.languages-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-bright), transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.education-card:hover,
.languages-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-card), 0 0 0 1px var(--accent-muted);
}

.education-card:hover::before,
.languages-card:hover::before {
    opacity: 1;
}

body.theme-light .education-card:hover,
body.theme-light .languages-card:hover {
    border-color: var(--accent);
}

.education-card-head {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-color);
}

html[dir="rtl"] .education-card-head,
body.rtl .education-card-head {
    flex-direction: row-reverse;
}

.education-card-index {
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    line-height: 1;
}

.education-title {
    flex: 1;
    min-width: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.35;
}

html[dir="rtl"] .education-title,
body.rtl .education-title {
    text-align: right;
}

.education-school {
    font-family: var(--font-mono);
    font-size: 0.92rem;
    color: var(--accent);
    font-weight: 600;
    margin: 0 0 0.35rem;
}

.education-date {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin: 0;
    font-family: var(--font-mono);
}

.education-honors {
    margin: 0.75rem 0 0;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--accent);
}

html[dir="rtl"] .education-honors,
body.rtl .education-honors {
    text-align: right;
}

.languages-title {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.35;
}

html[dir="rtl"] .languages-title,
body.rtl .languages-title {
    text-align: right;
}

html[dir="rtl"] .education-school,
html[dir="rtl"] .education-date,
body.rtl .education-school,
body.rtl .education-date {
    text-align: right;
}

.languages-list {
    list-style: none;
    color: var(--text-secondary);
    margin: 0;
    padding: 0;
}

.languages-list li {
    margin-bottom: 0.5rem;
}

/* ============================================
   Tools & Technologies
   ============================================ */

.tools-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 1.25rem;
    align-items: stretch;
}

.tools-category-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.35rem 1.35rem 1.25rem;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 0 0 0 transparent;
}

.tools-category-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-card), 0 0 0 1px var(--accent-muted);
}

body.theme-light .tools-category-card:hover {
    border-color: var(--accent);
}

.tools-category-head {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-color);
}

html[dir="rtl"] .tools-category-head,
body.rtl .tools-category-head {
    flex-direction: row-reverse;
}

.tools-category-index {
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    line-height: 1;
}

.tools-category-title {
    flex: 1;
    min-width: 0;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.35;
}

html[dir="rtl"] .tools-category-title,
body.rtl .tools-category-title {
    text-align: right;
}

.tools-chips {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tool-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    max-width: 100%;
    padding: 0.42rem 0.7rem 0.42rem 0.45rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.25;
    direction: ltr;
    unicode-bidi: embed;
    text-align: left;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.tool-chip::before {
    content: attr(data-abbr);
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 0.22rem 0.38rem;
    border-radius: 5px;
    line-height: 1;
    text-align: center;
    min-width: 1.55rem;
    background: var(--accent-muted);
    color: var(--accent);
    border: 1px solid transparent;
}

.tool-chip:hover {
    border-color: var(--accent);
    background: var(--accent-muted);
    color: var(--text-primary);
    transform: translateY(-1px);
}

body.theme-light .tool-chip {
    background: var(--bg-elevated);
    border-color: var(--border-strong);
}

body.theme-light .tool-chip:hover {
    border-color: var(--accent);
    background: var(--accent-muted);
}

/* ============================================
   Contact (section shell = .section-band + .section-contact::before)
   ============================================ */

.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.35rem;
    align-items: stretch;
}

.contact-panel {
    display: flex;
    flex-direction: column;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.35rem 1.35rem 1.25rem;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    overflow: hidden;
}

.contact-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-bright), transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.contact-panel:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-card), 0 0 0 1px var(--accent-muted);
}

.contact-panel:hover::before {
    opacity: 1;
}

body.theme-light .contact-panel:hover {
    border-color: var(--accent);
}

.contact-panel-head {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 1.1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-color);
}

html[dir="rtl"] .contact-panel-head,
body.rtl .contact-panel-head {
    flex-direction: row-reverse;
}

.contact-panel-index {
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    line-height: 1;
}

.contact-panel-title {
    flex: 1;
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1.35;
}

html[dir="rtl"] .contact-panel-title,
body.rtl .contact-panel-title {
    text-align: right;
}

.contact-channel-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.contact-channel {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-channel:hover {
    border-color: var(--accent);
    background: var(--accent-muted);
    transform: translateX(3px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

html[dir="rtl"] .contact-channel:hover,
body.rtl .contact-channel:hover {
    transform: translateX(-3px);
}

.contact-channel__icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--accent-muted);
    color: var(--accent);
    border: 1px solid var(--border-color);
}

.contact-channel__icon svg {
    width: 22px;
    height: 22px;
}

.contact-channel--whatsapp .contact-channel__icon {
    color: #25d366;
    background: rgba(37, 211, 102, 0.12);
    border-color: rgba(37, 211, 102, 0.35);
}

.contact-channel--whatsapp:hover {
    border-color: rgba(37, 211, 102, 0.55);
    background: rgba(37, 211, 102, 0.08);
}

.contact-channel__body {
    flex: 1;
    min-width: 0;
}

.contact-channel__value {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.35;
    word-break: break-word;
}

.contact-channel__value--email {
    font-family: var(--font-mono);
    font-size: 0.84rem;
    font-weight: 500;
}

.contact-link-placeholder {
    opacity: 0.6;
    cursor: not-allowed;
}

.phone-display {
    direction: ltr !important;
    unicode-bidi: embed !important;
    display: inline-block;
}

.contact-panel--form .contact-form {
    flex: 1;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.form-group label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
    padding: 0.78rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.98rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-panel--form .form-group input,
.contact-panel--form .form-group textarea {
    background: var(--bg-primary);
}

body.theme-light .contact-panel--form .form-group input,
body.theme-light .contact-panel--form .form-group textarea {
    background: var(--bg-elevated);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.65;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-muted);
}

.btn-contact-send {
    margin-top: 0.25rem;
    align-self: flex-start;
}

html[dir="rtl"] .btn-contact-send,
body.rtl .btn-contact-send {
    align-self: flex-end;
}

/* ============================================
   Footer
   ============================================ */

.footer {
    position: relative;
    padding: 2.5rem 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    background: var(--bg-secondary);
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.45), transparent);
    pointer-events: none;
}

body.theme-light .footer::before {
    background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.55), transparent);
}

.footer-copyright {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
    letter-spacing: -0.02em;
}

.footer-subtitle {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.25rem 2rem;
}

.footer-links a {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--accent-hot);
}

/* ============================================
   Animations
   ============================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(22px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .hero-eyebrow,
    .hero-title,
    .hero-subtitle,
    .hero-intro,
    .hero-intro-secondary,
    .hero-tech,
    .hero-buttons {
        opacity: 1;
        animation: none;
    }

    .section-title,
    .about-content,
    .skill-card,
    .service-card,
    .project-card,
    .experience-card,
    .education-card,
    .languages-card,
    .tools-category-card,
    .contact-panel {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .btn,
    .project-card,
    .skill-card,
    .service-card,
    .nav-action,
    .tool-chip {
        transition: none !important;
    }
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 992px) {
    .nav-container {
        gap: 2rem;
    }

    .nav-menu {
        gap: 1.25rem;
    }

    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }

    .section {
        padding: 4rem 1.25rem;
    }

    .hero {
        padding: 7rem 1.25rem 3.5rem;
    }

    .hero-intro,
    .hero-intro-secondary {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .nav-container {
        justify-content: space-between;
        gap: 0;
        padding: 0.75rem 1rem;
    }

    .nav-logo {
        font-size: 1.05rem;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 72px;
        left: -100%;
        width: 100%;
        flex: none;
        justify-content: flex-start;
        flex-direction: column;
        align-items: stretch;
        background-color: var(--bg-nav);
        backdrop-filter: blur(16px);
        padding: 1.5rem;
        gap: 0.5rem;
        border-bottom: 1px solid var(--border-color);
        transition: left 0.3s ease;
        max-height: calc(100vh - 72px);
        overflow-y: auto;
    }

    .nav-menu li {
        border-bottom: 1px solid rgba(31, 45, 58, 0.45);
    }

    body.theme-light .nav-menu li {
        border-bottom-color: rgba(212, 205, 194, 0.6);
    }

    .nav-menu li:last-child {
        border-bottom: none;
    }

    .nav-menu a {
        display: block;
        padding: 0.75rem 0;
    }

    html[dir="rtl"] .nav-menu {
        left: auto;
        right: -100%;
        transition: right 0.3s ease;
    }

    .nav-menu.active {
        left: 0;
    }

    html[dir="rtl"] .nav-menu.active {
        left: auto;
        right: 0;
    }

    .hero {
        padding: 5rem 1rem 2.5rem;
        min-height: auto;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .hero-buttons .btn {
        width: 100%;
        text-align: center;
    }

    .section {
        padding: 2.5rem 1rem;
    }

    .container {
        padding: 0 0.5rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .project-card {
        padding: 1.25rem;
    }

    .contact-layout {
        grid-template-columns: 1fr;
        gap: 1.15rem;
    }

    .contact-panel {
        padding: 1.15rem 1.15rem 1.05rem;
    }

    .contact-form .btn,
    .btn-contact-send {
        width: 100%;
        align-self: stretch !important;
    }

    .tools-board {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .tools-category-card {
        padding: 1.15rem 1.15rem 1.05rem;
    }

    .experience-card,
    .education-card,
    .languages-card {
        padding: 1.5rem;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0.5rem 0.75rem;
    }

    .nav-logo {
        font-size: 0.98rem;
    }

    .hero-title {
        font-size: 1.85rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .hero-intro,
    .hero-intro-secondary {
        font-size: 0.95rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

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

    .tool-chip {
        font-size: 0.78rem;
        padding: 0.38rem 0.6rem 0.38rem 0.4rem;
    }

    .nav-action {
        width: 2.35rem;
        height: 2.35rem;
    }

    .nav-action--lang {
        min-width: 2.35rem;
        padding: 0 0.45rem;
    }

    .nav-action__lang {
        font-size: 0.62rem;
    }

    .nav-toggle {
        width: 2.35rem;
        height: 2.35rem;
    }

    .footer-copyright,
    .footer-subtitle {
        font-size: 0.88rem;
    }
}

@supports (padding: max(0px)) {
    .navbar {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .nav-container {
        padding-left: max(0.5rem, env(safe-area-inset-left));
        padding-right: max(0.5rem, env(safe-area-inset-right));
    }

    @media (max-width: 768px) {
        .hero,
        .section {
            padding-left: max(1rem, env(safe-area-inset-left));
            padding-right: max(1rem, env(safe-area-inset-right));
        }
    }
}
