/* Registered so --wash animates; unregistered custom properties snap */
@property --wash {
    syntax: '<number>';
    inherits: true;
    initial-value: 0;
}

/* Palette sampled from the Pittsburgh skyline photo (assets/skyline-*).
   Gold is the only accent. It fails contrast as text on paper/sky (~2:1),
   so on light surfaces it is only ever a fill or a rule. */
:root {
    --paper: #e6e5e1;
    --sky: #cfcfcc;
    --concrete: #8a8a86;
    --steel: #4a4b4d;
    --ink: #121314;
    --gold: #ce9f46;

    --bg: var(--paper);
    --surface: var(--sky);
    --text: var(--ink);
    --text-muted: var(--steel);
    --rule: var(--concrete);
    --link: currentColor;
    --link-decoration: var(--gold);

    /* Gloock is a sturdy modern display serif; labels reuse it in tracked
       caps so headings and UI chrome read as one voice. Garamond for prose. */
    --font-display: 'Gloock', Georgia, serif;
    --font-label: var(--font-display);
    --font-body: 'EB Garamond', Garamond, Georgia, serif;

    --wrap: 1200px;
    --gutter: 2rem;
    --header-h: 4.5rem;

    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: var(--ink);
        --surface: #1c1d1f;
        --text: var(--paper);
        --text-muted: var(--concrete);
        --rule: var(--steel);
        --link: var(--gold);
    }
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* height: auto so width/height attributes only reserve aspect ratio;
   without it a shrunk image keeps its attribute height and stretches */
img {
    display: block;
    max-width: 100%;
    height: auto;
}

::selection {
    background-color: var(--gold);
    color: var(--ink);
}

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}

/* ============================================================
   Typography
   ============================================================ */

h1,
h2,
h3 {
    font-family: var(--font-display);
    line-height: 1.05;
}

h1 {
    font-size: clamp(2.5rem, 7vw, 5.5rem);
    font-weight: 400;
    margin-bottom: 1rem;
}

h2 {
    font-size: clamp(1.75rem, 3.5vw, 2.75rem);
    font-weight: 400;
    margin-bottom: 1.25rem;
}

h3 {
    font-size: 1.35rem;
    font-weight: 400;
    margin-bottom: 0.75rem;
}

p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

/* ============================================================
   Links & Buttons
   ============================================================ */

a {
    color: var(--link);
    text-decoration: underline;
    text-decoration-color: var(--link-decoration);
    text-decoration-thickness: 2px;
    text-underline-offset: 0.2em;
    transition: text-decoration-color 0.2s ease;
}

a:hover {
    text-decoration-color: currentColor;
}

.btn {
    display: inline-block;
    padding: 0.95rem 1.75rem;
    font-family: var(--font-label);
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--ink);
    background-color: var(--gold);
    border: 1px solid var(--gold);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.btn:hover {
    background-color: var(--ink);
    color: var(--gold);
    border-color: var(--gold);
}

/* Secondary: outline in the current text color */
.btn--ghost {
    background-color: transparent;
    color: var(--text);
    border-color: var(--text);
}

.btn--ghost:hover {
    background-color: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

/* ============================================================
   Layout
   ============================================================ */

.content-wrap {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

main {
    min-height: calc(100vh - 180px);
}

@media (max-width: 768px) {
    :root {
        --gutter: 1.25rem;
        --header-h: 4rem;
    }
}

@media (max-width: 480px) {
    :root {
        --gutter: 1rem;
    }
}

/* ============================================================
   Header & Nav
   ============================================================ */

header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--bg);
    border-bottom: 1px solid var(--rule);
}

/* Home: header floats over the photo. Text stays ink in both color
   schemes because it sits on the light sky, not on --bg. */
.header--overlay {
    position: absolute;
    left: 0;
    right: 0;
    background-color: transparent;
    border-bottom-color: transparent;
    --text: var(--ink);
    --text-muted: var(--steel);
    --bg: var(--paper);
    --surface: var(--sky);
    --rule: var(--concrete);
}

.header-inner {
    max-width: var(--wrap);
    height: var(--header-h);
    margin: 0 auto;
    padding: 0 var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 1.5rem;
    color: var(--text);
    text-decoration: none;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2.25rem;
}

nav a {
    display: block;
    padding: 0.4rem 0;
    font-family: var(--font-label);
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s ease;
}

nav a:hover {
    border-bottom-color: var(--text);
}

nav a[aria-current="page"] {
    border-bottom-color: var(--gold);
}

/* Hamburger */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text);
    margin: 5px 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 768px) {
    .header-inner {
        position: relative;
    }

    .menu-toggle {
        display: block;
    }

    nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--bg);
        border-bottom: 1px solid var(--rule);
    }

    nav.open {
        display: block;
    }

    nav ul {
        flex-direction: column;
        gap: 0;
    }

    nav a {
        padding: 1rem var(--gutter);
        border-bottom: 1px solid var(--rule);
    }

    nav li:last-child a {
        border-bottom: none;
    }

    nav a:hover {
        border-bottom-color: var(--rule);
        background-color: var(--surface);
    }

    /* Gold bar on the left instead of underline in the stacked menu */
    nav a[aria-current="page"] {
        border-bottom-color: var(--rule);
        box-shadow: inset 3px 0 0 var(--gold);
    }
}

/* ============================================================
   Page banner (interior pages)
   ============================================================ */

.page-banner {
    position: relative;
    height: 32vh;
    min-height: 15rem;
    overflow: hidden;
    border-bottom: 1px solid var(--rule);
}

.page-banner img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Tower tops in the bottom quarter so the title clears them */
    object-position: center 48%;
}

/* Same overlap-driven wash as the home hero (see skyline-wash.js) */
.page-banner {
    --wash: 0;
    transition: --wash 0.3s ease;
}

.page-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(230, 229, 225, var(--wash)) 0%,
        rgba(230, 229, 225, calc(var(--wash) * 0.6)) 40%,
        transparent 70%
    );
    pointer-events: none;
}

/* Title sits on the light sky, so it is ink in both color schemes */
.page-banner__inner {
    position: relative;
    z-index: 1; /* above the ::after wash, which comes later in paint order */
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 2.5rem;
    color: var(--ink);
    --text-muted: var(--steel);
}

.page-banner h1 {
    margin-bottom: 0.5rem;
}

.page-banner p {
    font-family: var(--font-label);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--steel);
}

@media (max-width: 768px) {
    .page-banner__inner {
        padding-top: 1.75rem;
    }
}

/* ============================================================
   Footer
   ============================================================ */

footer {
    background-color: var(--ink);
    color: var(--concrete);
    border-top: 1px solid var(--steel);
    font-family: var(--font-label);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
}

.footer-inner {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 2.5rem var(--gutter);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

footer p {
    margin-bottom: 0;
    line-height: 1.5;
}


@media (max-width: 768px) {
    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem var(--gutter);
    }
}
