/* Manoj Pentapati — editorial portfolio system */
:root {
    color-scheme: light;
    --paper: #f6f5f0;
    --paper-deep: #ecebe5;
    --surface: #fffefa;
    --ink: #171916;
    --ink-soft: #454943;
    --muted: #747970;
    --rule: #d8d9d1;
    --blue: #2446d8;
    --blue-dark: #1835b0;
    --red: #d64e32;
    --font-body: 'DM Sans', 'Inter', sans-serif;
    --font-heading: 'Space Grotesk', 'DM Sans', sans-serif;
    --max-width: 1240px;
    --shadow-card: 0 10px 30px rgba(23, 25, 22, .06);
    --shadow-card-hover: 0 18px 42px rgba(23, 25, 22, .10);
}

html { color-scheme: light; background: var(--paper); scroll-behavior: smooth; scroll-padding-top: 92px; }
body {
    color: var(--ink);
    background: var(--paper);
    font-family: var(--font-body);
    line-height: 1.65;
}
#particleCanvas, .page-preloader { display: none !important; }
::selection { color: white; background: var(--blue); }
a { color: var(--blue); }
a:hover { color: var(--red); }
:focus-visible { outline: 2px solid var(--blue) !important; outline-offset: 4px; }

/* A quiet, flat masthead replaces the floating glass capsule. */
header {
    position: fixed;
    top: 0;
    left: 0;
    transform: none;
    width: 100%;
    max-width: none;
    height: 76px;
    padding: 0 max(28px, calc((100vw - var(--max-width)) / 2));
    border: 0;
    border-bottom: 1px solid rgba(23, 25, 22, .12);
    border-radius: 0;
    background: rgba(246, 245, 240, .96);
    box-shadow: none;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.nav-wrapper { width: 100%; max-width: none; gap: 2rem; }
.nav-logo { align-items: flex-start; transform: none; }
.nav-logo-text { color: var(--ink); font: 700 1.42rem/1 var(--font-heading); letter-spacing: -.09em; }
.nav-logo-text span { color: var(--blue); }
.nav-logo-subtext { margin-top: 5px; color: var(--muted); font: 600 .57rem/1 var(--font-body); letter-spacing: .12em; }
nav { gap: .25rem; }
nav a { position: relative; padding: .5rem .65rem; border-radius: 0; color: var(--ink-soft); font-size: .78rem; font-weight: 500; }
nav a::after { bottom: 3px; height: 1px; border-radius: 0; background: var(--blue); }
nav a:hover, nav a.active { color: var(--blue); background: transparent; }
nav a.active::after { display: block; width: 60%; left: 20%; background: var(--blue); }
.nav-cta {
    padding: .7rem .95rem;
    border: 1px solid var(--ink);
    border-radius: 0;
    background: var(--ink);
    color: white !important;
    box-shadow: none;
    font-size: .75rem;
    letter-spacing: .015em;
}
.nav-cta:hover { transform: translateY(-2px); background: var(--blue); border-color: var(--blue); box-shadow: none; }
.nav-cta i:last-child { display: none; }
.nav-toggle { color: var(--ink); }
.nav-spacer { height: 76px; }

/* Full-width editorial canvas; each section shares a baseline and fine rule. */
.container { width: 100%; max-width: none; margin: 0; padding: 0; }
main { display: block; width: 100%; }
main > section {
    display: block !important;
    width: min(calc(100% - 64px), var(--max-width)) !important;
    min-height: 0;
    margin: 0 auto !important;
    padding: clamp(5rem, 9vw, 8.5rem) 0;
    border-bottom: 1px solid var(--rule);
    scroll-margin-top: 76px;
    opacity: 1 !important;
    transform: none !important;
}
main > section:first-child { padding-top: clamp(2.5rem, 4vw, 3.5rem); }
section h1, .hero-text h1 { color: var(--ink); font-family: var(--font-heading); letter-spacing: -.065em; }
section h1 { margin: 0 0 1rem; text-align: left; font-size: clamp(2.5rem, 5vw, 4.15rem); font-weight: 600; line-height: 1.02; }
section h1 span, .about-heading-accent, .edu-heading-accent, .contact-heading-accent,
.achieve-title span, .cert-title span, .coding-title span, .projects-heading-accent,
.skills-header-left h1 span { color: var(--blue) !important; background: none !important; -webkit-text-fill-color: currentColor !important; }
section p { color: var(--ink-soft); }

/* Hero: typography leads, portrait acts as a confident editorial plate. */
.hero-section { display: flex !important; align-items: center; height: calc(100svh - 76px); min-height: 610px; padding: clamp(1.25rem, 3vh, 2rem) 0; overflow: visible; box-sizing: border-box; }
main > section.hero-section:first-child { min-height: 0 !important; padding: clamp(1rem, 2vh, 1.5rem) 0 !important; }
.hero-content { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); align-items: center; gap: clamp(2rem, 6vw, 6rem); width: 100%; max-width: none; padding: 0; text-align: left; }
.hero-text { min-width: 0; padding: 0; text-align: left; }
.hero-greeting { display: inline-flex; align-items: center; gap: .75rem; margin: 0 0 1.2rem; padding: 0; border: 0; border-radius: 0; background: none; color: var(--blue); font: 600 .7rem/1.4 'DM Mono', monospace; letter-spacing: .07em; text-transform: uppercase; }
.hero-greeting::before { content: ''; width: 28px; height: 1px; background: var(--red); }
.hero-text h1 { max-width: 850px; margin: 0; font-size: clamp(3.7rem, 8vw, 7rem); font-weight: 600; line-height: .83; animation: none; background: none; -webkit-text-fill-color: currentColor; }
.hero-text h1 span { color: var(--blue); }
.hero-text h2 { margin: 1.15rem 0 .55rem; color: var(--ink); font: 600 .84rem/1.3 'DM Mono', monospace; letter-spacing: .09em; text-transform: uppercase; }
.hero-text h2::after { display: none; }
.hero-text p { max-width: 620px; margin: 0; color: var(--ink-soft); font-size: clamp(1.05rem, 1.5vw, 1.22rem); line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0; margin: 1.15rem 0 0; }
.hero-primary-link, .hero-secondary-link { display: inline-flex; min-height: 50px; align-items: center; justify-content: center; gap: .8rem; padding: .75rem 1.05rem; border: 1px solid var(--ink); border-radius: 0; font: 600 .79rem var(--font-body); text-decoration: none; transition: .2s ease; }
.hero-primary-link { color: white; background: var(--blue); border-color: var(--blue); }
.hero-primary-link:hover { color: white; background: var(--blue-dark); border-color: var(--blue-dark); transform: translateY(-2px); }
.hero-secondary-link { min-width: max-content; margin-left: 9px; color: var(--ink); background: transparent; white-space: nowrap; }
.hero-secondary-link:hover { color: var(--blue); border-color: var(--blue); transform: translateY(-2px); }
.hero-social { display: flex; gap: .45rem; margin-top: 1.1rem; }
.hero-social a { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--rule); border-radius: 50%; background: transparent; color: var(--ink-soft); transition: .2s ease; }
.hero-social a:hover { color: white; background: var(--ink); border-color: var(--ink); }
.hero-social a.brand-social-icon { background-color: transparent !important; }
.hero-social a svg { display: block; width: 19px; height: 19px; fill: currentColor; }
.hero-image { position: relative; left: auto; flex: none; width: min(100%, 390px); height: auto; aspect-ratio: 4 / 4.65; margin: 0 auto; }
.hero-image::before { position: absolute; z-index: -1; top: 8%; right: -9%; left: auto; width: 78%; height: 74%; border-radius: 0; background: var(--blue); filter: none; animation: none; content: ''; }
.hero-image-wrapper { position: absolute; inset: 0 8% 9% 0; width: auto; height: auto; overflow: hidden; border-radius: 0; background: var(--paper-deep); }
.hero-image-wrapper img { width: 100%; height: 100%; border: 0; border-radius: 0; object-fit: cover; object-position: 50% 35%; filter: grayscale(1) contrast(1.05); box-shadow: none; animation: heroPhotoReveal .9s .15s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes heroPhotoReveal { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
.orbit-ring, .ring-1 { display: none; }
.stats-bar { right: -6%; bottom: 0; display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; padding: .68rem 0; border: 0; border-top: 1px solid var(--ink); border-radius: 0; background: var(--paper); box-shadow: none; }
.stat-item { display: block; padding: 0 .9rem; border: 0; border-right: 1px solid var(--rule); }
.stat-item:last-child { border: 0; }
.stat-icon { display: none; }
.stat-info h3 { margin: 0 0 .14rem; color: var(--ink); font: 600 1.22rem/1.2 var(--font-heading); }
.stat-info p { color: var(--muted); font: 500 .6rem/1.35 'DM Mono', monospace; letter-spacing: .01em; }
.hero-download-cv { display: none; }

/* Section markers, labels and calm, consistent reading widths. */
.about-wrapper, .hero-content, .skills-header-container, .coding-activity-wrapper,
.experience-section > *, .achieve-header, .cert-header-container, .projects-header,
.contact-layout, .edu-hero, .edu-body { max-width: none; padding-left: 0; padding-right: 0; }
.about-section, .skills-section, .experience-section, .coding-activity-section, .projects-section,
.edu-section, .achieve-section, .cert-section, .contact-section { max-width: none; }
.about-wrapper, .skills-header-container, .coding-activity-wrapper, .projects-section > *,
.edu-section > *, .achieve-section > *, .cert-section > *, .contact-layout { width: 100%; }
.hero-greeting, .about-badge, .skills-badge, .exp-badge, .coding-badge, .projects-badge,
.achieve-badge, .cert-badge, .contact-badge, .edu-badge, .exp-title-badge {
    display: inline-flex; width: fit-content; align-items: center; gap: .55rem;
    margin: 0 0 1.2rem; padding: 0; border: 0; border-radius: 0;
    background: none; color: var(--blue); font: 600 .68rem/1.4 'DM Mono', monospace;
    letter-spacing: .08em; text-transform: uppercase;
}
.about-badge::before, .skills-badge::before, .exp-badge::before, .coding-badge::before,
.projects-badge::before, .achieve-badge::before, .cert-badge::before, .contact-badge::before, .edu-badge::before {
    content: ''; display: inline-block; width: 20px; height: 1px; background: var(--red);
}
.about-left { max-width: 790px; }
.about-heading, .skills-header-left h1, .edu-heading, .achieve-title, .coding-title,
.cert-title, .contact-heading { margin-bottom: 1.2rem; font: 600 clamp(2.5rem, 5vw, 4.15rem)/1.02 var(--font-heading); letter-spacing: -.065em; text-align: left; }
.about-bio { color: var(--ink-soft); font-size: 1.06rem; line-height: 1.85; }
.about-bio strong { color: var(--ink); }
.skills-header-container { margin-bottom: 2.1rem; }
.skills-header-left p, .coding-subtitle, .projects-subtext, .cert-subtitle, .edu-subtext, .exp-subtitle { max-width: 640px; color: var(--muted); font-size: 1rem; line-height: 1.75; }
.skills-header-right { display: none; }
.skills-section-title { padding: 0; color: var(--ink); font: 600 1.2rem var(--font-heading); }
.bullet-dot { width: 7px; height: 7px; border-radius: 0; background: var(--red); box-shadow: none; }
.skill-detail-card { align-items: flex-start; padding: 1.1rem; border: 1px solid var(--rule); border-radius: 0; background: var(--surface); box-shadow: none; text-align: left; }
.skill-detail-card:hover { transform: translateY(-2px); border-color: var(--blue); background: var(--surface); box-shadow: none; }
.skill-icon { width: 42px; height: 42px; margin-bottom: .75rem; }
.skill-icon svg, .skill-icon img { filter: none; }
.skill-detail-card h3 { color: var(--ink); text-align: left; }
.skill-proficiency { justify-content: flex-start; }
.skill-proficiency .dot.filled { background: var(--blue); box-shadow: none; }

/* Work is presented as a magazine index, with image scale setting hierarchy. */
.projects-hero { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin: 0 0 2.6rem; padding: 0; }
.projects-hero-left { max-width: 700px; }
.projects-hero-left { width: 100%; }
.projects-heading { margin: 0 0 .75rem; color: var(--ink); font: 600 clamp(2.5rem, 5vw, 4.15rem)/1.02 var(--font-heading); letter-spacing: -.065em; }
.projects-heading-accent { color: var(--blue) !important; }
.projects-subtext { margin: 0; }
.projects-hero-right { flex: 0 0 130px; }
.laptop-container { max-width: 130px; }
.projects-laptop-img { opacity: .78; filter: grayscale(1); }
.laptop-glow { display: none; }
.projects-hero-right, .cert-header-right, .edu-hero-right { display: none; }
.project-filters { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: .45rem; margin: 0 0 1.5rem; padding: .85rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.filter-btn, .skills-tab-btn, .heatmap-tab, .cert-view-more-btn, .btn-primary, .banner-btn {
    padding: .52rem .82rem; border: 1px solid transparent; border-radius: 0; background: transparent;
    color: var(--ink-soft); font: 500 .76rem var(--font-body); box-shadow: none; transition: .2s ease;
}
.filter-btn:hover, .skills-tab-btn:hover, .heatmap-tab:hover { border-color: var(--rule); color: var(--blue); background: transparent; }
.filter-btn.active, .skills-tab-btn.active, .heatmap-tab.active { border-color: var(--ink); color: white; background: var(--ink); box-shadow: none; }
.projects-container { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.5rem, 3vw, 2.5rem); padding: 0; counter-reset: portfolio-project; }
.project-card { min-width: 0; overflow: hidden; border: 0; border-radius: 0; background: transparent !important; box-shadow: none; counter-increment: portfolio-project; }
.project-card, .project-card:hover { transform: none !important; border-color: transparent; box-shadow: none; }
.project-card-image-wrapper { position: relative; height: clamp(200px, 25vw, 330px); overflow: hidden; border: 1px solid var(--rule); border-radius: 0; background: var(--paper-deep); }
.project-card-img { width: 100%; height: 100%; object-fit: cover; transition: transform .55s cubic-bezier(.2,.7,.2,1); }
.project-card:hover .project-card-img { transform: scale(1.025); }
.project-card-content { padding: 1.05rem 0 .2rem; }
.project-card-content::before { display: block; margin-bottom: .55rem; color: var(--red); content: counter(portfolio-project, decimal-leading-zero) " / PROJECT"; font: 500 .64rem 'DM Mono', monospace; letter-spacing: .07em; }
.project-card-header-row { display: flex; align-items: flex-start; gap: .8rem; }
.project-card-icon { display: none; }
.project-card-title { margin: 0; color: var(--ink); font: 600 clamp(1.2rem, 2vw, 1.65rem)/1.25 var(--font-heading); letter-spacing: -.035em; }
.project-card-title i { color: var(--blue); font-size: .7em; }
.project-card-desc { max-width: 610px; margin: .55rem 0 .8rem; color: var(--ink-soft); font-size: .92rem; line-height: 1.65; }
.project-card-tags span, .expertise-tags span { margin: 0 .28rem .3rem 0; padding: .22rem .5rem; border: 1px solid var(--rule); border-radius: 0; background: transparent; color: var(--muted); font: 500 .66rem 'DM Mono', monospace; }
.project-card .project-card-tags span, .project-card:hover .project-card-tags span { border-color: var(--rule) !important; background: transparent !important; color: var(--muted) !important; }
.project-card-actions { gap: .8rem; }
.project-card-actions a { color: var(--blue); font-size: .76rem; }

/* Skills and timeline: hairline borders, paper surfaces, restrained accent. */
.skills-tab-btn { margin: 0 .25rem .45rem 0; }
.skills-cards-grid { gap: .7rem; }
.skill-card, .skill-item, .progress-item { border: 1px solid var(--rule); border-radius: 0; background: var(--surface); box-shadow: none; }
.skill-card:hover { border-color: var(--blue); box-shadow: none; transform: translateY(-2px); }
.timeline-container { padding-left: 1.5rem; }
.timeline-container::before { width: 1px; background: var(--rule); }
.timeline-dot { border-color: var(--paper); background: var(--blue); box-shadow: none; }
.timeline-item, .exp-card { border: 1px solid var(--rule); border-radius: 0; background: var(--surface); box-shadow: none; }
.exp-card:hover, .edu-timeline-card:hover, .achieve-card:hover, .cert-card:hover, .coding-card:hover { transform: translateY(-2px); border-color: var(--blue); box-shadow: var(--shadow-card); }
.exp-role, .edu-entry-title, .cert-card-title, .achieve-rank, .coding-card h3, .form-card-title,
.timeline-content h3 { color: var(--ink); }
.exp-date, .edu-badge-score { color: var(--blue); background: none; border: 0; }
.exp-bullets, .edu-entry-inst, .cert-issuer, .achieve-desc, .contact-subtext { color: var(--ink-soft); }

/* Dashboard stays information-dense; the surrounding portfolio stays quiet. */
.coding-card, .coding-profile-card, .heatmap-viewer-card, .cert-card, .achieve-card,
.edu-timeline-card, .edu-highlights, .contact-form-card {
    color: var(--ink); border: 1px solid var(--rule); border-radius: 0; background: var(--surface); box-shadow: none;
}
.coding-card, .cert-card, .achieve-card, .edu-timeline-card { transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.coding-card:hover, .cert-card:hover, .achieve-card:hover, .edu-timeline-card:hover { border-color: var(--blue); box-shadow: var(--shadow-card); }
.achieve-card.highlight { color: var(--ink) !important; border: 1px solid var(--blue) !important; border-radius: 0 !important; background: var(--surface) !important; box-shadow: none !important; }
.achieve-card.highlight .achieve-card-content, .achieve-card.highlight .achieve-rank, .achieve-card.highlight .achieve-desc { color: var(--ink) !important; }
.achieve-card-glowing, .cap-glow { display: none; }
.achieve-icon-badge, .contact-icon-box, .form-icon-box { color: var(--blue); border-color: var(--rule); border-radius: 0; background: var(--paper); box-shadow: none; }
.achieve-rank { color: var(--blue) !important; }
.achieve-link-btn { color: white !important; border-radius: 0; background: var(--blue); box-shadow: none; }
.achieve-link-btn:hover { color: white !important; background: var(--blue-dark); box-shadow: none; }
.cert-footer-banner, .cert-inner-box, .cert-glowing-box { border-color: var(--rule); border-radius: 0; background: var(--paper-deep); color: var(--ink); }
.badges-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; padding: .15rem 0 .9rem; }
.badge-card { min-width: 0; padding: 1rem .8rem; border: 1px solid var(--rule); border-radius: 0; background: var(--paper); box-shadow: none; }
.badge-card:hover { border-color: var(--blue); background: var(--surface); box-shadow: none; transform: translateY(-2px); }
.badge-card img { filter: none; }
.badge-card h4 { color: var(--ink); }
.badge-card p { color: var(--muted); }
.badge-view-btn { border: 1px solid var(--rule); border-radius: 0; background: transparent; color: var(--blue); }
.badge-view-btn:hover { border-color: var(--blue); background: var(--blue); color: white; box-shadow: none; }
.leetcode-showcase-panel { min-width: 0; padding: clamp(1.2rem, 3vw, 2rem) 0; border: 0; border-top: 1px solid var(--rule); border-radius: 0; background: transparent; box-shadow: none; }
.edu-hero { grid-template-columns: minmax(0, 1fr) 170px; gap: 2rem; margin: 0 0 2.5rem; padding: 0; }
.edu-cap-container { width: 150px; height: 150px; }
.edu-cap-img { filter: grayscale(1); }
.heatmap-viewer-card, .heatmap-viewer-header, .heatmap-panel-overlay { background: transparent; }
.heatmap-viewer-card { border: 1px solid var(--rule); }
.heatmap-image-wrapper { background: var(--ink); }
.heatmap-select { border: 1px solid var(--rule); border-radius: 0; background: var(--surface); color: var(--ink); }
.profile-card, .timeline-content, .edu-entry, .edu-highlights-item { color: var(--ink); background: transparent; border-color: var(--rule); }

/* Contact and footer get the strongest ink block to close the story. */
.contact-layout { gap: clamp(2rem, 6vw, 6rem); }
.contact-icon-box, .form-icon-box { color: var(--blue); }
.ci-label { color: var(--muted); }
.ci-value { color: var(--ink); }
.contact-form-card { padding: clamp(1.4rem, 3vw, 2.25rem); }
.contact-form input, .contact-form textarea, .contact-form select { color: var(--ink); border: 1px solid var(--rule); border-radius: 0; background: var(--paper); }
.contact-form input::placeholder, .contact-form textarea::placeholder { color: #92958c; }
.contact-form label { color: var(--ink); }
.form-submit-btn, .banner-btn, .hero-download-cv { border: 1px solid var(--blue); border-radius: 0; background: var(--blue); color: white !important; box-shadow: none; }
.form-submit-btn:hover, .banner-btn:hover, .hero-download-cv:hover { background: var(--blue-dark); color: white !important; }
.site-footer { width: 100%; max-width: none; margin: 0; padding-right: max(32px, calc((100vw - var(--max-width)) / 2)); padding-left: max(32px, calc((100vw - var(--max-width)) / 2)); border: 0; border-radius: 0; background: var(--ink); color: #f6f5f0; box-shadow: none; }
.site-footer p, .site-footer a, .site-footer h2, .site-footer h3 { color: inherit; }
.site-footer a:hover { color: #aabaff; }
.footer-bottom { border-color: rgba(255,255,255,.16); background: transparent; }
.footer-orbit { opacity: .08; }
.back-to-top { border-radius: 0; background: var(--blue); color: white; }
.modal-content, .cert-modal-content { color: var(--ink); border-color: var(--rule); border-radius: 0; background: var(--surface); }
.modal-header { border-color: var(--rule); background: var(--surface); }
.modal-body, .cert-modal-body { background: var(--paper); }
.modal .close { color: var(--ink); border: 0; background: transparent; }
.modal .close:hover { color: var(--blue); background: var(--paper-deep); }

/* Project case studies share the visual language, with space for the work. */
.project-page .container { width: min(calc(100% - 64px), var(--max-width)); margin: 0 auto; padding-top: 110px; }
.project-page main > section { width: 100% !important; padding: 0; border: 0; }
.project-page .back-link { margin-bottom: 2rem; padding: .55rem 0; border: 0; border-radius: 0; background: none; color: var(--muted); }
.project-page .back-link:hover { color: var(--blue); transform: translateX(-3px); box-shadow: none; }
.project-page .project-header { max-width: 900px; margin-bottom: 2.5rem; }
.project-page .project-category-badge { margin-bottom: 1.1rem; padding: 0; border: 0; border-radius: 0; background: none; color: var(--blue); font: 600 .72rem 'DM Mono', monospace; letter-spacing: .06em; text-transform: uppercase; }
.project-page .project-category-badge i { color: var(--red); }
.project-page .project-title { max-width: 900px; margin-bottom: .8rem; color: var(--ink); font: 600 clamp(2.8rem, 6vw, 5.5rem)/.98 var(--font-heading); letter-spacing: -.065em; }
.project-page .project-subtitle { max-width: 760px; color: var(--ink-soft); font-size: 1.1rem; line-height: 1.75; }
.project-page .project-media-container { gap: 1rem; align-items: stretch; }
.project-page .media-item { overflow: hidden; border: 1px solid var(--rule); border-radius: 0; background: var(--surface); box-shadow: none; }
.project-page .media-title { color: var(--muted); font: 500 .7rem 'DM Mono', monospace; letter-spacing: .04em; }
.project-page .media-title { padding: .7rem .9rem; border-bottom: 1px solid var(--rule); background: var(--surface); text-align: left; }
.project-page .project-info, .project-page .project-card-details, .project-page .media-item { color: var(--ink); }
.project-page .project-info > *, .project-page .project-card-details { background-color: transparent; }

@media (max-width: 1000px) {
    header { padding-right: 22px; padding-left: 22px; }
    .nav-wrapper { gap: .5rem; }
    nav { gap: 0; }
    nav a { padding: .5rem .4rem; font-size: .7rem; }
    .nav-cta { padding: .65rem .7rem; font-size: .69rem; }
    .hero-content { gap: 2rem; }
}
@media (max-width: 768px) {
    header { top: 0; left: 0; transform: none; width: 100%; height: 64px; padding: 0 20px; border-right: 0; border-left: 0; border-top: 0; }
    .nav-toggle { display: inline-flex; font-size: 1.1rem; }
    nav { top: 64px; left: 0; width: 100%; gap: 0; padding: .6rem 20px 1rem; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; background: var(--paper); box-shadow: none; }
    nav a { width: 100%; padding: .8rem .35rem; border-bottom: 1px solid var(--rule); text-align: left; font-size: .9rem; }
    nav a::after { display: none; }
    .nav-cta { display: none; }
    .nav-spacer { height: 64px; }
    .container { padding-top: 0; }
    main > section { width: calc(100% - 40px); padding: 4.6rem 0; scroll-margin-top: 64px; }
    main > section:first-child { padding-top: 2.2rem; }
    .hero-section { height: auto; min-height: 0; padding: 2.2rem 0 3rem; }
    .hero-content { grid-template-columns: 1fr; gap: 2.5rem; flex-direction: initial; text-align: left; }
    .hero-text { text-align: left; }
    .hero-image { order: -1; width: min(70%, 350px); margin: 0 auto; }
    .hero-text h1 { font-size: clamp(4rem, 15vw, 6.5rem); }
    .hero-text h2 { margin-top: 1.25rem; }
    .stats-bar { right: -6%; bottom: 0; display: grid; width: 100%; margin: 0; padding: .75rem 0; }
    .stat-item { width: auto; padding: 0 .5rem; border-right: 1px solid var(--rule); border-bottom: 0; text-align: left; }
    .stat-info h3 { font-size: 1.05rem; }
    .stat-info p { white-space: normal; font-size: .55rem; }
    .hero-social { margin-top: 1.1rem; }
    .projects-hero { align-items: flex-start; }
    .projects-hero-right { display: none; }
    .projects-container { width: 100%; max-width: none; margin: 0; gap: 1.2rem; }
    .project-card-image-wrapper { height: clamp(190px, 36vw, 270px); }
    .edu-hero { grid-template-columns: 1fr; }
    .edu-hero-right { display: none; }
    .contact-layout { grid-template-columns: 1fr; }
    .project-page .container { width: calc(100% - 40px); padding-top: 90px; }
    .project-page .project-media-container { flex-direction: column; }
}
@media (max-width: 520px) {
    main > section { width: calc(100% - 36px); padding: 3.8rem 0; }
    .hero-content { gap: 2rem; }
    .hero-image { width: min(82%, 320px); aspect-ratio: 4 / 4.8; }
    .hero-text h1 { font-size: clamp(3.45rem, 17vw, 5.2rem); }
    .hero-text p { font-size: 1rem; }
    .hero-actions { display: grid; grid-template-columns: 1fr; gap: .55rem; }
    .hero-secondary-link { margin-left: 0; }
    .projects-container { grid-template-columns: 1fr; gap: 2rem; }
    .project-card-image-wrapper { height: 62vw; max-height: 320px; }
    .badges-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .project-card-content { padding-top: .8rem; }
    .stats-bar { right: -6%; }
    .stat-item { text-align: center; }
    .stat-info h3 { font-size: .95rem; }
    .stat-info p { font-size: .51rem; }
    .site-footer { padding-right: 20px; padding-left: 20px; }
    .project-page .container { width: calc(100% - 36px); }
}
/* Certifications: a compact, document-first credential register. */
.certifications-page .container { width: min(calc(100% - 64px), var(--max-width)); }
.certifications-page .cert-section { padding: 2.8rem 0 4.5rem; }
.certifications-page .cert-header-container { display: block; margin: 0 0 1.8rem; padding: 0 0 1.6rem; border-bottom: 1px solid var(--rule); }
.certifications-page .cert-header-left { max-width: 820px; }
.certifications-page .cert-badge { margin: 0 0 1rem; padding: 0; border: 0; border-radius: 0; background: none; color: var(--blue); font: 600 .68rem 'DM Mono', monospace; letter-spacing: .08em; }
.certifications-page .cert-title { margin: 0 0 .9rem; color: var(--ink); font: 600 clamp(3rem, 7vw, 6rem)/.96 var(--font-heading); letter-spacing: -.075em; }
.certifications-page .cert-title span { background: none; color: var(--blue); -webkit-text-fill-color: currentColor; }
.certifications-page .cert-subtitle { max-width: 650px; margin: 0; color: var(--ink-soft); font-size: 1rem; line-height: 1.75; }
.cert-record-strip { display: grid; grid-template-columns: minmax(130px, .5fr) minmax(170px, .7fr) minmax(250px, 1.5fr); align-items: center; margin-bottom: 2rem; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.cert-record-strip > div { display: flex; min-height: 78px; flex-direction: column; justify-content: center; gap: .2rem; padding: .8rem 1rem; border-right: 1px solid var(--rule); }
.cert-record-strip > div:first-child { padding-left: 0; }
.cert-record-strip strong { color: var(--ink); font: 600 1.7rem/1 var(--font-heading); letter-spacing: -.05em; }
.cert-record-strip span { color: var(--muted); font: 500 .62rem 'DM Mono', monospace; }
.cert-record-strip .cert-record-topics { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .4rem; border-right: 0; }
.cert-record-topics span { padding: .4rem .55rem; border: 1px solid var(--rule); color: var(--ink-soft); }
.certifications-page .cert-layout { display: block; margin: 0; padding: 0; }
.certifications-page .cert-left-content { width: 100%; }
.certifications-page .cert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.certifications-page .cert-card { min-width: 0; gap: 1rem; padding: 1.15rem; border: 1px solid var(--rule); border-radius: 0; background: var(--surface); box-shadow: none; }
.certifications-page .cert-card::before { display: none; }
.certifications-page .cert-card:hover { transform: translateY(-2px); border-color: var(--blue); background: white; box-shadow: none; }
.certifications-page .cert-logo-circle { width: 44px; height: 44px; padding: 7px; border: 1px solid var(--rule); border-radius: 50%; background: white; box-shadow: none; }
.certifications-page .cert-card-tag { margin: 0 0 .55rem; padding: 0; border: 0; border-radius: 0; background: none; color: var(--blue); font: 500 .6rem 'DM Mono', monospace; letter-spacing: .06em; }
.certifications-page .cert-card-content h3 { margin: 0 0 .3rem; color: var(--ink); font: 600 1.05rem/1.35 var(--font-heading); }
.certifications-page .cert-issuer { margin-bottom: .65rem; color: var(--ink-soft); font-size: .75rem; }
.certifications-page .cert-meta { flex-wrap: wrap; gap: .4rem .8rem; margin-bottom: 1rem; color: var(--muted); font-size: .65rem; }
.certifications-page .cert-meta i { color: var(--red); }
.certifications-page .cert-actions { flex-wrap: wrap; gap: .8rem; }
.certifications-page .cert-view-btn { color: var(--blue); font-size: .72rem; }
.certifications-page .cert-verify-link, .certifications-page .cert-verify-link.disabled { color: var(--muted); font-size: .66rem; }
.certifications-page .cert-verify-link i.fa-check-circle { color: var(--blue); }
.certifications-page .cert-right-column { display: none; }
.certifications-page .cert-view-more-container { justify-content: flex-start; margin-top: 1rem; }
.certifications-page .cert-view-more-btn { min-height: 40px; padding: .55rem .75rem; border: 1px solid var(--rule); border-radius: 0; color: var(--ink-soft); font-size: .72rem; }
.certifications-page .cert-footer-banner { display: flex; justify-content: space-between; gap: 1rem; margin: 2.5rem 0 1rem; padding: 1.2rem 0; border: 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none; overflow: visible; }
.certifications-page .cert-footer-banner::before { display: none; }
.certifications-page .banner-icon-box { display: none; }
.certifications-page .banner-text h3 { color: var(--ink); font: 600 1.1rem var(--font-heading); }
.certifications-page .banner-text p { color: var(--muted); font-size: .8rem; }
.certifications-page .banner-btn { min-height: 42px; padding: .65rem .8rem; font-size: .72rem; }
@media (max-width: 780px) {
    .certifications-page .container { width: min(calc(100% - 36px), var(--max-width)); }
    .certifications-page .cert-grid { grid-template-columns: 1fr; }
    .cert-record-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cert-record-strip .cert-record-topics { grid-column: 1 / -1; justify-content: flex-start; border-top: 1px solid var(--rule); }
}
@media (max-width: 520px) {
    .certifications-page .cert-title { font-size: clamp(2.4rem, 11vw, 3.4rem); }
    .certifications-page .cert-card { gap: .7rem; padding: .85rem; }
    .certifications-page .cert-meta { flex-direction: column; }
    .certifications-page .cert-footer-banner { align-items: flex-start; flex-direction: column; }
    .cert-record-strip > div { padding: .75rem .5rem; }
    .cert-record-strip strong { font-size: 1.35rem; }
}

/* Achievements: a contest result and an evidence trail of consistency. */
.achievements-page .container { width: min(calc(100% - 64px), var(--max-width)); }
.achievements-page .achieve-section { padding: 2.8rem 0 4.5rem; }
.achievements-page .achieve-header { margin: 0 0 2rem; padding: 0 0 1.8rem; border-bottom: 1px solid var(--rule); }
.achievements-page .achieve-badge { margin: 0 0 1rem; padding: 0; border: 0; border-radius: 0; background: none; color: var(--blue); font: 600 .68rem 'DM Mono', monospace; letter-spacing: .08em; }
.achievements-page .achieve-title { margin: 0 0 .9rem; color: var(--ink); font: 600 clamp(3rem, 7vw, 6rem)/.96 var(--font-heading); letter-spacing: -.075em; }
.achievements-page .achieve-title span { background: none; color: var(--blue); -webkit-text-fill-color: currentColor; }
.achievements-page .achieve-subtitle { max-width: 650px; margin: 0; color: var(--ink-soft); font-size: 1rem; line-height: 1.75; }
.achievements-page .achieve-grid { grid-template-columns: 1fr; gap: 2.5rem; padding: 0; }
.achievements-page .achieve-card.highlight { min-height: 260px; padding: clamp(1.3rem, 3vw, 2.5rem); border: 0; border-top: 3px solid #e6b85c; border-radius: 0; background: var(--ink); box-shadow: none; }
.achievements-page .achieve-card-content { display: grid; width: 100%; grid-template-columns: minmax(160px, .75fr) minmax(0, 1.5fr); grid-template-rows: auto auto 1fr; align-items: center; column-gap: clamp(1.2rem, 5vw, 5rem); }
.achievements-page .achieve-index { grid-column: 1; grid-row: 1; color: #d3bb8d; font: 500 .62rem 'DM Mono', monospace; letter-spacing: .08em; }
.achievements-page .achieve-score { grid-column: 1; grid-row: 2; margin: .15rem 0 0; color: #f0ca76; font: 600 clamp(3.6rem, 8vw, 6.4rem)/.95 var(--font-heading); letter-spacing: -.08em; }
.achievements-page .achieve-card.highlight .achieve-rank { grid-column: 1; grid-row: 3; align-self: start; margin: .35rem 0 0; color: #f0ca76 !important; font: 500 .72rem 'DM Mono', monospace; letter-spacing: .035em; text-transform: uppercase; }
.achievements-page .achieve-rank span { color: rgba(255,255,255,.5); }
.achievements-page .achieve-card h2 { grid-column: 2; grid-row: 1; margin: 0 0 .4rem; color: white; font: 600 clamp(1.55rem, 3.2vw, 2.4rem)/1.12 var(--font-heading); letter-spacing: -.045em; }
.achievements-page .achieve-card.highlight .achieve-desc { grid-column: 2; grid-row: 2; max-width: 540px; margin: 0 0 1.1rem; color: rgba(246,245,240,.72) !important; font-size: .88rem; }
.achievements-page .achieve-link-btn { grid-column: 2; grid-row: 3; align-self: start; justify-self: start; min-height: 42px; padding: .65rem .85rem; border: 1px solid rgba(255,255,255,.35); border-radius: 0; background: transparent; color: white !important; font-size: .72rem; box-shadow: none; }
.achievements-page .achieve-link-btn:hover { border-color: #f0ca76; background: #f0ca76; color: var(--ink) !important; box-shadow: none; }
.achievements-page .leetcode-showcase-panel { padding: 0; border: 0; border-top: 1px solid var(--rule); border-radius: 0; background: transparent; box-shadow: none; }
.achievement-gallery-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; padding: 1.4rem 0; border-bottom: 1px solid var(--rule); }
.achievement-gallery-heading > div > span { color: var(--blue); font: 500 .62rem 'DM Mono', monospace; letter-spacing: .08em; }
.achievement-gallery-heading h2 { margin: .45rem 0 0; color: var(--ink); font: 600 clamp(1.5rem, 3vw, 2.1rem)/1.1 var(--font-heading); letter-spacing: -.045em; }
.achievement-gallery-heading > p { margin: 0; color: var(--muted); font-size: .75rem; }
.achievement-badge-group { display: grid; grid-template-columns: 1fr; gap: .85rem; padding: 1.3rem 0; border-bottom: 1px solid var(--rule); }
.achievement-badge-group:last-child { border-bottom: 0; }
.achievement-year { display: flex; align-items: baseline; gap: .6rem; padding-bottom: .65rem; border-bottom: 1px solid var(--rule); }
.achievement-year > span { color: var(--red); font: 500 .62rem 'DM Mono', monospace; }
.achievement-year h3 { margin: 0; color: var(--ink); font: 600 1rem var(--font-heading); }
.achievements-page .badges-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; padding: 0; }
.achievements-page .badge-card { min-width: 0; min-height: 290px; display: flex; align-items: stretch; justify-content: flex-start; padding: .95rem; border: 1px solid var(--rule); border-radius: 0; background: var(--surface); text-align: left; box-shadow: none; }
.achievements-page .badge-card:hover { transform: translateY(-2px); border-color: var(--blue); background: white; box-shadow: none; }
.achievements-page .badge-card img { width: 100%; height: 165px; align-self: center; margin: 0 0 .8rem; background: var(--paper-deep); object-fit: contain; filter: none; }
.achievements-page .badge-card:hover img { transform: none; }
.achievements-page .badge-card h4 { margin: 0; color: var(--ink); font: 600 .78rem/1.35 var(--font-heading); }
.achievements-page .badge-card p { min-height: 2.4em; margin: .3rem 0 0; color: var(--muted); font-size: .65rem; line-height: 1.4; }
.achievements-page .badge-view-btn { align-self: flex-start; margin: auto 0 0; padding: .35rem 0 0; border: 0; border-radius: 0; background: none; color: var(--blue); font-size: .65rem; }
.achievements-page .badge-view-btn:hover { transform: none; border: 0; background: none; color: var(--blue-dark); box-shadow: none; }
@media (max-width: 860px) {
    .achievements-page .badges-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
    .achievements-page .container { width: min(calc(100% - 36px), var(--max-width)); }
    .achievements-page .achieve-card-content { grid-template-columns: 1fr; grid-template-rows: auto; }
    .achievements-page .achieve-index, .achievements-page .achieve-score, .achievements-page .achieve-card h2, .achievements-page .achieve-link-btn { grid-column: 1; grid-row: auto; }
    .achievements-page .achieve-card.highlight .achieve-rank, .achievements-page .achieve-card.highlight .achieve-desc { grid-column: 1; grid-row: auto; }
    .achievements-page .achieve-card h2 { margin-top: 1rem; }
    .achievements-page .achieve-desc { margin-bottom: 1rem; }
    .achievement-gallery-heading { align-items: flex-start; flex-direction: column; }
    .achievements-page .badge-card { min-height: 270px; }
}
@media (max-width: 480px) {
    .achievements-page .achieve-title { font-size: clamp(2.5rem, 12vw, 3.5rem); }
    .achievements-page .badges-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .hero-image-wrapper img { animation: none; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Shared footer: continue the portfolio's warm paper, charcoal and cobalt palette. */
.site-footer {
    position: relative;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 max(32px, calc((100vw - var(--max-width)) / 2));
    border: 0;
    border-top: 1px solid var(--rule);
    border-radius: 0;
    background: var(--paper-deep);
    color: var(--ink);
    box-shadow: none;
}
.site-footer p, .site-footer a, .site-footer h2, .site-footer h3, .site-footer h4 { color: inherit; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--blue); }
.footer-invitation {
    position: relative;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
    padding: clamp(2.2rem, 5vw, 4rem) 0;
    border-bottom: 1px solid var(--rule);
}
.footer-invitation::before { position: absolute; top: -1px; left: 0; width: 64px; height: 2px; background: var(--red); content: ''; }
.footer-invitation-kicker { color: var(--blue); font: 500 .62rem 'DM Mono', monospace; letter-spacing: .13em; }
.footer-invitation h2 { margin: .8rem 0 0; color: var(--ink); font: 500 clamp(2rem, 4vw, 3.55rem)/1 var(--font-heading); letter-spacing: -.06em; }
.footer-invitation > a {
    display: inline-flex;
    min-height: 48px;
    flex: 0 0 auto;
    align-items: center;
    gap: .75rem;
    padding: .8rem 1rem;
    border: 1px solid var(--blue);
    background: var(--blue);
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.footer-invitation > a:hover { transform: translateY(-2px); border-color: var(--red); background: var(--red); color: #fff; }
.footer-main { padding: 2.6rem 0 2.2rem; }
.footer-name, .footer-col-title { color: var(--ink); }
.footer-role, .footer-links-grid a i { color: var(--blue); }
.footer-desc, .footer-connect-sub, .footer-links-grid a { color: var(--ink-soft); }
.footer-social-btn { border-color: var(--rule); background: var(--surface); color: var(--ink); box-shadow: none; }
.footer-social-btn:hover { border-color: var(--blue); background: var(--blue); color: #fff; }
.footer-orbit { opacity: .12; }
.footer-orbit .orbit-ring { border-color: rgba(36,70,216,.32); }
.footer-orbit .orbit-dot { background: var(--red); box-shadow: none; }
.footer-bottom { border-color: var(--rule); background: transparent; }
.footer-bottom p { color: var(--muted); }
.footer-heart { color: var(--red); }
.project-page .nav-spacer { height: 0; }
.hero-social { gap: .55rem; margin-top: 1rem; }
.hero-social a.brand-social-icon {
    display: inline-grid;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    place-items: center;
    border: 1px solid var(--rule) !important;
    border-radius: 50%;
    background: #fff !important;
    box-shadow: 0 4px 14px rgba(23,25,22,.07) !important;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease !important;
}
.hero-social a.brand-social-icon:hover { transform: translateY(-3px); border-color: var(--blue) !important; background: #fff !important; box-shadow: 0 8px 18px rgba(23,25,22,.12) !important; }
.hero-social a svg { display: block; width: 21px; height: 21px; fill: currentColor; }
.hero-social a img { display: block; width: 22px; height: 22px; object-fit: contain; }
@media (max-width: 768px) {
    .site-footer { padding-right: 20px; padding-left: 20px; }
    .footer-invitation { align-items: flex-start; flex-direction: column; gap: 1.2rem; }
    .hero-social { flex-wrap: wrap; }
    .hero-social a.brand-social-icon { width: 46px; height: 46px; flex-basis: 46px; }
}

/* Match the reference's clear, recognizable platform marks. */
.hero-social a.github-icon { background: #050505 !important; color: #fff !important; border-color: #050505 !important; }
.hero-social a.github-icon:hover { background: #050505 !important; border-color: var(--blue) !important; }
.hero-social a.tuf-icon img { width: 24px; height: 24px; }


/* A distinct midnight footer gives the light pages a stronger, intentional close. */
.site-footer {
    border-top-color: rgba(255,255,255,.12);
    background: #111827;
    color: #f4f2ec;
}
.site-footer a:hover { color: #a9baff; }
.footer-invitation { border-bottom-color: rgba(255,255,255,.14); }
.footer-invitation-kicker { color: #a9baff; }
.footer-invitation h2, .footer-name, .footer-col-title { color: #f4f2ec; }
.footer-role, .footer-links-grid a i { color: #a9baff; }
.footer-desc, .footer-connect-sub { color: #b7becb; }
.footer-links-grid a { color: #d5d8df; }
.footer-links-grid a:hover { color: #a9baff; }
.footer-social-btn { border-color: rgba(255,255,255,.18); background: #f8f8f6; color: var(--ink); }
.footer-social-btn.github-icon { border-color: #050505; background: #050505; color: #fff !important; }
.footer-social-btn:hover { border-color: #a9baff; background: #a9baff; color: #111827 !important; }
.footer-social-btn.github-icon:hover { border-color: #a9baff; background: #050505; color: #fff !important; }
.footer-orbit { opacity: .22; }
.footer-orbit .orbit-ring { border-color: rgba(169,186,255,.28); }
.footer-orbit .orbit-dot { background: var(--red); }
.footer-bottom { border-color: rgba(255,255,255,.14); }
.footer-bottom p { color: #9ba3b1; }
.footer-heart { color: #f07867; }

/* Make the footer's role and exit point unmistakable. */
.footer-signpost {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 0;
    border-bottom: 1px solid rgba(255,255,255,.14);
    color: #b7becb;
    font: 500 .66rem 'DM Mono', monospace;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.footer-signpost span:first-child { color: #a9baff; }
.footer-signpost i { padding: 0 .35rem; color: #f07867; font-style: normal; }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.footer-back-top {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: #d5d8df !important;
    font-size: .75rem;
    text-decoration: none;
}
.footer-back-top:hover { color: #a9baff !important; }
@media (max-width: 520px) {
    .footer-signpost { align-items: flex-start; flex-direction: column; gap: .4rem; }
    .footer-bottom { align-items: flex-start; flex-direction: column; }
}

/* About page: a portrait-led profile with editorial working notes. */
.about-redesign { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0; }
.about-opening { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, .72fr); align-items: center; gap: clamp(3rem, 8vw, 8rem); }
.about-opening-copy { max-width: 690px; }
.about-eyebrow { display: inline-flex; align-items: center; gap: .65rem; color: var(--blue); font: 500 .68rem 'DM Mono', monospace; letter-spacing: .1em; text-transform: uppercase; }
.about-eyebrow > i { display: inline-block; width: 24px; height: 1px; background: var(--red); }
.about-heading { margin: 1.35rem 0 1.5rem !important; font: 600 clamp(3.25rem, 7vw, 6.4rem)/.92 var(--font-heading) !important; letter-spacing: -.075em !important; }
.about-heading .about-heading-accent { color: var(--blue) !important; }
.about-lede { max-width: 610px; margin: 0 0 1rem; color: var(--ink); font: 500 clamp(1.2rem, 2vw, 1.65rem)/1.5 var(--font-body); letter-spacing: -.025em; }
.about-bio { max-width: 610px; margin: 0 0 .75rem; color: var(--ink-soft); font-size: 1rem; line-height: 1.8; }
.about-actions { display: flex; flex-wrap: wrap; gap: 1.35rem; margin-top: 1.7rem; }
.about-actions a { display: inline-flex; align-items: center; gap: .65rem; color: var(--ink); font-size: .83rem; font-weight: 600; text-decoration: none; }
.about-actions a:first-child { padding: .86rem 1rem; background: var(--blue); color: #fff; }
.about-actions a:first-child:hover { background: var(--blue-dark); color: #fff; }
.about-actions a:last-child:hover { color: var(--red); }
.about-portrait { position: relative; width: 100%; max-width: 410px; justify-self: end; margin: 0; padding: 0 0 1.2rem 1.2rem; }
.about-portrait::before { position: absolute; z-index: 0; top: 1.2rem; right: 0; bottom: 2.7rem; left: 0; background: var(--blue); content: ''; }
.about-portrait img { position: relative; z-index: 1; display: block; width: 100%; aspect-ratio: 4 / 4.8; object-fit: cover; object-position: 50% 32%; filter: grayscale(1) contrast(1.04); }
.about-portrait-index { position: absolute; z-index: 2; top: 1.8rem; left: 1.8rem; display: flex; align-items: center; gap: .7rem; padding: .55rem .65rem; background: var(--paper); color: var(--ink); }
.about-portrait-index span:first-child { color: var(--blue); font: 700 1.1rem var(--font-heading); letter-spacing: -.08em; }
.about-portrait-index span:last-child { border-left: 1px solid var(--rule); padding-left: .65rem; color: var(--muted); font: 500 .52rem/1.35 'DM Mono', monospace; letter-spacing: .06em; }
.about-portrait figcaption { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: .7rem; padding: .75rem 0 0; color: var(--ink-soft); font: 500 .62rem 'DM Mono', monospace; }
.about-portrait figcaption span:first-child { color: var(--ink); }
.about-profile-line { display: grid; grid-template-columns: repeat(3, 1fr); margin: clamp(3rem, 7vw, 6.5rem) 0 clamp(4rem, 8vw, 7rem); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.about-profile-line > div { display: flex; min-height: 100px; flex-direction: column; justify-content: center; gap: .55rem; padding: 1rem clamp(.8rem, 2vw, 2rem); border-right: 1px solid var(--rule); }
.about-profile-line > div:first-child { padding-left: 0; }
.about-profile-line > div:last-child { padding-right: 0; border-right: 0; }
.about-profile-line span { color: var(--muted); font: 500 .59rem 'DM Mono', monospace; letter-spacing: .08em; }
.about-profile-line strong { color: var(--ink); font: 500 clamp(1rem, 1.8vw, 1.35rem) var(--font-heading); letter-spacing: -.035em; }
.about-practice { display: grid; grid-template-columns: minmax(220px, .62fr) minmax(0, 1fr); gap: clamp(2rem, 7vw, 7rem); }
.about-practice-heading h2 { margin: 1rem 0 0; color: var(--ink); font: 500 clamp(2.2rem, 4vw, 3.8rem)/1 var(--font-heading); letter-spacing: -.065em; }
.about-practice-list { border-top: 1px solid var(--rule); }
.about-practice-list article { display: grid; grid-template-columns: 38px minmax(0, 1fr) 18px; align-items: start; gap: 1rem; padding: 1.45rem 0; border-bottom: 1px solid var(--rule); }
.about-practice-list article > span { padding-top: .16rem; color: var(--red); font: 500 .66rem 'DM Mono', monospace; }
.about-practice-list h3 { margin: 0 0 .35rem; color: var(--ink); font: 500 1.08rem var(--font-heading); letter-spacing: -.025em; }
.about-practice-list p { max-width: 540px; margin: 0; color: var(--ink-soft); font-size: .88rem; line-height: 1.7; }
.about-practice-list article > i { margin-top: .3rem; color: var(--blue); font-size: .75rem; }
@media (max-width: 768px) {
    .about-opening { grid-template-columns: 1fr; gap: 2.5rem; }
    .about-opening-copy { order: 1; }
    .about-portrait { order: 0; width: min(78%, 390px); justify-self: center; }
    .about-profile-line { margin: 3rem 0 4rem; }
    .about-profile-line > div { min-height: 86px; }
    .about-practice { grid-template-columns: 1fr; gap: 2rem; }
}
@media (max-width: 520px) {
    .about-heading { font-size: clamp(3rem, 15vw, 4rem) !important; }
    .about-profile-line { grid-template-columns: 1fr; }
    .about-profile-line > div, .about-profile-line > div:first-child, .about-profile-line > div:last-child { min-height: 0; padding: .9rem 0; border-right: 0; border-bottom: 1px solid var(--rule); }
    .about-profile-line > div:last-child { border-bottom: 0; }
    .about-portrait figcaption { flex-direction: column; gap: .2rem; }
    .about-practice-list article { grid-template-columns: 28px minmax(0, 1fr) 14px; gap: .65rem; }
}

/* Skills page: a clear toolkit overview and browsable, filterable directory. */
.skills-opening { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(290px, .7fr); align-items: center; gap: clamp(2rem, 7vw, 7rem); margin-bottom: clamp(4rem, 8vw, 7rem); }
.skills-opening-copy { max-width: 700px; }
.skills-opening-copy .skills-badge { margin-bottom: 1rem; }
.skills-opening-copy h1 { max-width: 760px; margin: .2rem 0 1.25rem; color: var(--ink); font: 600 clamp(3.1rem, 6.7vw, 6.2rem)/.94 var(--font-heading); letter-spacing: -.075em; }
.skills-opening-copy h1 span { color: var(--blue); }
.skills-subtitle { max-width: 590px; margin: 0; color: var(--ink-soft); font-size: 1.06rem; line-height: 1.8; }
.skills-overview { position: relative; overflow: hidden; padding: 1.45rem clamp(1.2rem, 2.5vw, 2rem); border: 1px solid var(--rule); background: var(--paper-deep); }
.skills-overview::before { position: absolute; top: 0; bottom: 0; left: 0; width: 3px; background: var(--blue); content: ''; }
.skills-overview-label, .skills-directory-kicker { color: var(--muted); font: 500 .61rem 'DM Mono', monospace; letter-spacing: .1em; }
.skills-overview > div { display: grid; grid-template-columns: 34px 78px 1fr; align-items: baseline; gap: .5rem; padding: 1.08rem 0; border-bottom: 1px solid var(--rule); }
.skills-overview > div:last-of-type { border-bottom: 0; }
.skills-overview > div span { color: var(--red); font: 500 .62rem 'DM Mono', monospace; }
.skills-overview > div strong { color: var(--ink); font: 500 1rem var(--font-heading); }
.skills-overview > div small { color: var(--ink-soft); font-size: .72rem; }
.skills-overview-rule { position: absolute; right: 1.3rem; bottom: 1.25rem; width: 26px; height: 1px; background: var(--red); }
.skills-directory-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.15rem; padding-bottom: 1rem; border-bottom: 1px solid var(--rule); }
.skills-directory-heading h2 { margin: .45rem 0 0; color: var(--ink); font: 500 clamp(1.65rem, 3vw, 2.25rem)/1.1 var(--font-heading); letter-spacing: -.05em; }
.skills-directory-heading > p { max-width: 280px; margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.6; text-align: right; }
.skills-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1.4rem; }
.skills-tab-btn { margin: 0; padding: .58rem .85rem; border: 1px solid var(--rule); color: var(--ink-soft); font-size: .75rem; }
.skills-tab-btn.active { border-color: var(--ink); background: var(--ink); color: white; }
.skills-cards-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; padding: 1px; background: var(--rule); counter-reset: toolkit; }
.skill-detail-card { position: relative; display: grid; grid-template-columns: 42px minmax(0, 1fr); grid-template-rows: 42px auto auto; align-content: start; gap: .5rem .85rem; min-width: 0; min-height: 132px; padding: 1.05rem; border: 0; background: var(--paper); counter-increment: toolkit; transition: background .2s ease, opacity .2s ease, transform .2s ease; }
.skill-detail-card::after { position: absolute; top: 1rem; right: 1rem; color: #a4a69f; content: counter(toolkit, decimal-leading-zero); font: 500 .56rem 'DM Mono', monospace; }
.skill-detail-card:hover { border: 0; background: var(--surface); transform: translateY(-2px); }
.skill-icon { display: grid; width: 38px; height: 38px; place-items: center; margin: 0; grid-column: 1; grid-row: 1; }
.skill-icon img { display: block; width: 32px; height: 32px; object-fit: contain; }
.skill-icon i { color: var(--blue) !important; font-size: 1.65rem !important; }
.skill-detail-card h3 { overflow-wrap: anywhere; margin: 0; grid-column: 1 / -1; grid-row: 2; color: var(--ink); font: 500 1rem/1.25 var(--font-heading); }
.skill-category-label { grid-column: 1 / -1; grid-row: 3; width: fit-content; color: var(--muted); font: 500 .58rem 'DM Mono', monospace; letter-spacing: .06em; text-transform: uppercase; }
.skill-proficiency { display: none; }
@media (max-width: 900px) {
    .skills-cards-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .skills-opening { grid-template-columns: minmax(0, 1fr) minmax(260px, .78fr); gap: 2rem; }
}
@media (max-width: 650px) {
    .skills-opening { grid-template-columns: 1fr; }
    .skills-overview { max-width: none; }
    .skills-cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
    .skills-directory-heading { align-items: flex-start; flex-direction: column; }
    .skills-directory-heading > p { text-align: left; }
    .skills-cards-grid { grid-template-columns: 1fr; }
    .skill-detail-card { min-height: 112px; grid-template-columns: 42px minmax(0, 1fr) 40px; grid-template-rows: 1fr auto; align-items: center; }
    .skill-detail-card h3 { grid-column: 2; grid-row: 1; }
    .skill-category-label { grid-column: 2; grid-row: 2; }
    .skill-icon { grid-row: 1 / 3; }
}

/* Keep filtered skill rows on the page canvas and separate them from the footer. */
#Skills.skills-section { padding-bottom: clamp(4rem, 7vw, 6.5rem) !important; }
#Skills .skills-cards-grid { gap: .75rem; margin-bottom: 0; padding: 0; background: transparent; }
#Skills .skill-detail-card { border: 1px solid var(--rule); background: var(--paper); }
#Skills .skill-detail-card:hover { border-color: var(--blue); background: var(--surface); }

/* Experience page: foreground the current role and make its stack scannable. */
.exp-page-intro { max-width: 850px; margin: 0 0 clamp(2.4rem, 5vw, 4rem); }
.exp-page-intro h1 { margin: .2rem 0 1rem; color: var(--ink); font: 600 clamp(3rem, 6vw, 5.2rem)/.96 var(--font-heading); letter-spacing: -.07em; }
.exp-page-intro h1 span { color: var(--blue); }
.exp-page-intro > p { max-width: 640px; margin: 0; color: var(--ink-soft); font-size: 1.06rem; line-height: 1.75; }
#Experience .timeline-container { padding-left: 1.5rem; }
#Experience .timeline-item { margin-bottom: 1.5rem; }
#Experience .exp-card { padding: clamp(1.2rem, 2.5vw, 2rem); }
#Experience .exp-summary { margin: 1.3rem 0 .75rem; color: var(--ink-soft); font-size: .98rem; line-height: 1.75; }
#Experience .exp-tech-stack { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
#Experience .exp-tech-stack span { padding: .3rem .55rem; border: 1px solid var(--rule); color: var(--ink-soft); font: 500 .65rem 'DM Mono', monospace; }
@media (max-width: 768px) {
    .exp-page-intro h1 { font-size: clamp(2.6rem, 11vw, 4rem); }
    #Experience .timeline-container { padding-left: 1rem; }
    #Experience .exp-card { padding: 1rem; }
}
#Experience .exp-shift-badge { position: static; display: grid; justify-items: start; gap: .12rem; flex: 0 0 auto; margin: 0 0 0 auto; padding: .45rem .65rem; border: 1px solid var(--rule); background: var(--paper-deep); color: var(--blue); font: 600 .72rem var(--font-body); }
#Experience .exp-shift-badge small { color: var(--muted); font: 500 .52rem 'DM Mono', monospace; letter-spacing: .08em; }
@media (max-width: 768px) { #Experience .exp-shift-badge { position: static; margin: .1rem 0 0; } }

/* Two concurrent roles are easier to compare side by side than on a timeline. */
#Experience .exp-day-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; padding: 0; }
#Experience .exp-day-grid::before, #Experience .exp-day-grid .timeline-dot { display: none; }
#Experience .exp-day-grid .timeline-item { min-width: 0; margin: 0; }
#Experience .exp-day-grid .exp-card { height: 100%; }
#Experience .exp-day-grid .exp-card-header { gap: .9rem; margin-bottom: 1.2rem; }
#Experience .exp-day-grid .exp-header-text { min-width: 0; }
#Experience .exp-day-grid .exp-role { font-size: clamp(1rem, 1.5vw, 1.25rem); }
#Experience .exp-day-grid .exp-meta { flex-wrap: wrap; gap: .45rem .7rem; font-size: .76rem; }
@media (max-width: 900px) {
    #Experience .exp-day-grid { grid-template-columns: 1fr; max-width: 760px; }
}

/* Projects page: a numbered project index with roomy, image-led case rows. */
.projects-archive-intro { display: grid; grid-template-columns: minmax(0, 1fr) 190px; align-items: end; gap: 2rem; margin-bottom: clamp(2.7rem, 5vw, 4.5rem); }
.projects-archive-intro .projects-hero-left { max-width: 800px; }
.projects-archive-intro .projects-heading { margin: .25rem 0 1rem; font-size: clamp(3.2rem, 7vw, 6.3rem); line-height: .94; }
.projects-archive-intro .projects-subtext { max-width: 620px; font-size: 1.04rem; }
.projects-archive-mark { position: relative; display: flex; min-height: 172px; flex-direction: column; align-items: flex-start; justify-content: center; padding: 1rem 1.35rem; border-left: 1px solid var(--rule); }
.projects-archive-mark > span { color: var(--muted); font: 500 .6rem 'DM Mono', monospace; letter-spacing: .1em; }
.projects-archive-mark > strong { margin: .2rem 0 -.15rem; color: var(--blue); font: 500 5.5rem/.95 var(--font-heading); letter-spacing: -.1em; }
.projects-archive-mark > small { color: var(--ink-soft); font: 500 .66rem 'DM Mono', monospace; }
.projects-archive-mark > div { position: absolute; right: 0; bottom: 1.1rem; display: flex; gap: 4px; }
.projects-archive-mark > div i { width: 15px; height: 3px; background: var(--rule); }
.projects-archive-mark > div i:first-child { background: var(--red); }
.project-filters { margin-bottom: clamp(2rem, 4vw, 3.2rem); }
.projects-container { display: grid; grid-template-columns: 1fr; gap: 2.8rem; }
.projects-container .project-card { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); align-items: center; gap: clamp(1.5rem, 4vw, 4rem); padding: 0 0 2.8rem; border-bottom: 1px solid var(--rule); cursor: pointer; }
.projects-container .project-card:last-child { padding-bottom: 0; border-bottom: 0; }
.projects-container .project-card-image-wrapper { height: auto; aspect-ratio: 16 / 10; border-color: var(--rule); background: var(--paper-deep); }
.projects-container .project-card-img { display: block; }
.projects-container .project-card-content { min-width: 0; padding: .2rem 0; }
.projects-container .project-card-content::before { content: counter(portfolio-project, decimal-leading-zero) " / PROJECT"; }
.projects-container .project-card:first-child .project-card-content::before { content: "01 / FEATURED PROJECT"; }
.projects-container .project-card-title { font-size: clamp(1.5rem, 2.5vw, 2.25rem); line-height: 1.12; }
.projects-container .project-card-title i { margin-left: .2rem; }
.projects-container .project-card-desc { max-width: 540px; margin: .9rem 0 1.1rem; }
.projects-container .project-card-tags { display: flex; flex-wrap: wrap; gap: .32rem; margin-bottom: 1.25rem; }
.projects-container .project-card-tags span { margin: 0; }
.projects-container .project-card-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.projects-container .project-card-actions a { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; }
.projects-container .action-divider { display: none; }
@media (min-width: 761px) {
    .projects-container .project-card:nth-child(even) .project-card-image-wrapper { grid-column: 2; grid-row: 1; }
    .projects-container .project-card:nth-child(even) .project-card-content { grid-column: 1; grid-row: 1; }
}
@media (max-width: 760px) {
    .projects-archive-intro { grid-template-columns: 1fr; gap: 1.5rem; }
    .projects-archive-mark { min-height: 0; display: grid; grid-template-columns: auto auto 1fr; align-items: baseline; gap: .65rem; padding: .75rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); border-left: 0; }
    .projects-archive-mark > strong { font-size: 2.2rem; }
    .projects-archive-mark > div { position: static; justify-self: end; }
    .projects-container .project-card { grid-template-columns: 1fr; gap: 1rem; padding-bottom: 2rem; }
    .projects-container .project-card-image-wrapper, .projects-container .project-card-content { grid-column: 1; }
    .projects-container .project-card-image-wrapper { grid-row: 1; }
    .projects-container .project-card-content { grid-row: 2; }
}
@media (max-width: 520px) {
    .projects-archive-intro .projects-heading { font-size: clamp(3rem, 14vw, 4.4rem); }
    .project-filters { gap: .25rem; }
    .projects-container { gap: 2rem; }
}

/* Keep project screenshots fully inside their frames and invite clear actions. */
.projects-filter-status { min-height: 1.2em; margin: -1rem 0 1.1rem; color: var(--muted); font: 500 .63rem 'DM Mono', monospace; letter-spacing: .04em; }
.projects-container .project-card-image-wrapper { position: relative; display: grid; place-items: center; box-sizing: border-box; overflow: hidden; padding: clamp(.55rem, 1.25vw, 1rem); aspect-ratio: 16 / 10; }
.projects-container .project-card-img { width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; object-position: center; transform: scale(1); }
.projects-container .project-card-image-wrapper::after { position: absolute; right: .75rem; bottom: .75rem; display: grid; width: 2.35rem; height: 2.35rem; place-items: center; background: var(--blue); color: #fff; content: '↗'; font-size: 1.15rem; opacity: 0; transform: translateY(5px); transition: opacity .2s ease, transform .2s ease; }
.projects-container .project-card:hover .project-card-image-wrapper { border-color: var(--blue); }
.projects-container .project-card:hover .project-card-img { transform: scale(1.015); transition-duration: .5s; }
.projects-container .project-card:hover .project-card-image-wrapper::after,
.projects-container .project-card:focus-visible .project-card-image-wrapper::after { opacity: 1; transform: translateY(0); }
.projects-container .project-card:focus-visible { outline: 2px solid var(--blue); outline-offset: 5px; }
.projects-container .project-card-title { transition: color .2s ease; }
.projects-container .project-card:hover .project-card-title { color: var(--blue); }
.projects-container .project-card-actions a { transition: color .2s ease, transform .2s ease; }
.projects-container .project-card-actions a:hover { color: var(--red); transform: translateX(2px); }
.project-filters .filter-btn { transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease; }
.project-filters .filter-btn:hover { transform: translateY(-2px); }
@media (max-width: 760px) {
    .projects-container .project-card-image-wrapper { aspect-ratio: 16 / 10; }
    .projects-container .project-card-img { object-fit: contain; }
}
@media (prefers-reduced-motion: reduce) {
    .projects-container .project-card-img, .projects-container .project-card-image-wrapper::after,
    .project-filters .filter-btn, .projects-container .project-card-actions a { transition: none; }
}

/* Agentic AI Code Analyzer case study: a structured editorial project brief. */
.project-agentic .project-header { max-width: 980px; margin-bottom: 2rem; }
.project-agentic .project-category-badge { margin-bottom: 1rem; }
.project-agentic .project-title { margin-bottom: 1.1rem; font-size: clamp(3.2rem, 7vw, 6.2rem); line-height: .92; }
.project-agentic .project-title span { color: var(--blue); }
.project-agentic .project-subtitle { max-width: 780px; font-size: clamp(1rem, 1.4vw, 1.15rem); }
.project-hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.5rem; }
.project-hero-actions a { display: inline-flex; min-height: 46px; align-items: center; gap: .6rem; padding: .7rem .95rem; border: 1px solid var(--blue); font-size: .78rem; font-weight: 600; text-decoration: none; transition: background .2s ease, color .2s ease, transform .2s ease; }
.project-hero-primary { background: var(--blue); color: #fff !important; }
.project-hero-primary:hover { transform: translateY(-2px); background: var(--blue-dark); }
.project-hero-secondary { background: transparent; color: var(--ink) !important; }
.project-hero-secondary:hover { transform: translateY(-2px); background: var(--paper-deep); }
.project-case-facts { display: grid; grid-template-columns: repeat(3, minmax(100px, .55fr)) minmax(230px, 1.4fr); align-items: center; margin: 2.2rem 0 1.4rem; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.project-case-facts > div { display: flex; min-height: 88px; flex-direction: column; justify-content: center; gap: .2rem; padding: .8rem 1rem; border-right: 1px solid var(--rule); }
.project-case-facts > div:first-child { padding-left: 0; }
.project-case-facts > div strong { color: var(--ink); font: 500 1.8rem/1 var(--font-heading); letter-spacing: -.06em; }
.project-case-facts > div span { color: var(--muted); font: 500 .6rem 'DM Mono', monospace; letter-spacing: .04em; text-transform: uppercase; }
.project-case-facts .project-case-stack { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .45rem; border-right: 0; }
.project-case-stack span { padding: .35rem .5rem; border: 1px solid var(--rule); color: var(--ink-soft) !important; font-size: .58rem !important; }
.project-chapter-nav { position: sticky; z-index: 15; top: 76px; display: flex; gap: .2rem; overflow-x: auto; margin-bottom: 1.5rem; padding: .65rem 0; border-bottom: 1px solid var(--rule); background: rgba(246,245,240,.96); scrollbar-width: thin; backdrop-filter: blur(12px); }
.project-chapter-nav a { flex: 0 0 auto; padding: .45rem .7rem; color: var(--muted); font: 500 .66rem 'DM Mono', monospace; text-decoration: none; transition: color .2s ease, background .2s ease; }
.project-chapter-nav a:hover, .project-chapter-nav a.active { background: var(--paper-deep); color: var(--blue); }
.project-agentic .project-media-container { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin-bottom: 3rem; }
.project-agentic .media-item { min-width: 0; border-color: var(--rule); background: var(--paper-deep); transition: border-color .2s ease, transform .2s ease; }
.project-agentic .media-item:hover { transform: translateY(-3px); border-color: var(--blue); }
.project-agentic .media-title { min-height: 38px; padding: .65rem .75rem; font-size: .62rem; }
.project-agentic .project-video, .project-agentic .project-image { display: block; width: 100%; aspect-ratio: 16 / 10; height: auto; object-fit: contain; background: var(--paper-deep); }
.project-agentic .project-image { cursor: zoom-in; transition: transform .25s ease; }
.project-agentic .media-item:hover .project-image { transform: scale(1.015); }
.project-agentic .enlarge-btn-indicator { padding: 0; border-radius: 0; font: inherit; }
.project-agentic .enlarge-btn-indicator:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; opacity: 1; }
.project-agentic .project-card-details { margin: 0 0 4rem; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none; overflow: visible; }
.project-agentic .project-card-details::before { display: none; }
.project-agentic .project-info { max-width: 960px; }
.project-agentic .project-info > h2 { margin: 0 0 1.2rem; padding-bottom: .8rem; border-bottom: 1px solid var(--rule); color: var(--ink); font: 500 1.7rem var(--font-heading); }
.project-agentic .project-info h2 i, .project-agentic .project-info > h3 i { color: var(--blue); }
.project-agentic .project-info > p { max-width: 820px; color: var(--ink-soft); font-size: .98rem; }
.project-agentic .project-info > h3 { margin-top: 3.2rem; padding-top: 1rem; border-top: 1px solid var(--rule); color: var(--ink); font: 500 1.45rem var(--font-heading); }
.project-agentic .features-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.project-agentic .feature-card { padding: 1.1rem; border: 1px solid var(--rule); border-radius: 0; background: var(--surface); box-shadow: none; transition: border-color .2s ease, transform .2s ease, background .2s ease; }
.project-agentic .feature-card:hover { transform: translateY(-3px); border-color: var(--blue); background: #fff; box-shadow: none; }
.project-agentic .feature-card h3 { color: var(--ink) !important; font-size: .94rem !important; line-height: 1.4; }
.project-agentic .feature-card h3 i { color: var(--blue) !important; }
.project-agentic .feature-card p { color: var(--ink-soft); font-size: .82rem !important; }
.project-agentic .tech-stack { gap: .45rem; }
.project-agentic .tech-item { padding: .4rem .65rem; border: 1px solid var(--rule); border-radius: 0; background: var(--paper-deep); color: var(--ink-soft); font-size: .72rem; }
.project-agentic .tech-item:hover { transform: translateY(-2px); border-color: var(--blue); background: var(--surface); color: var(--blue); box-shadow: none; }
.project-agentic .tech-item i { color: var(--blue); }
.project-agentic .applications-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.project-agentic .application-card { padding: 1.1rem; border: 1px solid var(--rule); border-radius: 0; background: transparent; box-shadow: none; transition: border-color .2s ease, background .2s ease; }
.project-agentic .application-card:hover { transform: none; border-color: var(--blue); background: var(--surface); }
.project-agentic .application-card h4 { color: var(--ink); }
.project-agentic .application-card h4 i { color: var(--blue); }
.project-agentic .application-card p { color: var(--ink-soft); }
.project-agentic .future-plans { padding: 1.3rem 1.5rem; border: 1px solid var(--rule); border-left: 2px solid var(--red); border-radius: 0; background: var(--paper-deep); }
.project-agentic .future-plans h3 { border: 0; margin-top: 0 !important; padding-top: 0 !important; }
.project-agentic .project-actions { padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.project-agentic .project-actions .btn-primary, .project-agentic .project-actions .btn-secondary { min-height: 46px; border-radius: 0; box-shadow: none; font-size: .8rem; }
.project-agentic .project-actions .btn-primary { background: var(--blue); }
.project-agentic .project-actions .btn-primary:hover { background: var(--blue-dark); }
.project-agentic .project-actions .btn-secondary { border: 1px solid var(--rule); background: transparent; color: var(--ink); }
.project-agentic .project-actions .btn-secondary:hover { border-color: var(--blue); color: var(--blue); }
#overview, #features, #technology, #architecture, #routing { scroll-margin-top: 145px; }
@media (max-width: 900px) {
    .project-case-facts { grid-template-columns: repeat(3, 1fr); }
    .project-case-facts .project-case-stack { grid-column: 1 / -1; justify-content: flex-start; min-height: 54px; border-top: 1px solid var(--rule); }
    .project-agentic .project-media-container { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .project-agentic .media-item:first-child { grid-column: 1 / -1; }
    .project-agentic .features-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .project-agentic .project-title { font-size: clamp(3rem, 14vw, 4.8rem); }
    .project-case-facts > div { min-height: 76px; padding: .7rem .55rem; }
    .project-case-facts > div strong { font-size: 1.45rem; }
    .project-case-facts > div span { font-size: .54rem; }
    .project-chapter-nav { top: 64px; }
    .project-agentic .project-media-container, .project-agentic .features-grid, .project-agentic .applications-grid { grid-template-columns: 1fr; }
    .project-agentic .media-item:first-child { grid-column: auto; }
    .project-agentic .project-card-details { margin-bottom: 2.5rem; }
}

/* Dashboard: platform data as a clear activity ledger, not a generic admin panel. */
.dashboard-page .container { width: min(calc(100% - 64px), var(--max-width)); }
.dashboard-page .coding-activity-section { padding: 2.8rem 0 4.5rem; }
.dashboard-page .coding-header { margin: 0 0 2.25rem; padding: 0 0 1.75rem; border-bottom: 1px solid var(--rule); }
.dashboard-page .coding-badge { gap: .55rem; margin-bottom: 1rem; padding: 0; border: 0; border-radius: 0; background: none; color: var(--blue); font: 600 .68rem 'DM Mono', monospace; letter-spacing: .08em; }
.dashboard-page .live-dot { width: 7px; height: 7px; background: var(--red); box-shadow: none; animation: none; }
.dashboard-page .coding-title { margin: 0 0 1rem; color: var(--ink); font: 600 clamp(3.2rem, 7vw, 6.3rem)/.94 var(--font-heading); letter-spacing: -.075em; }
.dashboard-page .coding-title span { background: none; color: var(--blue); -webkit-text-fill-color: currentColor; }
.dashboard-page .coding-subtitle { max-width: 650px; color: var(--ink-soft); font-size: 1rem; line-height: 1.75; }
.dashboard-jump-nav { display: flex; flex-wrap: wrap; gap: 0; margin-top: 1.65rem; }
.dashboard-jump-nav a { display: flex; min-width: 180px; justify-content: space-between; gap: 1.1rem; padding: .68rem .9rem; border: 1px solid var(--rule); border-right: 0; color: var(--ink-soft); font-size: .76rem; text-decoration: none; transition: color .2s ease, background .2s ease; }
.dashboard-jump-nav a:last-child { border-right: 1px solid var(--rule); }
.dashboard-jump-nav a span { color: var(--blue); font: 500 .64rem 'DM Mono', monospace; }
.dashboard-jump-nav a:hover { background: var(--paper-deep); color: var(--ink); }
.dashboard-section-heading { margin: 0 0 1rem; }
.dashboard-section-heading > span { color: var(--blue); font: 500 .64rem 'DM Mono', monospace; letter-spacing: .07em; text-transform: uppercase; }
.dashboard-section-heading h2 { margin: .4rem 0 0; color: var(--ink); font: 600 clamp(1.55rem, 3vw, 2.2rem)/1.1 var(--font-heading); letter-spacing: -.045em; }
.dashboard-page .stats-grid-container { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-bottom: 2.5rem; }
.dashboard-page .coding-card { min-width: 0; padding: 1.2rem; border-color: var(--rule); border-radius: 0; background: var(--surface); box-shadow: none; }
.dashboard-page .coding-card:hover { transform: translateY(-2px); border-color: var(--blue); box-shadow: var(--shadow-card); }
.dashboard-page .card-header-row { gap: .8rem; padding-bottom: .8rem; border-color: var(--rule); }
.dashboard-page .card-brand { min-width: 0; gap: .75rem; }
.dashboard-page .card-brand img.brand-icon { flex: 0 0 38px; width: 38px; height: 38px; padding: 7px; border: 1px solid var(--rule); border-radius: 50%; background: #fff; object-fit: contain; }
.dashboard-page .card-brand h3 { margin: 0; color: var(--ink); font: 600 1rem/1.3 var(--font-heading); }
.dashboard-page .card-brand span { color: var(--muted); font-size: .7rem; }
.dashboard-page .profile-username { max-width: 45%; overflow-wrap: anywhere; color: var(--blue); font: 500 .65rem 'DM Mono', monospace; text-align: right; }
.dashboard-page .leetcode-stats-body { margin-top: .25rem; }
.dashboard-page .leetcode-top-row { gap: 1rem; }
.dashboard-page .leetcode-progress-circle-wrapper { flex: 0 0 100px; }
.dashboard-page .leetcode-footer-stats { gap: .5rem; margin-top: .75rem; padding-top: .75rem !important; border-color: var(--rule) !important; }
.dashboard-page .footer-stat-box { min-width: 0; padding: 0 .35rem; }
.dashboard-page .footer-stat-box span { color: var(--muted); font-size: .61rem; }
.dashboard-page .footer-stat-box h4 { color: var(--ink); font: 600 .95rem var(--font-heading); }
.dashboard-page .heatmap-viewer-card { margin-top: 2rem; padding: 0 !important; }
.dashboard-page .heatmap-viewer-header { padding: 1.1rem 1.2rem; border-color: var(--rule); }
.dashboard-page .heatmap-header-info .viewer-icon { width: 38px; height: 38px; border: 1px solid var(--rule); border-radius: 0; background: var(--paper-deep); color: var(--blue); }
.dashboard-page .heatmap-header-info h3 { color: var(--ink); font: 600 1.12rem var(--font-heading); }
.dashboard-page .heatmap-header-info span { color: var(--muted); font-size: .72rem; }
.dashboard-page .heatmap-viewer-tabs { flex-wrap: wrap; gap: .25rem; padding: 0; border: 0; border-radius: 0; background: transparent; }
.dashboard-page .heatmap-tab { min-height: 38px; gap: .45rem; padding: .45rem .65rem; border: 1px solid var(--rule); border-radius: 0; color: var(--ink-soft); font-size: .68rem; }
.dashboard-page .heatmap-tab img.tab-brand-icon { width: 17px; height: 17px; object-fit: contain; }
.dashboard-page .heatmap-tab.active { border-color: var(--ink); background: var(--ink); color: white; box-shadow: none; }
.dashboard-page .heatmap-image-wrapper { min-height: 200px; padding: 1.35rem; background: #111827; }
.dashboard-page .heatmap-image-wrapper img { max-width: 100%; }
.dashboard-page .github-activity-card { width: 100%; max-width: none; margin: 2rem 0 0 !important; padding: 1.2rem !important; }
.dashboard-page #platforms, .dashboard-page #submission-log, .dashboard-page #github-activity { scroll-margin-top: 112px; }

/* Live activity calendars use the same steady, keyboard friendly cell grid. */
.dashboard-page .heatmap-image-wrapper.activity-calendar-wrapper {
    display: block;
    height: 280px;
    min-height: 280px;
    padding: 1.25rem clamp(1rem, 3vw, 2.4rem);
    overflow-x: auto;
    overflow-y: hidden;
    background: #111827 !important;
}
.activity-calendar { display: flex; align-items: center; justify-content: center; min-width: max-content; min-height: 100%; color: #e5e7eb; }
.heatmap-calendar-content { width: max-content; max-width: none; }
.heatmap-months, .heatmap-grid { display: grid; grid-template-columns: repeat(var(--heatmap-weeks), 11px); column-gap: 4px; }
.heatmap-months { height: 19px; color: #aeb8c7; font: 500 10px/1.2 'DM Mono', monospace; }
.heatmap-months > span { white-space: nowrap; }
.heatmap-grid { grid-template-rows: repeat(7, 11px); row-gap: 4px; grid-auto-flow: column; }
.heatmap-day { width: 11px; height: 11px; box-sizing: border-box; border: 1px solid rgba(255,255,255,.035); border-radius: 2px; background: #263244; }
.heatmap-day[data-level="1"] { background: #174b39; }
.heatmap-day[data-level="2"] { background: #187452; }
.heatmap-day[data-level="3"] { background: #1fa579; }
.heatmap-day[data-level="4"] { background: #58d6a2; }
.heatmap-calendar-content[data-color="blue"] .heatmap-day[data-level="1"] { background: #263b8e; }
.heatmap-calendar-content[data-color="blue"] .heatmap-day[data-level="2"] { background: #2e52d0; }
.heatmap-calendar-content[data-color="blue"] .heatmap-day[data-level="3"] { background: #5274ef; }
.heatmap-calendar-content[data-color="blue"] .heatmap-day[data-level="4"] { background: #92a8ff; }
.heatmap-calendar-content[data-color="purple"] .heatmap-day[data-level="1"] { background: #49316f; }
.heatmap-calendar-content[data-color="purple"] .heatmap-day[data-level="2"] { background: #7042a8; }
.heatmap-calendar-content[data-color="purple"] .heatmap-day[data-level="3"] { background: #985dd5; }
.heatmap-calendar-content[data-color="purple"] .heatmap-day[data-level="4"] { background: #c59af1; }
.heatmap-day:focus-visible { outline: 2px solid white; outline-offset: 2px; }
.heatmap-day-empty { visibility: hidden; }
.heatmap-legend { display: flex; justify-content: flex-end; align-items: center; gap: 4px; margin-top: 12px; color: #aeb8c7; font: 10px 'DM Mono', monospace; }
.heatmap-legend span:first-child { margin-right: 3px; }
.heatmap-legend span:last-child { margin-left: 3px; }
.heatmap-legend i { width: 10px; height: 10px; border-radius: 2px; background: #263244; }
.heatmap-legend i[data-level="1"] { background: #174b39; }
.heatmap-legend i[data-level="2"] { background: #187452; }
.heatmap-legend i[data-level="3"] { background: #1fa579; }
.heatmap-legend i[data-level="4"] { background: #58d6a2; }
.heatmap-loading { max-width: 330px; color: #c7ced9; font-size: .85rem; line-height: 1.6; text-align: center; }
.heatmap-unavailable { display: grid; justify-items: center; gap: .55rem; max-width: 440px; margin: auto; color: #e5e7eb; text-align: center; }
.heatmap-unavailable-mark { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid #536174; border-radius: 50%; color: #9aa8bc; font-size: 1.4rem; }
.heatmap-unavailable strong { font: 600 1rem var(--font-heading); }
.heatmap-unavailable p { margin: 0; color: #aeb8c7; font-size: .75rem; line-height: 1.6; }
.heatmap-source-status { align-self: center; color: var(--muted); font: 500 .62rem 'DM Mono', monospace; }
.heatmap-source-status[data-state="live"] { color: #13845d; }
.heatmap-source-status[data-state="unavailable"] { color: #a36a20; }
.dashboard-page .github-contribution-chart { min-width: 0 !important; width: min(100%, 900px) !important; max-width: 900px !important; max-height: 200px !important; object-fit: contain; }
@media (max-width: 780px) {
    .dashboard-page .container { width: min(calc(100% - 36px), var(--max-width)); }
    .dashboard-page .stats-grid-container { grid-template-columns: 1fr; }
    .dashboard-page .heatmap-viewer-header { align-items: flex-start; flex-direction: column; }
    .dashboard-jump-nav a { flex: 1 1 100%; border-right: 1px solid var(--rule); border-bottom: 0; }
    .dashboard-jump-nav a:last-child { border-bottom: 1px solid var(--rule); }
}

/* Education: a quiet academic timeline with a distinct results panel. */
.education-page .container { width: min(calc(100% - 64px), var(--max-width)); }
.education-page .edu-section { padding: 2.8rem 0 4.5rem; }
.education-page .edu-hero { display: block; margin: 0 0 2.2rem; padding: 0 0 1.8rem; border-bottom: 1px solid var(--rule); }
.education-page .edu-hero-left { max-width: 1000px; }
.education-page .edu-badge { margin: 0 0 1rem; padding: 0; border: 0; border-radius: 0; background: none; color: var(--blue); font: 600 .68rem 'DM Mono', monospace; letter-spacing: .08em; text-transform: uppercase; }
.education-page .edu-heading { margin: 0 0 1rem; color: var(--ink); font: 600 clamp(3rem, 7vw, 6rem)/.96 var(--font-heading); letter-spacing: -.075em; }
.education-page .edu-heading-accent { background: none; color: var(--blue); -webkit-text-fill-color: currentColor; }
.education-page .edu-subtext { max-width: 630px; margin: 0; color: var(--ink-soft); font-size: 1rem; line-height: 1.75; }
.education-page .edu-body { grid-template-columns: minmax(0, 1.7fr) minmax(250px, .7fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; margin: 0; padding: 0; }
.education-page .edu-timeline-card { padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.education-page .edu-card-header { justify-content: space-between; margin: 0 0 1rem; padding: 0 0 .8rem; border-color: var(--rule); }
.education-page .edu-card-icon { display: none; }
.education-page .edu-card-title { color: var(--ink); font: 600 1.1rem var(--font-heading); }
.education-page .edu-entry { grid-template-columns: 38px minmax(0, 1fr); gap: 0 1rem; margin: 0; padding: 1.15rem 0; border-bottom: 1px solid var(--rule); }
.education-page .edu-entry:last-child { border-bottom: 0; }
.education-page .edu-entry-icon { width: 34px; height: 34px; border: 1px solid var(--rule); border-radius: 0; background: var(--paper-deep); color: var(--blue); font-size: .82rem; }
.education-page .edu-entry-dot { display: none; }
.education-page .edu-entry-top { align-items: flex-start; gap: .75rem; margin: 0; }
.education-page .edu-entry-title { margin: 0 0 .35rem; color: var(--ink); font: 600 1.05rem/1.35 var(--font-heading); }
.education-page .edu-entry-inst { margin: 0 0 .6rem; color: var(--blue); font-size: .82rem; }
.education-page .edu-entry-meta { gap: .4rem 1rem; }
.education-page .edu-entry-meta span { color: var(--muted); font-size: .7rem; line-height: 1.5; }
.education-page .edu-entry-meta i { color: var(--red); }
.education-page .edu-badge-score { padding: .36rem .52rem; border: 1px solid var(--rule); border-radius: 0; background: transparent; color: var(--ink); font: 500 .65rem 'DM Mono', monospace; }
.education-page .edu-highlights { gap: 0; padding: 1.35rem 1.4rem; border-top: 3px solid var(--blue); background: var(--ink); }
.education-page .edu-results-kicker { color: #aabaff; font: 500 .62rem 'DM Mono', monospace; letter-spacing: .08em; text-transform: uppercase; }
.education-page .edu-highlights-title { margin: .6rem 0 .35rem; color: white; font: 600 1.35rem/1.2 var(--font-heading); letter-spacing: -.035em; }
.education-page .highlight-item { gap: .7rem; padding: .85rem 0; border: 0; border-bottom: 1px solid rgba(255,255,255,.16); border-radius: 0; background: transparent; box-shadow: none; }
.education-page .highlight-item:last-child { border-bottom: 0; }
.education-page .highlight-item:hover { transform: none; border-color: rgba(255,255,255,.16); background: transparent; }
.education-page .highlight-icon { display: none; }
.education-page .highlight-name { margin: 0 0 .2rem; color: white; font: 600 1.1rem var(--font-heading); }
.education-page .highlight-desc { color: rgba(246,245,240,.7); font-size: .72rem; line-height: 1.55; }
@media (max-width: 780px) {
    .education-page .container { width: min(calc(100% - 36px), var(--max-width)); }
    .education-page .edu-body { grid-template-columns: 1fr; }
    .education-page .edu-highlights { margin-top: .5rem; }
}
@media (max-width: 520px) {
    .education-page .edu-entry { grid-template-columns: 30px minmax(0, 1fr); gap: 0 .65rem; }
    .education-page .edu-entry-icon { width: 28px; height: 28px; font-size: .72rem; }
    .education-page .edu-entry-top { flex-direction: column; }
    .education-page .edu-heading { font-size: clamp(2rem, 8.8vw, 3rem); }
}

/* Keep achievement evidence legible at laptop and tablet widths. */
@media (max-width: 900px) {
    .achievements-page .achieve-card-content { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; row-gap: .5rem; }
    .achievements-page .achieve-index,
    .achievements-page .achieve-score,
    .achievements-page .achieve-card.highlight .achieve-rank,
    .achievements-page .achieve-card h2,
    .achievements-page .achieve-card.highlight .achieve-desc,
    .achievements-page .achieve-link-btn { grid-column: 1; grid-row: auto; }
    .achievements-page .achieve-card h2 { margin-top: .75rem; }
    .achievements-page .achieve-card.highlight .achieve-desc { margin-bottom: .5rem; }
}
.achievements-page .badge-card img { height: 205px; }

/* Achievements visibility guard: certificates must load and card copy must retain contrast. */
.achievements-page .badge-card { display: flex !important; flex-direction: column !important; align-items: stretch !important; overflow: visible !important; color: var(--ink) !important; }
.achievements-page .badge-card img { display: block !important; flex: 0 0 205px !important; width: 100% !important; height: 205px !important; max-width: 100% !important; visibility: visible !important; opacity: 1 !important; object-fit: contain !important; }
.achievements-page .badge-card h4,
.achievements-page .badge-card p,
.achievements-page .achievement-year h3,
.achievements-page .achievement-gallery-heading h2 { display: block !important; visibility: visible !important; opacity: 1 !important; }
.achievements-page .badge-card h4 { color: #171916 !important; }
.achievements-page .badge-card p { color: #575b54 !important; }
.achievements-page .achieve-card.highlight .achieve-card-content { color: #f6f5f0 !important; }
.achievements-page .achieve-card.highlight h2 { color: #fff !important; }
.achievements-page .achieve-card.highlight .achieve-desc { color: #deded8 !important; }

/* Final achievement palette overrides: keep text and evidence visible over their surfaces. */
.achievements-page .achieve-card.highlight { background: #151a25 !important; border-color: #151a25 !important; }
.achievements-page .achieve-card.highlight .achieve-card-content { display: grid !important; }
.achievements-page .achieve-card.highlight h2 { color: #fff !important; }
.achievements-page .achieve-card.highlight .achieve-desc { color: #e0e3e9 !important; }
.achievements-page .achieve-card.highlight .achieve-index { color: #e7c77e !important; }
.achievements-page .achieve-card.highlight .achieve-score,
.achievements-page .achieve-card.highlight .achieve-rank { color: #f0ca76 !important; }
.achievements-page .leetcode-showcase-panel { display: block !important; visibility: visible !important; opacity: 1 !important; }
.achievements-page .achievement-badge-groups,
.achievements-page .achievement-badge-group,
.achievements-page .badges-grid { display: grid !important; visibility: visible !important; opacity: 1 !important; }
.achievements-page .achievement-badge-group { grid-template-columns: 1fr !important; }
.achievements-page .badges-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.achievements-page .badge-card { min-height: 310px !important; background: #fff !important; }
@media (max-width: 860px) {
    .achievements-page .badges-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 560px) {
    .achievements-page .badges-grid { grid-template-columns: 1fr !important; }
}

/* Contact page: clear invitation, direct contact routes and a calm message form. */
.contact-page .contact-section { padding: clamp(2.4rem, 5vw, 4.5rem) 0 clamp(3rem, 7vw, 6rem); }
.contact-page .contact-layout { display: grid; grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr); align-items: start; gap: clamp(2.5rem, 7vw, 7rem); }
.contact-page .contact-left { max-width: 590px; }
.contact-page .contact-badge { display: inline-flex; margin: 0 0 1rem; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--blue); font: 600 .68rem/1.4 'DM Mono', monospace; letter-spacing: .08em; text-transform: uppercase; }
.contact-page .contact-badge .badge-dot { width: 7px; height: 7px; background: var(--red); animation: none; }
.contact-page .contact-heading { max-width: 560px; margin: 0 0 1.15rem; color: var(--ink); font: 600 clamp(3.2rem, 6.4vw, 5.8rem)/.98 var(--font-heading); letter-spacing: -.075em; }
.contact-page .contact-heading-accent { color: var(--blue) !important; background: none; -webkit-text-fill-color: currentColor !important; }
.contact-page .contact-subtext { max-width: 460px; margin: 0 0 2rem; color: var(--ink-soft); font-size: 1rem; line-height: 1.75; }
.contact-page .contact-info-list { gap: 0; margin: 0 0 1.5rem; border-top: 1px solid var(--rule); }
.contact-page .contact-info-list li { min-width: 0; gap: .9rem; padding: .9rem 0; border-bottom: 1px solid var(--rule); }
.contact-page .contact-icon-box { flex: 0 0 38px; width: 38px; height: 38px; color: var(--blue); border: 1px solid var(--rule); background: var(--surface); }
.contact-page .ci-label { margin-bottom: .12rem; color: var(--muted); font: 500 .6rem/1.4 'DM Mono', monospace; letter-spacing: .08em; }
.contact-page .ci-value { display: inline-block; max-width: 100%; color: var(--ink); font-size: .83rem; line-height: 1.45; overflow-wrap: anywhere; }
.contact-page .ci-link:hover { color: var(--blue); }
.contact-page .contact-social-row { gap: .5rem; }
.contact-page .social-row-label { width: 100%; margin-bottom: .3rem; color: var(--muted); font: 500 .62rem 'DM Mono', monospace; letter-spacing: .08em; text-transform: uppercase; }
.contact-page .contact-social-btn { width: 40px; height: 40px; border-color: var(--rule); background: var(--surface); color: var(--ink); }
.contact-page .contact-social-btn:hover { border-color: var(--ink); background: var(--ink); color: white; transform: translateY(-2px); }
.contact-page .contact-right { min-width: 0; padding-top: 1rem; }
.contact-page .contact-form-card { padding: clamp(1.3rem, 3vw, 2.4rem); border: 1px solid var(--rule); border-top: 3px solid var(--blue); background: var(--surface); }
.contact-page .form-card-header { align-items: flex-start; gap: 1rem; margin-bottom: 1.7rem; padding-bottom: 1.3rem; border-bottom: 1px solid var(--rule); }
.contact-page .form-icon-box { flex: 0 0 42px; width: 42px; height: 42px; min-width: 42px; border: 1px solid var(--rule); background: var(--paper); color: var(--blue); }
.contact-page .form-card-title { margin: 0 0 .35rem; color: var(--ink); font: 600 1.35rem/1.2 var(--font-heading); letter-spacing: -.035em; }
.contact-page .form-card-sub { color: var(--muted); font-size: .78rem; line-height: 1.6; }
.contact-page .contact-form { gap: 1.1rem; }
.contact-page .form-row { gap: 1rem; }
.contact-page .form-group { min-width: 0; gap: .4rem; }
.contact-page .form-group label { color: var(--ink-soft); font: 500 .66rem 'DM Mono', monospace; letter-spacing: .04em; }
.contact-page .form-group input, .contact-page .form-group textarea, .contact-page .form-group select { width: 100%; min-width: 0; padding: .8rem .85rem; border: 1px solid var(--rule); border-radius: 0; background: var(--paper); color: var(--ink); font: 400 .85rem/1.5 var(--font-body); }
.contact-page .form-group textarea { min-height: 150px; resize: vertical; }
.contact-page .form-group input:focus, .contact-page .form-group textarea:focus, .contact-page .form-group select:focus { outline: 2px solid color-mix(in srgb, var(--blue) 25%, transparent); outline-offset: 1px; border-color: var(--blue); box-shadow: none; }
.contact-page .form-group input::placeholder, .contact-page .form-group textarea::placeholder { color: #898d86; }
.contact-page .form-submit-row { justify-content: space-between; gap: .8rem; }
.contact-page .form-submit-btn { min-height: 46px; padding: .7rem 1rem; border: 1px solid var(--blue); border-radius: 0; background: var(--blue); color: white; font-size: .77rem; }
.contact-page .form-submit-btn:hover { background: var(--blue-dark); transform: translateY(-1px); box-shadow: none; }
.contact-page .form-reply-note { color: var(--muted); font-size: .68rem; }
@media (max-width: 900px) {
    .contact-page .contact-layout { grid-template-columns: 1fr; gap: 2.5rem; }
    .contact-page .contact-left { max-width: none; }
    .contact-page .contact-heading { max-width: 650px; }
    .contact-page .contact-info-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.5rem; }
    .contact-page .contact-right { padding-top: 0; }
}
@media (max-width: 560px) {
    .contact-page .contact-layout { gap: 2rem; }
    .contact-page .contact-info-list, .contact-page .form-row { grid-template-columns: 1fr; }
    .contact-page .contact-heading { font-size: clamp(2.8rem, 14vw, 4.1rem); }
    .contact-page .contact-form-card { padding: 1.1rem; }
    .contact-page .form-submit-row { align-items: flex-start; flex-direction: column; }
    .contact-page .form-submit-btn { width: 100%; justify-content: center; }
}

/* Keep the footer GitHub mark visible even if the external icon font is unavailable. */
.footer-social-btn.github-icon { display: inline-grid; place-items: center; background: #050505 !important; color: #fff !important; }
.footer-social-btn.github-icon svg { display: block; width: 20px; height: 20px; fill: currentColor; }

/* Footer social buttons retain the supplied platform-logo treatment on hover. */
.site-footer .footer-social-btn.brand-social-icon { transition: transform .2s ease, border-color .2s ease, background-color .2s ease, box-shadow .2s ease !important; }
.site-footer .footer-social-btn.brand-social-icon:hover { background: #fff !important; border-color: #a9baff !important; box-shadow: 0 6px 16px rgba(0,0,0,.18) !important; transform: translateY(-3px) !important; }
.site-footer .footer-social-btn.github-icon,
.site-footer .footer-social-btn.github-icon:hover { background: #050505 !important; border-color: #050505 !important; color: #fff !important; }
.site-footer .footer-social-btn.github-icon:hover { box-shadow: 0 0 0 2px #a9baff, 0 6px 16px rgba(0,0,0,.18) !important; }
.site-footer .footer-social-btn.linkedin-icon { color: #0a66c2 !important; }
.site-footer .footer-social-btn.leetcode-icon { color: #ffa116 !important; }
.site-footer .footer-social-btn.geeksforgeeks-icon { color: #2f8d46 !important; }
.site-footer .footer-social-btn.code360-icon { color: #ff5b00 !important; }
.site-footer .footer-bottom { display: flex; justify-content: center; text-align: center; }
.site-footer .footer-bottom p { color: #9ba3b1; }

/* Experience: make the two daily roles read as a coordinated schedule. */
#Experience .exp-page-intro { max-width: 870px; margin-bottom: clamp(2rem, 4vw, 3.4rem); }
#Experience .exp-page-intro > p { max-width: 720px; color: var(--ink-soft); font-size: 1rem; line-height: 1.75; }
#Experience .exp-day-grid { gap: clamp(1rem, 2vw, 1.6rem); align-items: stretch; }
#Experience .exp-day-grid .exp-card { position: relative; display: flex; flex-direction: column; height: 100%; padding: clamp(1.25rem, 2.2vw, 2rem); border: 1px solid var(--rule); border-top: 3px solid var(--blue); background: var(--surface); transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
#Experience .exp-day-grid .timeline-item:first-child .exp-card { border-top-color: #c48a33; }
#Experience .exp-day-grid .exp-card:hover { transform: translateY(-4px); border-color: var(--blue); box-shadow: 0 16px 36px rgba(23,25,22,.08); }
#Experience .exp-day-grid .timeline-item:first-child .exp-card:hover { border-color: #c48a33; }
#Experience .exp-day-grid .exp-card-header { align-items: flex-start; gap: .9rem; margin: 0; }
#Experience .exp-day-grid .exp-icon-box { flex: 0 0 54px; width: 54px; height: 54px; border: 1px solid var(--rule); border-radius: 0; background: var(--paper-deep); color: var(--blue); font-size: 1.2rem; }
#Experience .exp-day-grid .timeline-item:first-child .exp-icon-box { color: #9b681e; background: #f7f0e4; }
#Experience .exp-day-grid .exp-header-text { flex: 1 1 auto; }
#Experience .exp-day-grid .exp-role { margin: 0 0 .4rem; color: var(--ink); font: 600 clamp(1rem, 1.45vw, 1.25rem)/1.3 var(--font-heading); letter-spacing: -.025em; }
#Experience .exp-day-grid .exp-org { margin: 0 0 .65rem; color: var(--blue); font-size: .83rem; line-height: 1.5; }
#Experience .exp-day-grid .timeline-item:first-child .exp-org { color: #9b681e; }
#Experience .exp-day-grid .exp-meta { flex-wrap: wrap; gap: .35rem .6rem; color: var(--muted); font-size: .68rem; }
#Experience .exp-day-grid .exp-divider { color: var(--rule); }
#Experience .exp-day-grid .exp-shift-badge { flex: 0 0 auto; justify-items: end; gap: .2rem; margin: 0 0 0 auto; padding: .45rem .6rem; border-color: var(--rule); background: var(--paper); color: var(--blue); font: 600 .65rem 'DM Mono', monospace; letter-spacing: .04em; text-transform: uppercase; }
#Experience .exp-day-grid .timeline-item:first-child .exp-shift-badge { color: #8c5c18; }
#Experience .exp-day-grid .exp-shift-badge small { color: var(--muted); font-size: .48rem; }
#Experience .exp-day-grid .exp-summary { margin: 1.3rem 0 .85rem; padding-top: 1rem; border-top: 1px solid var(--rule); color: var(--ink-soft); font-size: .88rem; line-height: 1.7; }
#Experience .exp-day-grid .exp-bullets { display: grid; gap: .55rem; }
#Experience .exp-day-grid .exp-bullets li { margin: 0; padding-left: 1rem; color: var(--ink-soft); font-size: .79rem; line-height: 1.6; }
#Experience .exp-day-grid .exp-bullets li::before { top: .58em; width: 5px; height: 5px; background: var(--blue); box-shadow: none; }
#Experience .exp-day-grid .timeline-item:first-child .exp-bullets li::before { background: #c48a33; }
#Experience .exp-day-grid .exp-bullets li span { color: var(--ink); font-weight: 600; }
#Experience .exp-day-grid .exp-tech-stack { gap: .4rem; margin-top: auto; padding-top: 1rem; }
#Experience .exp-day-grid .exp-tech-stack span { padding: .35rem .5rem; background: var(--paper); color: var(--ink-soft); font-size: .6rem; }
@media (max-width: 900px) {
    #Experience .exp-day-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; }
}
@media (max-width: 680px) {
    #Experience .exp-day-grid { grid-template-columns: 1fr; }
    #Experience .exp-day-grid .exp-role { font-size: 1.05rem; }
    #Experience .exp-day-grid .exp-shift-badge { justify-items: start; }
}
@media (max-width: 440px) {
    #Experience .exp-day-grid .exp-card-header { flex-wrap: wrap; }
    #Experience .exp-day-grid .exp-shift-badge { margin-left: calc(54px + .9rem); }
}

/* Dashboard heatmaps share one stable viewing stage; preserve each source image ratio. */
.dashboard-page .heatmap-viewer-card { overflow: hidden; }
.dashboard-page .heatmap-viewer-header { gap: 1.25rem; }
.dashboard-page .heatmap-viewer-tools { display: flex; align-items: flex-end; justify-content: flex-end; gap: .65rem; flex-wrap: wrap; }
.dashboard-page .heatmap-period-control { display: flex; align-items: center; gap: .5rem; min-height: 38px; }
.dashboard-page .heatmap-period-control[hidden] { display: none; }
.dashboard-page .heatmap-period-control label { color: var(--muted); font: 500 .62rem 'DM Mono', monospace; letter-spacing: .04em; white-space: nowrap; }
.dashboard-page .heatmap-period-control .heatmap-select { min-height: 38px; min-width: 132px; padding: .45rem .7rem; appearance: auto; color-scheme: dark; background: var(--paper); color: var(--ink); font-size: .7rem; }
.dashboard-page .heatmap-period-control .heatmap-select option { background-color: #111827 !important; color: #ffffff !important; }
.dashboard-page .heatmap-viewer-tabs { align-items: center; }
.dashboard-page .heatmap-tab { min-width: 112px; justify-content: center; }
.dashboard-page .heatmap-tab .github-mark { display: block; width: 18px; height: 18px; color: currentColor; }
.dashboard-page .heatmap-tab:not(.active) .github-mark { color: #171916; }
.dashboard-page .card-brand .github-mark { display: block; width: 32px; height: 32px; color: #171916; }
.dashboard-page .heatmap-panel { width: 100%; }
.dashboard-page .heatmap-panel[hidden] { display: none !important; }
.dashboard-page .heatmap-panel.active { display: flex; }
.dashboard-page .heatmap-image-wrapper { box-sizing: border-box; display: flex; align-items: center; justify-content: center; width: 100%; height: 280px; min-height: 280px; padding: 1.25rem; overflow: hidden; border: 0; background: #111827 !important; }
.dashboard-page .heatmap-panel-overlay { min-height: 82px; padding: 1rem 1.2rem; background: var(--surface); }
.dashboard-page .overlay-stat i { flex: 0 0 34px; }
.dashboard-page .heatmap-select { min-width: 100px; }
@media (max-width: 780px) {
    .dashboard-page .heatmap-image-wrapper { height: 235px; min-height: 235px; padding: .75rem; }
    .dashboard-page .heatmap-viewer-tabs { width: 100%; }
    .dashboard-page .heatmap-tab { flex: 1 1 120px; }
    .dashboard-page .heatmap-viewer-tools { width: 100%; align-items: stretch; justify-content: flex-start; }
    .dashboard-page .heatmap-period-control { justify-content: space-between; }
    .dashboard-page .heatmap-period-control .heatmap-select { flex: 1; }
    .dashboard-page .heatmap-panel-overlay { align-items: flex-start; }
}
@media (max-width: 520px) {
    .dashboard-page .heatmap-image-wrapper { height: 200px; min-height: 200px; }
    .dashboard-page .heatmap-panel-overlay { gap: .8rem; }
    .dashboard-page .overlay-stats { gap: .8rem; }
    .dashboard-page .overlay-stat { gap: .45rem; }
    .dashboard-page .overlay-stat i { width: 28px; height: 28px; flex-basis: 28px; }
}
@media (max-width: 780px) {
    .dashboard-page .heatmap-image-wrapper.activity-calendar-wrapper { height: 235px; min-height: 235px; padding: .75rem; }
}
@media (max-width: 520px) {
    .dashboard-page .heatmap-image-wrapper.activity-calendar-wrapper { height: 200px; min-height: 200px; }
}

/* Featured project: present the analyzer like a deliberate product case study. */
.projects-container .project-card:first-child { position: relative; gap: clamp(1.5rem, 4vw, 4rem); padding: .25rem 0 3rem; }
.projects-container .project-card:first-child .project-card-image-wrapper { aspect-ratio: 2.08 / 1; padding: clamp(.45rem, .9vw, .8rem); border: 1px solid #d7d7d0; border-top: 3px solid var(--blue); background: #ecebe6; }
.projects-container .project-card:first-child .project-card-img { width: 100%; height: 100%; object-fit: contain; }
.projects-container .project-card:first-child .project-card-content { padding: clamp(.5rem, 1.5vw, 1.2rem) 0; }
.projects-container .project-card:first-child .project-card-content::before { margin-bottom: .8rem; color: var(--red); font-size: .66rem; }
.projects-container .project-card:first-child .project-card-header-row { align-items: flex-start; }
.projects-container .project-card:first-child .project-card-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; color: var(--blue); font-size: clamp(1.8rem, 3vw, 2.7rem); line-height: 1.08; letter-spacing: -.055em; }
.projects-container .project-card:first-child .project-card-title i { display: grid; flex: 0 0 38px; width: 38px; height: 38px; place-items: center; margin: 0; border: 1px solid var(--rule); color: var(--blue); font-size: 1rem; transition: color .2s ease, background .2s ease, border-color .2s ease; }
.projects-container .project-card:first-child:hover .project-card-title i { border-color: var(--blue); background: var(--blue); color: white; }
.projects-container .project-card:first-child .project-card-desc { max-width: 580px; margin: 1.2rem 0 1.35rem; color: var(--ink-soft); font-size: clamp(.95rem, 1.2vw, 1.08rem); line-height: 1.75; }
.projects-container .project-card:first-child .project-card-tags { gap: .45rem; margin-bottom: 1.3rem; }
.projects-container .project-card:first-child .project-card-tags span { padding: .35rem .6rem; border-color: #d8d9d2 !important; background: rgba(255,255,255,.45) !important; color: #555a55 !important; font-size: .65rem; }
.projects-container .project-card:first-child .project-card-actions { gap: .55rem; padding-top: 1rem; }
.projects-container .project-card:first-child .project-card-actions a { min-height: 40px; padding: .55rem .7rem; color: var(--ink-soft); font-size: .75rem; }
.projects-container .project-card:first-child .project-card-actions a:hover { color: var(--blue); background: var(--paper-deep); transform: translateY(-2px); }
.projects-container .project-card:first-child .project-card-actions a:first-child { color: var(--blue); }
.projects-container .project-card:first-child .project-card-actions a svg,
.projects-container .project-card:first-child .project-card-actions a i { color: var(--blue); }
.projects-container .project-card:first-child .project-card-image-wrapper::after { right: 1rem; bottom: 1rem; }
@media (max-width: 760px) {
    .projects-container .project-card:first-child { gap: 1.1rem; padding-bottom: 2rem; }
    .projects-container .project-card:first-child .project-card-image-wrapper { aspect-ratio: 1.75 / 1; }
    .projects-container .project-card:first-child .project-card-content { padding: 0; }
}
@media (max-width: 520px) {
    .projects-container .project-card:first-child .project-card-title { font-size: 1.7rem; }
    .projects-container .project-card:first-child .project-card-title i { flex-basis: 34px; width: 34px; height: 34px; }
    .projects-container .project-card:first-child .project-card-actions { gap: .25rem; }
    .projects-container .project-card:first-child .project-card-actions a { padding: .45rem .5rem; font-size: .68rem; }
}

/* Dashboard profile cards: emphasize current metrics and label live-data freshness. */
.dashboard-page .platform-live-status { color: var(--muted); font: 500 .62rem 'DM Mono', monospace; }
.dashboard-page .platform-live-status[data-state="live"] { color: #28754a; }
.dashboard-page .platform-live-status[data-state="cached"] { color: #9b681e; }
.dashboard-page .platform-live-status[data-state="partial"] { color: #9b681e; }
.dashboard-page .platform-live-status[data-state="unavailable"] { color: var(--muted); }
.dashboard-page .platform-stats-body { display: grid; grid-template-columns: minmax(120px, .6fr) minmax(0, 1.4fr); align-items: center; gap: 1.2rem; margin: 1.2rem 0; }
.dashboard-page .platform-total-ring { position: relative; display: grid; width: 112px; height: 112px; place-items: center; margin: 0 auto; }
.dashboard-page .platform-total-ring .leetcode-progress-circle { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.dashboard-page .platform-total-ring .circle-bg { stroke: var(--rule); }
.dashboard-page .platform-total-ring .circle-progress { stroke-dasharray: 251.2; stroke-dashoffset: 0; }
.dashboard-page .platform-total-ring .circle-content { position: relative; inset: auto; }
.dashboard-page .platform-total-ring .circle-number { font-size: 1.55rem; }
.dashboard-page .live-breakdown { min-width: 0; }
.dashboard-page .live-breakdown-heading { display: flex; justify-content: space-between; gap: .5rem; margin-bottom: .65rem; color: var(--muted); font: 500 .58rem 'DM Mono', monospace; letter-spacing: .04em; text-transform: uppercase; }
.dashboard-page .live-breakdown-row { display: grid; gap: .38rem; margin: .65rem 0; }
.dashboard-page .live-breakdown-row > div:first-child { display: flex; justify-content: space-between; gap: .5rem; color: var(--ink-soft); font-size: .72rem; }
.dashboard-page .live-breakdown-row strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.dashboard-page .live-breakdown-row .progress-bar-bg { height: 5px; background: var(--paper-deep); }
.dashboard-page .live-breakdown-row .progress-bar-fill { height: 100%; width: 0; transition: width .55s ease; }
.dashboard-page .platform-footer-stats { margin-top: .3rem; }
.dashboard-page .platform-live-empty { display: grid; grid-template-columns: 48px minmax(0,1fr); align-items: center; gap: .8rem 1rem; min-height: 158px; margin: 1.25rem 0; padding: 1rem; border: 1px dashed var(--rule); background: var(--paper); }
.dashboard-page .platform-live-empty-mark { display: grid; width: 44px; height: 44px; place-items: center; background: var(--paper-deep); color: var(--muted); }
.dashboard-page .platform-live-empty strong { color: var(--ink); font: 600 .9rem var(--font-heading); }
.dashboard-page .platform-live-empty p { margin: .3rem 0 0; color: var(--muted); font-size: .71rem; line-height: 1.55; }
.dashboard-page .platform-live-empty > a { grid-column: 2; display: inline-flex; align-items: center; gap: .4rem; width: fit-content; color: var(--blue); font-size: .7rem; font-weight: 600; }
.dashboard-page .github-live-overview { display: grid; grid-template-columns: minmax(130px, .65fr) minmax(0, 1.35fr); gap: 1.1rem; align-items: center; min-height: 180px; margin: 1.1rem 0; }
.dashboard-page .github-live-total { display: grid; align-content: center; justify-items: center; min-height: 130px; border-right: 1px solid var(--rule); }
.dashboard-page .github-live-total strong { color: var(--ink); font: 600 clamp(2.2rem, 4vw, 3.2rem)/1 var(--font-heading); letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.dashboard-page .github-live-total span { margin-top: .4rem; color: var(--muted); font: 500 .6rem 'DM Mono', monospace; text-align: center; text-transform: uppercase; }
.dashboard-page .github-live-metrics { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .55rem; }
.dashboard-page .github-live-metrics > div { display: flex; justify-content: space-between; gap: .5rem; padding: .55rem .6rem; border-bottom: 1px solid var(--rule); }
.dashboard-page .github-live-metrics span { color: var(--muted); font-size: .67rem; }
.dashboard-page .github-live-metrics strong { color: var(--ink); font-size: .75rem; font-variant-numeric: tabular-nums; }
.dashboard-page .tuf-progress-note { margin: .55rem 0 0; color: var(--muted); font-size: .68rem; }
@media (max-width: 780px) {
    .dashboard-page .platform-stats-body { grid-template-columns: 1fr; gap: .8rem; }
    .dashboard-page .platform-total-ring { width: 100px; height: 100px; }
    .dashboard-page .github-live-overview { grid-template-columns: 1fr; gap: .65rem; }
    .dashboard-page .github-live-total { min-height: 82px; border-right: 0; border-bottom: 1px solid var(--rule); padding-bottom: .75rem; }
}
@media (max-width: 480px) {
    .dashboard-page .github-live-metrics { grid-template-columns: 1fr; }
    .dashboard-page .platform-live-empty { grid-template-columns: 38px minmax(0,1fr); padding: .75rem; }
    .dashboard-page .platform-live-empty-mark { width: 36px; height: 36px; }
}

/* Shared phone-width refinements: keep the reading column stable and controls easy to use. */
@media (max-width: 768px) {
    .container, main, main > section, .site-footer, .projects-container,
    .coding-card, .heatmap-viewer-card { min-width: 0; }
    main > section { width: calc(100% - 36px) !important; }
    main img, main video, main iframe { max-width: 100%; }
    .hero-section { height: auto; min-height: 0; }
    .hero-text h1 { max-width: 100%; font-size: clamp(2.7rem, 12.8vw, 5rem); line-height: .94; }
    .hero-image { max-width: min(82vw, 320px); }
    .stats-bar { right: 0; width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .stat-item { min-width: 0; padding-right: .35rem; padding-left: .35rem; }
    .heatmap-viewer-header, .heatmap-header-info, .heatmap-viewer-tools { min-width: 0; width: 100%; }
    .heatmap-viewer-tools { align-items: stretch; }
    .heatmap-period-control { width: 100%; }
    .heatmap-period-control .heatmap-select { min-width: 0; }
    .project-chapter-nav { max-width: 100%; }
}
@media (max-width: 600px) {
    .hero-text h1 { font-size: clamp(2.55rem, 12.8vw, 4.6rem); }
    .hero-image { width: min(78vw, 290px); }
    .project-case-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .project-case-facts > div { min-width: 0; padding-right: .4rem; padding-left: .4rem; }
    .project-case-facts > div strong, .project-case-facts > div span { overflow-wrap: anywhere; }
}
@media (max-width: 380px) {
    main > section { width: calc(100% - 28px) !important; }
    .hero-text h1 { font-size: clamp(2.35rem, 12vw, 3rem); }
    .hero-greeting, .about-eyebrow, .skills-badge, .exp-badge, .coding-badge,
    .projects-badge, .achieve-badge, .cert-badge, .contact-badge, .edu-badge { letter-spacing: .04em; }
    .heatmap-period-control { align-items: flex-start; flex-direction: column; }
    .heatmap-period-control .heatmap-select { width: 100%; }
}

/* Compact, scroll-safe navigation drawer for phones and short landscape screens. */
@media (max-width: 768px) {
    header { height: 64px; }
    .nav-wrapper { min-width: 0; }
    .nav-toggle {
        display: inline-flex;
        width: 44px;
        height: 44px;
        flex: 0 0 44px;
        border: 1px solid var(--rule);
        background: var(--surface);
        color: var(--ink);
        font-size: 1rem;
        transition: color .2s ease, background .2s ease, border-color .2s ease;
    }
    .nav-toggle:hover, .nav-toggle[aria-expanded="true"] {
        border-color: rgba(39, 69, 220, .28);
        background: rgba(39, 69, 220, .06);
        color: var(--blue);
    }
    #mainNav {
        counter-reset: mobile-nav-item;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-content: start;
        gap: 7px;
        top: 64px;
        left: 0;
        width: 100%;
        max-height: calc(100vh - 64px);
        max-height: calc(100dvh - 64px);
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 14px 18px max(18px, env(safe-area-inset-bottom));
        border: 1px solid var(--rule);
        border-top: 0;
        border-radius: 0 0 16px 16px;
        background: rgba(255, 255, 255, .98);
        box-shadow: 0 18px 38px rgba(20, 24, 34, .12);
        transform: translateY(-8px) scale(.99);
        transform-origin: top center;
        visibility: hidden;
        transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
    }
    #mainNav.open {
        transform: translateY(0) scale(1);
        visibility: visible;
        transition-delay: 0s;
    }
    #mainNav a {
        display: grid;
        grid-template-columns: 1.6rem minmax(0, 1fr);
        align-items: center;
        gap: .35rem;
        width: auto;
        min-width: 0;
        min-height: 50px;
        padding: .7rem .7rem;
        border: 1px solid var(--rule);
        background: var(--surface);
        color: var(--ink-soft);
        font-size: .8rem;
        line-height: 1.25;
        text-align: left;
        white-space: normal;
        transition: color .18s ease, background .18s ease, border-color .18s ease;
        counter-increment: mobile-nav-item;
    }
    #mainNav a::before {
        content: counter(mobile-nav-item, decimal-leading-zero);
        color: var(--muted);
        font: 500 .61rem/1 'DM Mono', monospace;
    }
    #mainNav a::after { display: none; }
    #mainNav a:hover, #mainNav a.active {
        border-color: rgba(39, 69, 220, .3);
        background: rgba(39, 69, 220, .055);
        color: var(--blue);
    }
    #mainNav a:focus-visible, .nav-toggle:focus-visible {
        outline: 2px solid var(--blue);
        outline-offset: 2px;
    }
}
@media (max-width: 380px) {
    #mainNav { grid-template-columns: 1fr; padding-right: 14px; padding-left: 14px; }
}
@media (max-height: 460px) and (max-width: 768px) {
    #mainNav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #mainNav a { min-height: 44px; padding-top: .55rem; padding-bottom: .55rem; }
}

/* Keep the résumé preview and its controls inside the visible viewport. */
#resumeModal {
    box-sizing: border-box;
    place-items: center;
    overflow-y: auto;
    padding: clamp(.5rem, 2vh, 1.25rem);
}
#resumeModal .modal-content {
    display: flex;
    width: min(1000px, 100%);
    height: min(88vh, 920px);
    height: min(88dvh, 920px);
    max-height: calc(100vh - 1rem);
    max-height: calc(100dvh - 1rem);
    flex-direction: column;
    margin: auto;
}
#resumeModal .modal-header { flex: 0 0 auto; gap: .75rem; padding: .85rem 1rem; }
#resumeModal .modal-header h2 { font-size: 1.15rem; }
#resumeModal .modal-controls { flex-wrap: wrap; gap: .5rem; }
#resumeModal .modal-body { min-height: 0; height: auto; flex: 1 1 auto; padding: .65rem; }
#resumeModal .modal-body iframe { display: block; min-height: 0; }
@media (max-width: 768px) {
    #resumeModal .modal-content { width: 100%; height: calc(100vh - 1rem); height: calc(100dvh - 1rem); }
    #resumeModal .modal-header { flex-direction: row; align-items: center; text-align: left; }
    #resumeModal .modal-header h2 { font-size: 1rem; }
    #resumeModal .modal-controls { width: auto; justify-content: flex-end; }
    #resumeModal .download-btn { padding: .55rem .7rem; font-size: .75rem; }
    #resumeModal .modal-body { padding: .45rem; }
}
@media (max-width: 420px) {
    #resumeModal .modal-header { align-items: flex-start; flex-direction: column; }
    #resumeModal .modal-controls { width: 100%; justify-content: space-between; }
    #resumeModal .modal-header h2 { font-size: .95rem; }
}

/* Cross-page motion is progressive enhancement; default navigation remains native. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: portfolio-page-out 160ms ease both; }
::view-transition-new(root) { animation: portfolio-page-in 220ms cubic-bezier(.2, .7, .2, 1) both; }
@keyframes portfolio-page-out { to { opacity: .82; } }
@keyframes portfolio-page-in { from { opacity: .82; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

