/* Knowledge Is Porridge: site styles. Black and white only. */

@font-face {
    font-family: "Montserrat";
    src: url("../fonts/montserrat/montserrat-regular-webfont.woff2") format("woff2");
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "Montserrat";
    src: url("../fonts/montserrat/montserrat-semibold-webfont.woff2") format("woff2");
    font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "Montserrat";
    src: url("../fonts/montserrat/montserrat-bold-webfont.woff2") format("woff2");
    font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "Montserrat";
    src: url("../fonts/montserrat/montserrat-black-webfont.woff2") format("woff2");
    font-weight: 900; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "Lora";
    src: url("../fonts/lora/lora-italic-webfont.woff2") format("woff2");
    font-weight: 400; font-style: italic; font-display: swap;
}

:root {
    --black: #000;
    --white: #fff;
    --grey: #8a8a8a;
    --grey-dark: #5c5c5c;
    --rule-light: rgb(255 255 255 / 0.22);
    --rule-dark: rgb(0 0 0 / 0.9);

    --sans: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
    --serif: "Lora", Georgia, serif;

    --gutter: clamp(16px, 4vw, 56px);
    --max: 1400px;
    --space: clamp(80px, 12vw, 176px);
    --border: 3px;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
    margin: 0;
    background: var(--black);
    color: var(--white);
    font-family: var(--sans);
    font-size: 1.0625rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
p { margin: 0 0 1em; }

h1, h2, h3 { margin: 0; font-weight: 900; line-height: 0.92; letter-spacing: -0.04em; text-transform: uppercase; }
h1 em, h2 em, .about em {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    text-transform: none;
    letter-spacing: -0.02em;
}

::selection { background: var(--white); color: var(--black); }
.section--light ::selection { background: var(--black); color: var(--white); }

.wrap {
    width: 100%;
    max-width: calc(var(--max) + var(--gutter) * 2);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.label {
    display: block;
    margin: 0 0 1.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.skip-link {
    position: absolute;
    left: 16px; top: -60px;
    padding: 10px 18px;
    background: var(--white); color: var(--black);
    font-weight: 700;
    z-index: 200;
}
.skip-link:focus { top: 16px; }

:focus-visible { outline: 3px solid currentColor; outline-offset: 4px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6em;
    padding: 1.05em 1.8em;
    border: var(--border) solid currentColor;
    font: 700 0.85rem/1 var(--sans);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.btn--light { background: var(--white); color: var(--black); border-color: var(--white); }
.btn--light:hover { background: var(--black); color: var(--white); }
.btn--outline-light { background: transparent; color: var(--white); }
.btn--outline-light:hover { background: var(--white); color: var(--black); }
.btn--dark { background: var(--black); color: var(--white); border-color: var(--black); }
.btn--dark:hover { background: var(--white); color: var(--black); }
.btn--big { font-size: 1rem; padding: 1.3em 2.2em; }
.btn[disabled] { opacity: 0.5; cursor: progress; }

/* Header: inverts against whatever is behind it */
.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px var(--gutter);
    color: var(--white);
    mix-blend-mode: difference;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
}
.brand img { width: 44px; height: 44px; }
.site-nav { display: flex; align-items: center; gap: clamp(14px, 3vw, 36px); }
.site-nav a {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0 2px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    padding-bottom: 3px;
    transition: background-size 0.25s ease;
}
.site-nav a:hover { background-size: 100% 2px; }
.site-nav__cta { border: 2px solid currentColor; padding: 10px 16px !important; background: none !important; }
.site-nav__cta:hover { background: var(--white) !important; color: var(--black); }

@media (max-width: 640px) {
    .brand span { display: none; }
    .site-nav a:not(.site-nav__cta) { display: none; }
}

/* Hero */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: flex-end;
    padding: 140px 0 clamp(40px, 6vw, 72px);
    overflow: hidden;
    isolation: isolate;
}
.hero__mark {
    position: absolute;
    z-index: -1;
    right: -6vw;
    top: 50%;
    width: min(70vw, 900px);
    transform: translateY(-50%);
    opacity: 0.16;
    pointer-events: none;
}
.hero__mark img { width: 100%; animation: breathe 10s ease-in-out infinite; }
@keyframes breathe {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.04) rotate(2deg); }
}
.hero__title {
    display: flex;
    flex-direction: column;
    font-size: clamp(3.4rem, 13vw, 12.5rem);
}
.hero__title span { display: block; }
.hero__title em { font-size: 0.92em; }
.hero__foot {
    display: grid;
    grid-template-columns: minmax(0, 34rem) auto;
    justify-content: space-between;
    align-items: end;
    gap: 32px;
    margin-top: clamp(32px, 5vw, 64px);
    padding-top: 28px;
    border-top: var(--border) solid var(--white);
}
.hero__lede { margin: 0; font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: #d0d0d0; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 860px) {
    .hero__foot { grid-template-columns: 1fr; }
    .hero__mark { width: 120vw; right: -40vw; top: 34%; }
}

/* Sections */
.section { padding: var(--space) 0; }
.section--light { background: var(--white); color: var(--black); }
.section--dark { background: var(--black); color: var(--white); }

.section__head {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 0 clamp(16px, 3vw, 40px);
    margin-bottom: clamp(48px, 7vw, 96px);
}
.section__num {
    padding-top: 0.6em;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.2em;
}
.section__num::before { content: "("; }
.section__num::after { content: ")"; }
.section__head h2 { font-size: clamp(3rem, 11vw, 10rem); }
.section__intro {
    grid-column: 2;
    margin: 1.25rem 0 0;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    font-weight: 600;
    max-width: 28em;
}

/* Products */
.products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    border-top: var(--border) solid var(--black);
    border-left: var(--border) solid var(--black);
}
.product {
    display: flex;
    flex-direction: column;
    min-height: 420px;
    padding: clamp(24px, 3vw, 40px);
    border-right: var(--border) solid var(--black);
    border-bottom: var(--border) solid var(--black);
    text-decoration: none;
    background: var(--white);
    color: var(--black);
    transition: background 0.2s ease, color 0.2s ease;
}
@media (max-width: 640px) { .product { min-height: 300px; } }
.product:hover, .product:focus-visible { background: var(--black); color: var(--white); outline: none; }
.product__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: auto; }
.product__icon {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    background: var(--black);
    color: var(--white);
    font-size: 1.75rem;
    font-weight: 900;
    overflow: hidden;
    transition: background 0.2s ease, color 0.2s ease;
}
.product:hover .product__icon { background: var(--white); color: var(--black); }
.product__icon img { width: 100%; height: 100%; object-fit: cover; }
.product__name { margin-top: 48px; font-size: clamp(1.75rem, 3vw, 2.5rem); }
.product__desc { margin: 14px 0 28px; font-size: 1.05rem; opacity: 0.75; }
.product__cta {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.product__cta span { display: inline-block; transition: transform 0.2s ease; }
.product:hover .product__cta span { transform: translate(4px, -2px); }

.tag {
    display: inline-block;
    padding: 6px 10px;
    border: 2px solid currentColor;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    white-space: nowrap;
}
.tag--live { background: var(--black); color: var(--white); border-color: var(--black); }
.product:hover .tag--live { background: var(--white); color: var(--black); border-color: var(--white); }

/* About */
.about {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: clamp(32px, 6vw, 96px);
    align-items: end;
}
.about__big {
    margin: 0;
    font-size: clamp(1.6rem, 3.6vw, 3rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
}
.about__small { margin: 0; color: #bdbdbd; font-size: 1.1rem; }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; } }

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: clamp(64px, 9vw, 128px) 0 0;
    border-top: var(--border) solid var(--white);
}
.stats__item {
    display: flex;
    flex-direction: column;
    padding: 24px clamp(12px, 2vw, 28px) 0 0;
}
.stats__item + .stats__item { border-left: 1px solid var(--rule-light); padding-left: clamp(12px, 2vw, 28px); }
.stats dd {
    margin: 0;
    font-size: clamp(3.5rem, 12vw, 11rem);
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: -0.05em;
}
.stats dt {
    margin-top: 12px;
    font-size: clamp(0.65rem, 1.4vw, 0.8rem);
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #bdbdbd;
}

/* Contact */
.contact {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: clamp(40px, 6vw, 112px);
}
.contact__intro p { font-size: 1.2rem; font-weight: 600; max-width: 22em; }
.contact__direct { margin-top: 2.5rem; }
.label--dark { color: var(--grey-dark); }
.contact__direct a {
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    font-weight: 900;
    text-decoration: none;
    border-bottom: var(--border) solid var(--black);
    word-break: break-word;
}
.contact__direct a:hover { background: var(--black); color: var(--white); }

.contact-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px 32px;
}
.field { display: grid; gap: 4px; }
.field--full { grid-column: 1 / -1; }
.field label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.optional { color: var(--grey-dark); letter-spacing: 0.1em; }
.field input, .field textarea {
    width: 100%;
    padding: 10px 0 12px;
    border: 0;
    border-bottom: var(--border) solid var(--black);
    border-radius: 0;
    background: transparent;
    color: var(--black);
    font: 600 1.25rem/1.4 var(--sans);
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:focus, .field textarea:focus { outline: none; border-bottom-width: 6px; padding-bottom: 9px; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-bottom-style: dashed; }
.field--trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact-form__submit { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.form-status { margin: 0; font-weight: 700; }
.form-status.is-error::before { content: "✕ "; }
.form-status.is-success::before { content: "✓ "; }

@media (max-width: 860px) {
    .contact { grid-template-columns: 1fr; }
    .contact-form { grid-template-columns: 1fr; }
}

/* Footer */
.site-footer {
    padding: clamp(56px, 8vw, 96px) 0 28px;
    background: var(--black);
    color: var(--white);
    overflow: hidden;
}
.site-footer__word {
    margin: 0 0 clamp(32px, 5vw, 56px);
    /* sized so the full name spans the container without overflowing */
    font-size: min(7vw, 6.8rem);
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: -0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}
.site-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px 32px;
    padding-top: 20px;
    border-top: 1px solid var(--rule-light);
    font-size: 0.8rem;
    color: var(--grey);
}
.site-footer__bottom p { margin: 0; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.site-footer__bottom a {
    color: var(--white);
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
}

/* Inner pages (privacy etc.) */
.page-hero {
    padding: clamp(140px, 18vw, 220px) 0 clamp(56px, 8vw, 96px);
    background: var(--black);
    color: var(--white);
    border-bottom: var(--border) solid var(--white);
}
.page-hero h1 { font-size: clamp(3.4rem, 12vw, 10rem); }

.legal { max-width: calc(46rem + var(--gutter) * 2); margin-left: 0; }
.legal__lede {
    margin-bottom: clamp(40px, 6vw, 72px);
    font-size: clamp(1.3rem, 2.4vw, 1.75rem);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
}
.legal h2 {
    margin: clamp(48px, 6vw, 72px) 0 18px;
    padding-top: 18px;
    border-top: var(--border) solid var(--black);
    font-size: clamp(1.6rem, 3vw, 2.25rem);
    line-height: 1;
}
.legal h3 {
    margin: 28px 0 8px;
    font-size: 0.8rem;
    letter-spacing: 0.18em;
}
.legal p, .legal li { font-size: 1.05rem; line-height: 1.7; }
.legal ul { margin: 0 0 1em; padding-left: 1.2em; }
.legal li { margin-bottom: 0.4em; }
.legal li::marker { content: "— "; }
.legal a { font-weight: 700; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.legal a:hover { background: var(--black); color: var(--white); text-decoration: none; }

/* While Products is hidden, keep a visible break between the black hero and black About section */
.hero + [hidden] + .section--dark { border-top: var(--border) solid var(--white); }
