/* RealGrip - brand placeholder.
   Two colors, taken off the logo: the blue of "Real" and the near-black of
   "Grip". Everything else is paper, steel and a hairline, so the blue only ever
   means one thing - the thing that grips. */

:root {
    --paper: #f4f5f7;
    --panel: #0a0e14;
    --ink: #0a0e14;
    --ink-on-panel: #eef1f5;
    /* 4.78:1 on --paper. The old #68727f measured 4.47:1, which misses WCAG AA
       for normal text by a hair and fails every scanner that checks it - the
       section labels, the masthead place and the colophon are all set in it. */
    --steel: #656d7b;
    --steel-on-panel: #96a2b0;
    --hairline: #d7dbe1;
    --hairline-on-panel: #263039;

    /* The band sits a half step off paper, so the tooth rows have a ground
       to be an edge to rather than floating on the page itself. */
    --band: #eceef1;

    /* Cards lift off paper rather than sinking into it - white against the
       warm grey ground, which is the only place pure white appears. */
    --card: #ffffff;

    /* The logo blue, and a darkened cousin for text. #007AFF clears 3:1 against
       paper, which is enough for a 16px rule or a 100px wordmark but not for a
       link, so anything set at body size uses --blue-ink instead. */
    --blue: #007AFF;
    --blue-ink: #0062cc;

    --sans: "Archivo", "Segoe UI", system-ui, -apple-system, sans-serif;

    --gutter: 1.25rem;
    --measure: 68rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        --paper: #0b1016;
        --panel: #141b23;
        --ink: #e9edf2;
        --ink-on-panel: #e9edf2;
        --steel: #8c99a8;
        --steel-on-panel: #96a2b0;
        --hairline: #1f2831;
        --hairline-on-panel: #2b3641;

        --band: #10161d;

        /* Inverted, a card has to come up off the page instead. */
        --card: #141b23;

        --blue: #3d9bff;
        --blue-ink: #7fbcff;
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 1.0625rem;
    font-variation-settings: "wdth" 100, "wght" 400;
    line-height: 1.6;
    overflow-wrap: break-word;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
}

.skip-link:focus {
    left: var(--gutter);
    top: 0.5rem;
    z-index: 10;
    padding: 0.5rem 0.75rem;
    background: var(--ink);
    color: var(--paper);
    font-size: 0.9rem;
    text-decoration: none;
}

:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 3px;
}

.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.shell {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 0 var(--gutter);
    width: 100%;
}

/* ---------- masthead ---------- */

.masthead {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    justify-content: space-between;
    align-items: center;
    padding: 1.15rem 0;
    border-bottom: 1px solid var(--hairline);
}

.masthead__place {
    color: var(--steel);
    font-size: 0.8125rem;
    font-variation-settings: "wdth" 100, "wght" 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* ---------- hero ---------- */

.hero {
    padding: clamp(3rem, 9vw, 6.5rem) 0 0;
}

/* The h1 is now a frame for the artwork rather than a line of type, so it
   sheds the inherited heading metrics that would otherwise add a phantom
   line-box under the mark. */
.hero__mark {
    margin: 0;
    line-height: 0;
}

/* Shrink-wraps the mark so the TM has an edge to hang off. Without this the
   h1 is full width and the symbol lands out in the margin. */
.hero__lockup {
    position: relative;
    display: inline-block;
}

/* Top-aligned with the ascenders and set just clear of the final letter, which
   is where the artwork version of the lockup puts it. Sized as a fraction of
   the viewport the way the mark is, so the two scale together instead of the
   symbol creeping as the logo grows. */
.hero__tm {
    position: absolute;
    left: 100%;
    top: 0;
    margin-left: 0.2em;
    color: var(--ink);
    font-size: clamp(0.6rem, 1.5vw, 0.95rem);
    font-variation-settings: "wdth" 100, "wght" 600;
    line-height: 1;
}

/* Sized by width, since the mark is a fixed 4.24:1 and height follows from it.
   The floor keeps it inside a 320px viewport once the gutters are taken off;
   the ceiling lands it around 128px tall, near where the old type wordmark
   topped out. */
.logo {
    display: block;
    width: clamp(15rem, 56vw, 33rem);
    max-width: 100%;
    height: auto;
}

/* The whole reason the mark is inlined: both halves are ordinary themed
   colors now, so the dark palette recolors them with everything else and
   no filter has to guess at the blue. */
.logo__real {
    fill: var(--blue);
}

.logo__grip {
    fill: var(--ink);
}

/* Text that carries meaning for a screen reader or a crawler while the visual
   job is done by artwork beside it. Not display:none, which would take it out
   of the accessibility tree along with the layout. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.lead {
    max-width: 32ch;
    margin: clamp(1.5rem, 3.5vw, 2.25rem) 0 0;
    font-size: clamp(1.125rem, 2.3vw, 1.5rem);
    font-variation-settings: "wdth" 100, "wght" 450;
    line-height: 1.4;
}

/* The one line that admits the store is down. Set apart from the tagline by a
   rule rather than by color, so it does not read as a warning. */
/* An invitation, not a caveat. It used to hedge about the store being down and
   was set in the muted grey the rest of the supporting text uses; now that it
   is asking to be contacted, grey fine print works against it, so it takes the
   body color and a little more size. */
.notice {
    max-width: 46ch;
    margin: 1.75rem 0 0;
    padding-left: 1rem;
    border-left: 3px solid var(--blue);
    color: var(--ink);
    font-size: 1.0625rem;
    line-height: 1.5;
}

/* ---------- product lines ---------- */

.lines {
    margin-top: clamp(3.5rem, 8vw, 6rem);
}

.lines__title,
.quality__title,
.about__title,
.contact__title {
    margin: 0 0 1.75rem;
    font-size: 0.8125rem;
    font-variation-settings: "wdth" 100, "wght" 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--steel);
}

.lines__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0 clamp(1.25rem, 3vw, 2.5rem);
}

/* Cards rather than columns. The 5px blue edge is kept and moved to the top
   of the card, so the row still reads as the same device it was before the
   surface went under it. */
.line {
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1.15rem 1.4rem;
    background: var(--card);
    border: 1px solid var(--hairline);
    border-top: 5px solid var(--blue);
    border-radius: 0 0 5px 5px;
}

/* Stroked, not filled, at the same weight as the tie drawing. Blue, because
   the only other blue in the row is the edge above it and the two should
   read as one accent rather than two. */
.line__icon {
    width: 42px;
    height: 42px;
    margin-bottom: 0.9rem;
    color: var(--blue);
    flex: none;
}

.line__name {
    margin: 0;
    font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
    font-variation-settings: "wdth" 92, "wght" 700;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.005em;
}

.line__what {
    margin: 0.6rem 0 0;
    color: var(--steel);
    font-size: 0.9375rem;
    line-height: 1.5;
}

/* ---------- hero, product alongside ---------- */

/* The product column is the narrower of the two: the bag is a tall portrait
   shot and giving it half the row would push the hero text into a column too
   narrow to set a tagline in. */
.hero-split {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: clamp(1.5rem, 5vw, 3.5rem);
    align-items: center;
}

.hero-split .hero {
    padding-bottom: clamp(2rem, 5vw, 3rem);
}

/* The shot is cut out on white, so it needs a white ground of its own rather
   than the page's. On paper that reads as a product card; on the dark theme it
   is the one deliberately light panel, which is the honest way to show a
   packshot that was never photographed for a dark background. */
.hero__shot {
    margin: 0;
    padding: clamp(1rem, 2.5vw, 1.75rem);
    background: #fff;
    border: 1px solid var(--hairline);
    border-radius: 6px;
}

.hero__shot img {
    display: block;
    width: 100%;
    max-width: 17rem;
    height: auto;
    margin: 0 auto;
}

/* Stacked, a tall shot under the hero pushes everything below it off the
   screen, so it is capped harder and centred. */
@media (max-width: 54rem) {
    .hero-split {
        grid-template-columns: 1fr;
        gap: clamp(1.75rem, 6vw, 2.5rem);
    }

    .hero__shot img {
        max-width: 12rem;
    }
}

/* ---------- the textured band ---------- */

/* Edged top and bottom with the tooth row off the tie head drawn further up
   the page, so the band repeats a mark the page has already made rather than
   introducing a texture from nowhere. Drawn as a repeating gradient: it costs
   no request, runs to any width, and takes its color from the theme the way
   an image never could.

   Pitch, length and weight are the three numbers worth touching - 3px of tooth
   every 19px, 14px deep. Tightening the pitch turns the row into a rule and
   loses the teeth. */
.band {
    position: relative;
    margin-top: clamp(3.5rem, 8vw, 6rem);
    padding: clamp(3rem, 6vw, 4rem) 0;
    background-color: var(--band);
}

/* The G off the wordmark, tiled as a watermark.

   Carried as a mask rather than as a background image: a mask throws the
   file's own color away and paints var(--ink) through it instead, so the
   field follows the theme from one declaration. A background image would need
   a second copy of the file in a second color. */
.band::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: var(--ink);
    -webkit-mask-image: url("/img/grip-g.svg");
            mask-image: url("/img/grip-g.svg");
    -webkit-mask-repeat: repeat;
            mask-repeat: repeat;
    -webkit-mask-size: 190px auto;
            mask-size: 190px auto;
    /* A watermark, not a wallpaper. The mark is dense and sets at a tight
       pitch, so anything much past this starts eating the sentence on top. */
    opacity: 0.07;
    pointer-events: none;
}

/* Both tooth rows on one pseudo-element, drawn as two gradients pinned to
   opposite edges - ::before is spent on the field above. */
.band::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(90deg, var(--ink) 0 3px, transparent 3px 19px),
        repeating-linear-gradient(90deg, var(--ink) 0 3px, transparent 3px 19px);
    background-size: 100% 14px, 100% 14px;
    background-position: left top, left bottom;
    background-repeat: repeat-x, repeat-x;
    /* Held well off full strength. At full ink the row reads as a barrier
       across the page instead of an edge to the band. */
    opacity: 0.55;
    pointer-events: none;
}

/* Both layers are absolutely positioned over the band, so the sentence needs
   lifting back above them. */
.band > .shell {
    position: relative;
    z-index: 1;
}

.band__line {
    margin: 0;
    max-width: 44ch;
    font-size: clamp(1.0625rem, 1.9vw, 1.375rem);
    font-variation-settings: "wdth" 92, "wght" 600;
    line-height: 1.35;
    letter-spacing: -0.005em;
    text-wrap: balance;
}

/* ---------- quality and sourcing ---------- */

/* Two columns from here down. Everything below the band was a single 58ch
   measure against a 68rem shell, which left the right-hand half of the page
   empty for the whole lower third - the band reads as the end of the page
   rather than the middle of it. Split in two, each column lands at about
   60ch, which is the measure the single column was aiming for anyway.

   The grid is on the section itself rather than on a wrapper, so the title
   and the certification cards span it and the two prose blocks place
   themselves into the columns. Nothing in the markup has to know. */
.quality {
    margin-top: clamp(3.5rem, 8vw, 6rem);
    padding-top: 2rem;
    border-top: 1px solid var(--hairline);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 clamp(1.75rem, 4vw, 3.25rem);
    align-items: start;
}

.quality__title {
    grid-column: 1 / -1;
}

/* Columns are assigned rather than left to auto-placement. The prose blocks
   are each conditional, so auto-placement would push the cards into column
   one the moment a second block of copy came back into the config - pinning
   them keeps "what it is held to" on the left and "who says so" on the
   right whatever the config holds. */
.quality__body {
    grid-column: 1;
}

.certs {
    grid-column: 2;
    grid-row: 2;
}

.quality__body p {
    margin: 0 0 1.15rem;
}

.quality__body p:last-child {
    margin-bottom: 0;
}

/* Sourcing is a separate claim from how the product is specified. Side by
   side it is the right-hand column and the rule on its edge is what marks it
   as the aside rather than the second half of the argument; stacked, the rule
   does the same job and the top margin separates them. */
.quality__body--sourcing {
    padding-left: 1.1rem;
    border-left: 3px solid var(--hairline);
}

.certs {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    /* auto-fill, not auto-fit: with one certification on file an auto-fit
       track collapses into the other and the single card stretches the whole
       68rem like a banner. Filled empty tracks keep it the width of the
       column above it. */
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr));
    gap: 1.5rem clamp(1.75rem, 4vw, 3.25rem);
}

/* The same 5px blue rule the product lines carry: a certification is a fact
   about the product, and it should look like it belongs to the same set. */
.cert {
    padding: 1.25rem 1.15rem 1.4rem;
    background: var(--card);
    border: 1px solid var(--hairline);
    border-top: 5px solid var(--blue);
    border-radius: 0 0 5px 5px;
}

.cert__name {
    margin: 0;
    font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
    font-variation-settings: "wdth" 92, "wght" 700;
    font-weight: 700;
    line-height: 1.15;
}

/* Deliberately not muted into the grey the rest of the supporting text uses.
   Who holds the certificate is the load-bearing part of the claim, not a
   footnote to it. */
.cert__held {
    margin: 0.3rem 0 0;
    font-size: 0.9375rem;
    font-variation-settings: "wdth" 100, "wght" 600;
}

.cert__scope {
    margin: 0.6rem 0 0;
    color: var(--steel);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.cert__meta {
    margin: 0.6rem 0 0;
    color: var(--steel);
    font-size: 0.8125rem;
    letter-spacing: 0.02em;
}

.cert__meta span + span::before {
    content: " · ";
}

.cert__id {
    font-variation-settings: "wdth" 100, "wght" 600;
}

/* ---------- about ---------- */

.about {
    margin-top: clamp(3.5rem, 8vw, 6rem);
    padding-top: 2rem;
    border-top: 1px solid var(--hairline);
}

/* Two columns, for the same reason the quality section has them: run across
   the whole 68rem shell and a line is about 115 characters, twice the measure
   of the block directly above it, so the longest prose on the page is also the
   hardest to read. Split in two and each column lands near 60ch - the measure
   the copy wants - without leaving the right half of the page empty.

   Multi-column rather than a grid because the paragraphs come out of a config
   loop: however many are in appsettings.json, the browser balances them.
   break-inside keeps a paragraph from being cut in half at the column edge,
   which is the one thing that would make this harder to read than the full
   width it replaces. */
.about__body {
    columns: 2;
    column-gap: clamp(1.75rem, 4vw, 3.25rem);
}

.about__body p {
    margin: 0 0 1.15rem;
    break-inside: avoid;
}

.about__body p:last-child {
    margin-bottom: 0;
}

/* ---------- contact, on an inverted panel ---------- */

/* The page ends on the dark end of the palette rather than trailing off into
   paper: the one thing a placeholder has to do is hand the visitor a way to
   reach someone, so that block gets the weight. */
.terminal {
    margin-top: clamp(4rem, 10vw, 7rem);
    padding: clamp(3rem, 7vw, 4.5rem) 0;
    background: var(--panel);
    color: var(--ink-on-panel);
}

.terminal .contact__title {
    color: var(--steel-on-panel);
}

.spec {
    margin: 0;
    max-width: 46rem;
    border-bottom: 1px solid var(--hairline-on-panel);
}

.spec__row {
    display: grid;
    grid-template-columns: 7rem 1fr;
    gap: 0 1.5rem;
    padding: 0.95rem 0;
    border-top: 1px solid var(--hairline-on-panel);
}

.spec__label {
    font-size: 0.8125rem;
    font-variation-settings: "wdth" 100, "wght" 550;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--steel-on-panel);
    line-height: 1.95;
}

.spec__value {
    margin: 0;
}

.spec__value a {
    color: var(--blue-ink);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

/* --blue-ink is tuned for dark text on paper; on the panel it is the darker of
   the two and the plain blue reads better. */
@media (prefers-color-scheme: light) {
    .terminal .spec__value a {
        color: #7fbcff;
    }
}

.spec__value a:hover {
    text-decoration-thickness: 2px;
}

.spec__note {
    font-size: 0.75rem;
    font-variation-settings: "wdth" 100, "wght" 450;
    color: var(--steel-on-panel);
    padding-left: 0.4rem;
}

.spec__plain {
    font-variant-numeric: tabular-nums;
}

.contact__aside {
    max-width: 52ch;
    margin: 1.75rem 0 0;
    color: var(--steel-on-panel);
    font-size: 0.9375rem;
}

/* ---------- colophon ---------- */

.colophon {
    margin-top: auto;
    font-size: 0.8125rem;
    font-variation-settings: "wdth" 100, "wght" 450;
    color: var(--steel);
}

.colophon__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
    justify-content: space-between;
    padding: 1.15rem var(--gutter) 2.5rem;
}

/* ---------- error page ---------- */

.shell--message {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

.message__title {
    margin: 0 0 1rem;
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    font-variation-settings: "wdth" 88, "wght" 750;
    line-height: 1.1;
    letter-spacing: -0.015em;
}

.message__body {
    max-width: 48ch;
}

.message__body a {
    color: var(--blue-ink);
    text-underline-offset: 3px;
}

/* ---------- narrow screens ---------- */

@media (max-width: 60rem) {
    .lines__grid {
        grid-template-columns: 1fr 1fr;
        gap: 2.25rem clamp(1.25rem, 3vw, 2.5rem);
    }

    /* Back to one measure. Two columns of 28rem is where the gap starts
       costing more than the second column returns. */
    .quality {
        grid-template-columns: minmax(0, 1fr);
    }

    .quality__body {
        max-width: 58ch;
    }

    .quality__body--sourcing {
        margin-top: 1.9rem;
    }

    /* Same call as the quality columns above: two columns of this width stop
       paying for themselves, and a reader should not have to travel back up
       the page to start the second one. */
    .about__body {
        columns: 1;
        max-width: 58ch;
    }

    .certs {
        grid-column: 1;
        grid-row: auto;
        margin-top: clamp(2rem, 4vw, 2.75rem);
    }
}

@media (max-width: 40rem) {
    .lines__grid {
        grid-template-columns: 1fr;
        gap: 2rem 0;
    }

    .spec__row {
        grid-template-columns: 1fr;
        gap: 0.15rem;
    }

    .spec__label {
        line-height: 1.6;
    }
}
