* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

:root {
    color-scheme: light;
    --background: #eaf7ee;
    --surface: #f8fcf9;
    --surface-secondary: #e0f0e5;
    --text: #14532d;
    --secondary: #34734c;
    --accent: #198754;
    --shadow: 0 16px 45px rgba(20, 83, 45, 0.08);
}

body.blue-theme {
    --background: #eaf0fb;
    --surface: #f8faff;
    --surface-secondary: #e0e8f7;
    --text: #102d65;
    --secondary: #49628f;
    --accent: #214a94;
    --shadow: 0 16px 45px rgba(16, 45, 101, 0.08);
}

body {
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background: var(--background);
    transition: background 700ms ease, color 700ms ease;
}

a {
    color: inherit;
}

.header {
    position: sticky;
    z-index: 10;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 18px clamp(20px, 5vw, 72px);
    background: color-mix(in srgb, var(--background) 88%, transparent);
    backdrop-filter: blur(14px);
}

.site-name {
    flex-shrink: 0;
    font-size: 1.05rem;
    font-weight: 800;
    text-decoration: none;
}

.navigation,
.theme-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navigation a {
    padding: 9px 10px;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition: color 200ms ease;
}

.navigation a:hover,
.navigation a:focus-visible {
    color: var(--accent);
}

.theme-button,
.submit-button {
    border: 0;
    border-radius: 999px;
    padding: 11px 16px;
    color: #fff;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 200ms ease, box-shadow 300ms ease;
}

.theme-button:hover,
.submit-button:hover {
    transform: translateY(-2px);
}

.theme-button:focus-visible,
.submit-button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--secondary);
    outline-offset: 3px;
}

.good-day {
    background: #198754;
    box-shadow: 0 7px 18px rgba(25, 135, 84, 0.2);
}

.bad-day {
    background: #173b83;
    box-shadow: 0 7px 18px rgba(23, 59, 131, 0.2);
}

.hero {
    min-height: calc(100vh - 74px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 64px 24px 90px;
    text-align: center;
    animation: fade-in 900ms ease both;
}

.profile-photo {
    width: clamp(150px, 22vw, 230px);
    height: clamp(150px, 22vw, 230px);
    margin-bottom: 26px;
    border: 7px solid var(--surface);
    border-radius: 50%;
    background: var(--surface-secondary);
    box-shadow: var(--shadow);
    object-fit: cover;
}

.school,
.section-label {
    color: var(--secondary);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.school {
    margin-bottom: 16px;
}

h1 {
    font-size: clamp(3.2rem, 9vw, 7rem);
    line-height: 1;
    letter-spacing: -0.07em;
    font-weight: 800;
}

.hero h2 {
    margin-top: 18px;
    color: var(--secondary);
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    font-weight: 500;
}

.scroll-link {
    margin-top: 34px;
    color: var(--accent);
    font-weight: 700;
    text-decoration-thickness: 1px;
    text-underline-offset: 5px;
}

.section {
    display: flex;
    justify-content: center;
    padding: clamp(56px, 8vw, 104px) 24px;
}

.section-inner {
    width: min(100%, 1080px);
}

.section-label {
    margin-bottom: 12px;
}

.section-title {
    margin-bottom: 36px;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    letter-spacing: -0.06em;
}

.about-grid,
.projects-grid {
    display: grid;
    gap: 22px;
}

.about-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.content-box,
.project-card {
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
    transition: background 700ms ease, color 700ms ease, transform 300ms ease;
}

.content-box {
    padding: clamp(24px, 4vw, 38px);
}

.about-photo,
.project-photo {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-bottom: 22px;
    border-radius: 16px;
    background: var(--surface-secondary);
    object-fit: cover;
}

.face-photo {
    object-position: center 25%;
}

.roomus-photo {
    object-fit: contain;
}

.content-box h3,
.project-card h3 {
    margin-bottom: 14px;
    font-size: 1.45rem;
}

.content-box p,
.project-card p,
.contact-intro > p:not(.section-label) {
    color: var(--secondary);
    line-height: 1.8;
}

.projects-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 245px;
    padding: clamp(24px, 3vw, 32px);
}

.project-card:hover {
    transform: translateY(-5px);
}

.project-card .project-number {
    margin-bottom: 20px;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.project-card > p:not(.project-number) {
    margin-bottom: 22px;
}

.project-card a {
    margin-top: auto;
    color: var(--accent);
    font-weight: 700;
    text-decoration-thickness: 1px;
    text-underline-offset: 5px;
}

.contact-layout {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    align-items: start;
    gap: clamp(32px, 7vw, 80px);
}

.contact-intro .section-title {
    margin-bottom: 18px;
}

.social-links {
    display: flex;
    gap: 14px;
    margin-top: 28px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border-radius: 999px;
    padding: 11px 16px;
    background: var(--surface);
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
    transition: transform 200ms ease, background 700ms ease;
}

.social-links a:hover {
    transform: translateY(-2px);
}

.social-links svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.contact-form {
    display: grid;
    gap: 10px;
}

.contact-form label {
    margin-top: 8px;
    font-size: 0.92rem;
    font-weight: 700;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    border: 0;
    border-radius: 12px;
    padding: 13px 14px;
    background: var(--background);
    color: var(--text);
    font: inherit;
    transition: background 700ms ease;
}

.contact-form textarea {
    resize: vertical;
}

.submit-button {
    justify-self: start;
    margin-top: 8px;
    padding: 13px 22px;
    background: var(--accent);
}

.form-status {
    min-height: 1.5em;
    color: var(--secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.footer {
    padding: 24px;
    color: var(--secondary);
    font-size: 0.9rem;
    text-align: center;
}

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 500ms ease, transform 500ms ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.theme-switch {
    animation: theme-switch 700ms ease;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes theme-switch {
    0% {
        opacity: 0.75;
        transform: scale(0.99);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 900px) {
    .header {
        flex-wrap: wrap;
        justify-content: center;
    }

    .projects-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contact-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    html {
        scroll-padding-top: 150px;
    }

    .header {
        gap: 12px;
        padding: 14px 16px;
    }

    .site-name {
        width: 100%;
        text-align: center;
    }

    .navigation {
        flex-wrap: wrap;
        justify-content: center;
        gap: 2px;
    }

    .navigation a {
        padding: 7px;
        font-size: 0.82rem;
    }

    .theme-button {
        padding: 10px 13px;
        font-size: 0.75rem;
    }

    .about-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .section {
        padding-right: 18px;
        padding-left: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
