:root {
    color-scheme: light;
    --bg: #f4f7fb;
    --surface: #fbfcfe;
    --surface-strong: #ffffff;
    --surface-tint: #eef3ff;
    --text: #172033;
    --text-soft: #526079;
    --text-faint: #748096;
    --primary: #3158c8;
    --primary-dark: #2444a3;
    --primary-soft: #e8eeff;
    --accent: #0e776c;
    --accent-soft: #e5f5f2;
    --border: #dbe3ef;
    --border-strong: #c9d4e3;
    --shadow-sm: 0 8px 24px rgba(35, 53, 84, 0.07);
    --shadow-md: 0 20px 50px rgba(35, 53, 84, 0.11);
    --shadow-lg: 0 30px 80px rgba(35, 53, 84, 0.15);
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 30px;
    --header-height: 76px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.7;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body.nav-open,
body.modal-open {
    overflow: hidden;
}

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

button,
input,
textarea,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

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

a:focus-visible,
button:focus-visible {
    outline: 3px solid rgba(49, 88, 200, 0.32);
    outline-offset: 4px;
}

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

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 10000;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    background: var(--text);
    color: #fff;
    transform: translateY(-160%);
    transition: transform 0.2s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.container {
    width: min(1180px, calc(100% - 48px));
    margin-inline: auto;
}

.floating-shapes {
    position: absolute;
    inset: 0 0 auto;
    z-index: 0;
    height: 100vh;
    overflow: hidden;
    pointer-events: none;
}

.shape {
    position: absolute;
    border: 1px solid rgba(49, 88, 200, 0.1);
    border-radius: 50%;
    background: rgba(49, 88, 200, 0.045);
    animation: float 18s ease-in-out infinite;
}

.shape:nth-child(1) {
    width: 220px;
    height: 220px;
    top: 12%;
    left: -70px;
}

.shape:nth-child(2) {
    width: 320px;
    height: 320px;
    top: 30%;
    right: -150px;
    animation-delay: -6s;
}

.shape:nth-child(3) {
    width: 110px;
    height: 110px;
    top: 72%;
    left: 42%;
    animation-delay: -11s;
}

/* Header and navigation */
header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 1000;
    height: var(--header-height);
    border-bottom: 1px solid transparent;
    background: rgba(244, 247, 251, 0.84);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

header.is-scrolled {
    border-color: rgba(201, 212, 227, 0.75);
    background: rgba(251, 252, 254, 0.95);
    box-shadow: 0 8px 30px rgba(35, 53, 84, 0.06);
}

nav {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo a,
.footer-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 15px;
    background: var(--primary);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    box-shadow: 0 10px 22px rgba(49, 88, 200, 0.18);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
}

.nav-links a {
    display: block;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    color: var(--text-soft);
    font-size: 0.93rem;
    font-weight: 650;
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-links a:hover,
.nav-links a.is-active {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-strong);
    color: var(--text);
    cursor: pointer;
}

.nav-toggle-line {
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-of-type(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-of-type(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-of-type(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Hero */
.hero {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    min-height: 760px;
    padding: calc(var(--header-height) + 72px) 0 88px;
    background:
        radial-gradient(circle at 8% 18%, rgba(49, 88, 200, 0.09), transparent 29%),
        radial-gradient(circle at 88% 30%, rgba(14, 119, 108, 0.07), transparent 26%),
        linear-gradient(180deg, #f7f9fd 0%, var(--bg) 100%);
}

.hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr);
    align-items: center;
    gap: clamp(3rem, 7vw, 7rem);
}

.hero-layout > *,
.about-grid > *,
.projects-grid > *,
.education-grid > * {
    min-width: 0;
}

.hero-content {
    max-width: 690px;
    animation: rise-in 0.65s ease both;
}

.eyebrow,
.section-kicker {
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.35rem;
}

.eyebrow span {
    width: 30px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
}

.hero-content h1 {
    max-width: 680px;
    color: var(--text);
    font-size: clamp(3.1rem, 6.4vw, 5.35rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
    overflow-wrap: break-word;
}

.hero-content h2 {
    margin-top: 1.5rem;
    color: var(--primary);
    font-size: clamp(1.25rem, 2.2vw, 1.7rem);
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.hero-content > p:not(.eyebrow) {
    max-width: 620px;
    margin-top: 1.25rem;
    color: var(--text-soft);
    font-size: 1.08rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 2rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    min-height: 48px;
    padding: 0.75rem 1.2rem;
    border: 1px solid transparent;
    border-radius: 13px;
    font-size: 0.94rem;
    font-weight: 750;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 12px 28px rgba(49, 88, 200, 0.22);
}

.button-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 16px 32px rgba(49, 88, 200, 0.26);
}

.button-secondary {
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.75);
    color: var(--text);
}

.button-secondary:hover {
    border-color: #aabbd5;
    background: var(--surface-strong);
}

.hero-specialties {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem 1.15rem;
    margin-top: 2rem;
    color: var(--text-faint);
    font-size: 0.88rem;
    font-weight: 650;
    list-style: none;
}

.hero-specialties li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-specialties li::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.hero-visual {
    position: relative;
    justify-self: end;
    width: min(100%, 430px);
    animation: rise-in 0.7s 0.1s ease both;
}

.portrait-frame {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 5;
    padding: 10px;
    border: 1px solid rgba(49, 88, 200, 0.18);
    border-radius: 38px;
    background: rgba(255, 255, 255, 0.65);
    box-shadow: var(--shadow-lg);
}

.portrait-frame::before {
    content: "";
    position: absolute;
    inset: 10px;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 29px;
    pointer-events: none;
}

.portrait-frame img {
    width: 100%;
    height: 100%;
    border-radius: 29px;
    object-fit: cover;
    object-position: center top;
}

.current-role-card {
    position: absolute;
    right: 18px;
    bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    max-width: min(300px, calc(100% - 36px));
    padding: 1rem 1.15rem;
    border: 1px solid rgba(201, 212, 227, 0.9);
    border-radius: 16px;
    background: rgba(251, 252, 254, 0.94);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(14px);
}

.status-dot {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    margin-top: 0.45rem;
    border: 3px solid #caebe6;
    border-radius: 50%;
    background: var(--accent);
    box-sizing: content-box;
}

.current-role-card span:not(.status-dot) {
    display: block;
    color: var(--text-faint);
    font-size: 0.73rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.current-role-card strong {
    display: block;
    margin-top: 0.2rem;
    color: var(--text);
    font-size: 0.92rem;
    line-height: 1.35;
}

/* Shared sections */
.section {
    position: relative;
    padding: 104px 0;
}

#about,
#projects {
    background: var(--surface);
}

#experience,
#education {
    background: var(--bg);
}

.section-heading {
    max-width: 740px;
    margin-bottom: 3rem;
}

.section-heading h2 {
    margin-top: 0.55rem;
    color: var(--text);
    font-size: clamp(2.15rem, 4vw, 3.3rem);
    line-height: 1.08;
    letter-spacing: -0.045em;
}

.section-heading > p:last-child:not(.section-kicker) {
    max-width: 640px;
    margin-top: 1rem;
    color: var(--text-soft);
    font-size: 1.02rem;
}

/* About */
.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    align-items: start;
    gap: clamp(2rem, 6vw, 5rem);
}

.about-text h3 {
    margin-bottom: 1.2rem;
    color: var(--text);
    font-size: 1.45rem;
    letter-spacing: -0.025em;
}

.about-text p {
    margin-bottom: 1.15rem;
    color: var(--text-soft);
    font-size: 1.02rem;
}

.about-text p:last-child {
    margin-bottom: 0;
}

.about-panel {
    padding: 2rem;
    border: 1px solid #cfdaee;
    border-radius: var(--radius-md);
    background: linear-gradient(145deg, #edf2ff 0%, #f8fbff 100%);
    box-shadow: var(--shadow-sm);
}

.about-panel-label,
.education-label {
    color: var(--primary-dark);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.about-panel h3 {
    margin-top: 0.65rem;
    color: var(--text);
    font-size: 1.3rem;
    line-height: 1.35;
}

.focus-list {
    display: grid;
    gap: 0.85rem;
    margin-top: 1.35rem;
    color: var(--text-soft);
    list-style: none;
}

.focus-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
}

.focus-list i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    margin-top: 0.08rem;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.65rem;
}

.contact-list {
    display: grid;
    gap: 0.35rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #d3dff1;
}

.contact-list a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: fit-content;
    padding: 0.35rem 0;
    color: var(--primary-dark);
    font-size: 0.92rem;
    font-weight: 700;
}

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

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

.skill-category {
    padding: 1.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-strong);
    box-shadow: 0 8px 26px rgba(35, 53, 84, 0.045);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.skill-category:hover {
    transform: translateY(-3px);
    border-color: #becbe0;
    box-shadow: var(--shadow-sm);
}

.skill-category h4 {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1rem;
    color: var(--text);
    font-size: 0.98rem;
}

.skill-category h4 i {
    color: var(--primary);
}

.skill-tags,
.tech-stack,
.experience-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.skill-tag,
.tech-tag,
.experience-highlights span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0.3rem 0.65rem;
    border: 1px solid #dce4f1;
    border-radius: 999px;
    background: #f3f6fa;
    color: #45536a;
    font-size: 0.76rem;
    font-weight: 650;
}

/* Experience */
.experience-timeline {
    position: relative;
    max-width: 920px;
    margin-left: auto;
    padding-left: 2.2rem;
}

.experience-timeline::before {
    content: "";
    position: absolute;
    inset: 1rem auto 1rem 0.5rem;
    width: 2px;
    border-radius: 2px;
    background: #cdd8e8;
}

.experience-card {
    position: relative;
    margin-bottom: 1.25rem;
    padding: 1.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-strong);
    box-shadow: 0 10px 30px rgba(35, 53, 84, 0.055);
}

.experience-card:last-child {
    margin-bottom: 0;
}

.experience-card.current-role {
    border-color: #c4d2f0;
    box-shadow: 0 14px 36px rgba(49, 88, 200, 0.09);
}

.experience-marker {
    position: absolute;
    top: 2.1rem;
    left: -2.25rem;
    width: 14px;
    height: 14px;
    border: 3px solid var(--bg);
    border-radius: 50%;
    background: #8fa1bd;
    box-shadow: 0 0 0 1px #b7c4d8;
}

.current-role .experience-marker {
    background: var(--primary);
    box-shadow: 0 0 0 1px #92a9e2, 0 0 0 6px var(--primary-soft);
}

.experience-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 0.8rem;
}

.experience-heading h3 {
    color: var(--text);
    font-size: 1.2rem;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.experience-heading h4 {
    margin-top: 0.2rem;
    color: var(--primary);
    font-size: 0.92rem;
}

.experience-date {
    flex: 0 0 auto;
    padding: 0.32rem 0.7rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 0.76rem;
    font-weight: 750;
}

.experience-card > p {
    margin-bottom: 1rem;
    color: var(--text-soft);
    font-size: 0.95rem;
}

.experience-highlights span {
    border-color: #d2def3;
    background: #f0f4fd;
    color: #36528f;
}

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

.project-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-strong);
    box-shadow: 0 10px 30px rgba(35, 53, 84, 0.055);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.project-card:hover {
    transform: translateY(-4px);
    border-color: #bdcbe0;
    box-shadow: var(--shadow-md);
}

.project-card.featured-project {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(260px, 0.82fr) minmax(0, 1.18fr);
    border-color: #c8d5ef;
    box-shadow: 0 18px 46px rgba(49, 88, 200, 0.09);
}

.projects-grid > .project-card:last-child {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(260px, 0.82fr) minmax(0, 1.18fr);
}

.projects-grid > .project-card:last-child .project-header {
    display: flex;
    min-height: 100%;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid var(--border);
    border-bottom: 0;
}

.project-header {
    min-height: 155px;
    padding: 1.65rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(145deg, #f3f6fc 0%, #eef3fb 100%);
}

.featured-project .project-header {
    display: flex;
    min-height: 100%;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid #d4def0;
    border-bottom: 0;
    background:
        radial-gradient(circle at 90% 10%, rgba(14, 119, 108, 0.1), transparent 32%),
        linear-gradient(145deg, #eaf0ff 0%, #f4f7ff 100%);
}

.project-header h3 {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    color: var(--text);
    font-size: 1.17rem;
    line-height: 1.35;
    letter-spacing: -0.02em;
}

.project-header h3 i {
    margin-top: 0.16rem;
    color: var(--primary);
}

.project-header > p {
    margin-top: 0.7rem;
    color: var(--text-soft);
    font-size: 0.9rem;
    line-height: 1.55;
}

.project-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1.65rem;
}

.project-content > p {
    margin-bottom: 1.25rem;
    color: var(--text-soft);
    font-size: 0.94rem;
}

.tech-stack {
    margin-bottom: 1.4rem;
}

.tech-tag {
    border-color: #d4def2;
    background: #eef3ff;
    color: #38538d;
}

.project-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.7rem;
    margin-top: auto;
}

.project-link,
.preview-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 40px;
    padding: 0.55rem 0.85rem;
    border: 1px solid #c8d4e6;
    border-radius: 10px;
    background: var(--surface-strong);
    color: var(--primary-dark);
    font-size: 0.83rem;
    font-weight: 750;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.project-link:hover,
.preview-button:hover {
    transform: translateY(-1px);
    border-color: #9fb1cf;
    background: var(--primary-soft);
    color: var(--primary-dark);
}

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

.education-card,
.certification-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1.25rem;
    padding: 2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-strong);
    box-shadow: var(--shadow-sm);
}

.education-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 1.1rem;
}

.education-card h3,
.certification-card h3 {
    margin-top: 0.35rem;
    color: var(--text);
    font-size: 1.2rem;
    line-height: 1.35;
}

.education-card h4 {
    margin-top: 0.35rem;
    color: var(--text-soft);
    font-size: 0.9rem;
}

.education-date {
    margin-top: 1rem;
    color: var(--text-faint);
    font-size: 0.88rem;
}

.education-date i {
    margin-right: 0.35rem;
}

.honor {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.75rem;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 750;
}

.certification-card ul {
    display: grid;
    gap: 0.65rem;
    margin-top: 1rem;
    color: var(--text-soft);
    font-size: 0.9rem;
    list-style: none;
}

.certification-card li {
    position: relative;
    padding-left: 1rem;
}

.certification-card li::before {
    content: "";
    position: absolute;
    top: 0.72em;
    left: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
}

/* Modals */
.modal {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: none;
    place-items: center;
    padding: 2rem;
    background: rgba(17, 28, 48, 0.72);
    backdrop-filter: blur(8px);
}

.modal.is-open {
    display: grid;
}

.modal-content {
    position: relative;
    width: min(1040px, 100%);
    max-height: calc(100vh - 4rem);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 24px;
    background: var(--surface-strong);
    box-shadow: 0 35px 100px rgba(10, 20, 38, 0.32);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: #f3f6fb;
}

.modal-header h3 {
    color: var(--text);
    font-size: 1.15rem;
}

.modal-header h3 i {
    margin-right: 0.45rem;
    color: var(--primary);
}

.close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-strong);
    color: var(--text-soft);
    font-size: 1.55rem;
    line-height: 1;
    cursor: pointer;
}

.close:hover {
    border-color: var(--border-strong);
    color: var(--text);
}

.modal-body {
    max-height: calc(100vh - 10rem);
    overflow-y: auto;
    padding: 1.75rem;
    overscroll-behavior: contain;
}

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

.preview-item {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: #f8fafc;
}

.preview-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 220px;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    background: #edf2f8;
    color: var(--primary);
    font-size: 2.5rem;
}

.preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.preview-caption {
    padding: 1rem;
}

.preview-caption h4 {
    color: var(--text);
    font-size: 0.98rem;
}

.preview-caption p {
    margin-top: 0.35rem;
    color: var(--text-soft);
    font-size: 0.84rem;
}

.feature-list,
.technical-panel {
    margin-top: 1.25rem;
    padding: 1.4rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #f7f9fc;
}

.feature-list h4,
.technical-panel h4 {
    margin-bottom: 0.8rem;
    color: var(--text);
}

.feature-list ul {
    display: grid;
    gap: 0.45rem;
    color: var(--text-soft);
    font-size: 0.88rem;
    list-style: none;
}

.feature-list li {
    position: relative;
    padding-left: 1.15rem;
}

.feature-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 800;
}

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

.technical-panel {
    border-color: #ccd8ee;
    background: #eef3ff;
    color: var(--text-soft);
}

.technical-panel > p {
    margin-bottom: 1rem;
}

.technical-grid > div {
    padding: 0.9rem;
    border: 1px solid #d4def1;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.62);
    color: var(--text-soft);
    font-size: 0.85rem;
}

.technical-grid strong {
    color: var(--primary-dark);
}

/* Footer */
footer {
    padding: 72px 0 28px;
    background: #17233a;
    color: #dce4f1;
}

.footer-content {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
    gap: 3rem;
}

.footer-logo {
    margin-bottom: 1.5rem;
    background: #e7edff;
    color: var(--primary-dark);
    box-shadow: none;
}

.footer-intro h2 {
    color: #f6f8fc;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.footer-intro p {
    margin-top: 0.85rem;
    color: #aab6c9;
}

.footer-contact {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-top: 0.7rem;
}

.footer-contact > p {
    margin-bottom: 0.8rem;
    color: #91a0b7;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.footer-contact > a {
    padding: 0.25rem 0;
    color: #eef2f8;
    font-size: 0.92rem;
}

.footer-contact > a:hover {
    color: #b9c8ff;
}

.social-links {
    display: flex;
    gap: 0.6rem;
    margin-top: 1.2rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: #eef2f8;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.social-links a:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.1);
}

.footer-bottom {
    grid-column: 1 / -1;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #8795aa;
    font-size: 0.82rem;
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translate3d(0, 0, 0);
    }
    50% {
        transform: translate3d(0, -18px, 0);
    }
}

/* Responsive */
@media (max-width: 1040px) {
    .hero-layout {
        grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr);
        gap: 3.5rem;
    }

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

    .skill-category:last-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 820px) {
    :root {
        --header-height: 70px;
    }

    .container {
        width: min(100% - 36px, 720px);
    }

    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: absolute;
        top: calc(100% + 10px);
        right: 0;
        left: 0;
        display: grid;
        gap: 0.2rem;
        padding: 0.75rem;
        border: 1px solid var(--border);
        border-radius: 16px;
        background: rgba(251, 252, 254, 0.98);
        box-shadow: var(--shadow-md);
        opacity: 0;
        pointer-events: none;
        transform: translateY(-8px);
        transition: opacity 0.2s ease, transform 0.2s ease;
    }

    .nav-links.is-open {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .nav-links a {
        padding: 0.8rem 0.9rem;
    }

    .hero {
        min-height: auto;
        padding: calc(var(--header-height) + 64px) 0 80px;
    }

    .hero-layout {
        grid-template-columns: 1fr;
        gap: 3.5rem;
    }

    .hero-content {
        max-width: 680px;
    }

    .hero-visual {
        justify-self: center;
        width: min(100%, 390px);
    }

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

    .project-card.featured-project {
        display: flex;
    }

    .projects-grid > .project-card:last-child {
        display: flex;
        grid-column: auto;
    }

    .projects-grid > .project-card:last-child .project-header {
        min-height: 155px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .featured-project .project-header {
        min-height: 170px;
        border-right: 0;
        border-bottom: 1px solid #d4def0;
    }

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

@media (max-width: 680px) {
    .section {
        padding: 78px 0;
    }

    .section-heading {
        margin-bottom: 2.2rem;
    }

    .hero-content h1 {
        font-size: clamp(2.8rem, 13vw, 4rem);
    }

    .hero-content,
    .eyebrow,
    .hero-specialties {
        max-width: 100%;
    }

    .hero-specialties {
        gap: 0.55rem 0.9rem;
    }

    .current-role-card {
        right: 12px;
        bottom: 24px;
        max-width: calc(100% - 24px);
    }

    .skills-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .skill-category:last-child,
    .project-card.featured-project {
        grid-column: auto;
    }

    .experience-timeline {
        padding-left: 1.55rem;
    }

    .experience-timeline::before {
        left: 0.28rem;
    }

    .experience-marker {
        left: -1.63rem;
    }

    .experience-heading {
        flex-direction: column;
        gap: 0.6rem;
    }

    .experience-date {
        width: fit-content;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-bottom {
        grid-column: auto;
    }

    .modal {
        padding: 0.8rem;
    }

    .modal-content {
        max-height: calc(100vh - 1.6rem);
        border-radius: 18px;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-header h3 {
        font-size: 1rem;
    }

    .modal-body {
        max-height: calc(100vh - 7rem);
        padding: 1rem;
    }

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

    .preview-image {
        height: 190px;
    }
}

@media (max-width: 480px) {
    .container {
        width: min(100% - 28px, 440px);
    }

    .hero {
        padding-bottom: 68px;
    }

    .eyebrow {
        align-items: flex-start;
        font-size: 0.7rem;
        line-height: 1.5;
    }

    .eyebrow span {
        margin-top: 0.48rem;
    }

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

    .button {
        width: 100%;
    }

    .portrait-frame {
        border-radius: 28px;
    }

    .portrait-frame img,
    .portrait-frame::before {
        border-radius: 20px;
    }

    .about-panel,
    .skill-category,
    .experience-card,
    .project-header,
    .project-content,
    .education-card,
    .certification-card {
        padding: 1.35rem;
    }

    .education-card,
    .certification-card {
        grid-template-columns: 1fr;
    }

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

    .project-link,
    .preview-button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

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