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

:root {
    --paper: #F4F1EA;
    --card: #FFFFFF;
    --sunken: #ECE7DC;
    --ink: #111111;
    --ink-soft: #4A4A4A;
    /* Brief specifies #85817A, but it fails WCAG AA (3.1–3.9:1) at caption sizes on all three surfaces. */
    --ink-faint: #67635C;
    --hairline: #C9C3B6;
    --rule: #111111;

    --green: #22B573;
    --yellow: #F2C200;
    --red: #D52B1E;

    --u: 17px;

    --sans: 'Jost', Futura, 'Century Gothic', Arial, sans-serif;
    --serif: 'Spectral', Georgia, serif;
    --mono: 'IBM Plex Mono', Menlo, monospace;
}

html { height: 100%; }

body {
    font-family: var(--serif);
    background: var(--paper);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover { text-decoration-thickness: 2px; }

.mono-label {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; }
}

/* ===================== HOME ===================== */

body.home {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    max-width: 1100px;
    margin: 0 auto;
    border-left: 1px solid var(--hairline);
    border-right: 1px solid var(--hairline);
}

/* Takes whatever height the footer leaves; min-height: 0 lets it shrink below its content so .right scrolls instead. */
.home-main {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
}

.footer {
    flex: none;
    background: var(--sunken);
}

.left {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid var(--hairline);
    overflow: hidden;
}

.photo-spacer {
    flex: 1;
    overflow: hidden;
}

.photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

.name-block {
    background: var(--paper);
    padding: var(--u) calc(var(--u) * 2);
    width: 100%;
}

/* Size intentionally unchanged pending broker guidance on name-vs-brokerage sizing. */
.name {
    font-family: var(--sans);
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.01em;
}

.headline-block {
    background: var(--ink);
    color: var(--paper);
    padding: 10px var(--u);
    position: absolute;
    bottom: 0;
    left: 0;
}

.headline {
    font-family: var(--sans);
    font-size: clamp(1.5rem, 3.2vw, 1.9rem);
    font-weight: 500;
    line-height: 1.35;
}

.headline em {
    font-style: italic;
    background: var(--red);
    padding: 0 0.12em;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.bio-block {
    grid-column: 1;
    grid-row: 2;
    padding: var(--u) calc(var(--u) * 2);
    border-right: 1px solid var(--hairline);
    border-top: 1px solid var(--hairline);
}

.bio {
    font-size: 17px;
    line-height: 1.6;
    color: var(--ink-soft);
    max-width: 65ch;
}

.bio strong {
    font-weight: 600;
    color: var(--ink);
}

.bio p + p { margin-top: 0.6em; }

.credentials {
    margin-top: var(--u);
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink-faint);
}

.credentials a { color: inherit; }

.right {
    grid-column: 2;
    grid-row: 1 / 3;
    padding: calc(var(--u) * 2);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.section-label,
.library-toggle,
.ask-toggle {
    font-family: var(--mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-top: 4px solid var(--rule);
    padding-top: 10px;
    margin-bottom: 10px;
}

.project-list,
.past-list,
.library-list {
    list-style: none;
}

.project-header,
.past-header {
    padding: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--u);
    cursor: pointer;
    user-select: none;
}

.project-list > li + li .project-header,
.past-list > li + li .past-header {
    border-top: 1px solid var(--hairline);
}

.project-header:hover .project-name,
.past-header:hover .project-name {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.project-name {
    font-family: var(--sans);
    font-size: 18px;
    font-weight: 500;
}

.past-header .project-name { font-size: 16px; }

.project-date {
    font-family: var(--mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--ink-faint);
    white-space: nowrap;
    flex-shrink: 0;
}

.project-detail,
.library-detail,
.ask-detail {
    display: none;
}

.project-detail.open,
.library-detail.open,
.ask-detail.open {
    display: block;
    animation: fade-in 0.2s ease;
}

.project-detail.open { padding-bottom: var(--u); }

.project-detail p {
    font-size: 17px;
    line-height: 1.6;
    color: var(--ink-soft);
    max-width: 65ch;
}

.project-detail p + p { margin-top: 0.6em; }

.project-links {
    margin-top: 10px;
    display: flex;
    gap: var(--u);
}

.project-links a {
    font-family: var(--mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.letters-teaser {
    display: block;
    margin-top: var(--u);
    padding: 10px var(--u) 12px;
    background: var(--card);
    border: 1.5px solid var(--ink);
    border-top: 4px solid var(--ink);
    text-decoration: none;
}

.letters-teaser-label,
.letters-teaser-cta {
    font-family: var(--mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.letters-teaser-label { display: block; }

.letters-teaser-text {
    display: block;
    margin-top: 4px;
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink-soft);
}

.letters-teaser-cta {
    margin-left: 4px;
    white-space: nowrap;
    color: var(--ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.letters-teaser:hover .letters-teaser-cta { text-decoration-thickness: 2px; }

.past-section {
    margin-top: auto;
    padding-top: calc(var(--u) * 2);
}

.library-section,
.ask-section {
    margin-top: calc(var(--u) * 2);
}

.library-toggle,
.ask-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    margin-bottom: 0;
}

.library-toggle:hover .library-toggle-label,
.ask-toggle:hover .ask-toggle-label {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.library-toggle-icon,
.ask-toggle-icon {
    font-size: 16px;
    line-height: 1;
}

.library-toggle.open .library-toggle-icon,
.ask-toggle.open .ask-toggle-icon {
    transform: rotate(45deg);
}

.library-detail.open,
.ask-detail.open {
    padding-bottom: var(--u);
}

.library-group { margin-top: var(--u); }

.library-group-label {
    font-family: var(--mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--ink-faint);
    padding-bottom: 6px;
    border-bottom: 1px solid var(--hairline);
}

.library-list li {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid var(--hairline);
    font-size: 16px;
    line-height: 1.4;
}

.library-list li:last-child { border-bottom: none; }

.medium-tag {
    font-family: var(--mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--ink-faint);
    flex-shrink: 0;
    width: 3.5rem;
}

.library-item-title { font-style: italic; }

.library-item-author {
    color: var(--ink-faint);
    font-size: 14px;
}

.ask-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: var(--u);
}

.ask-topic {
    font-style: italic;
    font-size: 16px;
    background: var(--card);
    border: 1px solid var(--hairline);
    padding: 4px 10px;
}

/* ===================== FOOTER ===================== */

.compliance {
    border-top: 4px solid var(--rule);
    padding: var(--u) calc(var(--u) * 2);
    font-family: var(--sans);
    color: var(--ink);
    line-height: 1.5;
}

/* Name must never be larger or bolder than either brokerage line. */
.compliance-agent {
    font-size: 14px;
    font-weight: 400;
}

.compliance-row {
    display: grid;
    grid-template-columns: repeat(4, auto);
    justify-content: space-between;
    align-items: start;
    gap: 10px 24px;
}

/* Matches one brokerage line + one address line (15px and 14px at line-height 1.5). */
.compliance-logo {
    display: block;
    height: 44px;
    width: auto;
}

.compliance-brokerage {
    font-size: 15px;
    font-weight: 500;
}

.compliance-address {
    font-size: 14px;
    font-weight: 400;
}

.footer-bar {
    border-top: 1px solid var(--hairline);
    padding: 10px calc(var(--u) * 2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--u);
}

.footer-left {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.8px;
    color: var(--ink-faint);
}

.footer-links {
    display: flex;
    gap: calc(var(--u) * 1.5);
}

.footer-links a {
    font-family: var(--mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* ===================== INNER PAGES ===================== */

body.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-header,
.page-main {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding-left: calc(var(--u) * 2);
    padding-right: calc(var(--u) * 2);
}

.page-header {
    padding-top: var(--u);
    padding-bottom: var(--u);
}

/* Kept at brokerage-line size/weight so it never outranks the compliance footer. */
.page-header a {
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
}

.page-header a:hover { text-decoration: underline; }

.page-main {
    flex: 1;
    padding-top: calc(var(--u) * 2);
    padding-bottom: calc(var(--u) * 4);
    border-top: 4px solid var(--rule);
}

.page-title {
    font-family: var(--sans);
    font-weight: 500;
    font-size: clamp(32px, 6vw, 44px);
    line-height: 1.15;
}

/* SVG rather than ■ ● ▲ glyphs: fonts draw those three at mismatched sizes. */
.marks {
    display: block;
    margin-top: var(--u);
    fill: var(--ink);
}

.card {
    margin-top: calc(var(--u) * 2);
    background: var(--card);
    border: 1.5px solid var(--ink);
    border-top: 4px solid var(--ink);
}

.page .footer > * {
    padding-left: max(calc(var(--u) * 2), calc((100% - 1100px) / 2 + var(--u) * 2));
    padding-right: max(calc(var(--u) * 2), calc((100% - 1100px) / 2 + var(--u) * 2));
}

/* ===================== MOBILE ===================== */

@media (max-width: 768px) {
    body.home {
        display: block;
        height: auto;
        overflow: visible;
        border: none;
    }

    .home-main {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .left { border-right: none; }

    .photo-spacer {
        height: 80vw;
        flex: none;
    }

    .name-block,
    .bio-block,
    .right {
        padding-left: var(--u);
        padding-right: var(--u);
    }

    .bio-block {
        border-right: none;
        padding-top: var(--u);
        padding-bottom: calc(var(--u) * 2);
    }

    .right {
        grid-column: 1;
        grid-row: 3;
        overflow-y: visible;
        padding-top: 0;
        padding-bottom: calc(var(--u) * 2);
    }

    .compliance,
    .footer-bar,
    .page .footer > * {
        padding-left: var(--u);
        padding-right: var(--u);
    }

    .compliance-row {
        grid-template-columns: 1fr;
        justify-content: start;
    }

    .footer-bar {
        padding-top: var(--u);
        padding-bottom: var(--u);
    }

    .compliance-logo { height: 36px; }

    .footer-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-links {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px calc(var(--u) * 1.5);
    }

    .page-header,
    .page-main {
        padding-left: var(--u);
        padding-right: var(--u);
    }
}

.tel { white-space: nowrap; }
