:root {
    color-scheme: dark light;
    --bg: #0b0b12;
    --fg: #e8eaf1;
    --muted: #a9afc3;
    --accent: #7aa2ff;
    --card: #141625;
    --line: #23263a;
    --btn: #1f2540;
    --header-bg: rgba(11, 11, 18, .7);
    --image-bg: #0e1220;
    /* Custom brand color for the hero name */
    --hero-name: #0f2a6b;
}

/* Light theme tokens */
:root[data-theme="light"] {
    color-scheme: light dark;
    --bg: #f8fafc; /* slate-50 */
    --fg: #0b1220; /* near-black */
    --muted: #475569; /* slate-600 */
    --accent: #3b82f6; /* blue-500 */
    --card: #ffffff; /* white */
    --line: #e5e7eb; /* gray-200 */
    --btn: #eef2ff; /* indigo-50 */
    --header-bg: rgba(255, 255, 255, .75);
    --image-bg: #f1f5f9; /* slate-100 */
    /* Keep hero name consistent across themes unless specified otherwise */
    --hero-name: #0f2a6b;
}

* {
    box-sizing: border-box
}

html, body {
    margin: 0;
    padding: 0
}

body {
    font-family: Poppins, Inter, system-ui, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--fg);
    line-height: 1.6;
    transition: background-color .2s ease, color .2s ease
}

.container {
    max-width: 1100px;
    margin-inline: auto;
    padding: 0 1rem
}

.site-header {
    position: sticky;
    top: 0;
    background: var(--header-bg);
    backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--line);
    z-index: 1000;
    transition: background-color .2s ease, border-color .2s ease
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px
}

.brand {
    color: var(--fg);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    border: 1px solid var(--line);
    padding: .25rem .5rem;
    border-radius: .5rem
}

.nav-links {
    display: flex;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0
}

.nav a {
    color: var(--fg);
    text-decoration: none
}

.nav a.btn {
    background: var(--btn);
    padding: .5rem .9rem;
    border-radius: .5rem;
    border: 1px solid var(--line)
}

/* Visual divider between nav groups */
.nav-divider {
    width: 1px;
    height: 24px;
    background: var(--line);
    margin: 0 .25rem;
    align-self: center
}

/* Theme toggle button */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: var(--card);
    color: var(--fg);
    border: 1px solid var(--line);
    padding: .4rem .6rem;
    border-radius: .5rem;
    cursor: pointer;
    font: inherit
}

.theme-toggle:hover {
    filter: brightness(1.05)
}

.theme-toggle .icon {
    font-size: 1rem;
    line-height: 1
}

.theme-toggle .label {
    font-size: .9rem
}

/* Language toggle button */
.lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: var(--card);
    color: var(--fg);
    border: 1px solid var(--line);
    padding: .4rem .6rem;
    border-radius: .5rem;
    cursor: pointer;
    font: inherit
}

.lang-toggle:hover {
    filter: brightness(1.05)
}

.hero {
    display: grid;
    grid-template-columns:1.3fr .7fr;
    gap: 2rem;
    align-items: center;
    min-height: 70vh;
    position: relative
}

.hero::before {
    content: "";
    position: absolute;
    inset: 10% -15% auto auto;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(closest-side, rgba(122, 162, 255, .18), rgba(122, 162, 255, 0) 70%);
    filter: blur(120px);
    pointer-events: none;
    z-index: -1;
    border-radius: 50%
}

.hero h1 {
    font-size: clamp(2.25rem, calc(6vw + 1rem), 5rem);
    line-height: 1.05;
    margin: 0;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: .01em
}

/* Apply the requested dark-blue color to the hero heading text */
#hero-heading {
    color: var(--hero-name)
}

.hero-subtitle {
    margin: .25rem 0 0;
    color: var(--accent);
    text-transform: lowercase;
    font-size: clamp(1.05rem, .8vw + 1rem, 1.5rem);
    line-height: 1.2;
    font-weight: 600
}

.eyebrow {
    color: color-mix(in hsl, var(--fg) 70%, black);
    opacity: .75;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: .08em;
    font-size: .95rem;
    margin: 0 0 .5rem 0
}

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

.tagline {
    color: var(--muted);
    margin-top: .5rem;
    font-size: clamp(1rem, .6vw + .9rem, 1.25rem)
}

.intro {
    color: var(--fg);
    opacity: .9;
    max-width: 60ch
}

.cta {
    display: flex;
    gap: .75rem;
    margin-top: 1rem
}

.btn {
    display: inline-block;
    color: var(--fg);
    background: var(--card);
    border: 1px solid var(--line);
    padding: .6rem 1rem;
    border-radius: .6rem;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease;
    font-weight: 600
}

.btn.primary {
    background: var(--accent);
    color: #0b0b12;
    border-color: transparent
}

/* Outlined button style (as in the sample design) */
.btn.outline {
    background: transparent;
    border: 2px solid var(--fg);
    color: var(--fg);
    text-transform: uppercase;
    letter-spacing: .04em
}

.btn.outline:hover {
    background: var(--fg);
    color: var(--bg)
}

.hero-photo {
    display: flex;
    justify-content: center;
    align-items: flex-end
}

.hero-photo img {
    max-width: clamp(260px, 30vw, 520px);
    width: 100%;
    aspect-ratio: 3/4;
    border-radius: 1rem;
    border: 1px solid var(--line);
    background: var(--card);
    object-fit: cover
}

.section {
    padding: 3rem 0
}

h2 {
    margin: 0 0 1rem 0;
    font-size: 1.8rem
}

h3 {
    margin: .8rem 0 .4rem 0
}

.grid.two {
    display: grid;
    grid-template-columns:2fr 1fr;
    gap: 2rem
}

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

.timeline {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 2px solid var(--line);
    padding-left: 1rem
}

.timeline-card {
    background: var(--card);
    border: 1px solid var(--line);
    padding: 1rem;
    border-radius: .75rem;
    margin: 1rem 0;
    transition: background-color .2s ease, border-color .2s ease
}

.meta {
    color: var(--muted);
    font-size: .9rem
}

.skills {
    display: grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap: .5rem;
    padding-left: 1rem
}

/* Resume photo replacing the Experience block */
.resume-photo {
    display: flex;
    justify-content: center
}

.resume-photo img {
    max-width: min(100%, 520px);
    width: 100%;
    height: auto;
    border-radius: 1rem;
    border: 1px solid var(--line);
    background: var(--image-bg);
    object-fit: cover;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .18)
}

/* Technology knowledge block (replaces skills/education/certs) */
.tech-knowledge {
    display: grid;
    gap: 1rem
}

.tech-knowledge .tech-group h4 {
    margin: .25rem 0 .25rem 0;
    color: var(--accent);
    font-size: 1.05rem
}

.tech-knowledge .tech-group ul {
    margin: .25rem 0 0 1.1rem;
    padding: 0
}

.tech-knowledge .tech-group li {
    margin: .2rem 0
}

.about-section {
    position: relative;
    padding: 4rem 0;
    background: color-mix(in hsl, var(--card) 90%, var(--bg));
    border-radius: 1rem;
    box-shadow: 0 0 40px rgba(0, 0, 0, .2);
    overflow: hidden;
    transition: background-color .3s ease, box-shadow .3s ease
}

.about-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 40% 20%, rgba(122, 162, 255, .08), transparent 70%);
    pointer-events: none;
    z-index: 0
}

.about-section h2 {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: .05em
}

.about-section .content {
    position: relative;
    z-index: 1;
    max-width: 70ch;
    margin-inline: auto;
    color: var(--fg);
    line-height: 1.7;
    font-size: 1.05rem;
    font-weight: 400
}

.about-section p {
    margin: 1rem 0
}

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

.about-highlight {
    border-left: 4px solid var(--accent);
    padding-left: 1rem;
    margin: 2rem 0;
    color: color-mix(in hsl, var(--accent) 90%, var(--fg) 60%);
    font-weight: 500;
    font-style: italic
}

@media (prefers-reduced-motion: no-preference) {
    .about-section {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity .8s ease, transform .8s ease
    }

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

/* About paragraph cards */
.about-section .paragraph-box {
    background: color-mix(in hsl, var(--card) 92%, var(--accent) 8%);
    border: 1px solid var(--accent);
    border-radius: .75rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
    transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease
}

.about-section .paragraph-box:hover {
    box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
    transform: translateY(-2px)
}

.about-section .paragraph-box h3 {
    display: inline-block;
    background: var(--accent);
    color: #0b0b12;
    margin: 0 0 1rem 0;
    padding: .25rem .6rem;
    border-radius: .5rem;
    font-weight: 600;
    line-height: 1.2
}

.about-section .paragraph-box p {
    margin: .8rem 0
}

.about-section .paragraph-box p:last-child {
    margin-bottom: 0
}

/* Mobile tweaks for paragraph cards */
@media (max-width: 700px) {
    .about-section .paragraph-box {
        padding: 1rem
    }
}

/* Subtle staggered reveal for cards when About becomes visible */
@media (prefers-reduced-motion: no-preference) {
    .about-section .paragraph-box {
        opacity: 0;
        transform: translateY(10px);
        transition: opacity .6s ease, transform .6s ease
    }

    .about-section.is-visible .paragraph-box {
        opacity: 1;
        transform: translateY(0)
    }

    .about-section.is-visible .paragraph-box:nth-of-type(1) {
        transition-delay: .05s
    }

    .about-section.is-visible .paragraph-box:nth-of-type(2) {
        transition-delay: .1s
    }

    .about-section.is-visible .paragraph-box:nth-of-type(3) {
        transition-delay: .15s
    }

    .about-section.is-visible .paragraph-box:nth-of-type(4) {
        transition-delay: .2s
    }

    .about-section.is-visible .paragraph-box:nth-of-type(5) {
        transition-delay: .25s
    }

    .about-section.is-visible .paragraph-box:nth-of-type(6) {
        transition-delay: .3s
    }
}

.cards .card {
    background: var(--card);
    border: 1px solid var(--line);
    padding: 1rem;
    border-radius: .75rem;
    transition: background-color .2s ease, border-color .2s ease, transform .15s ease
}

.cards .card:hover {
    border-color: color-mix(in hsl, var(--accent) 50%, var(--line));
    transform: translateY(-2px)
}

.cards .card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: .5rem;
    border: 1px solid var(--line);
    background: var(--image-bg);
    image-rendering: auto;
}

.excerpt {
    color: var(--muted)
}

/* --- Project progress bars --- */
.progress {
    background: var(--line);
    height: 10px;
    border-radius: 10px;
    margin-top: .5rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%; /* animated to target */
    border-radius: 10px; /* keep rounded ends */
    transition: width .6s ease-in-out;
}

/* Colors per project */
.progress-bar.p1 { background: #7AA2FF; }
.progress-bar.p2 { background: #44C4A1; }
.progress-bar.p3 { background: #FFD56B; }

.progress-label {
    display: inline-block;
    font-size: .85rem;
    color: var(--muted);
    margin-top: .25rem;
}

.site-footer {
    border-top: 1px solid var(--line);
    padding: 2rem 0;
    color: var(--muted)
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden
}

.skip-link:focus {
    position: fixed;
    left: 1rem;
    top: 1rem;
    width: auto;
    height: auto;
    z-index: 10000;
    background: var(--accent);
    color: #0b0b12;
    padding: .5rem .75rem;
    border-radius: .5rem;
    outline: 2px solid var(--fg)
}

@media (max-width: 900px) {
    .hero {
        grid-template-columns:1fr
    }

    .grid.two {
        grid-template-columns:1fr
    }

    .grid.three {
        grid-template-columns:1fr
    }
}

/* Light theme adjustments for the decorative glow */
:root[data-theme="light"] .hero::before {
    background: radial-gradient(closest-side, rgba(59, 130, 246, .12), rgba(59, 130, 246, 0) 70%)
}

/* Social icons in the nav (right side) */
.social {
    display: flex;
    gap: .75rem;
    align-items: center
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: .5rem;
    background: transparent;
    color: var(--fg);
    text-decoration: none;
    transition: transform .15s ease, border-color .2s ease
}

.icon-btn:hover {
    transform: translateY(-1px);
    border-color: color-mix(in hsl, var(--accent) 50%, var(--line))
}

/* Screen reader only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0
}

/* Tighter spacing between Hero and Blog */
/* Bring the Blog section higher by reducing its top padding only for this section */
#blog.section {
    padding-top: 1.5rem
}

/* Reduce hero minimum height slightly so content below appears sooner */
.hero {
    min-height: 60vh
}

/* ------------------------------------------------------------
   Blog Post Styles
   Scope styles to the blog article to avoid affecting the rest
   of the site. Implements the guideline in
   Guidlines/Improve style/improve blogpost style.md
   ------------------------------------------------------------ */

/* Article wrapper card */
.blog-post {
    max-width: 740px;
    margin: 0 auto;
    background: color-mix(in hsl, var(--card) 92%, var(--bg));
    border: 1px solid var(--line);
    border-radius: 1rem;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
    padding: 2rem
}

@media (max-width: 800px) {
    .blog-post {
        padding: 1.25rem
    }
}

/* Header spacing */
.blog-post .blog-header {
    margin: 0 0 1rem 0
}

.blog-post .blog-header .meta {
    display: block;
    margin-top: .25rem;
    color: var(--muted);
    font-size: .9rem;
    border-left: 3px solid var(--accent);
    padding-left: .5rem
}

/* Body typography (Inter for readability) */
.blog-post .prose {
    font-family: Inter, system-ui, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.75;
    font-size: 1.05rem;
    letter-spacing: .01em
}

/* Headings */
.blog-post .prose h1 {
    font-family: Poppins, system-ui, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    color: var(--accent);
    font-weight: 700;
    line-height: 1.1;
    margin: 0 0 .5em 0;
    font-size: clamp(1.8rem, 2.5vw + 1rem, 2.6rem)
}

.blog-post .prose h2 {
    font-family: Poppins, system-ui, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    color: var(--accent);
    margin: 2.5rem 0 .75rem 0;
    font-size: clamp(1.3rem, 1.3vw + 1rem, 1.9rem);
    padding-bottom: .25rem;
    border-bottom: 1px solid var(--line)
}

.blog-post .prose h3 {
    font-family: Poppins, system-ui, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    color: var(--fg);
    font-weight: 600;
    margin: 2rem 0 .5rem 0;
    font-size: clamp(1.15rem, .8vw + 1rem, 1.4rem)
}

/* Paragraphs & lists */
.blog-post .prose p {
    margin: 1rem 0
}

.blog-post .prose ul, .blog-post .prose ol {
    margin: 1rem 0;
    padding-left: 1.5rem
}

.blog-post .prose li {
    margin: 0 0 .4rem 0
}

/* Links */
.blog-post .prose a {
    color: var(--accent);
    text-underline-offset: 3px
}

.blog-post .prose a:hover {
    text-decoration: underline
}

.blog-post .prose a:focus {
    outline: 2px solid var(--accent);
    outline-offset: 2px
}

/* Blockquote */
.blog-post .prose blockquote {
    margin: 1.25rem 0;
    padding: 1rem 1rem 1rem 1.1rem;
    border-left: 4px solid var(--accent);
    background: color-mix(in hsl, var(--image-bg) 90%, var(--bg));
    border-radius: .5rem;
    font-style: italic
}

/* Code */
.blog-post .prose code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    background: color-mix(in hsl, var(--image-bg) 85%, var(--bg));
    padding: .1rem .35rem;
    border-radius: .35rem;
    border: 1px solid var(--line)
}

.blog-post .prose pre {
    background: color-mix(in hsl, var(--image-bg) 90%, var(--bg));
    border: 1px solid var(--line);
    border-radius: .6rem;
    padding: 1rem;
    overflow: auto
}

.blog-post .prose pre code {
    background: transparent;
    border: none;
    padding: 0
}

/* Images */
.blog-post .prose img {
    max-width: 100%;
    height: auto;
    border-radius: .6rem;
    border: 1px solid var(--line);
    background: var(--image-bg);
    display: block;
    margin: 1rem auto
}

/* Tables (if present) */
.blog-post .prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0
}

.blog-post .prose th, .blog-post .prose td {
    border: 1px solid var(--line);
    padding: .5rem;
    text-align: left
}

.blog-post .prose th {
    background: color-mix(in hsl, var(--image-bg) 92%, var(--bg))
}

/* Post content reveal */
.blog-post .post-content {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .4s ease, transform .4s ease
}

.blog-post .post-content.is-ready {
    opacity: 1;
    transform: none
}

@media (prefers-reduced-motion: reduce) {
    .blog-post .post-content {
        transition: none
    }
}

/* Footer */
.blog-post .post-footer {
    border-top: 1px solid var(--line);
    padding-top: 1.5rem;
    margin-top: 2rem;
    text-align: center;
    color: var(--muted);
    font-size: .95rem
}
