/* ==========================================================================
   Design Tokens
   ========================================================================== */

:root {
    /* Brand colors */
    --color-brand:        #2b3494;
    --color-brand-light:  #5660b8;
    --color-brand-xlight: #878dd5;
    --color-accent:       #f59e0b;   /* amber CTA highlight */
    --color-accent-hover: #d97706;

    /* Neutrals */
    --color-text:         #1a1a2e;
    --color-text-muted:   #4a4a6a;
    --color-surface:      #ffffff;
    --color-surface-alt:  #f4f5fb;
    --color-border:       #e0e2f0;
    --color-bg:           #f4f5fb;

    /* Feedback */
    --color-company-bg:   #5660b8;
    --color-position-bg:  #c7caed;
    --color-row-alt:      #eef0fb;

    /* Typography */
    --font-body:    'Inter', system-ui, sans-serif;
    --font-heading: 'Sora', system-ui, sans-serif;

    --text-xs:   clamp(0.7rem,  1vw, 0.75rem);
    --text-sm:   clamp(0.8rem,  1.2vw, 0.875rem);
    --text-base: clamp(0.875rem,1.4vw, 1rem);
    --text-lg:   clamp(1rem,    1.6vw, 1.125rem);
    --text-xl:   clamp(1.125rem,2vw,   1.5rem);
    --text-2xl:  clamp(1.5rem,  3vw,   2rem);
    --text-3xl:  clamp(2rem,    4vw,   2.75rem);
    --text-hero: clamp(2.25rem, 5vw,   3.5rem);

    /* Spacing scale */
    --space-1:  0.25rem;
    --space-2:  0.5rem;
    --space-3:  0.75rem;
    --space-4:  1rem;
    --space-5:  1.25rem;
    --space-6:  1.5rem;
    --space-8:  2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* Elevation */
    --shadow-sm: 0 1px 3px rgba(43,52,148,.08), 0 1px 2px rgba(43,52,148,.06);
    --shadow-md: 0 4px 6px rgba(43,52,148,.10), 0 2px 4px rgba(43,52,148,.06);
    --shadow-lg: 0 10px 15px rgba(43,52,148,.10), 0 4px 6px rgba(43,52,148,.05);

    /* Radii */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-pill: 999px;

    /* Motion */
    --transition: 150ms ease;

    /* Layout */
    --header-height: 56px;
    --max-width: 1200px;
}


/* ==========================================================================
   Reset & Base
   ========================================================================== */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-brand-light);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover { color: var(--color-brand); }

/* Focus visible — keyboard accessibility (WCAG AA) */
:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}


/* ==========================================================================
   Buttons
   ========================================================================== */

.resume-printable-outer {
	display: flex;
    justify-content: flex-end;

	.printable {
      margin-left: auto;
      padding: 0 0.5rem;
      background: #f59e0b;
      color: #fff;
      border: none;
      border-radius: 4px;
      font-size: 0.875rem;
      font-weight: 600;
      cursor: pointer;
    }

    .printable:hover { background: #d97706; }

}



.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: background-color var(--transition), color var(--transition), border-color var(--transition);
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-text);
    border-color: var(--color-accent);
}

.btn-secondary {
    background-color: var(--color-brand);
    color: #fff;
    border-color: rgba(255,255,255,0.7);
}

.btn-primary:hover {
    background-color: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
    color: var(--color-text);
}

.btn-outline {
    background-color: transparent;
    color: #fff;
    border-color: rgba(255,255,255,0.7);
}

.btn-outline:hover {
    background-color: rgba(255,255,255,0.15);
    color: #fff;
    border-color: #fff;
}

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


/* ==========================================================================
   Header / Nav
   ========================================================================== */

#header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: var(--color-brand);
    padding: 0 var(--space-6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.header-brand {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
}

.header-brand:hover { color: var(--color-accent); }

#header nav ul {
    list-style: none;
    display: flex;
    gap: var(--space-6);
}

#header nav a {
    color: rgba(255,255,255,0.85);
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0.01em;
    padding: var(--space-2) 0;
    border-bottom: 2px solid transparent;
    transition: color var(--transition), border-color var(--transition);
}

#header nav a:hover {
    color: #fff;
    border-bottom-color: var(--color-accent);
}


/* ==========================================================================
   Hero Section
   ========================================================================== */

#hero {
    position: relative;
    background-image: url('hero_1.jpg');
    background-size: cover;
    background-position: center;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    text-align: center;
    overflow: hidden;
}

/* Gradient overlay */
#hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(43,52,148,.75) 0%, rgba(86,96,184,.55) 100%);
    z-index: 0;
}

#hero-main {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-rows: var(--header-height) auto 1fr auto auto;
    align-items: start;
}

#hero-top-gap { height: var(--header-height); }

#hero-top {
    padding-top: var(--space-6);
}

#hero-top h1 {
    font-family: var(--font-heading);
    font-size: var(--text-hero);
    font-weight: 800;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 12px rgba(0,0,0,.4);
    line-height: 1.1;
}

#hero-top p {
    font-size: var(--text-xl);
    color: rgba(255,255,255,.85);
    margin-top: var(--space-2);
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

#hero-middle {
    align-self: center;
    height: clamp(280px, 55vh, 480px);
}

/* Carousel */
.carousel-container {
    position: relative;
    width: 100vw;
    height: 100%;
    display: flex;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    list-style: none;
}

.carousel-container::-webkit-scrollbar { display: none; }

.carousel-slide {
    flex: 0 0 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: var(--space-4);
    scroll-snap-align: start;
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: 700;
    gap: var(--space-4);
    text-shadow: 0 1px 4px rgba(0,0,0,.5);
}

.carousel-slide .image {
    max-height: clamp(180px, 40vh, 340px);
    width: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

/* Carousel controls */
#hero-control {
    padding: var(--space-4) 0 var(--space-6);
}

.carousel-control-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
}

.carousel-control {
    background: transparent;
    border: 2px solid rgba(255,255,255,.6);
    color: #fff;
    font-size: var(--text-xl);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition), border-color var(--transition);
    line-height: 1;
}

.carousel-control:hover {
    background-color: rgba(255,255,255,.2);
    border-color: #fff;
}

.carousel-control-left { visibility: hidden; } /* hidden on initial load */


/* ==========================================================================
   Experience / Logo Strip
   ========================================================================== */

.logo-strip-section {
    background-color: var(--color-surface);
    padding: var(--space-6) 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.section-label {
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    text-align: center;
    margin-bottom: var(--space-4);
}

.slider-container {
    width: 100%;
    height: 72px;
    overflow: hidden;
}

.slider {
    height: 100%;
    overflow: hidden;
}

.slider ul {
    display: flex;
    width: 200%;
    align-items: center;
    justify-content: space-evenly;
    list-style: none;
    height: 100%;
    animation: scroll-logo 18s linear infinite;
}

.slider ul li img {
    height: 52px;
    width: auto;
    max-width: 120px;
    filter: grayscale(0.3);
    opacity: 0.8;
    transition: opacity var(--transition), filter var(--transition);
}

.slider ul li img:hover {
    filter: none;
    opacity: 1;
}

@keyframes scroll-logo {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}


/* ==========================================================================
   Page Hero (non-homepage pages)
   ========================================================================== */

.page-hero {
    margin-top: var(--header-height);
    background: linear-gradient(135deg, var(--color-brand) 0%, var(--color-brand-light) 100%);
    color: #fff;
    padding: var(--space-12) var(--space-6);
    text-align: center;
}

.page-hero h1 {
    font-family: var(--font-heading);
    font-size: var(--text-3xl);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.page-hero p {
    margin-top: var(--space-3);
    font-size: var(--text-lg);
    color: rgba(255,255,255,.8);
}


/* ==========================================================================
   Main Content
   ========================================================================== */

#content {
    max-width: var(--max-width);
    margin: var(--space-8) auto;
    padding: 0 var(--space-4);
}

/* Generic content card */
.content-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    box-shadow: var(--shadow-sm);
}

.content-card h2 {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--color-brand);
    margin-bottom: var(--space-4);
}

.content-card p {
    font-size: var(--text-base);
    color: var(--color-text-muted);
    line-height: 1.7;
    margin-bottom: var(--space-4);
}


/* ==========================================================================
   Contact Page
   ========================================================================== */

.contact-card {
    max-width: 600px;
    margin: var(--space-8) auto;
}

.contact-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin-top: var(--space-6);
}

.contact-list li {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-base);
    color: var(--color-text);
}

.contact-list svg {
    flex-shrink: 0;
    color: var(--color-brand-light);
}

.contact-list a {
    color: var(--color-brand);
    font-weight: 500;
}

.contact-list a:hover { color: var(--color-accent-hover); }


/* ==========================================================================
   Resume Page
   ========================================================================== */

.resume-page {
    margin-top: var(--header-height);
}

/* Filter panel */
.resume-filter-panel {
    position: sticky;
    top: var(--header-height);
    z-index: 50;
    background: var(--color-brand-light);
    padding: var(--space-3) var(--space-4);
    box-shadow: var(--shadow-md);
    max-width: var(--max-width);
	margin-left: auto;
	margin-right: auto;
}

.filter-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
}

.resume-filter-panel h3 {
    font-family: var(--font-heading);
    color: #fff;
    font-size: var(--text-base);
}

.filter-tab-bar {
    display: flex;
    gap: var(--space-1);
}

.filter-tab {
    padding: 3px var(--space-3);
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}

.filter-tab:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.6);
}

.filter-tab.active {
    background: #fff;
    color: var(--color-brand);
    border-color: #fff;
}

.filter-grid {
    display: grid;
    grid-template-columns: auto repeat(3, 1fr);
    gap: var(--space-2);
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: var(--space-2);
    box-shadow: var(--shadow-sm);
}

.filter-grid .filter-all {
    grid-row: span 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color var(--transition);
    font-size: var(--text-sm);
    font-weight: 500;
    user-select: none;
    overflow: hidden;
	background-color: aliceblue;
	border-radius: 15px;
	border: 1px solid lightblue;
}

.filter-option:has(input:checked) {
    background-color: var(--color-surface-alt);
    outline: 2px solid var(--color-brand-light);
    font-weight: 700;
}

.filter-option img {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.filter-option input[type="radio"] {
    appearance: none;
    width: 0;
    height: 0;
    position: absolute;
}

/* ── Tools filter: pill layout ─────────────────────────── */
.filter-tools {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    padding: var(--space-2);
    box-shadow: var(--shadow-sm);
    margin-top: var(--space-2);
    display: flex;
    flex-direction: row;
    gap: var(--space-2);
	overflow: scroll;
}

.filter-tools-header {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tool-cat-group {
    display: flex;
    flex-wrap: wrap;
    align-items: start;
    gap: var(--space-1);
	border-radius: 15px;
	background-color: floralwhite;
}

.tool-cat-pill,
.tool-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px var(--space-3);
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: background-color var(--transition), border-color var(--transition), color var(--transition);
    background: rgba(245, 158, 11, 0.1);
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.tool-cat-pill {
    font-weight: 700;
    background: rgba(245, 158, 11, 0.2);
}

.tool-cat-pill:has(input:checked),
.tool-pill:has(input:checked) {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent-hover);
}

.tool-cat-pill input[type="radio"],
.tool-pill input[type="radio"] {
    appearance: none;
    width: 0;
    height: 0;
    position: absolute;
}

.tool-pill img {
    width: 14px;
    height: 14px;
}

/* Resume content area */
.resume-content {
    max-width: var(--max-width);
    margin: var(--space-4) auto;
    padding: 0 var(--space-4) var(--space-12);
}

/* Company card */
.company-card {
    margin-bottom: var(--space-8);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
}

.company-header {
    background: var(--color-brand-light);
    color: #fff;
    padding: var(--space-4) var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.company-header img {
    height: 32px;
    width: auto;
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 2px 4px;
}

.company-header h2 {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: 700;
}

/* Position block */
.position-block {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
}

.position-header {
    background: var(--color-position-bg);
    padding: var(--space-3) var(--space-6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.position-title {
    font-family: var(--font-heading);
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--color-brand);
}

.position-dates {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    font-weight: 500;
}

/* Skills & tools badges */
.badge-group {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    padding: var(--space-3) var(--space-6);
    background: var(--color-surface-alt);
    border-top: 1px solid var(--color-border);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px var(--space-3);
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: 500;
    white-space: nowrap;
}

.badge-skill {
    background: rgba(43,52,148,.1);
    color: var(--color-brand);
    border: 1px solid rgba(43,52,148,.2);
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.badge-skill.badge--active {
    background: var(--color-brand);
    color: #fff;
    border-color: var(--color-brand);
}

.badge-tool {
    background: rgba(245,158,11,.1);
    color: #92400e;
    border: 1px solid rgba(245,158,11,.25);
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.badge-tool.badge--active {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

.badge img {
    width: 14px;
    height: 14px;
}

/* Bullet rows */
.bullet-list {
    list-style: none;
}

.bullet-item {
    padding: var(--space-3) var(--space-6);
    border-top: 1px solid var(--color-border);
    font-size: var(--text-base);
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    transition: opacity 200ms ease, max-height 200ms ease;
}

.bullet-item::before {
    content: '▸';
    color: var(--color-brand-light);
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 0.7em;
}

.bullet-item.hidden {
    display: none;
}

/* Hidden tag cell (for JS filtering) */
.td-tag { display: none; }

/* Resume table (keeping the existing table for JS compatibility) */
.resume-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table.resume {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
}

table.resume th {
    background: var(--color-text);
    color: #fff;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-heading);
    font-size: var(--text-sm);
    font-weight: 700;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 5;
    white-space: nowrap;
    border: 2px solid var(--color-surface);
}

table.resume td {
    border: 1px solid var(--color-border);
    padding: var(--space-3) var(--space-4);
    vertical-align: top;
    font-size: var(--text-sm);
}

table.resume td.visible {
    padding: var(--space-3) var(--space-4) var(--space-3) var(--space-6);
}

table.resume .company {
    background: var(--color-brand-light);
    color: #fff;
    padding: var(--space-3) var(--space-4);
    font-weight: 700;
    position: sticky;
    top: 38px;
    z-index: 4;
}

table.resume .company .company-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

table.resume .company img {
    height: 24px;
    width: auto;
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 2px 4px;
}

table.resume .position {
    background: var(--color-position-bg);
    font-weight: 600;
    color: var(--color-brand);
    position: sticky;
    top: calc(38px + 2.2rem);
    z-index: 4;
}

table.resume .from-to {
    background: var(--color-row-alt);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
}

table.resume .skills,
table.resume .tools {
    background: var(--color-surface);
    vertical-align: top;
    width: 40px;
    padding: var(--space-2);
}

table.resume .skills-img,
table.resume .tools-img {
    position: sticky;
    top: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
}

table.resume .skills-tools {
    max-height: 28px;
    max-width: 36px;
    width: auto;
    height: auto;
}

/* Alternating bullet rows */
table.resume tr:nth-child(even) td.visible {
    background-color: var(--color-row-alt);
}


/* ==========================================================================
   About Page
   ========================================================================== */

.about-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--space-8);
    align-items: start;
    margin: var(--space-8) auto;
    max-width: var(--max-width);
    padding: 0 var(--space-4);
}

.about-photo-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
}

.about-photo {
    width: 100%;
    max-width: 280px;
    aspect-ratio: 3/4;
    border-radius: var(--radius-lg);
    object-fit: cover;
    box-shadow: var(--shadow-lg);
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
}

.about-photo-placeholder {
    width: 100%;
    max-width: 280px;
    aspect-ratio: 3/4;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--color-brand) 0%, var(--color-brand-xlight) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 800;
    color: rgba(255,255,255,0.9);
    box-shadow: var(--shadow-lg);
}

.about-bio {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.about-bio h2 {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: 800;
    color: var(--color-brand);
    margin-bottom: var(--space-6);
    letter-spacing: -0.02em;
}

.about-bio p {
    font-size: var(--text-base);
    line-height: 1.8;
    color: var(--color-text-muted);
    margin-bottom: var(--space-5);
}

.expertise-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-6);
}

.expertise-tag {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-pill);
    background: rgba(43,52,148,.08);
    color: var(--color-brand);
    font-size: var(--text-sm);
    font-weight: 600;
    border: 1px solid rgba(43,52,148,.15);
}


/* ==========================================================================
   About-Site Page
   ========================================================================== */

.site-page {
    max-width: var(--max-width);
    margin: var(--space-8) auto;
    padding: 0 var(--space-4) var(--space-12);
}

.tech-stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-top: var(--space-6);
}

.tech-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: transform var(--transition), box-shadow var(--transition);
}

.tech-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.tech-card h3 {
    font-family: var(--font-heading);
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--color-brand);
    margin-bottom: var(--space-2);
}

.tech-card p {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    line-height: 1.5;
}

.architecture-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-8);
    margin-top: var(--space-8);
    box-shadow: var(--shadow-sm);
}

.architecture-section h2 {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--color-brand);
    margin-bottom: var(--space-6);
}

.architecture-section p,
.architecture-section li {
    font-size: var(--text-base);
    color: var(--color-text-muted);
    line-height: 1.8;
    margin-bottom: var(--space-3);
}

.architecture-section ul {
    padding-left: var(--space-6);
}

.arch-diagram {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-6);
    margin: var(--space-6) 0;
    font-family: monospace;
    font-size: var(--text-sm);
    line-height: 2;
    color: var(--color-text);
    overflow-x: auto;
}


/* ==========================================================================
   Footer
   ========================================================================== */

#footer {
    background: var(--color-brand);
    color: rgba(255,255,255,.7);
    padding: var(--space-6) var(--space-6);
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
}

.footer-links {
    display: flex;
    gap: var(--space-4);
}

.footer-links a {
    color: rgba(255,255,255,.6);
    transition: color var(--transition);
}

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


/* ==========================================================================
   Portfolio
   ========================================================================== */

.portfolio-subnav {
    position: sticky;
    top: var(--header-height);
    z-index: 50;
    background: var(--color-brand-light);
    display: flex;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-6);
    box-shadow: var(--shadow-md);
    flex-wrap: wrap;
}

.portfolio-subnav-link {
    color: rgba(255, 255, 255, .75);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: var(--text-sm);
    padding: var(--space-1) var(--space-4);
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, .3);
    text-decoration: none;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.portfolio-subnav-link:hover,
.portfolio-subnav-link.is-active {
    background: rgba(255, 255, 255, .2);
    color: #fff;
    border-color: rgba(255, 255, 255, .7);
}

.portfolio-page {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-8) var(--space-6);
}

.portfolio-category {
    margin-bottom: var(--space-12);
    scroll-margin-top: calc(var(--header-height) + 52px);
}

.portfolio-category-heading {
    display: inline-block;
    font-family: 'Sora', sans-serif;
    font-weight: 800;
    font-size: var(--text-2xl);
    color: var(--color-accent);
    border-bottom: 3px solid var(--color-accent);
    padding-bottom: var(--space-1);
    margin-bottom: var(--space-6);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
}

.portfolio-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    cursor: pointer;
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
}

.portfolio-card:hover,
.portfolio-card:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
    outline: none;
}

.portfolio-card:focus-visible {
    outline: 2px solid var(--color-brand);
    outline-offset: 2px;
}

.portfolio-card-img-wrap {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--color-surface-alt);
}

.portfolio-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.portfolio-card:hover .portfolio-card-img {
    transform: scale(1.04);
}

.portfolio-card-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-4);
    flex: 1;
}

.portfolio-card-title {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: var(--text-base);
    color: var(--color-brand);
    margin: 0;
}

.portfolio-card-desc {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    flex: 1;
    margin: 0;
}

.portfolio-card-tools {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    margin-top: var(--space-2);
}

.portfolio-tool-badge {
    display: inline-block;
    padding: 2px var(--space-2);
    background: rgba(245, 158, 11, .12);
    color: #b8860b;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 500;
    white-space: nowrap;
}

.portfolio-tool-badge--lg {
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-sm);
}

/* Modal */

.portfolio-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.portfolio-modal[hidden] {
    display: none;
}

.portfolio-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    cursor: pointer;
}

.portfolio-modal-panel {
    position: relative;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    max-width: 680px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.portfolio-modal-close {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    border: none;
    background: var(--color-surface-alt);
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-base);
    z-index: 1;
    transition: background var(--transition), color var(--transition);
}

.portfolio-modal-close:hover {
    background: var(--color-brand);
    color: #fff;
}

.portfolio-modal-img-wrap {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: var(--color-surface-alt);
}

.portfolio-modal-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portfolio-modal-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding: var(--space-6);
}

.portfolio-modal-title {
    font-family: 'Sora', sans-serif;
    font-weight: 800;
    font-size: var(--text-xl);
    color: var(--color-brand);
    padding-right: var(--space-8);
    margin: 0;
}

.portfolio-modal-body {
    line-height: 1.8;
    color: var(--color-text-muted);
    margin: 0;
}

.portfolio-modal-tools {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border);
}

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

@media (max-width: 768px) {
    #header {
        padding: 0 var(--space-4);
    }

    #header nav ul {
        gap: var(--space-4);
    }

    #header nav a {
        font-size: var(--text-xs);
    }

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

    .about-photo-placeholder,
    .about-photo {
        max-width: 200px;
        margin: 0 auto;
        aspect-ratio: 1;
    }

    .filter-grid {
        grid-template-columns: auto repeat(2, 1fr);
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }

    table.resume .skills,
    table.resume .tools {
        width: 28px;
    }

    table.resume .skills-tools {
        max-height: 22px;
        max-width: 28px;
    }

    table.resume th,
    table.resume td {
        font-size: var(--text-xs);
        padding: var(--space-2);
    }

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

@media (max-width: 480px) {
    .header-brand { font-size: var(--text-base); }

    #header nav ul { gap: var(--space-3); }

    .carousel-control-group {
        gap: var(--space-2);
    }

    .btn {
        padding: var(--space-2) var(--space-4);
        font-size: var(--text-sm);
    }

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

    .filter-grid .filter-all {
        grid-column: span 2;
        grid-row: span 1;
    }

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

    .portfolio-modal-content {
        padding: var(--space-4);
    }
}
