:root {
    --bg: #f3efe6;
    --bg-image: url("../img/uploads-2024-08-cropped-bg-masthead.jpg");
    --panel: rgba(255, 252, 244, 0.86);
    --panel-strong: #fffaf0;
    --text: #16130f;
    --muted: #5d554a;
    --line: rgba(22, 19, 15, 0.14);
    --accent: #0d4c45;
    --accent-strong: #083831;
    --shadow: 0 24px 70px rgba(20, 17, 11, 0.08);
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Manrope", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(13, 76, 69, 0.1), transparent 28%),
        linear-gradient(180deg, #f9f4ea 0%, var(--bg) 48%, #ebe3d3 100%);
}

body.menu-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

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

figure {
    margin: 0;
}

.site-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 48px;
}

.site-header {
    position: sticky;
    top: 16px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 250, 240, 0.82);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--text);
    color: #f8f1e4;
    font-family: "Instrument Serif", serif;
    font-size: 1.05rem;
    font-style: italic;
    letter-spacing: 0.02em;
}

.brand-text {
    font-size: 0.95rem;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.menu-item {
    position: relative;
}

.menu-item > a,
.nav-cta {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--muted);
    border-radius: 999px;
    transition: color 180ms ease, background 180ms ease;
}

.menu-item > a::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 6px;
    height: 1px;
    transform: scaleX(0);
    transform-origin: left;
    background: currentColor;
    transition: transform 180ms ease;
}

.menu-item > a:hover::after,
.menu-item.current > a::after,
.menu-item > a.is-active::after {
    transform: scaleX(1);
}

.menu-item.current > a,
.menu-item > a:hover {
    color: var(--text);
}

.nav-cta {
    padding: 12px 18px;
    background: var(--text);
    color: #f8f1e4 !important;
}

.nav-cta::after {
    display: none;
}

.submenu-toggle {
    display: none;
}

.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 280px;
    margin: 0;
    padding: 20px 10px 10px;
    list-style: none;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 250, 240, 0.96);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.menu-item.has-children:hover > .sub-menu,
.menu-item.has-children:focus-within > .sub-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.sub-menu li a {
    display: block;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted);
    border-radius: 12px;
    transition: background 180ms ease, color 180ms ease;
}

.sub-menu li a:hover,
.sub-menu li.current a {
    background: var(--panel-strong);
    color: var(--text);
}

.menu-toggle {
    display: none;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--text);
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    background: #f8f1e4;
    transition: transform 180ms ease, opacity 180ms ease;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

main {
    padding-top: 40px;
}

section[id] {
    scroll-margin-top: 140px;
}

.hero,
.section,
.site-footer,
.page-section {
    border-top: 1px solid var(--line);
}

.hero {
    padding: 88px 40px 80px;
    border-radius: 36px;
    background:
        linear-gradient(180deg, rgba(92, 77, 66, 0.72) 0%, rgba(92, 77, 66, 0.72) 100%),
        var(--bg-image);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    color: #fff9f0;
    box-shadow: var(--shadow);
}

.hero-inner {
    max-width: 820px;
}

.eyebrow {
    margin: 0 0 14px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
}

.hero h1,
.section-heading h2,
.page-heading h1 {
    margin: 0;
    font-family: "Instrument Serif", serif;
    font-weight: 400;
    letter-spacing: -0.03em;
    line-height: 0.95;
}

.hero h1 {
    max-width: none;
    font-size: clamp(1.1rem, 4.6vw, 4.5rem);
    white-space: nowrap;
}

.hero .eyebrow {
    color: rgba(255, 249, 240, 0.82);
}

.hero h1 {
    color: #fff9f0;
}

.hero-copy {
    max-width: 900px;
    margin: 24px 0 0;
    font-size: clamp(1.02rem, 2.4vw, 1.3rem);
    line-height: 1.75;
    color: rgba(255, 249, 240, 0.88);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 32px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 22px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 800;
    transition: transform 180ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button-primary {
    background: var(--accent);
    color: #f6f1e8;
}

.button-primary:hover {
    background: var(--accent-strong);
}

.button-secondary {
    color: #fff9f0;
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.45);
}

.section,
.page-section {
    padding: 36px 0 0;
}

.section + .section,
.page-section + .page-section {
    margin-top: 28px;
}

.section-heading,
.page-heading {
    display: grid;
    gap: 8px;
    margin-bottom: 28px;
}

.section-heading h2,
.page-heading h1 {
    max-width: 14ch;
    font-size: clamp(2.2rem, 5vw, 4.3rem);
}

.section-body,
.contact-panel,
.content-panel,
.prose {
    border: 1px solid var(--line);
    border-radius: 28px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 28px;
    padding: 28px;
}

.two-column p,
.contact-panel p,
.content-panel p,
.prose p {
    margin: 0;
    color: var(--muted);
    line-height: 1.8;
}

.prose {
    padding: 36px;
}

.prose > * + * {
    margin-top: 1.25em;
}

.prose h2,
.prose h3,
.prose h4 {
    margin: 1.6em 0 0.6em;
    font-family: "Instrument Serif", serif;
    font-weight: 400;
    color: var(--text);
    line-height: 1.2;
}

.prose h2 {
    font-size: 2rem;
}

.prose h3 {
    font-size: 1.5rem;
}

.prose h4 {
    font-size: 1.15rem;
    font-family: "Manrope", sans-serif;
    font-weight: 800;
}

.prose p {
    margin: 0 0 1.25em;
}

.prose a {
    color: var(--accent);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.prose a:hover {
    color: var(--accent-strong);
}

.prose img {
    border-radius: 20px;
    margin: 1.5em 0;
}

.prose figure {
    margin: 1.5em 0;
}

.prose figure img {
    margin: 0;
}

.prose ul,
.prose ol {
    margin: 0 0 1.25em;
    padding-left: 1.4em;
    color: var(--muted);
    line-height: 1.8;
}

.prose li + li {
    margin-top: 0.5em;
}

.prose strong {
    color: var(--text);
}

.prose hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 2em 0;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 0.95rem;
}

.prose th,
.prose td {
    padding: 14px 16px;
    text-align: left;
    border: 1px solid var(--line);
}

.prose th {
    background: var(--panel-strong);
    font-weight: 800;
    color: var(--text);
}

.prose td {
    color: var(--muted);
}

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

.product-card,
.project-card,
.post-card {
    display: grid;
    gap: 14px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.project-card {
    gap: 10px;
}

.product-kicker,
.project-kicker,
.post-date {
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0;
}

.product-card h3,
.project-card h3,
.post-card h2 {
    margin: 0;
    font-size: 1.4rem;
    font-family: "Instrument Serif", serif;
    font-weight: 400;
    line-height: 1.15;
}

.post-card h2 {
    font-size: 1.25rem;
}

.product-card p,
.project-card p,
.post-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
    font-size: 0.95rem;
}

.product-card a,
.project-card a,
.post-card a.text-link,
.text-link {
    font-weight: 800;
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.product-card a:hover,
.project-card a:hover,
.text-link:hover {
    color: var(--accent-strong);
}

.post-card h2 a {
    color: inherit;
    text-decoration: none;
}

.post-card h2 a:hover {
    color: var(--accent);
}

.hero-meta {
    margin: 14px 0 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: rgba(255, 249, 240, 0.78);
}

.back-link {
    margin: 28px 0 0;
    font-weight: 800;
}

.back-link a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.back-link a:hover {
    color: var(--accent-strong);
}

.spotlight-panel,
.contact-panel,
.content-panel {
    padding: 28px;
}

.contact-panel {
    display: grid;
    gap: 24px;
    align-items: start;
}

.site-footer {
    margin-top: 36px;
    padding-top: 18px;
    color: var(--muted);
    font-size: 0.92rem;
}

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 500ms ease, transform 500ms ease;
}

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

.hero.reveal,
.hero.reveal.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
}

.no-reveal {
    opacity: 1;
    transform: none;
}

.project-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 12px;
}

.project-list li {
    padding: 14px 16px;
    border-radius: 18px;
    background: var(--panel-strong);
    border: 1px solid rgba(22, 19, 15, 0.08);
    font-weight: 700;
}

.project-list li a {
    color: var(--accent);
}

@media (max-width: 900px) {
    .product-grid,
    .project-grid,
    .post-grid,
    .two-column,
    .spotlight-panel,
    .contact-panel,
    .content-panel,
    .prose {
        grid-template-columns: 1fr;
    }

    .site-nav {
        position: fixed;
        top: 86px;
        right: 16px;
        left: 16px;
        display: block;
        padding: 18px;
        border: 1px solid var(--line);
        border-radius: 24px;
        background: rgba(255, 250, 240, 0.96);
        box-shadow: var(--shadow);
        opacity: 0;
        pointer-events: none;
        transform: translateY(-10px);
        transition: opacity 180ms ease, transform 180ms ease;
        max-height: calc(100vh - 110px);
        overflow-y: auto;
    }

    .menu-open .site-nav {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .menu {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }

    .menu-item {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px;
    }

    .menu-item > a,
    .nav-cta {
        padding: 12px 14px;
        width: 100%;
    }

    .menu-item > a::after {
        display: none;
    }

    .menu-item.current > a,
    .menu-item > a:hover {
        background: var(--panel-strong);
    }

    .nav-cta {
        margin-top: 8px;
        justify-content: center;
    }

    .submenu-toggle {
        display: grid;
        place-items: center;
        width: 40px;
        height: 40px;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: var(--panel-strong);
        font-size: 1.2rem;
        font-weight: 700;
        cursor: pointer;
        color: var(--text);
    }

    .sub-menu {
        position: static;
        opacity: 1;
        pointer-events: auto;
        transform: none;
        box-shadow: none;
        background: transparent;
        border: 0;
        border-radius: 0;
        min-width: auto;
        width: 100%;
        padding: 4px 0 4px 12px;
        display: none;
    }

    .menu-item.has-children.is-open > .sub-menu {
        display: block;
    }

    .menu-item.has-children:hover > .sub-menu,
    .menu-item.has-children:focus-within > .sub-menu {
        opacity: 1;
        transform: none;
    }

    .sub-menu li a {
        padding: 10px 14px;
    }

    .menu-toggle {
        display: inline-block;
    }

    .menu-open .menu-toggle span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .menu-open .menu-toggle span:nth-child(2) {
        opacity: 0;
    }

    .menu-open .menu-toggle span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }
}

@media (max-width: 640px) {
    .site-shell {
        width: min(100% - 20px, 1120px);
    }

    .site-header {
        padding: 12px 14px;
    }

    .hero {
        padding: 54px 22px 44px;
        border-radius: 28px;
    }

    .section-heading h2,
    .page-heading h1,
    .hero h1 {
        max-width: none;
    }

    .two-column,
    .spotlight-panel,
    .contact-panel,
    .content-panel,
    .prose,
    .product-card,
    .project-card,
    .post-card {
        padding: 22px;
    }

    .prose h2 {
        font-size: 1.6rem;
    }

    .prose h3 {
        font-size: 1.25rem;
    }
}
