/* ============================================
   IMPORT UNIFIED DESIGN SYSTEM TOKENS
   See assets/css/variables.css for token definitions
   ============================================ */
@import url('variables.css');

/* ============================================
   PROGRESSIVE ENHANCEMENT LOADING STATE
   Portfolio is visible by default (no JS required)
   Skeleton loader only shows when JS adds .is-loading class
   ============================================ */

/* Default state: portfolio is fully visible */
#portfolio-app {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

/* Loading state: only applied when JS adds .is-loading to body */
body.is-loading #portfolio-app {
    opacity: 0;
    visibility: hidden;
}

/* Loader is hidden by default */
#app-loader {
    display: none;
}

/* Loader visible only during loading state */
body.is-loading #app-loader {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color, #f5f5f5);
    z-index: 9999;
    overflow-y: auto;
}

/* ============================================
   General Styles (Using CSS Variables)
   ============================================ */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-color);
    transition: var(--transition-smooth);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navigation */
header.header {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1.5rem 20px;
    transition: var(--transition-smooth);
}

/* Top application navbar (minimal, non-redundant) */
:root {
    --nav-bg: rgba(255,255,255,0.6); /* rgba(255,255,255,0.45) */
    --nav-border: rgba(0,0,0,0.06);
}

html.dark-mode {
    --nav-bg: rgba(10,14,20,0.55);
    --nav-border: rgba(255,255,255,0.06);
}

.top-navbar {
    position: sticky;
    top: 0;
    z-index: 150;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    background-color: var(--nav-bg);
    border-bottom: 1px solid var(--nav-border);
    box-shadow: none;
}

.top-navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 56px;
}

.top-navbar .nav-left,
.top-navbar .nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-about {
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
    transition: var(--transition-smooth);
    font-weight: 600;
}

.nav-about:hover,
.nav-about:focus {
    background-color: var(--hover-color);
    outline: none;
}

.nav-center {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 1rem;
    min-width: 0;
}

.nav-phrases {
    color: var(--text-secondary);
    font-size: 0.95rem;
    opacity: 0.95;
    transition: opacity 600ms ease, transform 600ms ease;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.nav-location {
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-location-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

/* Mobile behavior: hide rotating phrases to conserve space */
@media (max-width: 720px) {
    .nav-center { display: none; }
    .top-navbar-inner { height: 52px; }
    :root { --navbar-height: 52px; }
}

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

.theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition-smooth);
    padding: 0;
}

.theme-toggle:hover,
.theme-toggle:focus {
    border-color: var(--primary-color);
    background-color: var(--accent-color);
    outline: none;
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
}

.skill-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    font-size: 1.2rem;
    line-height: 1;
}

.theme-icon svg,
.skill-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    color: var(--primary-color);
}

/* Utility class for icons that should appear to the right of text */
.icon-right {
    margin-left: 0.5rem;
    margin-right: 0;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    align-items: center;
    justify-items: center;
    margin-top: 1rem;
}

.footer-links a,
.footer-links span {
    color: var(--text-secondary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links a:hover,
.footer-links a:focus {
    color: var(--primary-color);
    outline: none;
}

.sidebar-panel {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.header-title h1 {
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.tagline {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.badge {
    background-color: var(--primary-light);
    color: var(--primary-color);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Flexbox Navigation */
.nav {
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
    position: relative;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

.nav-menu {
    display: grid;
    list-style: none;
    gap: 0.5rem;
    padding: 0;
    margin: 0 0 1.25rem;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    display: block;
    text-decoration: none;
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background-color: var(--accent-color);
    transition: var(--transition-smooth);
}

.nav-menu a:hover,
.nav-menu a:focus {
    border-bottom-color: var(--primary-color);
    outline: none;
}

/* Main Layout */
main {
    padding: 2rem 20px;
}

.page-layout {
    display: grid;
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr) minmax(240px, 280px);
    gap: 2rem;
    align-items: flex-start;
}

.main-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

/* Article Section */
.profile-article {
    grid-column: 1;
}

.shell-main {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.shell-main section {
    scroll-margin-top: 80px;
}

/* Independent scrolling sidebar - v1.1.1-beta */
.sidebar-left {
    grid-column: 1;
    width: 100%;
    max-width: 280px;
    position: sticky;
    top: calc(var(--navbar-height) + 0.75rem);
    align-self: start;
    max-height: calc(100vh - var(--navbar-height) - 2rem);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.sidebar-left::-webkit-scrollbar {
    width: 4px;
}

.sidebar-left::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-left::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}

.sidebar-right {
    grid-column: 3;
    width: 100%;
    max-width: 280px;
    position: sticky;
    top: calc(var(--navbar-height) + 0.75rem);
    align-self: start;
}

.sidebar-panel {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 2rem;
}

.sidebar-panel + .sidebar-panel {
    margin-top: 1rem;
}

.sidebar-profile {
    text-align: center;
}

.sidebar-title {
    color: var(--text-secondary);
    margin: 1rem 0 0.75rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

.sidebar-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.sidebar-heading,
.sidebar-panel h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.sidebar-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-link:hover,
.sidebar-link:focus {
    text-decoration: underline;
    outline: none;
}

.contact-section {
    text-align: center;
}

.contact-section .contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.contact-item .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary-color);
}

.contact-item a {
    text-decoration: none;
    color: var(--primary-color);
}

.contact-item a:hover,
.contact-item a:focus {
    text-decoration: underline;
    outline: none;
}

.contact-item small {
    margin: 0;
}

.button-group {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    border: 1px solid transparent;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.button-primary {
    background-color: var(--primary-color);
    color: #fff;
}

.button-secondary {
    background-color: var(--accent-color);
    color: var(--primary-color);
    border-color: var(--border-color);
}

.button-primary:hover,
.button-secondary:hover,
.button-primary:focus,
.button-secondary:focus {
    opacity: 0.95;
    outline: none;
}

.hero-section {
    background-color: var(--surface-color);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary-color);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.hero-copy {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-top: 1rem;
}

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

.insights-section {
    margin-bottom: 2.5rem;
}

.insights-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.insights-section > p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.insight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.footer-panel {
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 2rem 1.25rem;
    text-align: center;
}

/* Footer intro two-column grid with card treatment matching .card style */
.footer-intro-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    text-align: left;
    margin-bottom: 2rem;
}

.footer-intro-grid p {
    background-color: var(--surface-color);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
    transition: var(--transition-smooth);
}

.footer-intro-grid p:hover {
    border-color: var(--hover-color);
}

@media (max-width: 768px) {
    .footer-intro-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        text-align: center;
    }
    
    .footer-intro-grid p {
        padding: 1.25rem;
    }
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    align-items: center;
    justify-items: center;
    margin-top: 1rem;
}

.footer-links a,
.footer-links span {
    color: var(--text-secondary);
    text-decoration: none;
    position: relative;
}

.footer-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 50%;
    background-color: var(--primary-color);
    transition: width 0.3s ease, left 0.3s ease;
}

.footer-links a:hover,
.footer-links a:focus {
    color: var(--primary-color);
    outline: none;
}

.footer-links a:hover::after,
.footer-links a:focus::after {
    width: 100%;
    left: 0;
}

.button-group a {
    width: 100%;
}

.sidebar-panel-copy {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.5rem;
}

.info-list li {
    color: var(--text-secondary);
}

.profile-figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 1rem; /* reduced to tighten gap to paragraph */
    padding-bottom: 1rem; /* reduced so border sits closer to content */
    border-bottom: 1px solid var(--border-color);
}

.profile-img {
    width: 85%;
    max-width: 200px;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    border: 3px solid var(--primary-color);
    object-fit: cover;
    margin-bottom: 0.75rem; /* slightly tighter under image */
}

.profile-figure:hover .profile-img {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

figcaption {
    font-size: 0.85rem;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

/* About Section */
.about-section {
    margin-bottom: 2.5rem;
}

.about-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.about-section h3 {
    font-size: 1.1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.about-section p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.hobbies-list,
.courses-list {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.hobbies-list li,
.courses-list li {
    margin-bottom: 0.5rem;
}

/* Coursework Dropdowns */
.coursework-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.coursework-item {
    background-color: var(--accent-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.coursework-item:hover {
    background-color: var(--hover-color);
}

.coursework-item summary {
    list-style: none;
    display: flex;
    align-items: center;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    outline: none;
}

.coursework-item summary::-webkit-details-marker {
    display: none;
}

.coursework-item summary::before {
    content: '▶';
    display: inline-block;
    margin-right: 0.5rem;
    transition: transform 0.2s ease;
    font-size: 0.8rem;
    color: var(--primary-color);
}

.coursework-item[open] summary::before {
    transform: rotate(90deg);
}

.coursework-item[open] summary {
    margin-bottom: 0.75rem;
}

.coursework-item p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Skills Section */
.skills-section {
    margin-bottom: 2.5rem;
}

.skills-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

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

.skill-category h3 {
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

/* Skill Tags - Pill Badges with Flexbox */
.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
}

.skills-list li {
    background-color: var(--accent-color);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid var(--hover-color);
}

.skills-list li:hover {
    background-color: var(--hover-color);
}

/* Projects Section */
.projects-section {
    margin-bottom: 2.5rem;
}

/* Leadership & Community Impact Section */
.leadership-section {
    margin-bottom: 2.5rem;
}

.leadership-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.leadership-section h3 {
    font-size: 1.1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.leadership-section > p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.impact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.impact-card {
    background-color: var(--accent-color);
    border: 1px solid var(--hover-color);
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    border-radius: 4px;
    transition: var(--transition-smooth);
}

.impact-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.impact-card h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.impact-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.impact-badge {
    display: inline-block;
    background-color: var(--primary-light);
    color: var(--primary-color);
    padding: 0.35rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.projects-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.experience-section,
.skills-section {
    margin-bottom: 2.5rem;
}

.experience-section h2,
.skills-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.section-intro {
    margin: 0 0 1.5rem;
    color: var(--text-secondary);
    line-height: 1.75;
}

.experience-grid {
    display: grid;
    gap: 1rem;
}

.experience-card {
    background-color: var(--surface-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    transition: var(--transition-smooth);
}

.experience-card:hover {
    border-color: var(--hover-color);
}

.experience-card h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.experience-meta {
    margin: 0 0 1rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
}

.skill-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0;
    margin: 0;
}

.skill-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 0.9rem;
    background-color: var(--accent-color);
    color: var(--primary-color);
    border-radius: 999px;
    border: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.skill-pill .skill-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    min-width: 1.2rem;
    height: 1.2rem;
    min-height: 1.2rem;
    flex-shrink: 0;
    font-size: 1.2rem;
    line-height: 1;
}

.skill-pill .skill-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

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

.skill-category {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    transition: var(--transition-smooth);
}

.skill-category:hover {
    border-color: var(--hover-color);
}

.skill-category h3 {
    margin: 0 0 0.75rem;
    color: var(--primary-color);
    font-size: 1rem;
    font-weight: 600;
}

.card {
    background-color: var(--surface-color);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-left: 4px solid var(--primary-color);
    transition: var(--transition-smooth);
}

.card:hover {
    border-color: var(--hover-color);
}

.card h3 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 0.75rem;
}

/* Project Screenshot Image */
.project-screenshot {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 1rem;
    display: block;
}

.card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Keep contact section text centered */
.contact-section p {
    text-align: center;
}

.card-links {
    display: flex;
    gap: 0.75rem;
}

.card-link {
    flex: 1;
    display: inline-block;
    padding: 0.5rem 0.75rem;
    background-color: var(--accent-color);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 3px;
    text-align: center;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    transition: var(--transition-smooth);
}

.card-link:hover,
.card-link:focus {
    background-color: var(--hover-color);
    outline: none;
}

/* Sidebar - Enhanced spacing for v1.1.1-beta */
.sidebar {
    background-color: var(--surface-color);
    padding: 1.25rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

/* Desktop layout spacing - sidebars have ~19px (0.5cm) padding from screen edges */
@media (min-width: 769px) {
    .page-layout {
        padding-left: 1px;
        padding-right: 1px;
    }
    
    .sidebar-left {
        padding-right: 1rem;
    }
    
    .sidebar-right {
        padding-left: 1rem;
    }
    
    .shell-main {
        padding: 0 1rem;
    }
}

.sidebar-section h3 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.sidebar-links {
    list-style: none;
}

.sidebar-links li {
    margin-bottom: 0.5rem;
}

.sidebar-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.sidebar-links a:hover,
.sidebar-links a:focus {
    text-decoration: underline;
    outline: none;
}

.academic-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.academic-info dt {
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 0.5rem;
}

.academic-info dd {
    color: var(--text-secondary);
    margin-left: 1rem;
}

.sidebar-section p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.sidebar-section a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.sidebar-section a:hover,
.sidebar-section a:focus {
    text-decoration: underline;
    outline: none;
}

.email-link {
    font-weight: 600;
}

/* Contact Section - Card style like hero section */
.contact-section {
    background-color: var(--surface-color);
    padding: 2rem;
    padding-bottom: 3rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-top: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.contact-section h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.contact-section p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.footer-email {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    background-color: var(--primary-color);
    color: var(--surface-color);
    text-decoration: none;
    border-radius: 3px;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.footer-email:hover,
.footer-email:focus {
    background-color: var(--secondary-color);
    outline: none;
}

.footer-bottom {
    background-color: #2d2d2d;
    color: #fff;
    text-align: center;
    padding: 1rem;
    font-size: 0.85rem;
}

.footer-bottom p {
    margin: 0;
    font-size: 0.85rem;
}

/* Responsive Design */

/* Tablet screens */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .header-title h1 {
        font-size: 1.5rem;
    }

    .profile-img {
        width: 140px;
        height: 140px;
    }

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

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

    .about-section h2,
    .skills-section h2,
    .projects-section h2 {
        font-size: 1.3rem;
    }

    /* Stack the three-column layout: left → main → right */
    .page-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .sidebar-left {
        grid-column: 1;
        grid-row: 1;
        position: static;
        top: auto;
        max-width: 100%;
    }

    .shell-main {
        grid-column: 1;
        grid-row: 2;
    }

    .sidebar-right {
        grid-column: 1;
        grid-row: 3;
        position: static;
        top: auto;
        max-width: 100%;
    }
}

/* Mobile screens */
@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    header.header {
        padding: 1rem 15px;
    }

    main {
        padding: 1rem 15px;
    }

    .header-content {
        margin-bottom: 0.75rem;
    }

    .header-title h1 {
        font-size: 1.3rem;
    }

    .tagline {
        font-size: 0.85rem;
    }

    .badge {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }

    .nav {
        padding-top: 0.5rem;
    }

    .nav-menu {
        flex-direction: column;
    }

    .nav-menu a {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    .profile-img {
        width: 60%;
        max-width: 160px;
        height: auto;
    }

    figcaption {
        font-size: 0.9rem;
    }

    .about-section h2,
    .skills-section h2,
    .projects-section h2,
    .about-section h3 {
        font-size: 1.2rem;
    }

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

    .skills-list li {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
    }

    .projects-grid {
        gap: 1rem;
    }

    .card {
        padding: 1rem;
    }

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

    .card p {
        font-size: 0.9rem;
    }

    .card-link {
        font-size: 0.85rem;
        padding: 0.45rem 0.5rem;
    }

    .sidebar-section,
    .sidebar-panel {
        padding: 1rem;
    }

    .sidebar-section h3,
    .sidebar-panel h3 {
        font-size: 0.95rem;
    }

    .sidebar-links a,
    .sidebar-section p,
    .sidebar-panel-copy,
    .info-list li {
        font-size: 0.9rem;
    }

    .academic-info {
        font-size: 0.85rem;
    }

    .contact-section {
        padding: 1.5rem 15px;
    }

    .contact-section h2 {
        font-size: 1.3rem;
    }

    .contact-section p {
        font-size: 0.9rem;
    }

    .footer-email {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}