:root {
    --bg: #f7f7f7;
    --surface: #ffffff;
    --surface-soft: #fafafa;
    --text: #111111;
    --muted: #555555;
    --border: #d9d9d9;
    --border-strong: #bdbdbd;
    --shadow: 0 10px 24px rgba(0, 0, 0, 0.05);
    --radius: 16px;
    --max-width: 960px;
    --duration-fast: 160ms;
    --duration-base: 260ms;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Manrope", "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

button {
    font: inherit;
}

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 30;
    width: 100%;
    height: 3px;
    background: rgba(0, 0, 0, 0.08);
}

.scroll-progress::after {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    background: #111111;
    transform-origin: left center;
    transform: scaleX(var(--scroll-progress, 0));
    transition: transform var(--duration-fast) linear;
}

.site-shell {
    width: min(calc(100% - 32px), var(--max-width));
    margin: 0 auto;
    padding: 28px 0 56px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.brand-mark,
.back-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 700;
    transition:
        border-color var(--duration-base) ease,
        transform var(--duration-base) ease;
}

.brand-mark:hover,
.back-link:hover,
.assignment-card:hover,
.photo-card:hover,
.resource-link:hover {
    transform: translateY(-1px);
    border-color: var(--border-strong);
}

.content-stack {
    display: grid;
    gap: 18px;
}

.section-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 22px;
}

.section-heading {
    margin-bottom: 18px;
}

.section-kicker,
.photo-label {
    margin: 0 0 8px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.section-title,
.assignment-title,
.photo-title {
    margin: 0;
    font-size: clamp(1.3rem, 3vw, 2rem);
    line-height: 1.2;
    font-weight: 800;
}

.section-summary,
.photo-caption,
.objective-list li,
.analysis-panel p {
    color: var(--muted);
}

.section-summary {
    margin: 6px 0 0;
}

.card-grid,
.photo-grid,
.resource-grid {
    display: grid;
    gap: 16px;
}

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

.resource-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.assignment-card,
.analysis-panel,
.photo-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.assignment-card,
.analysis-panel {
    padding: 18px;
}

.assignment-card {
    text-decoration: none;
}

.assignment-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-bottom: 14px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface-soft);
    font-size: 0.9rem;
    font-weight: 700;
}

.photo-card {
    overflow: hidden;
}

.photo-frame {
    aspect-ratio: 3 / 4;
    background: #efefef;
    cursor: zoom-in;
    overflow: hidden;
}

.photo-frame.is-wide {
    aspect-ratio: 4 / 3;
}

.parta-media-frame {
    aspect-ratio: auto;
    display: block;
    padding: 16px;
    background: var(--surface-soft);
}

.photo-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition:
        transform var(--duration-base) ease,
        object-fit var(--duration-base) ease;
}

.photo-card:hover .photo-frame img {
    transform: scale(1.02);
}

.photo-card.is-contained .photo-frame img {
    object-fit: contain;
    background: var(--surface-soft);
}

.parta-media-frame img {
    height: auto;
    max-height: 520px;
    object-fit: contain;
    margin: 0 auto;
    background: transparent;
}

.photo-body {
    padding: 16px;
}

.photo-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.photo-label {
    margin: 0;
}

.photo-title {
    font-size: 1.1rem;
    margin-bottom: 6px;
}

.photo-action,
.resource-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #111111;
    color: #ffffff;
    text-decoration: none;
    cursor: pointer;
    transition:
        transform var(--duration-base) ease,
        background var(--duration-base) ease,
        border-color var(--duration-base) ease;
}

.photo-action.is-secondary,
.resource-link.is-secondary {
    background: var(--surface);
    color: var(--text);
}

.objective-list {
    margin: 0;
    padding-left: 18px;
}

.objective-list li + li {
    margin-top: 6px;
}

.analysis-panel p {
    margin: 0;
}

.analysis-panel p + p {
    margin-top: 10px;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

.data-table th {
    background: var(--surface-soft);
    font-weight: 700;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.overlay-card {
    display: block;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    overflow: hidden;
    text-decoration: none;
    transition:
        border-color var(--duration-base) ease,
        transform var(--duration-base) ease;
}

.overlay-card:hover {
    transform: translateY(-1px);
    border-color: var(--border-strong);
}

.overlay-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #efefef;
}

.overlay-card span {
    display: block;
    padding: 10px 12px;
    font-size: 0.9rem;
    color: var(--muted);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.82);
    opacity: 0;
    visibility: hidden;
    transition:
        opacity var(--duration-base) ease,
        visibility var(--duration-base) ease;
}

.modal.is-open {
    opacity: 1;
    visibility: visible;
}

.modal-dialog {
    position: relative;
    width: min(720px, 100%);
}

.modal-image {
    width: 100%;
    max-height: 84vh;
    object-fit: contain;
    border-radius: 14px;
    background: #111111;
}

.modal-caption {
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #111111;
    cursor: pointer;
}

.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition:
        opacity var(--duration-base) ease,
        transform var(--duration-base) ease;
}

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

body.modal-open {
    overflow: hidden;
}

@media (max-width: 700px) {
    .site-shell {
        width: min(calc(100% - 20px), var(--max-width));
        padding-top: 20px;
        padding-bottom: 40px;
    }

    .section-card {
        padding: 18px;
    }

    .card-grid,
    .photo-grid {
        grid-template-columns: 1fr;
    }

    .photo-topline {
        flex-direction: column;
        align-items: flex-start;
    }

    .resource-link,
    .photo-action {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
