/* Subpages (portfolio archive, project pages, Impressum) in the start page's theme. */
.page-sub { padding-top: 1.5rem; }
.page-sub .page-inner { max-width: 72rem; }

/* Top bar: back links left, contact links right (next to the theme toggle) */
.topnav { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; min-height: 2.875rem; margin: 0 4rem 2.5rem 0; }
.topnav-back, .topnav-social { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.topnav-social { margin-left: auto; } /* stays right-aligned when it wraps to a second row */
/* The 4rem right margin keeps clear of the fixed theme toggle; from 1320px the 72rem column ends left of it */
@media (min-width: 1320px) { .topnav { margin-right: 0; } }

.page-header { margin-bottom: 2.5rem; }
.page-header h1 {
    color: var(--heading); font-size: 2.25rem; line-height: 2.5rem; font-weight: 700; letter-spacing: -.025em;
    overflow-wrap: break-word; hyphens: manual;
}
@media (min-width: 768px) { .page-header h1 { font-size: 3rem; line-height: 1.1; } }
.page-header .bar { margin-top: .75rem; }
.lead { max-width: 60rem; margin-top: 1.5rem; color: var(--muted); font-size: 1.125rem; line-height: 1.7; }
.lead p + p { margin-top: .5rem; }
.lead a { color: var(--text); text-decoration-color: var(--decoration); text-underline-offset: 3px; }
.lead a:hover { text-decoration-color: var(--decoration-hover); }

/* Project grid */
.projects { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); }
.project-card {
    display: flex; flex-direction: column; overflow: hidden; padding: 0; color: inherit; text-decoration: none;
    transition: transform .3s, box-shadow .3s, background-color .3s, border-color .3s;
}
.project-card:hover, .project-card:focus-visible { transform: translateY(-4px); box-shadow: 0 30px 60px -15px rgb(0 0 0 / .35); }
.project-card__media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--chip-bg); border-bottom: 1px solid var(--card-border); }
.project-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.project-card:hover .project-card__media img { transform: scale(1.05); }
.project-card__body { display: flex; flex: 1; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.5rem 1.5rem; }
.project-card h2 { color: var(--heading); font-size: 1.25rem; line-height: 1.35; font-weight: 700; }
.meta { margin-top: .375rem; color: var(--muted); font-size: .875rem; line-height: 1.4; }
.project-card .go {
    display: flex; flex: none; align-self: flex-end; padding: .5rem; border-radius: 9999px; color: var(--muted);
    background: var(--chip-bg); border: 1px solid var(--chip-border); transition: color .3s, transform .3s;
}
.project-card .go svg.lucide { width: 1rem; height: 1rem; }
.project-card:hover .go { color: var(--accent); transform: translateX(3px); }

/* Project page */
.hero { position: relative; overflow: hidden; padding: 0; margin-bottom: 2rem; }
.hero img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
@media (min-width: 768px) { .hero img { aspect-ratio: 21 / 9; } }
.hero__caption {
    position: absolute; inset: auto 0 0 0; padding: 4rem 2rem 1.75rem;
    background: linear-gradient(to top, rgb(17 24 39 / .85), rgb(17 24 39 / .45) 55%, transparent);
    color: #fff;
}
.hero__caption h1 { font-size: 1.875rem; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; }
@media (min-width: 768px) { .hero__caption h1 { font-size: 2.5rem; } }
.hero__caption .meta { color: rgb(255 255 255 / .85); font-size: 1rem; }
.hero__caption .bar { margin-top: .75rem; background: linear-gradient(to right, #60a5fa, #a855f7); }

.project-layout { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 960px) { .project-layout { grid-template-columns: minmax(0, 2fr) minmax(17rem, 1fr); } }
.project-main { display: grid; gap: 2rem; min-width: 0; }
.project-aside { display: grid; gap: 2rem; }
@media (min-width: 960px) { .project-aside { position: sticky; top: 1.5rem; } }

.label { margin-bottom: 1rem; color: var(--muted); font-size: .75rem; line-height: 1rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.label + .label, * + .label { margin-top: 2rem; }
.goal { color: var(--heading); font-size: 1.375rem; line-height: 1.4; font-weight: 600; }
.client { margin-top: .5rem; color: var(--muted); font-size: .9375rem; }
.summary {
    margin-top: 1.25rem; font-size: 1.125rem; line-height: 1.6; font-weight: 500;
    background: var(--bar); -webkit-background-clip: text; background-clip: text; color: transparent;
}

.facts { margin: 0; display: grid; gap: .875rem; }
.facts div { display: flex; justify-content: space-between; gap: 1rem; }
.facts dt { color: var(--muted); font-size: .9375rem; }
.facts dd { margin: 0; color: var(--heading); font-size: .9375rem; font-weight: 500; text-align: right; }

.resource-group + .resource-group { margin-top: 1.25rem; }
.resource-group h3 { margin-bottom: .5rem; color: var(--heading); font-size: .9375rem; font-weight: 600; }
.resource-links { list-style: none; margin: 0; padding: 0; display: grid; gap: .375rem; }
.resource-links a {
    display: flex; align-items: center; gap: .625rem; padding: .5rem .75rem; border-radius: .625rem;
    color: var(--text); font-size: .9375rem; text-decoration: none; overflow-wrap: anywhere;
    background: var(--chip-bg); border: 1px solid var(--chip-border); transition: background-color .2s, color .2s;
}
.resource-links a:hover { background: var(--chip-bg-hover); color: var(--muted-hover); }
.resource-links .icon { flex: none; color: var(--accent); }

.gallery { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); }
.gallery a { display: block; overflow: hidden; border-radius: .75rem; aspect-ratio: 4 / 3; background: var(--chip-bg); }
.gallery img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gallery a:hover img { transform: scale(1.06); }

.page-end { display: flex; justify-content: center; margin-top: 3rem; }

/* Footer */
.site-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.5rem; margin-top: 4rem; }

/* Contact links in the top bar (pill style) */
.social-link {
    display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .875rem; border-radius: 9999px;
    color: var(--muted); font-size: .875rem; text-decoration: none;
    background: var(--toggle-bg); border: 1px solid var(--toggle-border);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: color .3s, background-color .3s;
}
.social-link:hover { color: var(--muted-hover); background: var(--toggle-bg-hover); }
.social-link svg.lucide { width: 1rem; height: 1rem; }

@media (max-width: 900px) {
    .social-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .social-link { padding: .5rem .625rem; }
}
@media (max-width: 640px) {
    .pill-compact span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .pill-compact { padding: .5rem .75rem; }
    .card { padding: 1.5rem; }
    .project-card, .hero { padding: 0; }
    .hero__caption { padding: 3rem 1.25rem 1.25rem; }
}
