* {
    box-sizing: border-box;
}

:root {
    --af-bg: #ffffff;
    --af-surface: #ffffff;
    --af-text: #111111;
    --af-muted: #666666;
    --af-border: #dcdcdc;
    --af-soft: #f2f2ef;
    --af-accent: #111111;
    --af-accent-text: #ffffff;
}

body.archfolio-mode-dark {
    --af-bg: #0e0f0f;
    --af-surface: #161817;
    --af-text: #f2f1ec;
    --af-muted: #aaa69c;
    --af-border: #32342f;
    --af-soft: #20221f;
    --af-accent-text: #ffffff;
}

body.archfolio-palette-graphite {
    --af-accent: #111111;
}

body.archfolio-palette-terracotta {
    --af-accent: #b65f43;
}

body.archfolio-palette-forest {
    --af-accent: #2f6b4f;
}

body.archfolio-mode-dark.archfolio-palette-graphite {
    --af-accent: #dedbd2;
    --af-accent-text: #111111;
}

body {
    background: var(--af-bg);
    color: var(--af-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0;
}

a {
    color: inherit;
}

img {
    height: auto;
    max-width: 100%;
}

.site-header,
.site-footer {
    background: var(--af-bg);
    border-bottom: 1px solid var(--af-border);
}

.site-footer {
    border-bottom: 0;
    border-top: 1px solid var(--af-border);
}

.site-header-inner,
.site-footer-inner,
.theme-main {
    margin: 0 auto;
    width: min(1180px, calc(100% - 40px));
}

.site-header-inner,
.site-footer-inner {
    align-items: center;
    display: flex;
    justify-content: space-between;
    min-height: 76px;
}

.site-brand {
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
}

.site-nav ul,
.site-footer ul {
    display: flex;
    gap: 22px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav a,
.site-footer a {
    color: var(--af-muted);
    font-size: 14px;
    text-decoration: none;
}

.theme-main {
    padding: 64px 0;
}

.front-hero {
    align-items: end;
    background: var(--front-hero-image) center / cover no-repeat;
    color: #ffffff;
    display: grid;
    margin-left: calc(50% - 50vw);
    min-height: 68vh;
    overflow: hidden;
    padding: 72px max(40px, calc((100vw - 1180px) / 2));
    position: relative;
    width: 100vw;
}

.front-hero-video,
.front-hero-overlay {
    height: 100%;
    inset: 0;
    position: absolute;
    width: 100%;
}

.front-hero-video {
    object-fit: cover;
    z-index: 0;
}

.front-hero-overlay {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.22));
    z-index: 1;
}

.front-hero-content {
    position: relative;
    z-index: 2;
}

.front-hero p,
.section-heading p,
.theme-page-header p,
.project-hero-copy p {
    color: var(--af-muted);
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.front-hero p {
    color: rgba(255, 255, 255, 0.78);
}

.front-hero h1,
.theme-page-header h1,
.project-hero h1 {
    font-size: clamp(42px, 7vw, 96px);
    font-weight: 500;
    letter-spacing: 0;
    line-height: 0.95;
    margin: 0;
}

.front-hero h1 {
    color: #ffffff;
    max-width: 980px;
    text-shadow: 0 14px 42px rgba(0, 0, 0, 0.26);
}

.front-subtitle,
.project-excerpt {
    color: var(--af-text);
    font-size: 21px;
    line-height: 1.5;
    margin: 24px 0;
    max-width: 720px;
}

.front-hero .front-subtitle {
    color: rgba(255, 255, 255, 0.86);
}

.front-hero .theme-button {
    background: #ffffff;
    border-color: #ffffff;
    color: #111111;
}

.theme-button {
    background: var(--af-accent);
    border: 1px solid var(--af-accent);
    color: var(--af-accent-text);
    display: inline-flex;
    font-size: 13px;
    letter-spacing: 0.04em;
    padding: 13px 18px;
    text-decoration: none;
    text-transform: uppercase;
}

.theme-button-outline {
    background: transparent;
    color: var(--af-accent);
}

.front-projects,
.theme-page-header,
.project-gallery-section,
.project-actions {
    padding: 54px 0;
}

.section-heading,
.theme-page-header {
    border-bottom: 1px solid var(--af-border);
    margin-bottom: 34px;
    padding-bottom: 28px;
}

.section-heading h2 {
    font-size: 32px;
    font-weight: 500;
    margin: 0;
}

.archfolio-projects-wrap {
    width: 100%;
}

.archfolio-grid {
    display: grid;
    gap: 28px;
}

.archfolio-columns-1 {
    grid-template-columns: 1fr;
}

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

.archfolio-columns-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.archfolio-columns-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.archfolio-card {
    background: var(--af-surface);
    border: 1px solid var(--af-border);
    display: grid;
    grid-template-rows: auto 1fr;
    min-width: 0;
}

.archfolio-card-image {
    align-items: center;
    aspect-ratio: 4 / 3;
    background: var(--af-soft);
    color: var(--af-muted);
    display: flex;
    justify-content: center;
    overflow: hidden;
    text-decoration: none;
}

.archfolio-card-image img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.archfolio-card-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 22px;
}

.archfolio-card-meta {
    color: var(--af-muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 11px;
    gap: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.archfolio-card h3 {
    font-size: 22px;
    font-weight: 500;
    line-height: 1.15;
    margin: 0;
}

.archfolio-card h3 a {
    text-decoration: none;
}

.archfolio-card p {
    color: var(--af-text);
    font-size: 14px;
    line-height: 1.55;
    margin: 0;
}

.archfolio-card-specs {
    color: var(--af-muted);
}

.archfolio-button,
.archfolio-filter button,
.archfolio-private-form button {
    align-self: flex-start;
    background: var(--af-accent);
    border: 1px solid var(--af-accent);
    color: var(--af-accent-text);
    display: inline-flex;
    font-size: 12px;
    letter-spacing: 0.04em;
    margin-top: auto;
    padding: 11px 14px;
    text-decoration: none;
    text-transform: uppercase;
}

.archfolio-filter {
    border: 1px solid var(--af-border);
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin-bottom: 30px;
    padding: 16px;
}

.archfolio-filter label {
    display: grid;
    gap: 6px;
}

.archfolio-filter span {
    color: var(--af-muted);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.archfolio-filter select,
.archfolio-private-form input {
    background: var(--af-surface);
    border: 1px solid var(--af-border);
    color: var(--af-text);
    min-height: 40px;
    padding: 8px 10px;
}

.theme-post-list {
    display: grid;
    gap: 22px;
}

.theme-post-card {
    border-bottom: 1px solid var(--af-border);
    padding-bottom: 22px;
}

.theme-post-card h2 {
    font-weight: 500;
}

.project-hero {
    display: grid;
    gap: 34px;
}

.project-hero-media img {
    display: block;
    max-height: 74vh;
    object-fit: cover;
    width: 100%;
}

.project-body {
    border-top: 1px solid var(--af-border);
    display: grid;
    gap: 52px;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.75fr);
    margin-top: 54px;
    padding-top: 42px;
}

.project-narrative h2 {
    font-size: 28px;
    font-weight: 500;
    margin-top: 38px;
}

.project-narrative p,
.project-narrative li {
    color: var(--af-text);
    line-height: 1.75;
}

.theme-project-specs {
    border-collapse: collapse;
    width: 100%;
}

.theme-project-specs th,
.theme-project-specs td {
    border-bottom: 1px solid var(--af-border);
    padding: 13px 0;
    text-align: left;
    vertical-align: top;
}

.theme-project-specs th {
    color: var(--af-muted);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    width: 38%;
}

.project-gallery-section {
    border-top: 1px solid var(--af-border);
}

.project-gallery-section h2 {
    font-size: 30px;
    font-weight: 500;
}

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

.theme-project-gallery figure {
    margin: 0;
}

.theme-project-gallery img {
    aspect-ratio: 4 / 3;
    display: block;
    object-fit: cover;
    width: 100%;
}

.project-actions {
    border-top: 1px solid var(--af-border);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

@media (max-width: 820px) {
    .site-header-inner,
    .site-footer-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 16px;
        padding: 18px 0;
    }

    .site-nav ul,
    .site-footer ul {
        flex-wrap: wrap;
    }

    .project-body,
    .theme-project-gallery,
    .archfolio-columns-2,
    .archfolio-columns-3,
    .archfolio-columns-4,
    .archfolio-filter {
        grid-template-columns: 1fr;
    }

    .front-hero {
        min-height: 54vh;
        padding: 56px 24px;
    }
}
