/* (removed duplicate variable block) */

:root {
    /* Dark-mode only: make dark theme permanent */
    --bg: #030B18;
    --surface: #051327;
    --surface-soft: #0C1F3C;

    --text: #F4F5F6;
    --text-secondary: #BABABF;
    --text-muted: #7D838B;

    --border: #125895;

    --accent: #1B93F6;
    --accent-hover: #1683DD;

    /* supporting variables derived from the core palette */
    --accent-soft: #125895;
    --accent-foreground: #FFFFFF;
    --header-bg: var(--surface);
    --header-border: var(--border);
    --button-hover-bg: var(--accent-hover);
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    --header-offset: 84px;
}

/* Smoothly transition theme-related properties */
html {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
.button {
    font: inherit;
}

.container {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
}

body,
.site-header,
.feature,
.project-card,
.skill-card,
.about-card,
.experience-card,
.testimonial-card {
    color: var(--text-secondary);
}

.service-item,
.button,
.nav-link,
.section-link {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.header-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
    min-height: 84px;
}

.brand,
.footer-brand {
    font-weight: 700;
    font-size: 1.1rem;
}

.brand {
    justify-self: start;
    font-size: 32px;
}

.main-nav {
    justify-self: center;
}

.header-actions {
    justify-self: end;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}


.menu-toggle {
    display: none;
    width: 3rem;
    height: 3rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}


.nav-list {
    display: flex;
    justify-content: center;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: var(--text-secondary);
    font-size: 0.95rem;
    position: relative;
    padding: 0.25rem 0;
}

.nav-link.active,
.nav-link:hover {
    color: var(--accent);
}

.nav-link.active::after {
    background: var(--accent);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -8px;
    height: 2px;
    background: var(--accent);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.95rem 1.4rem;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.25s ease;
}

.button-primary {
    background: var(--accent);
    color: var(--accent-foreground);
}

.button-primary:hover {
    transform: translateY(-1px);
    filter: brightness(0.98);
}

.button-secondary {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
}

.button-secondary:hover {
    background: var(--button-hover-bg);
}

.button-outline {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.button-outline:hover {
    background: var(--surface);
}

.hero-section {
    padding: 4rem 0 2rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: 3rem;
}

.hero-copy {
    max-width: 42rem;
}

.hero-visual {
    display: grid;
    place-items: center;
}

.eyebrow,
.section-label {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--accent);
    font-size: 0.85rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.hero-copy h1,
.section-header h2 {
    margin: 0;
    line-height: 1.02;
}

.hero-copy h1 {
    font-size: clamp(3rem, 4vw, 4.7rem);
}

.section-header h2 {
    font-size: clamp(2rem, 2.1vw, 2.6rem);
}

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

.hero-text {
    margin: 1.75rem 0 2.5rem;
    max-width: 38rem;
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.hero-socials {
    margin-top: 3rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
}

.social-label {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.social-links {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.social-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1rem;
    border-radius: 0.95rem;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.reveal-item {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.hero-frame {
    position: relative;
    width: min(520px, 100%);
    aspect-ratio: 1 / 1;
    border-radius: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 2.5rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.hero-circle {
    position: absolute;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: var(--accent-soft);
    top: -30px;
    right: -40px;
    z-index: 1;
}

.hero-background {
    position: absolute;
    inset: 0;
    background: transparent;
    z-index: 0;
}

.hero-image {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    /* align-items: flex-end; */
    justify-content: center;
    /* overflow: hidden; */
    z-index: 2;
}

.hero-photo {
    width: auto;
    height: 130%;
    max-width: none;
    object-fit: contain;
    object-position: bottom center;
    display: block;
    position: absolute;
    left: 80px;
    top: -40px;
}

.hero-dot-grid {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 72px;
    height: 72px;
    background-image: radial-gradient(var(--accent) 10%, transparent 10%);
    background-size: 12px 12px;
    opacity: 0.28;
    pointer-events: none;
    z-index: 3;
}

.hero-decoration {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 1.5rem;
    border: 1px solid var(--accent-soft);
    top: 40px;
    left: 40px;
    z-index: 2;
}

.feature-strip {
    padding: 2rem 0;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.feature h3 {
    margin: 0;
    font-size: 1rem;
}

.feature {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    padding: 1.3rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.75rem;
    align-items: start;
}

.feature-icon {
    width: 3rem;
    height: 3rem;
    display: grid;
    place-items: center;
    border-radius: 1rem;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 1.1rem;
}

.feature-icon img {
    width: 2rem;
    height: 2rem;
    object-fit: contain;
    display: block;
}

.feature h3 {
    margin: 0;
}

.feature p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.section {
    padding: 4rem 0;
}

/* Ensure native anchor navigation accounts for sticky header */
.section,
.hero-section {
    scroll-margin-top: var(--header-offset);
}

.section-header {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 2rem;
}

.section-label {
    letter-spacing: 0.26em;
    font-weight: 600;
}

.section-link {
    color: var(--accent);
    font-weight: 600;
}

.section-link:hover {
    text-decoration: underline;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.project-type {
    display: block;
    margin: .35rem 0 .9rem;
    color: var(--text-muted);
    font-size: .85rem;
    letter-spacing: .05em;
}

.project-card {
    display: grid;
    gap: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.75rem;
    overflow: hidden;
}

.project-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--surface-soft);
    border-radius: 1.5rem 1.5rem 0 0;
}

.project-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.project-copy {
    padding: 1.4rem 1.5rem 1.5rem;
}

.project-copy h3 {
    margin: 0 0 0.75rem;
}

.project-copy p {
    margin: 0 0 1rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.project-tags span {
    display: inline-flex;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--text-muted);
    font-size: 0.82rem;
}

.service-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;

    padding: 1.75rem;

    background: var(--surface);
    color: var(--text-secondary);

    border: 1px solid var(--border);
    border-radius: 1.5rem;

    text-align: left;

    transition:
        transform 0.3s ease,
        background-color 0.3s ease,
        border-color 0.3s ease;
}

.service-item:hover {
    transform: translateY(-5px);
    background: var(--surface-soft);
    border-color: var(--accent);
}

.service-item h3 {
    margin: 0 0 0.8rem;
    color: var(--text);
    font-size: 1.2rem;
}

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

.service-item:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.project-links {
    display: flex;
    gap: 1rem;
}

/* Placeholder link/button for unavailable external links */
.link-placeholder[disabled] {
    opacity: 0.7;
    cursor: not-allowed;
    color: var(--text-muted);
    background: transparent;
    border-color: transparent;
}

.project-links .link-placeholder {
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
    font-weight: 600;
    background: transparent;
    border: 1px solid transparent;
    color: var(--accent);
}

.link-disabled {
    opacity: 0.8;
    color: var(--text-muted);
    cursor: default;
}

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

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.skill-card {
    padding: 1.4rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.5rem;
    display: grid;
    gap: 1rem;
}

.skill-icon {
    width: 3.5rem;
    height: 3.5rem;

    display: grid;
    place-items: center;

    border-radius: 1rem;
    background: var(--surface-soft);
}

.skill-icon img {
    width: 2.4rem;
    height: 2.4rem;
    object-fit: contain;
    display: block;
}

.skill-card h3 {
    margin: 0;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.testimonial-card {
    grid-column: 1 / -1;
}

.about-card,
.experience-card,
.testimonial-card,
.contact-card {
    padding: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.75rem;
}

.contact-text {
    max-width: 600px;
    margin: 1rem 0 1.5rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.contact-card {
    background: var(--surface-soft);
}

.contact-card h2 {
    font-size: clamp(1.8rem, 2vw, 2.1rem);
}

.contact-section {
    padding: 6rem 0;
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-soft) 100%);
}

.contact-section .contact-card {
    background: var(--surface);
    border-color: var(--border);
}

.contact-section .contact-card h2 {
    color: var(--text);
}

.contact-section .button {
    background: var(--accent);
}

.about-card h2,
.experience-card h3,
.testimonial-card blockquote {
    margin: 0;
}

.about-card p,
.timeline-item p,
.testimonial-card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.timeline-item {
    margin-top: 1.5rem;
}

.timeline-year {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.65rem;
}

.testimonial-card blockquote {
    margin: 0 0 1.5rem;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.testimonial-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.testimonial-avatar {
    width: 3.4rem;
    height: 3.4rem;
    display: grid;
    place-items: center;
    background: var(--surface-soft);
    border-radius: 1rem;
    font-weight: 700;
}



.contact-card {
    display: grid;
    align-items: center;
    grid-template-columns: 1fr auto;
    gap: 2rem;
}

.contact-card h2 {
    font-size: 1.95rem;
    line-height: 1.15;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.contact-info div {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    text-align: center;
}

.contact-info div:hover {
    background: var(--surface-soft);
    border-color: var(--accent);
}

.contact-info span {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.contact-info a {
    display: block;
    color: var(--accent);
    font-weight: 600;
    word-break: break-all;
    transition: color 0.3s ease;
}

.contact-info a:hover {
    color: var(--text);
}

.site-footer {
    padding: 2.5rem 0 3rem;
}

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

.footer-nav,
.footer-social {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-copy {
    color: var(--text-muted);
    margin-top: 2rem;
    font-size: 0.95rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.footer-name {
    margin: 1rem 0 0.25rem;
    color: var(--text);
    font-weight: 600;
}

.footer-role {
    margin: 0;
    color: var(--text-muted);
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-nav a {
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

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

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-top: 1.5rem;
}

.footer-copy {
    margin: 0;
    color: var(--text-muted);
}

.back-to-top {
    color: var(--accent);
    font-weight: 600;
}

.back-to-top:hover {
    text-decoration: underline;
}

/* Accessibility: reduced motion */
@media (prefers-reduced-motion: reduce) {
    :root {
        --shadow: none;
    }

    html {
        scroll-behavior: auto;
    }

    .reveal-item {
        transition: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
}

/* Focus-visible for keyboard users */
:focus-visible {
    outline: 3px solid rgba(27, 147, 246, 0.18);
    outline-offset: 3px;
}

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

@media (max-width: 1080px) {

    .hero-grid {
        grid-template-columns: 1fr 0.9fr;
        gap: 2rem;
    }

    .project-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .skills-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .about-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contact-info {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* =========================================
   Tablet
   ========================================= */

@media (max-width: 900px) {

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

    .hero-copy {
        max-width: 48rem;
    }

    .hero-visual {
        margin-top: 1rem;
    }

    .hero-frame {
        width: min(480px, 100%);
    }

    .skills-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .contact-card {
        grid-template-columns: 1fr;
    }

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


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

@media (max-width: 768px) {

    .header-inner {
        display: grid;
        grid-template-columns: 1fr auto;
        min-height: 72px;
        gap: 0.75rem;
        padding: 0.5rem 0;
    }

    .brand {
        justify-self: start;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        justify-self: end;
        order: initial;
    }

    .main-nav {
        grid-column: 1 / -1;
        width: 100%;
        justify-self: stretch;
    }

    .nav-list {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;

        width: 100%;
        padding: 0.75rem 0 1rem;

        background: var(--surface);
        border-top: 1px solid var(--border);
    }

    .nav-list.active {
        display: flex;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }

    .nav-link {
        display: inline-block;
        /* min-height: 44px; */
        padding: 0.65rem 0;
        font-size: 1rem;
    }

    .header-actions {
        display: none;
    }

    .hero-grid,
    .feature-grid,
    .project-grid,
    .skills-grid {
        grid-template-columns: 1fr;
    }

    .hero-section {
        padding-top: 3rem;
    }

    .hero-copy h1 {
        font-size: clamp(2.6rem, 10vw, 4rem);
    }

    .hero-actions {
        flex-wrap: wrap;
    }

    .project-links {
        flex-direction: row;
    }

    .services-grid {
        flex-direction: column;
    }

    .service-item {
        min-height: auto;
    }

    .contact-info {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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


/* =========================================
   Small Mobile
   ========================================= */

@media (max-width: 520px) {


    .container {
        width: min(100%, calc(100% - 1.5rem));
    }

    .hero-section {
        padding: 2.5rem 0 1.5rem;
    }

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

    .hero-actions .button {
        width: 100%;
    }

    .hero-socials {
        margin-top: 2rem;
        align-items: flex-start;
        flex-direction: column;
        gap: 1rem;
    }

    .social-links {
        width: 100%;
    }

    .social-item {
        flex: 1;
        min-width: 0;
    }

    .hero-frame {
        padding: 1.25rem;
        border-radius: 1.5rem;
    }

    .hero-image {
        border-radius: 1.2rem;
    }

    .hero-photo {
        width: calc(100% - 1.5rem);
        height: calc(130% - 1.5rem);
        top: -25px;
        left: 10px;
    }

    .hero-decoration {
        display: none;
    }

    .feature-grid,
    .project-grid,
    .skills-grid,
    .about-grid,
    .contact-info {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 3rem 0;
    }

    .section-header h2 {
        font-size: 1.9rem;
    }

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

    .project-links .button {
        width: 100%;
    }

    .about-card,
    .experience-card,
    .testimonial-card,
    .contact-card {
        padding: 1.5rem;
    }

    .contact-card h2 {
        font-size: 1.7rem;
    }

    .footer-nav,
    .footer-social {
        gap: 0.75rem;
    }

    .footer-content,
    .footer-bottom {
        flex-direction: column;
    }

    .footer-nav {
        gap: 1rem;
    }
}


/* =========================================
   Very Small Screens
   ========================================= */

@media (max-width: 360px) {

    .container {
        width: min(100%, calc(100% - 1rem));
    }

    .menu-toggle {
        width: 2.75rem;
        height: 2.75rem;
    }

    .hero-copy h1 {
        font-size: 2.35rem;
    }

    .eyebrow,
    .section-label {
        font-size: 0.75rem;
    }

    .social-links {
        flex-direction: column;
        width: 100%;
    }

    .social-item {
        width: 100%;
    }
}


/* =========================================
   Accessibility
   ========================================= */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal-item {
        opacity: 1 !important;
        transform: none !important;
    }
}


/* Keyboard focus */

:focus-visible {
    outline: 3px solid rgba(27, 147, 246, 0.35);
    outline-offset: 3px;
}