@font-face {
    font-family: "JetBrains Mono";
    src: url("/assets/fonts/webfonts/JetBrainsMono-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "JetBrains Mono";
    src: url("/assets/fonts/webfonts/JetBrainsMono-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --ink: #172328;
    --ink-soft: #314046;
    --paper: #f7f1e9;
    --paper-warm: #eee7dc;
    --line: #cfc8ba;
    --muted: #627076;
    --accent: #b58d5a;
    --content-width: 1330px;
    --reading-width: 820px;
    --font-mono: "JetBrains Mono", monospace;
}

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

html {
    font-size: 16px;
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    display: flex;
    flex-direction: column;
    font-family: var(--font-mono);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

main {
    flex: 1;
}

body:not(.template-home) main {
    display: flex;
    flex-direction: column;
    padding-bottom: 42px;
}

.template-home main {
    display: flex;
    flex: 1;
    flex-direction: column;
}

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

a {
    color: inherit;
    text-underline-offset: 0.22em;
    text-decoration-thickness: 1px;
}

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

.container {
    width: min(calc(100% - 4rem), var(--content-width));
    margin-inline: auto;
}

.site-header {
    border-bottom: 1px solid var(--line);
}

.site-header .container {
    width: min(calc(100% - 12rem), 1728px);
}

.template-home .site-footer .container {
    width: min(calc(100% - 12rem), 1728px);
}

.header-inner {
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
}

.brand img {
    width: 132px;
    height: auto;
}

.brand-wordmark {
    display: grid;
    gap: 0.2rem;
    color: var(--ink);
    line-height: 1;
    text-transform: uppercase;
}

.brand-name {
    display: flex;
    gap: 0.32rem;
    font-size: 1.95rem;
    font-weight: 700;
    letter-spacing: 0;
}

.brand-system {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.7rem;
    font-size: 1rem;
    font-weight: 700;
}

.brand-system-letters {
    display: flex;
    gap: 0.38rem;
}

.brand-system::before,
.brand-system::after {
    content: "";
    width: 3.8rem;
    height: 1px;
    background: currentColor;
}

.site-nav,
.footer-nav {
    display: flex;
    align-items: center;
    gap: clamp(1.7rem, 4vw, 4.8rem);
}

.site-nav a,
.footer-nav a {
    position: relative;
    font-size: 0.94rem;
    font-weight: 700;
    letter-spacing: 0;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
}

.site-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -0.72rem;
    height: 2px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 140ms ease;
}

.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after {
    transform: scaleX(1);
}

.hero {
    display: flex;
    align-items: center;
    flex: 1 0 auto;
    padding-block: 0.75rem;
}

.hero .container {
    width: min(calc(100% - 12rem), 1728px);
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(34rem, 0.72fr) minmax(0, 1.28fr);
    gap: 3rem;
    align-items: center;
}

.hero-copy h1 {
    margin: 0;
    font-size: 5.6rem;
    line-height: 0.98;
    font-weight: 700;
    letter-spacing: 0;
}

.hero-copy h1 span {
    white-space: nowrap;
}

.rule-mark {
    display: grid;
    grid-template-columns: 1fr 0.85rem 1fr;
    align-items: center;
    gap: 1.25rem;
    width: min(100%, 32rem);
    margin-block: 1.25rem 1.45rem;
}

.rule-mark::before,
.rule-mark::after,
.rule-mark {
    color: var(--ink);
}

.rule-mark::before,
.rule-mark::after {
    content: "";
    height: 2px;
    background: var(--ink);
    justify-self: stretch;
}

.rule-mark span {
    width: 0.85rem;
    height: 0.85rem;
    background: var(--ink);
    transform: rotate(45deg);
}

.hero-copy p {
    max-width: 35rem;
    margin: 0 0 1.35rem;
    color: var(--ink-soft);
    font-size: 1.1rem;
    line-height: 1.8;
}

.hero-art {
    justify-self: end;
    width: 100%;
    min-width: 0;
}

.hero-art img {
    width: 100%;
    max-width: 920px;
    max-height: 420px;
    height: auto;
    margin-left: auto;
    object-fit: contain;
    opacity: 1;
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 1.2rem;
    min-height: 3.45rem;
    padding: 0.8rem 1.6rem;
    background: var(--ink);
    color: var(--paper);
    font-weight: 700;
    letter-spacing: 0;
    text-decoration: none;
    text-transform: uppercase;
}

.button:hover {
    background: var(--accent);
    color: #fff;
}

.button span {
    font-size: 1.8em;
    line-height: 0;
}

.principles-band {
    background:
        radial-gradient(circle at 50% -20%, rgba(255, 255, 255, 0.08), transparent 23rem),
        var(--ink);
    color: var(--paper);
}

.principles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.principle {
    position: relative;
    min-height: 160px;
    padding: 0.85rem clamp(1.4rem, 4vw, 4rem) 1rem;
    text-align: center;
}

.principle + .principle::before {
    content: "";
    position: absolute;
    left: 0;
    top: 1.35rem;
    bottom: 1.35rem;
    width: 2px;
    background: rgba(243, 238, 228, 0.62);
}

.principle-icon {
    display: block;
    width: 3rem;
    height: 3rem;
    margin: 0 auto 0.45rem;
    color: #e9d8bd;
    fill: none;
    overflow: visible;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.principle h2,
.home-cta h2 {
    margin: 0 0 0.65rem;
    font-size: 1.04rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.home-cta h2::after {
    content: "";
    display: block;
    width: 2.8rem;
    height: 1px;
    margin-top: 0.45rem;
    background: var(--muted);
}

.principle p {
    max-width: 24rem;
    margin: 0 auto;
    font-size: 0.9rem;
    line-height: 1.45;
}

.home-cta {
    border-bottom: 1px solid var(--line);
}

.cta-grid {
    position: relative;
    display: grid;
    grid-template-columns: 2fr 1fr;
    column-gap: 0;
    padding-block: 0.8rem;
}

.cta-grid::before {
    content: "";
    position: absolute;
    top: 0.95rem;
    bottom: 0.95rem;
    left: 66.666%;
    width: 2px;
    background: rgba(23, 35, 40, 0.24);
}

.cta-grid article:first-child {
    grid-column: 1;
    padding-right: clamp(2rem, 6vw, 5rem);
}

.cta-grid article:last-child {
    grid-column: 2;
    padding-left: clamp(2rem, 6vw, 5rem);
}

.home-cta p {
    max-width: 48rem;
    margin: 0 0 0.55rem;
    color: var(--ink-soft);
    font-size: 0.96rem;
    line-height: 1.6;
}

.text-link {
    display: inline-flex;
    align-items: baseline;
    gap: 0.75rem;
    border-bottom: 2px solid currentColor;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.05;
    text-decoration: none;
    text-transform: uppercase;
}

.text-link span {
    font-size: 1.45rem;
    line-height: 0;
    transform: translateY(0.08rem);
}

.page-shell {
    flex: 1;
    padding-block: 4rem;
}

.page-grid {
    display: grid;
    grid-template-columns: 12rem minmax(0, var(--reading-width));
    gap: clamp(3rem, 8vw, 8rem);
    align-items: start;
}

.page-kicker {
    position: sticky;
    top: 2rem;
    padding-top: 0.5rem;
    border-top: 2px solid var(--ink);
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
}

.page-content {
    max-width: var(--reading-width);
}

.page-content h1 {
    max-width: 14ch;
    margin: 0 0 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
    font-size: 3.8rem;
    line-height: 1.04;
    letter-spacing: 0;
}

.page-content h2 {
    margin: 2.6rem 0 0.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.page-content p {
    margin: 0 0 1.15rem;
    color: var(--ink-soft);
    font-size: 1.02rem;
    line-height: 1.75;
}

.site-footer {
    background: var(--ink);
    color: var(--paper);
}

body:not(.template-home) .site-footer {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10;
}

.footer-inner {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.site-footer p {
    margin: 0;
    font-size: 0.82rem;
    letter-spacing: 0;
    text-transform: uppercase;
}

.footer-nav {
    gap: 2rem;
}

.footer-nav a {
    color: var(--paper);
    font-size: 0.82rem;
    font-weight: 400;
}

@media (max-width: 1100px) {
    .header-inner {
        min-height: auto;
        padding-block: 1.2rem;
        align-items: flex-start;
        flex-direction: column;
        gap: 1.2rem;
    }

    .site-nav {
        width: 100%;
        justify-content: space-between;
        gap: 0.8rem;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .hero-art {
        justify-self: center;
    }

    .hero-art img {
        margin-inline: auto;
    }

    .principles-grid,
    .cta-grid {
        grid-template-columns: 1fr;
    }

    .page-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .page-kicker {
        position: static;
        width: 12rem;
    }

    .principle + .principle::before {
        left: 1.5rem;
        right: 1.5rem;
        top: 0;
        bottom: auto;
        width: auto;
        height: 2px;
    }

    .cta-grid::before {
        display: none;
    }

    .cta-grid article,
    .cta-grid article:first-child,
    .cta-grid article:last-child {
        grid-column: 1;
        padding-left: 0;
        padding-right: 0;
    }
}

@media (max-width: 640px) {
    .container {
        width: min(calc(100% - 2rem), var(--content-width));
    }

    .hero .container {
        width: min(calc(100% - 2rem), var(--content-width));
    }

    .brand img {
        width: 96px;
    }

    .brand-name {
        font-size: 1.3rem;
        gap: 0.16rem;
    }

    .brand-system {
        font-size: 0.78rem;
        gap: 0.45rem;
    }

    .brand-system-letters {
        gap: 0.2rem;
    }

    .brand-system::before,
    .brand-system::after {
        width: 2.2rem;
    }

    .site-nav a {
        font-size: 0.82rem;
    }

    .hero-copy h1 {
        font-size: 3.5rem;
    }

    .page-content h1 {
        font-size: 3rem;
    }

    .rule-mark {
        width: 100%;
    }

    .footer-inner {
        padding-block: 1rem;
        align-items: flex-start;
        flex-direction: column;
    }
}
