@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600&family=Space+Grotesk:wght@400;500;600&display=swap");

:root {
    color-scheme: light;
    --surface: #f5f5f1;
    --panel: rgba(255, 255, 255, 0.7);
    --text: #0f172a;
    --muted: #6b7280;
    --accent: #2563eb;
    --shadow-soft: 0 25px 60px rgba(15, 23, 42, 0.1);
    --border: rgba(15, 23, 42, 0.08);
}

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

body {
    font-family: "Space Grotesk", system-ui, -apple-system, sans-serif;
    background: var(--surface);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

.parallax-wrap {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: -1;
}

.cloud-layer {
    position: absolute;
    top: -35vh;
    left: var(--x, 10%);
    will-change: transform;
    pointer-events: none;
    animation: cloud-fall var(--duration, 48s) linear infinite;
    animation-delay: var(--delay, 0s);
}

.cloud-body {
    width: 420px;
    height: 220px;
    background: url("../img/cloud.png")
        center / contain no-repeat;
    opacity: var(--opacity, 0.65);
    transform: translate3d(0, var(--parallax, 0px), 0);
    will-change: transform;
}

.cloud-layer.size-sm .cloud-body {
    width: 140px;
    height: 75px;
}

.cloud-layer.size-md .cloud-body {
    width: 180px;
    height: 95px;
}

.cloud-layer.size-lg .cloud-body {
    width: 240px;
    height: 125px;
}

.cloud-layer.size-xl .cloud-body {
    width: 280px;
    height: 145px;
}

@keyframes cloud-fall {
    from {
        transform: translate3d(0, 0, 0);
    }
    to {
        transform: translate3d(0, 165vh, 0);
    }
}

@media (max-width: 720px) {
    .cloud-layer.size-sm .cloud-body {
        width: 100px;
        height: 60px;
    }

    .cloud-layer.size-md .cloud-body {
        width: 130px;
        height: 75px;
    }

    .cloud-layer.size-lg .cloud-body {
        width: 160px;
        height: 90px;
    }

    .cloud-layer.size-xl .cloud-body {
        width: 190px;
        height: 105px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cloud-layer {
        animation: none;
    }
}

.page-shell {
    position: relative;
    width: min(1100px, 100% - 2rem);
    margin: 0 auto;
    padding-bottom: 5rem;
}

header {
    padding: 2.5rem 0 1rem;
}

.nav {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

.nav a {
    color: var(--muted);
    text-decoration: none;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    border: 1px solid transparent;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.nav a:hover,
.nav a:focus-visible {
    color: var(--text);
    border-color: var(--border);
}

.hero {
    margin-top: 3rem;
    display: grid;
    gap: 1.75rem;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hero h1 {
    font-family: "Playfair Display", "Times New Roman", serif;
    font-size: clamp(2.5rem, 4vw, 3.6rem);
    line-height: 1.1;
}

.hero p {
    max-width: 600px;
    color: var(--muted);
}

.hero .cta-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.cta {
    border-radius: 999px;
    padding: 0.75rem 1.5rem;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-primary {
    background: var(--text);
    color: #fff;
    box-shadow: var(--shadow-soft);
}

.cta-secondary {
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
}

.cta:hover,
.cta:focus-visible {
    transform: translateY(-2px);
}

main {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 5rem;
}

.section {
    padding: clamp(2rem, 3vw, 3rem) 0;
    border-top: 1px solid var(--border);
}

.section:first-of-type {
    border-top: none;
    padding-top: 0;
}

.section-title {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    margin-bottom: 1.5rem;
    font-family: "Playfair Display", serif;
}

.section-content {
    display: grid;
    gap: clamp(1.5rem, 2vw, 2.5rem);
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    align-items: center;
}

.section-content img {
    width: 100%;
    border-radius: 18px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(37, 99, 235, 0.05));
    box-shadow: var(--shadow-soft);
}

.section-visual {
    padding: 1.75rem;
    border-radius: 18px;
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

.hero-visual {
    padding: 1.75rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

.hero-pill {
    margin-bottom: 0.75rem;
}

.hero-note {
    font-size: 1rem;
    color: var(--muted);
}

.hero-note a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
}

.hero-note a:hover,
.hero-note a:focus-visible {
    color: var(--accent);
    border-bottom-color: rgba(37, 99, 235, 0.5);
}

.section-callout {
    font-size: 0.95rem;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.section-callout strong {
    color: var(--text);
    font-size: 1rem;
}

.section-callout p {
    margin: 0;
}

.story-gallery {
    margin-top: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.story-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.story-title {
    text-align: center;
    margin-bottom: 0;
}

.story-note {
    color: var(--muted);
    max-width: 560px;
}

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

.story-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.story-column.is-offset {
    margin-top: 190px;
}

.story-card {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(320px, 520px) minmax(180px, 1fr);
    gap: 1.5rem;
    align-items: stretch;
}

.story-image-card {
    border-radius: 18px;
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    padding: 1rem;
    width: 100%;
    justify-self: stretch;
}

.story-image-card img {
    width: 100%;
    border-radius: 14px;
    height: 340px;
    object-fit: contain;
}

.story-text-card {
    border-radius: 18px;
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    width: 100%;
    justify-self: stretch;
    color: var(--muted);
    font-size: 0.95rem;
}

.story-card:nth-child(even) {
    grid-template-columns: minmax(180px, 1fr) minmax(320px, 520px);
}

.story-card:nth-child(even) img {
    order: 2;
}

.story-card:nth-child(even) .story-text-card {
    order: 1;
}

.story-column:first-child .story-image-card {
    order: 2;
}

.story-column:first-child .story-text-card {
    order: 1;
}

.story-card.is-swapped .story-image-card {
    order: 1;
}

.story-card.is-swapped .story-text-card {
    order: 2;
}

.story-column.is-offset .story-card.is-swapped .story-image-card {
    order: 2;
}

.story-column.is-offset .story-card.is-swapped .story-text-card {
    order: 1;
}

@media (max-width: 720px) {
    .story-grid {
        grid-template-columns: 1fr;
    }
    .story-column.is-offset {
        margin-top: 0;
    }
    .story-card,
    .story-card:nth-child(even) {
        grid-template-columns: 1fr;
    }
    .story-card img,
    .story-card:nth-child(even) img,
    .story-card:nth-child(even) figcaption {
        order: initial;
    }
}

.section-text {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    font-size: 0.8rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent);
    border: 1px solid rgba(37, 99, 235, 0.3);
}

.card-grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.project-card {
    padding: 1.25rem;
    border-radius: 18px;
    background: var(--panel);
    border: 1px solid transparent;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    transition: border-color 0.2s ease;
}

.project-card:hover,
.project-card:focus-within {
    border-color: rgba(37, 99, 235, 0.5);
}

.project-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.35rem;
}

.project-card p {
    color: var(--muted);
    font-size: 0.95rem;
}

.tag-line {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.1);
}

.experience-list,
.academic-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.experience-item,
.academic-item {
    padding: 1.1rem 1.25rem;
    border-radius: 16px;
    background: var(--panel);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: var(--shadow-soft);
}

.experience-item h3,
.academic-item h3 {
    margin-bottom: 0.45rem;
    font-size: 1.1rem;
}

.experience-meta {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.95rem;
}

.experience-item ul {
    margin-top: 0.45rem;
    list-style: none;
    padding-left: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.experience-item li::before {
    content: "•";
    margin-right: 0.4rem;
    color: var(--accent);
}

footer {
    margin-top: 4rem;
    padding: 2rem 0 1rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

@media (max-width: 640px) {
    .nav {
        justify-content: center;
    }
    .section-content {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cloud,
    .cta,
    .project-card,
    .section {
        animation: none;
        transition: none;
    }
}
