/* =================================================
   templates/styles.css — consolidated
   - Duplicates removed, like rules merged
   - Keeps: card-link fill, footer btn fix, square avatar,
            mobile stacking, disable animations on mobile
   ================================================= */

/* ============================================
   Global Design Tokens and Baseline
   ============================================ */
:root {
    --accent-from: #5b4bff;
    --accent-to: #7c5cff;
    --accent: linear-gradient(90deg, var(--accent-from), var(--accent-to));
    --muted: #b6bfd0;
    --text: #f5f8fb;
    --panel-bg: rgba(255, 255, 255, 0.02);
    --card-bg: rgba(255, 255, 255, 0.03);
    --glass-blur: 8px;
    --radius: 12px;
    --container-max: 1100px;
    --gutter: 18px;
}

/* baseline */
* {
    box-sizing: border-box;
    word-wrap: break-word;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    hyphens: auto;
}

html,
body {
    height: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    color: var(--text);
    background-color: #0b1830;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding: 28px 16px;
    overflow-y: overlay;
    -webkit-tap-highlight-color: transparent;
}

/* =================================================
   Stacking, site & container baseline
   ================================================= */
.site {
    position: relative;
    z-index: 1;
    isolation: isolate;
    background-color: transparent;
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.container {
    position: relative;
    z-index: 1;
    isolation: unset;
    max-width: var(--container-max);
    margin: 0 auto;
    width: 100%;
    position: relative;
}

/* Prevent accidental stacking-context changes from transforms/opacity */
body,
.site,
.container {
    transform: none !important;
    opacity: 1 !important;
}

/* Panels/panels-like should use consistent translucent look */
.panel,
header.site-header,
footer section.panel#contact,
.projects-panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0.008));
    border: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    opacity: 1;
    transform: none;
    will-change: auto;
    box-shadow: 0 10px 30px rgba(2, 8, 28, 0.45);
}

/* ============================================
   Animated Layered Background (brighter version)
   ============================================ */
.bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(900px 480px at 8% 18%, rgba(124, 92, 255, 0.20), transparent 15%),
        radial-gradient(700px 360px at 92% 80%, rgba(59, 130, 246, 0.15), transparent 15%),
        radial-gradient(680px 320px at 50% 30%, rgba(32, 201, 192, 0.10), transparent 15%);
    opacity: 1;
}

.bg::before,
.bg::after {
    content: "";
    position: absolute;
    inset: 0;
    will-change: transform, opacity;
    mix-blend-mode: screen;
    opacity: 1;
}

/* purple / blue layer */
.bg::before {
    background: linear-gradient(120deg,
            rgba(124, 92, 255, 0.25) 0%,
            rgba(124, 92, 255, 0.12) 25%,
            rgba(59, 130, 246, 0.12) 60%,
            rgba(59, 130, 246, 0.20) 100%);
    transform: translate3d(-10%, -6%, 0) rotate(-1deg);
    animation: floatA 22s linear infinite;
    filter: blur(60px) saturate(140%);
}

/* teal + white overlay (brighter) */
.bg::after {
    background: linear-gradient(60deg,
            rgba(32, 201, 192, 0.20) 0%,
            rgba(255, 255, 255, 0.12) 25%,
            rgba(32, 201, 192, 0.12) 60%,
            rgba(255, 255, 255, 0.10) 100%);
    transform: translate3d(10%, 8%, 0) rotate(1deg);
    animation: floatB 30s linear infinite reverse;
    filter: blur(90px) saturate(150%);
}

/* keyframes */
@keyframes floatA {
    0% {
        transform: translate3d(-14%, -8%, 0) rotate(-1deg);
    }

    50% {
        transform: translate3d(14%, 8%, 0) rotate(0.5deg);
    }

    100% {
        transform: translate3d(-14%, -8%, 0) rotate(-1deg);
    }
}

@keyframes floatB {
    0% {
        transform: translate3d(12%, 8%, 0) rotate(1deg);
        opacity: 0.9;
    }

    50% {
        transform: translate3d(-12%, -8%, 0) rotate(-0.6deg);
        opacity: 1;
    }

    100% {
        transform: translate3d(12%, 8%, 0) rotate(1deg);
        opacity: 0.9;
    }
}

/* =================================================
   Header & Navigation
   ================================================= */
header.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    border-radius: var(--radius);
    background: linear-gradient(180deg, var(--panel-bg), rgba(255, 255, 255, 0.008));
    border: 1px solid rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(var(--glass-blur));
    box-shadow: 0 10px 30px rgba(2, 8, 28, 0.35);
    position: relative;
    z-index: 2;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    flex-shrink: 0;
}

.logo {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    background: var(--accent);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 8px 28px rgba(92, 68, 255, 0.12);
}

.brand h2 {
    margin: 0;
    font-size: 1.05rem;
}

.brand small {
    display: block;
    color: var(--muted);
    font-size: .85rem;
    margin-top: 2px;
}

nav.primary {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 18px;
}

nav.primary a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 10px;
    border-radius: 8px;
    transition: background .12s, color .12s, transform .12s;
}

nav.primary a:hover,
nav.primary a:focus {
    color: var(--text);
    background: rgba(255, 255, 255, 0.02);
    transform: translateY(-2px);
    outline: none;
}

nav.primary a.active {
    color: var(--text);
    background: linear-gradient(90deg, rgba(124, 92, 255, 0.12), rgba(124, 92, 255, 0.06));
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.02);
}

/* Mobile hamburger */
.mobile-toggle {
    display: none;
    width: 46px;
    height: 46px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    background: transparent;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
}

.hamburger {
    width: 20px;
    height: 14px;
    position: relative;
    display: block;
}

.hamburger span {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--muted);
    border-radius: 2px;
    transition: transform .18s ease, opacity .12s;
}

.hamburger span:nth-child(1) {
    top: 0;
}

.hamburger span:nth-child(2) {
    top: 6px;
}

.hamburger span:nth-child(3) {
    top: 12px;
}

.mobile-toggle.open .hamburger span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
    background: var(--text);
}

.mobile-toggle.open .hamburger span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.open .hamburger span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
    background: var(--text);
}



/* =================================================
   Page Layout & Content
   ================================================= */
.header {
  display: flex; /* retain flex layout */
  align-items: flex-start; /* align top edges so avatar looks taller */
  justify-content: flex-start; /* text and avatar closer together */
  gap: 24px; /* increased spacing between text and avatar */
  padding: 18px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.008));
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: 0 10px 30px rgba(2, 8, 28, 0.45);
  margin-bottom: 24px;
}

/* Keep hero text flexible */
.header .hero-left {
  flex: 1 1 0%;
  min-width: 0;
  overflow: visible;
}

/* Ensure text wraps naturally */
.header .hero-left h1,
.header .hero-left p {
  word-wrap: break-word;
  hyphens: auto;
}

/* Avatar: fixed large size, does not shrink */
.header .avatar {
  flex: 0 0 auto;
  width: 220px; /* desktop size */
  height: 220px;
  border-radius: 12px; /* square with rounded corners */
  overflow: hidden;
  background: linear-gradient(90deg, var(--accent-from), var(--accent-to));
  box-shadow: 0 12px 30px rgba(92, 68, 255, 0.12);
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Image fills container */
.header .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

/* grid */
.grid {
    display: grid;
    gap: var(--gutter);
    grid-template-columns: 1fr;
}

@media(min-width:900px) {
    .grid {
        grid-template-columns: 2fr 1fr;
        align-items: start;
    }
}

/* Panels & Cards (global defaults) */
.panel {
    padding: 14px;
    border-radius: 12px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.card {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    padding: 14px;
    border-radius: 12px;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(var(--glass-blur));
    transition: transform 180ms cubic-bezier(.2, .9, .3, 1), box-shadow 180ms, border-color 180ms;
    will-change: transform;
    position: relative;
}

.current-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.18), rgba(34, 197, 94, 0.08));
    color: #c7f9d7;
    border: 1px solid rgba(34, 197, 94, 0.12);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 999px;
    box-shadow: 0 4px 10px rgba(34, 197, 94, 0.12);
    z-index: 2;
}

.card:focus-within,
.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 26px 60px rgba(2, 8, 28, 0.6);
    border-color: rgba(124, 92, 255, 0.22);
}

.card h3 {
    margin: 0;
    font-size: 1.03rem;
    font-weight: 600;
    color: var(--text);
}

.card p {
    margin: 8px 0 0 0;
    color: var(--muted);
    font-size: 0.96rem;
}

.meta {
    color: var(--muted);
    font-size: 0.88rem;
    margin-top: 6px;
}

/* Cards: clickable fill for whole card */
.card-grid {
    display: grid;
    gap: 12px;
    grid-auto-rows: auto;
    align-items: start;
}

.card-grid .card,
.card-grid article.card,
.card-grid .project-card {
    min-height: 120px;
    padding: 14px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

/* Ensure <article class="card"> fills its anchor so full card is clickable */
.card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    height: 100%;
}

.card-link>article.card,
.card-link>.card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    outline: none;
}

a.card-link:focus {
    outline: none;
}

/* Skills chips (global, scoped overrides exist for projects/positions) */
.skills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.skill {
    padding: 6px 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(124, 92, 255, 0.14), rgba(59, 130, 246, 0.06));
    color: #eef0ff;
    font-size: 0.86rem;
    transition: transform .12s, box-shadow .12s;
}

.skill:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 26px rgba(92, 68, 255, 0.08);
    cursor: default;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 10px;
    text-decoration: none;
    color: white;
    background: linear-gradient(90deg, #6d4bff, #7c5cff);
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: transform .12s ease, box-shadow .12s ease;
}

.btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(92, 68, 255, 0.12);
}

.btn.secondary {
    color: var(--muted);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.btn.secondary:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
}

/* ---------- Edited: footer contact button styling so it doesn't look off ---------- */
footer section.panel#contact .btn {
    padding: 10px 12px;
    border-radius: 10px;
    min-height: 40px;
    font-weight: 600;
    background: linear-gradient(90deg, #6d4bff, #7c5cff);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: none;
    /* remove lift for footer buttons */
    box-shadow: 0 8px 20px rgba(92, 68, 255, 0.08);
}

footer section.panel#contact .btn:hover,
footer section.panel#contact .btn:focus {
    transform: none;
    box-shadow: 0 8px 20px rgba(92, 68, 255, 0.12);
    outline: none;
}

/* Footer layout adjustments for small screens */
footer section.panel#contact>div {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
}

@media(max-width:600px) {
    footer section.panel#contact>div {
        justify-content: center;
        flex-direction: column;
        gap: 10px;
    }

    footer section.panel#contact .btn {
        width: 100%;
        max-width: 420px;
    }
}

/* =================================================
   Projects page (scoped to .projects-panel)
   ================================================= */
.projects-panel .projects-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 10px;
}

/* Make Projects title plain white (override previous gradient) */
.projects-panel .projects-title {
    margin: 0;
    font-size: 1.75rem;
    order: 0;
    flex: 0 1 auto;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: none !important;
    -webkit-background-clip: unset !important;
    background-clip: unset !important;
    -webkit-text-fill-color: #ffffff !important;
    color: #ffffff !important;
    text-shadow: none;
}

/* Filters */
.projects-panel .filters {
    order: 1;
    margin-left: auto;
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Visually-hidden utility (single consolidated version) */
.visually-hidden,
.projects-panel .visually-hidden {
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
    clip-path: inset(50%);
    border: 0;
    padding: 0;
    margin: -1px;
}

/* grid layout (scoped) */
.projects-panel .projects-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}

@media(min-width:720px) {
    .projects-panel .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(min-width:1100px) {
    .projects-panel .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* scoped project-card (overrides global .card hover lift) */
.projects-panel .project-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 14px;
    border-radius: 12px;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(var(--glass-blur));
    transition: box-shadow .15s ease, border-color .15s ease;
}

.projects-panel .project-card:hover,
.projects-panel .project-card:focus-within {
    transform: none !important;
    box-shadow: 0 12px 28px rgba(2, 8, 28, 0.18);
    border-color: rgba(255, 255, 255, 0.03);
}

.projects-panel .project-card h3 {
    font-size: 1.05rem;
    margin: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* current badge (scoped) */
#project-current-badge {
    position: relative;
    top: 0px;
    right: 0px;
}

/* scoped skills (projects) */
.projects-panel .skills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.projects-panel .skill {
    /* same as global .skill but scoped in case of overrides */
    padding: 6px 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(124, 92, 255, 0.14), rgba(59, 130, 246, 0.06));
    color: #eef0ff;
    font-size: 0.86rem;
    transition: transform .12s, box-shadow .12s;
}

.projects-panel .skill:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 26px rgba(92, 68, 255, 0.08);
    cursor: default;
}

/* project actions (scoped) */
.projects-panel .project-actions {
    margin-top: 12px;
    display: flex;
    gap: 10px;
}

/* search + select (scoped) */
.projects-panel .project-search,
.projects-panel .project-year {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    font-weight: 500;
}

/* project-search defaults & placeholder */
.projects-panel .project-search {
    min-width: 200px;
    max-width: 340px;
}

.projects-panel .project-search::placeholder {
    color: rgba(182, 191, 208, 0.6);
}

/* responsive tweaks for projects */
@media(max-width:480px) {
    .projects-panel .projects-header {
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .projects-panel .projects-title {
        font-size: 1.5rem;
    }

    .projects-panel .project-search {
        min-width: 120px;
    }

    .projects-panel .projects-grid {
        gap: 12px;
    }
}

/* =================================================
   Small utilities & footer CTA
   ================================================= */
.footer-cta {
    margin-top: 40px;
    padding-top: 12px;
    display: flex;
    justify-content: flex-start;
}

@media (max-width:480px) {
    .footer-cta {
        margin-top: 24px;
        padding-top: 10px;
    }
}

/* ===== Project Page Styles ===== */
.project-page {
    --photo-frame-bg: #07101a;
    --photo-max-height: 600px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

.project-page .current-badge {
    position: relative;
    top: 0px;
    left: 5px;
}

@media (max-width:520px) {
    .project-page {
        padding: 14px;
    }

    :root {
        --photo-max-height: 420px;
    }
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.project-year {
    font-weight: 600;
    font-size: 1rem;
    
}

.project-summary {
    margin-top: 14px;
    color: var(--text);
    line-height: 1.6;
    font-size: 1rem;
}

.project-skills {
    margin-top: 16px;
}

.project-skills h4 {
    margin: 0 0 8px 0;
    font-size: 1rem;
}

.skills-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* photo layout */
.project-photos {
    margin-top: 22px;
}

.photos-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.photo-card {
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.01), rgba(255, 255, 255, 0.006));
    border: 1px solid rgba(255, 255, 255, 0.02);
    overflow: hidden;
}

.photo-frame {
    width: 100%;
    background: var(--photo-frame-bg);
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.01);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: var(--photo-max-height);
}

.photo-img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: var(--photo-max-height);
    object-fit: contain;
    object-position: center;
    opacity: 0;
    transition: opacity .28s ease, transform .18s ease;
}

.photo-img.loaded {
    opacity: 1;
    transform: none;
}

figcaption {
    padding: 10px;
}

.photo-title {
    font-weight: 600;
    margin-bottom: 6px;
}

.photo-desc {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.4;
}

.photos-list img {
    display: block;
}

/* ===== Positions / Timeline ===== */
.positions-panel {
    padding: 18px;
}

.positions-panel .positions-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 12px;
}

.positions-panel .positions-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.positions-panel .positions-subtitle {
    margin: 0;
    font-size: 0.95rem;
    color: var(--muted);
}

/* timeline */
.positions-panel .timeline {
    list-style: none;
    margin: 24px 0 0;
    padding: 0;
    position: relative;
}

.positions-panel .timeline::before {
    content: "";
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 72px;
    width: 3px;
    margin-left: -1.5px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    border-radius: 3px;
    z-index: 0;
}

.positions-panel .timeline-item {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 18px;
    align-items: start;
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
}

.positions-panel .marker-col {
    position: relative;
    width: 72px;
    height: 1px;
}

.positions-panel .marker {
    position: absolute;
    left: 72px;
    transform: translateX(-50%);
    top: 12px;
    z-index: 2;
    pointer-events: none;
}

.positions-panel .timeline-marker {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent-from), var(--accent-to));
    box-shadow: 0 8px 20px rgba(92, 68, 255, 0.18);
    border: 2px solid rgba(255, 255, 255, 0.06);
    display: block;
}

.positions-panel .connector {
    position: absolute;
    left: calc(72px + 10px);
    top: 16px;
    height: 2px;
    width: 18px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    border-radius: 2px;
    z-index: 1;
}

/* card styling — restore previous card appearance (scoped) */
.positions-panel .card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.02);
    padding: 14px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* card head */
.positions-panel .card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.positions-panel .card-head .title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.positions-panel .card-head .title .meta {
    font-weight: 600;
    color: var(--muted);
    font-size: 0.95rem;
}

.positions-panel .card-head .right-meta {
    text-align: right;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.2;
}

.positions-panel .card-head .right-meta .company {
    display: block;
    font-weight: 600;
    color: var(--text);
}

.positions-panel .card-head .right-meta .dates {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.9rem;
}

/* description, skills, actions */
.positions-panel .card p {
    margin: 8px 0 0 0;
    color: var(--muted);
    font-size: 0.96rem;
    line-height: 1.5;
}

.positions-panel .skills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.positions-panel .skill {
    padding: 6px 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(124, 92, 255, 0.14), rgba(59, 130, 246, 0.06));
    color: #eef0ff;
    font-size: 0.86rem;
}

.positions-panel .actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

/* responsive adjustments */
@media (max-width:720px) {
    .positions-panel .timeline::before {
        left: 56px;
    }

    .positions-panel .timeline-item {
        grid-template-columns: 56px 1fr;
    }

    .positions-panel .marker {
        left: 56px;
    }

    .positions-panel .connector {
        left: calc(56px + 8px);
        width: 14px;
    }

    .positions-panel .card-head .right-meta {
        text-align: left;
    }
}

@media (max-width:600px) {
    .positions-panel .positions-header {
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
}

@media (max-width:520px) {
    .positions-panel .timeline::before {
        display: none;
    }

    .positions-panel .timeline-item {
        grid-template-columns: 1fr;
    }

    .positions-panel .marker,
    .positions-panel .connector {
        display: none;
    }

    .positions-panel .card-head {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .positions-panel .card-head .right-meta {
        text-align: left;
        font-size: 0.9rem;
    }
}

/* ===== Fix: disable card raise/hover effect for positions (kept) ===== */
.positions-panel .card,
.positions-panel .card:hover,
.positions-panel .card:focus-within {
    transform: none !important;
    box-shadow: none !important;
    border-color: rgba(255, 255, 255, 0.02) !important;
    transition: none !important;
}

/* ===========================================================
   mobile-overrides.css — Mobile & Accessibility focused rules
   Drop this at the END of your main styles.css
   =========================================================== */

/* ===== 0) Strong global disable for animations & transitions on mobile ===== */
@media (max-width: 520px) {

    /* disable animations/transitions on mobile */
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
        transform: none !important;
    }

    /* reduce background motion & heavy filters on mobile */
    .bg,
    .bg::before,
    .bg::after {
        animation: none !important;
        filter: none !important;
        opacity: 0.92 !important;
        will-change: auto !important;
    }

    header.site-header,
    .panel,
    .card {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        box-shadow: none;
    }

    /* Performance & reduced paint heuristics */
    .card,
    header.site-header,
    footer section.panel#contact {
        box-shadow: none !important;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    :root {
        --glass-blur: 0px;
    }
}

/* Respect prefers-reduced-motion explicitly */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* ===== 1) General small-screen adjustments & container padding ===== */
@media (max-width: 900px) {
    :root {
        --container-max: 900px;
        --gutter: 14px;
    }

    body {
        padding: 20px 12px;
    }

    .site {
        gap: 0.75rem;
    }

    header.site-header {
        padding: 12px 14px;
        border-radius: 10px;
    }

    .grid {
        gap: calc(var(--gutter) / 1.2);
    }
}

@media (max-width: 1000px) {
    .container {
        width: 100%;
    }

    .header {
        display: block;
        padding: 12px;
        gap: 12px;
        box-shadow: none;
    }

    .avatar {
        justify-self: center;
        margin: 10px;
    }

    .hero-left h1,
    .hero-left p {
        justify-self: center;
        margin: 10px;
    }

}

/* Slightly smaller typography for very small screens for fit & readability */
@media (max-width: 480px) {
    html {
        font-size: 15px;
    }

    body {
        padding: 16px 10px;
        line-height: 1.45;
    }

    .positions-panel,
    .projects-panel,
    .project-page,
    .panel {
        padding: 12px;
    }

    header.site-header {
        padding: 10px 12px;
    }

    .brand h2 {
        font-size: 0.98rem;
    }

    .brand small {
        font-size: 0.75rem;
    }

    .card {
        padding: 12px;
        border-radius: 10px;
    }

    .card h3 {
        font-size: 1rem;
    }

    .projects-panel .projects-title {
        font-size: 1.5rem;
        font-weight: 700;
    }

    .card p,
    .project-summary,
    .positions-panel .card p {
        line-height: 1.55;
    }

    .card-grid .card {
        min-height: 140px;
    }

    .btn {
        min-height: 44px;
        padding-left: 14px;
        padding-right: 14px;
    }

    nav.primary a {
        font-size: 1rem;
        padding: 12px;
    }

    .footer-cta {
        margin-top: 24px;
        padding-top: 10px;
    }
}

/* ===== 2) Mobile nav — in-flow expanded panel that pushes content down ===== */
/* (No JS here; CSS expects a class body.nav-open to show the menu) */

/* Mobile */
.mobile-toggle {
    display: none;
    width: 46px;
    height: 46px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    background: transparent;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
}

.hamburger {
    width: 20px;
    height: 14px;
    position: relative;
    display: block;
}

.hamburger span {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--muted);
    border-radius: 2px;
    transition: transform .18s ease, opacity .12s;
}

.hamburger span:nth-child(1) {
    top: 0;
}

.hamburger span:nth-child(2) {
    top: 6px;
}

.hamburger span:nth-child(3) {
    top: 12px;
}

.mobile-toggle.open .hamburger span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
    background: var(--text);
}

.mobile-toggle.open .hamburger span:nth-child(2) {
    opacity: 0;
}

.mobile-toggle.open .hamburger span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
    background: var(--text);
}

/* ---------- Mobile / small screens ---------- */
/* Mobile: keep toggle button fixed at top-right of header while nav expands below */
@media (max-width: 720px) {
  /* make header a positioning container */
  .site-header {
    position: relative;           /* <-- needed for absolute positioning of toggle */
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;         /* tune to taste */
  }

  /* brand should get some right padding so it doesn't underlap the toggle */
  .site-header .brand {
    flex: 1 1 auto;
    padding-right: 3.25rem;       /* reserve space for the absolute toggle (tweak as needed) */
  }

  /* Absolute-position the toggle in the header so it visually stays put */
  .mobile-toggle {
    position: absolute;
    top: 0.75rem;                 /* distance from top of header — adjust to match your visual */
    right: 1rem;                  /* distance from right edge */
    z-index: 20;                  /* above the nav links */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0.25rem;
  }

  /* Keep the nav itself in the document flow and push main down */
  nav.primary {
    display: none;
    width: 100%;
    box-sizing: border-box;
    flex-direction: column;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(0,0,0,0.06);
    background: transparent;
  }

  nav.primary.open { display: flex; }

  nav.primary a {
    display: block;
    width: 100%;
    padding: 0.9rem 0.75rem;
    text-decoration: none;
    font-size: 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.03);
  }

  /* optional: prevent body scroll while nav open */
  body.nav-open { overflow: hidden; }

  /* ensure the toggle can animate despite the global reset */
  .mobile-toggle,
  .mobile-toggle .hamburger,
  .mobile-toggle .hamburger span {
    transition: transform 250ms ease, opacity 200ms ease !important;
    transform-origin: center center !important;
  }

  /* when open: bring bar 1 & 3 to the vertical center then rotate them */
  .mobile-toggle.open .hamburger span:nth-child(1),
  .mobile-toggle.open .hamburger span:nth-child(3) {
    top: 7.5px !important; /* move to center */
    transform: translateY(-50%) rotate(45deg) !important; /* rotate; translate centers vertically */
  }

  /* rotate the bottom bar the opposite direction */
  .mobile-toggle.open .hamburger span:nth-child(3) {
    transform: translateY(-50%) rotate(-45deg) !important;
  }

  /* hide middle bar */
  .mobile-toggle.open .hamburger span:nth-child(2) {
    opacity: 0 !important;
  }
}


/* ===== 3) Tappable targets, forms, and inputs adjustments ===== */
a,
.btn,
.project-card .card-link,
.skill,
nav.primary a {
    -webkit-tap-highlight-color: transparent;
}

input[type="search"],
input[type="text"],
select,
textarea {
    font-size: 1rem;
    padding: 10px 12px;
    border-radius: 10px;
}

/* projects filter responsive tweaks (allow search to grow) */
.projects-panel .filters {
    display: flex;
    gap: 12px;
    align-items: baseline;
}

.projects-panel .project-search {
    min-width: 140px;
    max-width: 520px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    font-weight: 500;
    font-size: 0.98rem;
    outline-offset: 2px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transition: box-shadow .12s, border-color .12s;
}

.projects-panel .project-search::-webkit-search-decoration,
.projects-panel .project-search::-webkit-search-cancel-button,
.projects-panel .project-search::-webkit-search-results-button,
.projects-panel .project-search::-webkit-search-results-decoration {
    -webkit-appearance: none;
}

.projects-panel .project-search:focus {
    box-shadow: 0 6px 22px rgba(124, 92, 255, 0.09);
    border-color: rgba(124, 92, 255, 0.18);
    outline: 2px solid rgba(124, 92, 255, 0.12);
}

.projects-panel .project-search::placeholder {
    color: rgba(182, 191, 208, 0.6);
}

.projects-panel .project-year {
    flex: 0 0 auto;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    font-weight: 500;
}

/* small-screen layout: stack filters */
@media (max-width: 480px) {
    .projects-panel .filters {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 10px;
        margin-left: 0px;
    }

    .projects-panel .project-search {
        max-width: 100%;
        width: 100%;
    }

    .projects-panel .project-year {
        width: 140px;
    }
}

/* ===== 4) Images/media responsiveness & photo frames ===== */
img,
picture,
video,
svg {
    max-width: 100%;
    height: auto;
    display: block;
}

@media (max-width: 520px) {
    :root {
        --photo-max-height: 360px;
        --glass-blur: 0px;
    }

    .photo-frame {
        padding: 8px;
    }

    .photo-img {
        max-height: var(--photo-max-height);
    }
}

/* ===== 5) Reduce heavy visual effects on small/low-power devices ===== */
@media (max-width: 520px) {

    .bg,
    .bg::before,
    .bg::after {
        filter: none;
        opacity: 0.85;
        animation: none !important;
    }

    header.site-header,
    .panel,
    .card {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        box-shadow: none;
    }
}

/* ===== 6) Card equalization & home page uniformity ===== */
.home .card-grid .card,
.index .card-grid .card {
    padding: 14px;
    border-radius: 12px;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* ===== 7) Accessibility: focus outlines and keyboard usability ===== */
a:focus,
button:focus,
.card:focus {
    outline: 3px solid rgba(124, 92, 255, 0.16);
    outline-offset: 2px;
    box-shadow: none !important;
}

body.nav-open nav.primary a:focus {
    background: rgba(124, 92, 255, 0.08);
    color: var(--text);
}

/* ===== 8) Prevent horizontal overflow due to long words/content ===== */
/* (already covered by html/body overflow-x hidden and word-wrap rules) */

/* ===== 9) Performance & reduced paint heuristics (duplicate small-screen rules merged) ===== */
/* covered by other mobile rules above */

/* ===== 10) Final small-screen spacing refinements ===== */
/* covered under the max-width:480px / 520px blocks above */

/* End of consolidated styles.css */

