/* ================================================================
   styles.css — Thanh Truc Phan Personal Website
   ================================================================

   TABLE OF CONTENTS
   1.  CSS Variables  (colors, shadows, spacing — edit here first)
   2.  Reset & Base
   3.  Typography
   4.  Utility classes
   5.  Buttons
   6.  Navigation
   7.  Hero section
   8.  About section
   9.  Timeline  (Education & Experience)
   10. Skills section
   11. Projects section
   12. Interests section
   13. Contact section
   14. Footer
   15. Scroll reveal animation
   16. Responsive (tablet & mobile)

   ✏️  QUICK CUSTOMISATION:
   — Colors:     edit the :root block in section 1
   — Fonts:      edit font-family in the body selector (section 2)
   — Max width:  edit --max-width in section 1
   ================================================================ */


/* ================================================================
   1.  CSS VARIABLES
   ================================================================ */
:root {
    /* ✏️ Change the color palette here */
    --color-bg:            #F4F7F9;       /* page background */
    --color-surface:       #FFFFFF;       /* card / nav background */
    --color-text:          #1B2B3B;       /* main body text */
    --color-text-muted:    #5A6A7A;       /* secondary text */
    --color-accent:        #1B4F72;       /* primary accent — deep navy blue */
    --color-accent-hover:  #154360;       /* darker accent for hover */
    --color-accent-light:  #D6EAF8;       /* very light accent tint */
    --color-border:        #DDE6EE;       /* card / input borders */
    --color-section-alt:   #EBF2F8;       /* alternate section background */
    --color-tag-bg:        #EBF5FB;       /* tag / badge background */
    --color-tag-text:      #1B4F72;       /* tag / badge text */
    --color-exchange:      #0E6655;       /* exchange tag — green */
    --color-exchange-bg:   #D1F2EB;

    --shadow-sm:  0 1px 4px rgba(0, 0, 0, 0.06);
    --shadow-md:  0 4px 16px rgba(0, 0, 0, 0.09);
    --shadow-lg:  0 8px 32px rgba(0, 0, 0, 0.12);

    --radius-sm:   8px;
    --radius-md:   14px;
    --radius-lg:   20px;
    --radius-full: 9999px;

    --transition: 0.24s ease;

    /* ✏️ Change the max content width here */
    --max-width: 1080px;
}


/* ================================================================
   2.  RESET & BASE
   ================================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    /* scroll-behavior intentionally omitted — JS handles smooth scroll via window.scrollTo */
}

body {
    /* ✏️ Change the font here — keep Inter as fallback */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

ul { list-style: none; }
img { display: block; max-width: 100%; }
a { color: var(--color-accent); text-decoration: none; }

/* nav-highlight animation removed — it was the main cause of the scroll shake */


/* ================================================================
   3.  TYPOGRAPHY
   ================================================================ */
h1, h2, h3 { line-height: 1.2; color: var(--color-text); }

/* ✏️ hero name uses Playfair Display — change font-family here */
h1.hero-name {
    font-family: 'Playfair Display', Georgia, serif;
}

h2 {
    font-size: clamp(1.7rem, 3vw, 2.2rem);
    font-weight: 700;
}

h3 {
    font-size: 1.05rem;
    font-weight: 600;
}

p {
    color: var(--color-text-muted);
    line-height: 1.8;
}


/* ================================================================
   4.  UTILITY
   ================================================================ */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 5rem 0;
}

.section-alt {
    background-color: var(--color-section-alt);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

/* Coloured pill label above a section heading */
.section-label {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-accent);
    background-color: var(--color-accent-light);
    padding: 0.3rem 0.9rem;
    border-radius: var(--radius-full);
    margin-bottom: 0.6rem;
}


/* ================================================================
   5.  BUTTONS
   ================================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.65rem 1.35rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
    line-height: 1;
}

/* Filled accent button */
.btn-primary {
    background-color: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}
.btn-primary:hover {
    background-color: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* White / bordered button */
.btn-secondary {
    background-color: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}
.btn-secondary:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Ghost button */
.btn-outline {
    background-color: transparent;
    color: var(--color-accent);
    border-color: var(--color-accent);
}
.btn-outline:hover {
    background-color: var(--color-accent);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}


/* ================================================================
   6.  NAVIGATION
   ================================================================ */
.nav-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(244, 247, 249, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--color-border);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-accent);
    letter-spacing: 0.08em;
    width: 36px;
    height: 36px;
    border: 2px solid var(--color-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}
.nav-logo:hover {
    background-color: var(--color-accent);
    color: white;
}

.nav-lang {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em;
    border: 1.5px solid var(--color-accent);
    border-radius: 4px;
    padding: 0.2rem 0.5rem !important;
    color: var(--color-accent) !important;
    transition: var(--transition);
}
.nav-lang:hover, .nav-lang.active {
    background: var(--color-accent);
    color: white !important;
}

.nav-links {
    display: flex;
    gap: 0.15rem;
    align-items: center;
}

.nav-links a {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-muted);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-full);
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--color-accent);
    background-color: var(--color-accent-light);
    /* font-weight intentionally NOT changed — bold text is wider and causes nav layout shift */
}

/* Hamburger toggle (hidden on desktop) */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--color-text);
    border-radius: 2px;
    transition: var(--transition);
}

/* Animate hamburger into X when open */
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* ================================================================
   7.  HERO SECTION
   ================================================================ */
.hero-section {
    min-height: auto;
    display: flex;
    align-items: center;
    padding: 3rem 0 2.5rem;
    background: linear-gradient(140deg, #F4F7F9 0%, #EBF5FB 55%, #F4F7F9 100%);
    position: relative;
    overflow: hidden;
}

/* Subtle radial glow in the top-right corner */
.hero-section::before {
    content: '';
    position: absolute;
    top: -180px;
    right: -180px;
    width: 550px;
    height: 550px;
    background: radial-gradient(circle, rgba(27, 79, 114, 0.07) 0%, transparent 70%);
    pointer-events: none;
}

.hero-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 4rem;
    align-items: start;
}

/* min-width: 0 is required in grid so long German text wraps
   instead of expanding the column and pushing the image out */
.hero-text {
    min-width: 0;
}

/* ---- Hero text ---- */
.hero-greeting {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-accent);
    letter-spacing: 0.04em;
    margin-bottom: 0.4rem;
}

.hero-name {
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.75rem;
    line-height: 1.1;
}

.hero-headline {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

.hero-sub-headline {
    display: block;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--color-text-muted);
    margin-bottom: 1.1rem;
}

.hero-intro {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    max-width: 100%;
    margin-bottom: 1.5rem;
    line-height: 1.85;
}

/* ---- Badges ---- */
.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.32rem 0.8rem;
    border-radius: var(--radius-full);
}

.badge-location {
    background-color: var(--color-surface);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.badge-open {
    background-color: #EAFAF1;
    color: #1E8449;
    border: 1px solid #A9DFBF;
}

/* Animated green dot */
.pulse-dot {
    width: 7px;
    height: 7px;
    background-color: #27AE60;
    border-radius: 50%;
    animation: pulse 2.2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.45); }
    50%       { box-shadow: 0 0 0 5px rgba(39, 174, 96, 0); }
}

/* ---- Hero buttons ---- */
.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

/* ---- Hero image ---- */
.hero-image-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-shrink: 0;
    width: 320px;
}

.hero-image-ring {
    width: 290px;
    height: 290px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-accent) 0%, #2980B9 100%);
    padding: 4px;
    box-shadow: var(--shadow-lg);
    flex-shrink: 0;
}

.hero-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 20%;
    border: 4px solid var(--color-surface);
    background-color: var(--color-accent-light);
    display: block;
}

/* Floating university card beneath the image */
.hero-image-card {
    position: absolute;
    bottom: 12px;
    left: -10px;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.55rem 0.9rem;
    box-shadow: var(--shadow-md);
    color: var(--color-accent);
    pointer-events: none;
}

.hero-image-card div {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.hero-image-card span {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1;
}

.hero-image-card small {
    font-size: 0.7rem;
    color: var(--color-text-muted);
}


/* ================================================================
   8.  ABOUT SECTION
   ================================================================ */
.about-content {
    max-width: 780px;
    margin: 0 auto;
}

.about-content p {
    font-size: 0.96rem;
    line-height: 1.85;
    margin-bottom: 1rem;
}

.about-highlights {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-top: 2.5rem;
}

.highlight-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.5rem 1.25rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    min-height: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

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

.highlight-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-accent);
    line-height: 1;
    margin-bottom: 0.4rem;
}

.highlight-label {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    font-weight: 500;
    display: block;
}

.highlight-sub {
    font-size: 0.68rem;
    color: var(--color-accent);
    letter-spacing: 0.04em;
    display: block;
    margin-top: 0.15rem;
}


/* ================================================================
   9.  TIMELINE  (Education & Experience)
   ================================================================ */
.timeline {
    position: relative;
    max-width: 760px;
    margin: 0 auto;
}

/* Vertical line */
.timeline::before {
    content: '';
    position: absolute;
    left: 13px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: linear-gradient(to bottom, var(--color-accent), var(--color-border));
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    padding-left: 48px;
    margin-bottom: 1.75rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

/* Circle dot on the line */
.timeline-dot {
    position: absolute;
    left: 5px;
    top: 22px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background-color: var(--color-accent);
    border: 3px solid var(--color-bg);
    box-shadow: 0 0 0 2px var(--color-accent);
    transition: var(--transition);
}

.timeline-dot-exchange {
    background-color: var(--color-exchange);
    box-shadow: 0 0 0 2px var(--color-exchange);
}

.section-alt .timeline-dot {
    border-color: var(--color-section-alt);
}

/* Card */
.timeline-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.4rem 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

.timeline-meta {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.timeline-date {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

.timeline-tag {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.18rem 0.55rem;
    border-radius: var(--radius-full);
}

.tag-current  { background-color: var(--color-accent-light); color: var(--color-accent); }
.tag-exchange { background-color: var(--color-exchange-bg);   color: var(--color-exchange); }

.timeline-institution {
    font-size: 0.83rem;
    font-weight: 500;
    color: var(--color-accent);
    margin: 0.3rem 0 0.65rem;
}

.timeline-details {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.timeline-details li {
    font-size: 0.86rem;
    color: var(--color-text-muted);
    padding-left: 1rem;
    position: relative;
    line-height: 1.55;
}

.timeline-details li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--color-accent);
    font-weight: 600;
}


/* ================================================================
   10. SKILLS SECTION
   ================================================================ */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 1.4rem;
}

.skill-group {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.6rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.skill-group:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.skill-group-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 1.1rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--color-border);
}

.skill-group-title svg { color: var(--color-accent); }

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

/* Language row item */
.skill-tag-language {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background-color: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.38rem 0.7rem;
    width: 100%;
}

.lang-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
}

.lang-level {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.lang-native {
    color: var(--color-accent);
    font-weight: 600;
}

/* Skill badge pill — full-width one per row */
.skill-badge {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.38rem 0.8rem;
    border-radius: var(--radius-full);
    background-color: var(--color-tag-bg);
    color: var(--color-tag-text);
    border: 1px solid var(--color-accent-light);
    transition: var(--transition);
    cursor: default;
}

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

/* Technical tool badges — same font as professional skills */
.skill-badge-tech {
    background-color: #EBF5FB;
    color: #1A5276;
    border-color: #AED6F1;
}

.skill-badge-tech:hover {
    background-color: #1A5276;
    color: #fff;
    border-color: #1A5276;
}


/* ================================================================
   11. PROJECTS SECTION
   ================================================================ */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.4rem;
}

.project-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-accent-light);
}

.project-icon {
    width: 46px;
    height: 46px;
    background-color: var(--color-accent-light);
    color: var(--color-accent);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.project-card h3 { font-size: 1rem; }
.project-card p  { font-size: 0.875rem; line-height: 1.7; }

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: auto;
}

.project-tag {
    font-size: 0.74rem;
    font-weight: 500;
    padding: 0.22rem 0.6rem;
    border-radius: var(--radius-full);
    background-color: var(--color-tag-bg);
    color: var(--color-tag-text);
    border: 1px solid var(--color-accent-light);
}

.project-preview {
    margin: -1.75rem -1.75rem 1.1rem -1.75rem;
    width: calc(100% + 3.5rem);
    height: 178px;
    overflow: hidden;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    background-color: var(--color-tag-bg);
    position: relative;
    flex-shrink: 0;
}

.project-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform 0.4s ease;
}

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

.project-preview canvas {
    width: 100% !important;
    height: auto !important;
    display: block;
}

.project-preview-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 0.78rem;
}

.project-read-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-accent);
    text-decoration: none;
    transition: var(--transition);
    align-self: flex-start;
}

.project-read-link:hover {
    color: var(--color-accent-hover, var(--color-accent));
    gap: 0.5rem;
}

.projects-institution-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-accent);
    margin-top: 2.5rem;
    margin-bottom: 1.2rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--color-accent-light);
}

.projects-institution-label:first-of-type {
    margin-top: 0;
}

.project-meta {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--color-text-muted);
    letter-spacing: 0.02em;
}


/* ================================================================
   12. INTERESTS SECTION
   ================================================================ */
.interests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.4rem;
    max-width: 620px;
    margin: 0 auto;
}

.interest-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

.interest-icon {
    width: 58px;
    height: 58px;
    background-color: var(--color-accent-light);
    color: var(--color-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.interest-card h3 { margin-bottom: 0.5rem; font-size: 1rem; }
.interest-card p  { font-size: 0.875rem; line-height: 1.7; }


/* ================================================================
   12. HOBBIES / PHOTO GRID
   ================================================================ */
.hobbies-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.4rem;
}

.hobby-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

.hobby-photo {
    width: 100%;
    height: 210px;
    overflow: hidden;
}

.hobby-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.4s ease;
}

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

.hobby-body {
    padding: 1.1rem 1.4rem 1.3rem;
    min-height: 90px;
}

.hobby-body h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.hobby-body p {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    line-height: 1.6;
}

.about-sub-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-accent);
    font-weight: 600;
    margin: 2.8rem 0 1.4rem;
}

.photo-subsection {
    margin-top: 3.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--color-border);
}

.photo-subsection-header {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    margin-bottom: 1.2rem;
    color: var(--color-accent);
}

.photo-subsection-header svg { flex-shrink: 0; margin-top: 0.2rem; }

.photo-subsection-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.2rem;
}

.photo-subsection-header p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin: 0;
}

.photo-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: 210px 210px 280px;
    gap: 0.7rem;
}

/*
  Layout (4 cols, 3 rows):
  Row 1+2: [Fuji landscape, 2 cols] [Alps portrait, col 3, rows 1-2 = 427px] [Tokyo Festival portrait, col 4, rows 1-2 = 427px]
  Row 2:   [Shrine landscape, 2 cols]  ↑ Alps continues  ↑ Festival continues
  Row 3:   [Shibuya portrait] [Autumn Foliage landscape, 2 cols] [Hiking portrait]
*/
.photo-tile:nth-child(1) { grid-column: 1 / 3; grid-row: 1; }
.photo-tile:nth-child(2) { grid-column: 3;     grid-row: 1 / 3; }
.photo-tile:nth-child(3) { grid-column: 4;     grid-row: 1 / 3; }
.photo-tile:nth-child(4) { grid-column: 1 / 3; grid-row: 2; }
.photo-tile:nth-child(5) { grid-column: 1;     grid-row: 3; }
.photo-tile:nth-child(6) { grid-column: 2 / 4; grid-row: 3; }
.photo-tile:nth-child(7) { grid-column: 4;     grid-row: 3; }

.photo-tile {
    margin: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    contain: layout paint;          /* isolate each tile's rendering */
}

.photo-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.45s ease;
}

.photo-tile:hover img { transform: scale(1.04); }

.photo-tile figcaption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem 0.8rem;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.9);
    background: linear-gradient(to top, rgba(0,0,0,0.52) 0%, transparent 100%);
    letter-spacing: 0.02em;
}


/* ================================================================
   13. PAPERS LIST (compact view in Projects section)
   ================================================================ */
.papers-list-section {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.papers-list-heading {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-accent);
    font-weight: 600;
    margin-bottom: 1.1rem;
}

.papers-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.paper-list-item {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.9rem 1.1rem;
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
}

.paper-list-meta {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.paper-list-title {
    font-size: 0.87rem;
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
    display: block;
    margin-bottom: 0.3rem;
    transition: color 0.2s;
}

.paper-list-title:hover { color: var(--color-accent); }

.paper-list-item p {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    line-height: 1.55;
    margin: 0;
}


/* ================================================================
   14. ADDITIONAL DOCUMENTS SECTION
   ================================================================ */
.documents-notice {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    line-height: 1.7;
    margin-bottom: 1.4rem;
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.document-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.4rem 1rem 1.2rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

.document-card svg {
    color: var(--color-accent);
    margin-bottom: 0.65rem;
}

.document-card h3 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.document-card p {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}


/* ================================================================
   15. CONTACT SECTION
   ================================================================ */
.contact-section {
    background: linear-gradient(140deg, var(--color-accent) 0%, #1A5276 55%, #154360 100%);
}

.contact-inner {
    text-align: center;
    max-width: 820px;
    margin: 0 auto;
}

/* Override section-label colors on dark background */
.contact-section .section-label {
    background-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
}

.contact-section h2 {
    color: #fff;
    font-size: clamp(1.9rem, 4vw, 2.6rem);
    margin-bottom: 0.9rem;
}

.contact-description {
    color: rgba(255, 255, 255, 0.72);
    font-size: 1rem;
    margin-bottom: 2.25rem;
    line-height: 1.85;
}

.contact-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: center;
}

/* Override button colors on dark hero background */
.contact-section .btn-primary {
    background-color: #fff;
    color: var(--color-accent);
    border-color: #fff;
}
.contact-section .btn-primary:hover {
    background-color: var(--color-accent-light);
    border-color: var(--color-accent-light);
    color: var(--color-accent);
}

.contact-section .btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}
.contact-section .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.7);
    color: #fff;
}

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


/* ================================================================
   14. FOOTER
   ================================================================ */
.footer {
    background-color: var(--color-text);
    padding: 1.7rem 0;
    text-align: center;
}

.footer p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.82rem;
    line-height: 1.6;
}

.footer-note {
    font-size: 0.72rem !important;
    margin-top: 0.2rem;
}


/* ================================================================
   15. SCROLL REVEAL ANIMATION
   ================================================================ */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}


/* ================================================================
   16. RESPONSIVE — tablet & mobile
   ================================================================ */

/* Tablet: stack hero columns */
@media (max-width: 880px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2.5rem;
    }

    .hero-text { order: 2; min-width: 0; }
    .hero-image-wrapper { order: 1; width: auto; flex-shrink: 0; }

    .hero-intro,
    .hero-badges,
    .hero-buttons {
        margin-left: auto;
        margin-right: auto;
        justify-content: center;
    }

    .hero-image-ring {
        width: 220px;
        height: 220px;
    }

    .hero-image-card {
        left: 50%;
        transform: translateX(-50%);
        bottom: -16px;
        white-space: nowrap;
    }
}

/* Tablet: two-column grids */
@media (max-width: 1024px) {
    .projects-grid,
    .hobbies-grid    { grid-template-columns: repeat(2, 1fr); }
    .documents-grid  { grid-template-columns: repeat(3, 1fr); }
    .papers-list     { grid-template-columns: 1fr; }
    .photo-strip     { grid-template-columns: 1fr 1fr; grid-auto-rows: 200px; }
    .photo-tile:nth-child(n) { grid-column: auto !important; grid-row: auto !important; }
}

/* Mobile: hamburger menu, single-column grids */
@media (max-width: 720px) {
    /* Show hamburger, hide nav links by default */
    .nav-toggle { display: flex; }

    .nav-links {
        display: none;
        position: absolute;
        top: 62px;
        left: 0;
        right: 0;
        flex-direction: column;
        background-color: var(--color-surface);
        border-bottom: 1px solid var(--color-border);
        padding: 0.75rem 1.5rem 1rem;
        gap: 0.2rem;
        box-shadow: var(--shadow-md);
    }

    .nav-links.open { display: flex; }

    .nav-links a {
        padding: 0.65rem 0.9rem;
        border-radius: var(--radius-sm);
    }

    .about-highlights {
        grid-template-columns: 1fr;
        max-width: 300px;
    }

    /* Adjust timeline line position */
    .timeline::before { left: 9px; }
    .timeline-dot     { left: 1px; width: 15px; height: 15px; }
    .timeline-item    { padding-left: 36px; }

    .skills-grid,
    .hobbies-grid    { grid-template-columns: 1fr; }
    .projects-grid   { grid-template-columns: 1fr; }
    .documents-grid  { grid-template-columns: repeat(2, 1fr); }
    .papers-list     { grid-template-columns: 1fr; }
    .photo-strip     { grid-template-columns: 1fr 1fr; grid-auto-rows: 160px; }
    .photo-tile:nth-child(n) { grid-column: auto !important; grid-row: auto !important; }
}

/* Small mobile */
@media (max-width: 480px) {
    .hero-section { padding: 3rem 0; }
    .hero-image-ring { width: 180px; height: 180px; }
    .section { padding: 3.5rem 0; }
    .btn { font-size: 0.82rem; padding: 0.6rem 1.05rem; }

    .contact-buttons {
        flex-direction: column;
        align-items: center;
    }

    .contact-buttons .btn {
        width: 100%;
        max-width: 340px;
        justify-content: center;
    }
}
