/* Shibolett root page. Self-hosted Source Serif 4, no external requests. */
/* latin-ext 400 */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/source-serif-4-latin-ext-1.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin 400 */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/source-serif-4-latin-2.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* latin-ext 600 */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/source-serif-4-latin-ext-1.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin 600 */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(../fonts/source-serif-4-latin-2.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --navy: #111628;
    --grey: #5C6070;
    --rule: #D9DBE1;
    --red: #8A2821;
    --gold: #C9962B;
    --white: #FFFFFF;
    --gutter: clamp(1.25rem, 5vw, 5rem);
    --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    background: var(--white);
    color: var(--navy);
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    line-height: 1.5;
}

body {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--navy);
}

/* Navy ring: gold on white is 2.7:1, below the 3:1 a focus indicator needs */
a:focus-visible {
    outline: 3px solid var(--navy);
    outline-offset: 3px;
}

.container {
    width: 100%;
    padding: 0 var(--gutter);
}

/* Header */
.site-header {
    border-bottom: 1px solid var(--rule);
}

.site-header .container {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding-top: 1.4rem;
    padding-bottom: 1.4rem;
}

.mark {
    height: 34px;
    width: auto;
}

.wordmark {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* Body: the two practices are full-bleed tiles that share the space between header and footer,
   side by side on wider screens and stacked on a phone. Each tile is in its own site's colours:
   Security navy with the rings from its hero diagram, Operations grey with its dot grid.
   Each tile's decoration is centred on its arrow button. */
main {
    flex: 1;
    display: flex;
}

main .container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.intro {
    font-size: 1.6rem;
    line-height: 1.3;
    font-weight: 400;
    color: var(--grey);
    padding: clamp(1.75rem, 4vw, 3rem) var(--gutter);
}

.practices {
    flex: 1;
    display: flex;
}

.practice {
    --tile-x: var(--gutter);
    --tile-y: clamp(1.5rem, 5vw, 4.5rem);
    --button: clamp(44px, 4vw, 56px);
    --rings: clamp(360px, 38vw, 720px);
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    isolation: isolate;
    /* clip where supported: with hidden, a stacked tile can shrink below its content and be cut off */
    overflow: hidden;
    overflow: clip;
    padding: var(--tile-y) var(--tile-x);
    background: var(--tile);
    color: var(--ink-body);
}

.practice::before {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;
}

/* Security: dark band tokens as on its own site. Brand red is about 2:1 on navy,
   so it only fills behind white text and the rules use the lifted red. */
.practice.security {
    --tile: radial-gradient(70% 70% at 85% 80%, rgba(255, 255, 255, 0.06), transparent 72%), var(--navy);
    --ink: var(--white);
    --ink-body: rgba(255, 255, 255, 0.86);
    --ink-muted: rgba(255, 255, 255, 0.64);
    --accent: #B3392E;
    --button-fill: var(--red);
}

.practice.security::before {
    width: var(--rings);
    height: var(--rings);
    right: calc(var(--tile-x) + var(--button) / 2 - var(--rings) / 2);
    bottom: calc(var(--tile-y) + var(--button) / 2 - var(--rings) / 2);
    background: url(../images/rings.svg) center / contain no-repeat;
}

/* Operations: grey panel, dots fading out from the arrow button. Grey text is 5.6:1 on the panel;
   gold is decoration only here. */
.practice.operations {
    --tile: #F1F2F5;
    --ink: var(--navy);
    --ink-body: var(--grey);
    --ink-muted: var(--grey);
    --accent: var(--gold);
    --button-fill: var(--navy);
}

.practice.operations::before {
    inset: 0;
    background-image: radial-gradient(var(--rule) 1.2px, transparent 1.4px);
    background-size: 20px 20px;
    -webkit-mask-image: radial-gradient(circle at calc(100% - var(--tile-x) - var(--button) / 2) calc(100% - var(--tile-y) - var(--button) / 2), #000 45%, transparent 95%);
    mask-image: radial-gradient(circle at calc(100% - var(--tile-x) - var(--button) / 2) calc(100% - var(--tile-y) - var(--button) / 2), #000 45%, transparent 95%);
}

.practice h2 {
    font-weight: 400;
    margin-bottom: clamp(0.9rem, 2vw, 1.75rem);
}

/* One link per practice, stretched over the whole tile so anywhere in it is clickable.
   The link is a block so its focus ring wraps both lines of the heading. */
.practice-link {
    display: block;
    color: var(--ink);
    text-decoration: none;
}

.practice-link::after {
    content: "";
    position: absolute;
    z-index: 1;
    inset: 0;
}

.practice-link:focus-visible {
    outline-color: var(--ink);
}

/* Firm name on its own line, so the practice name can be set large */
.practice h2 .firm {
    display: block;
    font-size: clamp(1rem, 1.25vw, 1.2rem);
    font-weight: 600;
    line-height: 1.4;
    color: var(--ink-muted);
}

.practice h2 .name {
    display: inline-block;
    position: relative;
    padding-bottom: 14px;
    font-size: clamp(1.75rem, 3.4vw, 3.25rem);
    line-height: 1.2;
}

.practice h2 .name::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 72px;
    height: 6px;
    background: var(--accent);
}

.practice p {
    font-size: clamp(1.1rem, 1.5vw, 1.35rem);
    line-height: 1.45;
    max-width: 26em;
    margin-bottom: 1.25rem;
}

.practice .go {
    margin-top: auto;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: none;
    color: var(--ink);
    font-family: var(--sans);
    font-size: clamp(15px, 1.1vw, 16px);
}

.go .domain {
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 5px;
}

/* The arrow is each site's primary button: brick red for Security (white on it 8.7:1), navy for Operations */
.go .arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: var(--button);
    height: var(--button);
    font-size: calc(var(--button) * 0.42);
    color: var(--white);
    background: var(--button-fill);
}

/* Hover anywhere on a tile: its accent rule lengthens, the address underline takes the text colour
   and the button lightens as the practice sites' buttons do */
.practice:hover .name::after {
    width: 112px;
}

.practice:hover .domain {
    text-decoration-color: var(--ink);
}

.practice:hover .arrow {
    background: color-mix(in srgb, var(--button-fill) 85%, var(--white));
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--rule);
    color: var(--grey);
    font-size: 0.95rem;
}

.site-footer .container {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem 2rem;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
}

.site-footer a {
    color: var(--navy);
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

/* Phones and portrait tablets: tiles stacked, each taking half the space below the header */
@media (max-width: 760px), (orientation: portrait) and (max-width: 1100px) {
    .practices {
        flex-direction: column;
    }
}

/* Phone spacing, set so the page stays on one screen at 375x667 */
@media (max-width: 760px) {
    .site-header .container {
        padding-top: 0.9rem;
        padding-bottom: 0.9rem;
    }

    .site-footer .container {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .intro {
        font-size: 1.45rem;
    }

    .practice {
        padding-top: 1.4rem;
    }

    .practice p {
        margin-bottom: 1rem;
    }
}

/* Motion, matching the Operations site; off for anyone whose device asks for reduced motion.
   The tiles themselves stay put; their contents rise and their decoration fades in. */
@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
}

@keyframes fade {
    from {
        opacity: 0;
    }
}

@keyframes draw-rule {
    from {
        transform: scaleX(0);
    }
}

@media (prefers-reduced-motion: no-preference) {
    .site-header .container > * {
        animation: fade 0.6s ease both;
    }

    .practice.operations {
        --delay: 0.12s;
    }

    .intro + .practices .practice.security {
        --delay: 0.1s;
    }

    .intro + .practices .practice.operations {
        --delay: 0.22s;
    }

    /* The heading's two lines move, never the heading or link themselves: a transform on an
       ancestor of the link would become the frame for its stretched area and shrink the
       clickable area to the heading */
    .intro,
    .practice h2 .firm,
    .practice h2 .name,
    .practice > p {
        animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
    }

    .practice h2 .firm,
    .practice h2 .name {
        animation-delay: var(--delay, 0s);
    }

    .practice > p {
        animation-delay: calc(var(--delay, 0s) + 0.08s);
    }

    .practice > .go {
        animation-delay: calc(var(--delay, 0s) + 0.16s);
    }

    .practice::before {
        animation: fade 1.2s ease calc(var(--delay, 0s) + 0.3s) both;
    }

    .practice h2 .name::after {
        transform-origin: left;
        animation: draw-rule 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) calc(var(--delay, 0s) + 0.45s) both;
        transition: width 0.3s ease;
    }

    .go .domain {
        transition: text-decoration-color 0.2s ease;
    }

    .go .arrow {
        transition: background-color 0.2s ease;
    }
}
