/* Ker Corp - kercorp.fr
   ---------------------------------------------------------------------------
   Direction: titre de société. A holding is, literally, a certificate of
   ownership, so the page is engraved rather than designed: ivory stock, bottle
   green ink, a Didone cut, a double rule, and a real guilloché rosette computed
   from spirograph curves the way the ones on share certificates are.

   The page carries 45 words. With that little to say, a lukewarm layout shows
   immediately; the only workable answer is a single committed gesture.
   --------------------------------------------------------------------------- */

@font-face {
    font-family: "Bodoni";
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url("fonts/bodoni.woff2") format("woff2");
}

@font-face {
    font-family: "Karla";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("fonts/karla.woff2") format("woff2");
}

:root {
    --paper: #f5f1e7;
    --paper-2: #fbf9f3;
    --ink: #10261e;
    --ink-2: #3f5b4e;
    --ink-3: #7d8f85;
    --gold: #9d7a33;
    --rule: rgba(16, 38, 30, 0.22);
    --rule-soft: rgba(16, 38, 30, 0.1);
    --wrap: 880px;
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background-color: var(--paper);
    /* Security-paper hatching: invisible until you look for it. */
    background-image: repeating-linear-gradient(
        45deg,
        rgba(16, 38, 30, 0.022) 0 1px,
        transparent 1px 7px
    );
    color: var(--ink);
    font-family: "Karla", ui-sans-serif, system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.68;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Print grain: flat ivory reads as a screen colour, not as stock. */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    opacity: 0.4;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='0.4'/%3E%3C/svg%3E");
}

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

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

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

/* ---------- The certificate ---------- */

.page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 34px 20px;
    position: relative;
    z-index: 2;
}

.sheet {
    position: relative;
    width: 100%;
    max-width: var(--wrap);
    background: var(--paper-2);
    border: 1px solid var(--rule);
    padding: 62px 56px 46px;
    text-align: center;
    box-shadow: 0 26px 60px rgba(16, 38, 30, 0.09);
}

/* The engraved double rule. */
.sheet::before {
    content: "";
    position: absolute;
    inset: 9px;
    border: 1px solid var(--rule-soft);
    pointer-events: none;
}

/* ---------- Crest ---------- */

.crest {
    position: relative;
    width: 232px;
    height: 232px;
    margin: 0 auto 30px;
    display: grid;
    place-items: center;
}

.crest img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.5;
    animation: turn 150s linear infinite;
}

@keyframes turn {
    to {
        transform: rotate(360deg);
    }
}

.crest .monogram {
    position: relative;
    font-family: "Bodoni", Didot, "Times New Roman", serif;
    font-weight: 700;
    font-size: 3.5rem;
    line-height: 1;
    letter-spacing: 0.02em;
    color: var(--ink);
}

/* ---------- Type ---------- */

.overline {
    margin: 0 0 20px;
    font-size: 0.71rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--ink-3);
    text-indent: 0.3em;
}

h1 {
    margin: 0;
    font-family: "Bodoni", Didot, "Times New Roman", serif;
    font-weight: 500;
    font-size: clamp(3rem, 11vw, 6.6rem);
    line-height: 0.98;
    letter-spacing: 0.005em;
}

/* Rule with a lozenge at its centre, the way an engraved title is separated. */
.divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 26px auto 24px;
    max-width: 300px;
    color: var(--gold);
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: currentColor;
    opacity: 0.5;
}

.divider span {
    width: 7px;
    height: 7px;
    transform: rotate(45deg);
    background: currentColor;
}

.statement {
    margin: 0 auto;
    max-width: 30ch;
    font-family: "Bodoni", Didot, serif;
    font-size: clamp(1.1rem, 2.4vw, 1.42rem);
    font-style: italic;
    line-height: 1.5;
    color: var(--ink-2);
}

/* ---------- Register of legal facts ---------- */

.register {
    margin: 46px 0 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border-top: 1px solid var(--rule);
}

.register > div {
    padding: 18px 20px;
    border-bottom: 1px solid var(--rule-soft);
}

.register > div:nth-child(odd) {
    border-right: 1px solid var(--rule-soft);
}

.register dt {
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin-bottom: 6px;
}

.register dd {
    margin: 0;
    font-family: "Bodoni", Didot, serif;
    font-size: 1.1rem;
    letter-spacing: 0.01em;
}

@media (min-width: 720px) {
    .register {
        grid-template-columns: repeat(4, 1fr);
    }

    .register > div {
        border-right: 1px solid var(--rule-soft);
        border-bottom: 0;
    }

    .register > div:last-child {
        border-right: 0;
    }
}

/* ---------- Foot of the sheet ---------- */

.endorse {
    margin: 34px 0 0;
    font-size: 0.86rem;
    color: var(--ink-2);
}

.endorse a {
    font-weight: 600;
}

.legal-link {
    margin: 26px 0 0;
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.legal-link a {
    color: var(--ink-3);
}

.legal-link a:hover {
    color: var(--gold);
}

/* ---------- Legal page ---------- */

.prose {
    text-align: left;
    padding: 8px 0 0;
}

.prose .back {
    display: inline-block;
    margin-bottom: 30px;
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.prose h1 {
    font-size: clamp(2rem, 6vw, 3.2rem);
    text-align: left;
    margin-bottom: 8px;
}

.prose .updated {
    margin: 0 0 38px;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.prose h2 {
    font-family: "Bodoni", Didot, serif;
    font-weight: 500;
    font-size: 1.5rem;
    margin: 42px 0 14px;
    padding-top: 16px;
    border-top: 1px solid var(--rule-soft);
}

.prose p {
    margin: 0 0 15px;
    max-width: 62ch;
    color: var(--ink-2);
    font-size: 0.94rem;
}

.prose dl {
    margin: 0 0 20px;
    display: grid;
    grid-template-columns: minmax(140px, 200px) 1fr;
    gap: 9px 24px;
    font-size: 0.94rem;
}

.prose dt {
    color: var(--ink-3);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding-top: 4px;
}

.prose dd {
    margin: 0;
    color: var(--ink);
}

/* ---------- Load ---------- */

.rise {
    animation: rise 1s cubic-bezier(0.22, 0.72, 0.3, 1) backwards;
}

.rise-1 { animation-delay: 0.05s; }
.rise-2 { animation-delay: 0.18s; }
.rise-3 { animation-delay: 0.3s; }
.rise-4 { animation-delay: 0.42s; }
.rise-5 { animation-delay: 0.54s; }

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .rise {
        animation: none;
    }

    .crest img {
        animation: none;
    }
}

/* ---------- Responsive ---------- */

@media (max-width: 700px) {
    .page {
        padding: 16px 12px;
    }

    .sheet {
        padding: 40px 22px 32px;
    }

    .crest {
        width: 172px;
        height: 172px;
        margin-bottom: 22px;
    }

    .crest .monogram {
        font-size: 2.6rem;
    }

    .prose dl {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .prose dd {
        margin-bottom: 12px;
    }
}

/* Two columns still crush "Le Perreux-sur-Marne" on a narrow phone. */
@media (max-width: 430px) {
    .register {
        grid-template-columns: 1fr;
    }

    .register > div:nth-child(odd) {
        border-right: 0;
    }
}
