:root {
    --page-background: #F4F7F6;
    --surface-color: #FFFFFF;
    --text-color: #263238;
    --secondary-text-color: #526568;
    --dark-surface: #2F4F4F;
    --accent-color: #ADD8E6;
    --border-color: #D7E0DE;
    --personal-experience-background: #EAF4FA;
    --internship-background: #E7F1E9;
    --pitch-background: #E8F0F1;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding-top: 20px;
    font-family: 'Consolas', sans-serif;
    background-color: var(--page-background);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.5;
}

p {
    max-width: 70ch;
}

main {
    width: min(1300px, calc(100% - 24px));
    margin: 20px auto 0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
video:focus-visible {
    outline: 3px solid var(--text-color);
    outline-offset: 5px;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(1300px, calc(100% - 24px));
    margin: 0 auto;
    padding: 17px 18px;
    background-color: var(--dark-surface);
    border-radius: 20px;
    position: sticky;
    top: 10px;
    z-index: 1000;
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: clamp(10px, 1.4vw, 22px);
}

.nav-item {
    display: inline-block;
    color: var(--surface-color);
    text-decoration: none;
    font-size: 25px;
    font-weight: bold;
    border-bottom: 3px solid transparent;
    padding-bottom: 3px;
    transition: border-bottom-color 0.3s, color 0.3s;
    white-space: nowrap;
}

.nav-item:hover {
    border-bottom-color: var(--accent-color);
}

.nav-item.active {
    color: var(--accent-color);
    text-transform: uppercase;
    border-bottom-color: var(--accent-color);
}

.navbar a:focus-visible {
    outline-color: var(--accent-color);
}

.page-about .cv-sidebar {
    flex: 0 0 28%;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 100px;
    align-self: flex-start;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
}

.page-about .cv-sheet {
    display: flex;
    gap: 32px;
    width: 100%;
    min-height: max(680px, calc(100vh - 160px));
    padding: 32px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: 0 8px 26px rgba(38, 50, 56, 0.08);
}

.page-about .profile-card {
    padding: 20px;
    background-color: var(--page-background);
    border: 1px solid var(--border-color);
    border-radius: 14px;
}

.page-about .profile-photo {
    display: block;
    width: 200px;
    max-width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 14px;
    margin: 0 auto;
}

.page-about .cv-nav {
    padding: 20px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 14px;
}

.page-about .cv-nav h2 {
    margin: 0 0 12px;
    font-size: 1.2rem;
    color: var(--dark-surface);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 8px;
}

.page-about .cv-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.page-about .cv-nav a {
    display: block;
    padding: 5px 8px;
    font-size: 0.88rem;
    line-height: 1.25;
    color: var(--text-color);
    text-decoration: none;
    border-left: 3px solid transparent;
    border-radius: 4px;
    transition: background-color 0.2s, border-color 0.2s;
}

.page-about .cv-nav a:hover {
    background-color: var(--page-background);
    border-left-color: var(--accent-color);
}

.nav-pitch {
    display: inline-block;
    padding: 8px 12px;
    font-size: 0.9rem;
    background-color: var(--accent-color);
    color: var(--text-color);
    text-decoration: none;
    font-weight: bold;
    border-radius: 8px;
    white-space: nowrap;
    transition: background-color 0.3s, color 0.3s;
}

.nav-pitch:hover {
    background-color: var(--pitch-background);
    color: var(--dark-surface);
}

.page-about .cv-sidebar > .nav-pitch {
    display: block;
    width: 100%;
    text-align: center;
}

.page-about .cv-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 26px;
}

.page-about .cv-intro {
    padding: 20px 24px;
    background-color: var(--page-background);
    border-left: 5px solid var(--accent-color);
    border-radius: 12px;
}

.page-about .cv-intro h1 {
    margin: 0 0 8px;
    color: var(--dark-surface);
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    line-height: 1.2;
}

.page-about .cv-intro .profile-subtitle {
    margin: 0 0 10px;
    color: var(--dark-surface);
    font-weight: bold;
    font-size: 1.05rem;
}

.page-about .cv-intro .profile-intro {
    margin: 0;
    font-size: 0.95rem;
}

.page-about .cv-section {
    scroll-margin-top: 95px;
}

.page-about #skills > p {
    max-width: none;
}

.page-about .cv-section > h2,
.page-about .pitch-section > h2 {
    margin: 0 0 18px;
    padding-bottom: 8px;
    color: var(--dark-surface);
    font-size: clamp(1.5rem, 2.5vw, 1.9rem);
    border-bottom: 3px solid var(--accent-color);
}

.page-about .education-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr);
    gap: 18px;
}

.page-about .education-entry,
.page-about .skill-card,
.page-about .language-card {
    padding: 18px;
    background-color: #F9FBFA;
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.page-about .education-entry h3,
.page-about .skill-card h3 {
    margin: 0 0 8px;
    color: var(--dark-surface);
    font-size: 1.15rem;
}

.page-about .education-period {
    margin: 0 0 8px;
    color: var(--secondary-text-color);
    font-size: 0.9rem;
    font-weight: bold;
}

.page-about .education-program {
    margin: 0 0 12px;
    font-weight: bold;
}

.page-about .cv-list {
    padding-left: 20px;
    margin: 10px 0 0;
}

.page-about .cv-list li + li {
    margin-top: 8px;
}

.page-about .skills-grid,
.page-about .experience-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.page-about .experience-card {
    padding: 18px;
    border-radius: 12px;
}

.page-about .personal-experience {
    background-color: var(--personal-experience-background);
    border: 1px solid #C9DDEB;
}

.page-about .internship {
    background-color: var(--internship-background);
    border: 1px solid #CADCCF;
}

.page-about .experience-card h3 {
    margin: 0 0 10px;
    color: var(--text-color);
}

.page-about .internship-entry + .internship-entry {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border-color);
}

.page-about .internship-entry h4 {
    margin: 0 0 8px;
    color: var(--dark-surface);
    font-size: 1.05rem;
}

.page-about .experience-card p:not(.education-period) {
    margin: 0;
}

.page-about .pitch-section {
    margin-top: 32px;
    scroll-margin-top: 90px;
}

.page-about .pitch-video-card {
    padding: 28px;
    background-color: var(--pitch-background);
    border: 1px solid var(--border-color);
    border-radius: 18px;
}

.page-about .pitch-video-card video {
    display: block;
    width: 100%;
    max-width: 850px;
    max-height: 480px;
    margin: 0 auto;
    background-color: #000000;
    border-radius: 12px;
}

.page-about .pitch-video-card h3 {
    margin: 20px 0 20px;
    color: var(--dark-surface);
    font-size: 1.3rem;
}

.page-about .pitch-video-card iframe {
    display: block;
    width: 100%;
    max-width: 850px;
    height: auto;
    aspect-ratio: 16 / 9;
    margin: 0 auto;
    border: 0;
    border-radius: 12px;
}

.page-portfolio .portfolio-intro,
.page-career .career-intro {
    padding: 24px;
    margin-bottom: 24px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--accent-color);
    border-radius: 14px;
}

.page-portfolio .portfolio-intro h1,
.page-career .career-intro h1 {
    margin: 0;
    color: var(--dark-surface);
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    line-height: 1.2;
}

.page-portfolio .portfolio-map-section {
    padding: 24px;
    margin-bottom: 24px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    text-align: center;
}

.page-portfolio .portfolio-map-section h2 {
    margin: 0 0 8px;
    color: var(--dark-surface);
    font-size: 1.5rem;
}

.page-portfolio .portfolio-map-hint {
    margin: 0 auto 20px;
    font-size: 0.9rem;
}

.page-portfolio .portfolio-map-image {
    display: block;
    margin: 0 auto;
    border-radius: 10px;
}

.page-portfolio .portfolio-map-image--desktop {
    width: 600px;
    max-width: 100%;
}

.page-portfolio .portfolio-map-image--mobile {
    display: none;
}

.page-portfolio .portfolio-projects {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.page-portfolio .portfolio-project {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 24px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    scroll-margin-top: 100px;
}

.page-portfolio .portfolio-project.reverse {
    flex-direction: row-reverse;
}

.page-portfolio .portfolio-project-text {
    flex: 1;
    min-width: 0;
}

.page-portfolio .portfolio-project h2 {
    margin: 0 0 10px;
    color: var(--dark-surface);
    font-size: 1.3rem;
}

.page-portfolio .portfolio-project-details {
    margin: 0 0 14px;
    color: var(--secondary-text-color);
    font-size: 0.88rem;
    font-weight: bold;
}

.page-portfolio .portfolio-project-text > p:last-child {
    margin-bottom: 0;
}

.page-portfolio .portfolio-project-media {
    flex: 0 0 50%;
    min-width: 0;
    aspect-ratio: 4 / 3;
    padding: 10px;
    background-color: var(--pitch-background);
    border-radius: 10px;
    overflow: hidden;
}

.page-portfolio .portfolio-project-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.page-career .career-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.page-career .career-card,
.page-contact .contact-card {
    padding: 22px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 14px;
}

.page-career .career-card h2 {
    margin: 0 0 16px;
    padding-bottom: 10px;
    color: var(--dark-surface);
    font-size: 1.25rem;
    border-bottom: 2px solid var(--accent-color);
}

.page-career .career-card p {
    margin: 0;
    max-width: none;
}

.page-contact .columns {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 0 auto;
    width: 100%;
    max-width: 1200px;
}

.page-contact .columns > div {
    flex: 1;
    min-width: 0;
}

.page-contact .contact-card > h1 {
    margin: 0 0 16px;
    padding-bottom: 10px;
    color: var(--dark-surface);
    font-size: 2rem;
    line-height: 1.3;
    border-bottom: 2px solid var(--accent-color);
}

.page-contact .contact-card form > p {
    display: inline-block;
    padding-bottom: 8px;
    font-weight: bold;
}

.vertical-divider {
    border: none;
    width: 5px;
    background-color: var(--dark-surface);
}

.page-contact input[type="text"],
.page-contact input[type="date"],
.page-contact input[type="email"],
.page-contact input[type="tel"],
.page-contact textarea {
    background-color: var(--surface-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 10px;
    font-family: 'Consolas', sans-serif;
    width: 100%;
    margin-top: 20px;
}

.page-contact label {
    font-weight: bold;
}

.page-contact textarea {
    resize: none;
}

.page-contact button {
    background-color: var(--dark-surface);
    color: var(--surface-color);
    border: 2px solid var(--surface-color);
    border-radius: 5px;
    cursor: pointer;
    padding: 10px 20px;
    text-transform: uppercase;
    font-weight: bold;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.page-contact button:hover {
    background-color: var(--accent-color);
    color: var(--dark-surface);
    border-color: var(--dark-surface);
}

.page-contact button:focus-visible {
    outline-color: var(--accent-color);
}

.page-contact h2 {
    display: inline-block;
    padding-bottom: 8px;
    border-bottom: 3px solid var(--dark-surface);
}

.page-contact h2 a {
    color: var(--text-color);
    text-decoration: none;
    font-style: italic;
}

.page-contact h2 a::before {
    content: "➜";
    display: inline-block;
    margin-right: 10px;
    color: var(--dark-surface);
    font-weight: bold;
}

footer {
    margin: 20px 0;
    text-align: center;
}

footer a {
    color: var(--dark-surface);
    font-weight: bold;
    text-decoration: none;
}

footer p {
    font-size: 1.5rem;
}

@media (max-width: 850px) {

    .page-about .cv-sheet {
        flex-direction: column;
        min-height: 0;
    }

    .page-about .cv-sidebar {
        position: static;
        max-width: none;
        flex-basis: auto;
        max-height: none;
        overflow: visible;
        display: grid;
        grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
        align-items: start;
        align-self: stretch;
    }

    .page-about .cv-sidebar > .nav-pitch {
        grid-column: 1 / -1;
    }

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

@media (max-width: 700px) {

    .navbar {
        padding: 14px;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 14px 20px;
    }

    .nav-item {
        font-size: 16px;
    }

    .nav-pitch {
        align-self: center;
    }

    .page-about .cv-sheet {
        padding: 18px;
        gap: 22px;
    }

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

    .page-about .education-grid,
    .page-about .skills-grid,
    .page-about .experience-grid {
        grid-template-columns: 1fr;
    }

    .page-about .pitch-section {
        padding: 20px;
    }

    .page-contact .columns {
        flex-direction: column;
        align-items: center;
        width: 90%;
    }

    .page-contact .columns > div {
        width: 100%;
    }

    .vertical-divider {
        width: 100%;
        height: 5px;
        align-self: auto;
    }

    .page-career .career-grid {
        grid-template-columns: 1fr;
    }

    .page-portfolio .portfolio-map-section {
        padding: 14px;
    }

    .page-portfolio .portfolio-map-image--desktop {
        display: none;
    }

    .page-portfolio .portfolio-map-image--mobile {
        display: block;
        width: 240px;
    }

    .page-portfolio .portfolio-project,
    .page-portfolio .portfolio-project.reverse {
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
        padding: 18px;
    }

    .page-portfolio .portfolio-project-media {
        flex-basis: auto;
        width: 100%;
    }
}