/* RTL Support */
[dir="rtl"] .hero__content, [dir="rtl"] .about__text p, [dir="rtl"] .section-title { text-align: right; }
[dir="rtl"] .hero__scroll { right: auto; left: 2rem; }
[dir="rtl"] .stat__label, [dir="rtl"] .skill-group__title { text-align: right; }
[dir="rtl"] .contact-form { direction: rtl; }
[dir="rtl"] .timeline { padding-left: 0; padding-right: 2.5rem; }
[dir="rtl"] .timeline::before { left: auto; right: 0; }
[dir="rtl"] .timeline__item { padding-left: 0; padding-right: 1rem; }
[dir="rtl"] .timeline__dot { left: auto; right: -2.85rem; }
[dir="rtl"] .timeline__details li { padding-left: 0; padding-right: 1.25rem; }
[dir="rtl"] .timeline__details li::before { left: auto; right: 0; }
[dir="rtl"] .terminal { direction: ltr; text-align: left; }

section {
    padding: 7rem 0;
}

/* ═══════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 5rem;
    position: relative;
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4rem;
    align-items: center;
    width: 100%;
}

.hero__content {
    min-width: 0;
}

.hero__greeting {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    color: var(--accent);
    margin-bottom: 1.25rem;
    opacity: 0;
    animation: fadeSlideUp 0.6s var(--transition) 0.2s forwards;
}

.hero__name {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1.05;
    margin-bottom: 0.5rem;
    opacity: 0;
    animation: fadeSlideUp 0.6s var(--transition) 0.4s forwards;
}

.hero__tagline {
    font-size: clamp(1.5rem, 3.5vw, 2.75rem);
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: -1px;
    line-height: 1.2;
    margin-bottom: 1.75rem;
    opacity: 0;
    animation: fadeSlideUp 0.6s var(--transition) 0.6s forwards;
}

.hero__desc {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 580px;
    line-height: 1.8;
    margin-bottom: 2.5rem;
    opacity: 0;
    animation: fadeSlideUp 0.6s var(--transition) 0.8s forwards;
}

.hero__cta-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeSlideUp 0.6s var(--transition) 1s forwards;
}

.hero__terminal {
    width: 320px;
    flex-shrink: 0;
    opacity: 0;
    animation: fadeSlideLeft 0.8s var(--transition) 1.2s forwards;
}

.terminal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.terminal__bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.75rem 1rem;
    background: rgba(30, 30, 46, 0.6);
    border-bottom: 1px solid var(--border);
}

.terminal__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.terminal__dot--red { background: #ff5f57; }
.terminal__dot--yellow { background: #ffbd2e; }
.terminal__dot--green { background: #28c840; }

.terminal__title {
    margin-left: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.7rem;
}

.terminal__body {
    padding: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.terminal__line {
    display: block;
}

.terminal__prompt {
    color: var(--accent);
}

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

.terminal__output {
    color: var(--text-secondary);
    padding-left: 0.5rem;
}

.terminal__cursor {
    display: inline-block;
    width: 7px;
    height: 14px;
    background: var(--accent);
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
    margin-left: 2px;
}

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

/* Scroll indicator */
.hero__scroll {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    animation: fadeIn 0.6s var(--transition) 1.6s forwards;
}

.hero__scroll-text {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.hero__scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--accent), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(1); }
    50% { opacity: 1; transform: scaleY(1.3); }
}

/* ═══════════════════════════════════════════
   ABOUT SECTION
   ═══════════════════════════════════════════ */
.about__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.about__text p {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    font-size: 1rem;
}

.about__stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.stat {
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.4s var(--transition);
}

.stat:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--glow);
}

.stat__number {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat__label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

/* ═══════════════════════════════════════════
   SKILLS SECTION
   ═══════════════════════════════════════════ */
.skills__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

.skill-group {
    padding: 1.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.4s var(--transition);
    position: relative;
    overflow: hidden;
}

.skill-group::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.3s;
}

.skill-group:hover {
    border-color: var(--border-accent);
    transform: translateY(-3px);
}

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

.skill-group__icon {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.skill-group__title {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.skill-group__items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.skill-tag {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    padding: 0.35rem 0.75rem;
    background: rgba(100, 255, 218, 0.05);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.skill-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

/* ═══════════════════════════════════════════
   EXPERIENCE SECTION
   ═══════════════════════════════════════════ */
.timeline {
    position: relative;
    padding-left: 2.5rem;
}

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

.timeline__item {
    position: relative;
    margin-bottom: 3.5rem;
    padding-left: 1rem;
}

.timeline__item:last-child {
    margin-bottom: 0;
}

.timeline__dot {
    position: absolute;
    left: -2.85rem;
    top: 0.5rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 2px solid var(--accent);
    z-index: 1;
    transition: all 0.3s;
}

.timeline__item:hover .timeline__dot {
    background: var(--accent);
    box-shadow: 0 0 12px rgba(100, 255, 218, 0.4);
}

.timeline__date {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.timeline__role {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    letter-spacing: -0.5px;
}

.timeline__company {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.timeline__details {
    list-style: none;
}

.timeline__details li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.6rem;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.timeline__details li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* ═══════════════════════════════════════════
   PROJECTS SECTION
   ═══════════════════════════════════════════ */
.projects__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2rem;
    transition: all 0.4s var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

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

.project-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

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

.project-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.project-card__folder {
    font-size: 1.75rem;
    color: var(--accent);
}

.project-card__link {
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: color 0.3s;
}

.project-card__link:hover {
    color: var(--accent);
    text-shadow: none;
}

.project-card__title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    letter-spacing: -0.3px;
}

.project-card__desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    flex: 1;
    margin-bottom: 1.25rem;
    line-height: 1.7;
}

.project-card__tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-card__tech span {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════
   CONTACT SECTION
   ═══════════════════════════════════════════ */
.contact {
    padding-bottom: 4rem;
}

.contact__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.contact__info {
    padding-top: 0.5rem;
}

.contact__heading {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -1.5px;
    margin-bottom: 1.25rem;
    line-height: 1.2;
}

.contact__text {
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    font-size: 1rem;
    line-height: 1.8;
}

.contact__links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact__link {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all 0.3s var(--transition);
}

.contact__link span {
    font-size: 1.25rem;
    line-height: 1;
}

.contact__link:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
    text-shadow: none;
}

/* Contact Form */
.contact-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2.5rem;
}

.contact-form__title {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 1.75rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: all 0.3s var(--transition);
    outline: none;
}

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

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(100, 255, 218, 0.08);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

.form-group--row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn--submit {
    width: 100%;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 0.9rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s var(--transition);
    letter-spacing: 0.5px;
    margin-top: 0.5rem;
}

.btn--submit:hover {
    background: var(--accent-dim);
    box-shadow: var(--glow);
}

.btn--submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-alert {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 0.85rem 1rem;
    border-radius: 6px;
    margin-bottom: 1.25rem;
    display: none;
}

.form-alert--success {
    display: block;
    background: rgba(100, 255, 218, 0.08);
    border: 1px solid rgba(100, 255, 218, 0.2);
    color: var(--accent);
}

.form-alert--error {
    display: block;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.form-field-error {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--danger);
    margin-top: 0.35rem;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 900px) {
    .hero .container {
        grid-template-columns: 1fr;
    }

    .hero__terminal {
        display: none;
    }

    .about__grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

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

    .contact__grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    section {
        padding: 5rem 0;
    }
}

@media (max-width: 600px) {
    .hero__name {
        font-size: 2.25rem;
    }

    .hero__tagline {
        font-size: 1.25rem;
    }

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

    .stat {
        padding: 1.25rem;
    }

    .stat__number {
        font-size: 1.5rem;
    }

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

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

    .form-group--row {
        grid-template-columns: 1fr;
    }

    .contact-form {
        padding: 1.75rem;
    }
}

/* ═══════════════════════════════════════════
   LIGHT THEME OVERRIDES
   ═══════════════════════════════════════════ */
[data-theme="light"] .terminal__bar {
    background: rgba(238, 240, 245, 0.8);
}

[data-theme="light"] .terminal__output {
    color: var(--text-secondary);
}

[data-theme="light"] .project-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .skill-tag {
    background: rgba(13, 147, 115, 0.04);
}

[data-theme="light"] .form-group input:focus,
[data-theme="light"] .form-group textarea:focus {
    box-shadow: 0 0 0 3px rgba(13, 147, 115, 0.08);
}

[data-theme="light"] .timeline__item:hover .timeline__dot {
    box-shadow: 0 0 12px rgba(13, 147, 115, 0.3);
}
