/*
 * site.css — drtx.co.uk.
 *
 * The page somebody lands on before they know what DRTX is. Separate from
 * Arena on purpose: this is read once by a stranger on a phone, and Arena is
 * used every week by somebody who already knows where everything is. They
 * want different things from a layout.
 *
 * Colours, type and shape all come from brand/drtx-tokens.css. Per the brand:
 * no gradients, no glows, 4px radii, and the cyan edge bar kept for something
 * that is live.
 */

@font-face {
    font-family: 'Archivo';
    src: url('../fonts/Archivo[wdth,wght].ttf') format('truetype-variations'),
         url('../fonts/Archivo[wdth,wght].ttf') format('truetype');
    font-weight: 100 900;
    font-stretch: 62% 125%;
    font-display: swap;
}
@font-face {
    font-family: 'JetBrains Mono';
    src: url('../fonts/JetBrainsMono[wght].ttf') format('truetype-variations'),
         url('../fonts/JetBrainsMono[wght].ttf') format('truetype');
    font-weight: 400 600;
    font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
    margin: 0;
    background: var(--drtx-bg);
    color: var(--drtx-text);
    font-family: var(--drtx-font-sans);
    font-size: 17px;
    line-height: 1.6;
}

/* One gutter everywhere, so nothing on the page lines up by accident. */
.top, .hero, .band, .foot {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
}
/*
 * The measure, and the centring that goes with it.
 *
 * Every rule below that spaces one of these out uses margin-top/-bottom and
 * never the `margin` shorthand. The shorthand sets all four sides, so a child
 * saying `margin: 0 0 24px` silently resets the auto margins here to zero and
 * the band stops centring while the hero carries on — which is exactly the
 * way the page looked the first time it was rendered.
 */
/*
 * Two groups, and they are measured differently on purpose.
 *
 * .top, .hero and .foot carry their OWN gutter, so their max-width has to
 * include it: 920 of content plus 20 either side. .band is full width because
 * .band-quiet needs an edge-to-edge background, so the gutter is on the band
 * and its children are the 920.
 *
 * Get that wrong and everything still looks fine on its own while the hero
 * sits 20px further in than every heading below it, which is precisely how
 * this read the second time it was rendered.
 */
.top, .hero, .foot { max-width: 960px; margin-left: auto; margin-right: auto; }

/*
 * ONE element per band establishes the measure, and everything inside simply
 * aligns to it.
 *
 * Centring each child independently looks identical until a child is narrower
 * than the measure - a 46em list inside a 920px column - and then that one
 * centres itself in the viewport and sits 70px right of every heading above
 * it. Which is what happened.
 */
.band-inner { max-width: 920px; margin-left: auto; margin-right: auto; }

/* --- the bar ------------------------------------------------------------ */

.top {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 18px;
    padding-bottom: 18px;
}
.top-mark { display: block; line-height: 0; }
.top-mark img { display: block; height: 27px; width: auto; }
.top-nav { margin-left: auto; }

/* --- hero --------------------------------------------------------------- */

.hero { padding-top: 56px; padding-bottom: 64px; }
.hero-kicker { color: var(--drtx-accent); margin-top: 0; margin-bottom: 18px; }
.hero-title {
    margin-top: 0;
    margin-bottom: 20px;
    /* Scales with the viewport rather than stepping at a breakpoint, so it
     * does not spend three widths looking slightly wrong. */
    font-size: clamp(38px, 8vw, 76px);
}
.hero-lede {
    margin-top: 0;
    margin-bottom: 32px;
    font-size: clamp(17px, 2.4vw, 21px);
    color: var(--drtx-text-muted);
    max-width: 34em;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 0; margin-bottom: 0; }

/* --- buttons ------------------------------------------------------------ */

.button {
    display: inline-block;
    padding: 13px 24px;
    background: var(--drtx-accent);
    color: var(--drtx-midnight);
    border: 1px solid var(--drtx-accent);
    border-radius: var(--drtx-radius);
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    /* 44px of target, because most of these are pressed with a thumb. */
    min-height: 44px;
}
.button:hover { background: var(--drtx-white); border-color: var(--drtx-white); }
.button:focus-visible { outline: 2px solid var(--drtx-white); outline-offset: 2px; }

.button-quiet {
    background: none;
    color: var(--drtx-accent);
    border-color: var(--drtx-border);
}
.button-quiet:hover {
    background: var(--drtx-accent);
    color: var(--drtx-midnight);
    border-color: var(--drtx-accent);
}

/* --- bands -------------------------------------------------------------- */

.band { padding-top: 56px; padding-bottom: 56px; border-top: 1px solid var(--drtx-border); }
.band-quiet { background: var(--drtx-surface); }
.band-cta { text-align: center; }
.band-cta .hero-actions { justify-content: center; }
.band-title { margin-top: 0; margin-bottom: 24px; font-size: clamp(24px, 4vw, 34px); }
.band-lede { color: var(--drtx-text-muted); max-width: 42em;
             margin-top: 0; margin-bottom: 28px; }
.band-foot { color: var(--drtx-text-muted); max-width: 42em;
             margin-top: 28px; margin-bottom: 0; }
.band a { color: var(--drtx-accent); }

/* --- the three cards ---------------------------------------------------- */

.cards {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}
/* Three across only when all three still have room to be read. Below that
 * they stack, rather than becoming three narrow columns of broken words. */
@media (min-width: 760px) {
    .cards { grid-template-columns: repeat(3, 1fr); }
}

.card {
    background: var(--drtx-bg);
    border: 1px solid var(--drtx-border);
    border-radius: var(--drtx-radius);
    padding: 24px 22px;
}
.band-quiet .card { background: var(--drtx-bg); }
.card-title { margin: 0 0 10px; font-size: 19px; font-weight: 800; }
.card p { margin: 0; color: var(--drtx-text-muted); font-size: 16px; }

/* --- what works today --------------------------------------------------- */

.status { list-style: none; margin-top: 0; margin-bottom: 0; padding: 0;
          max-width: 46em; }
.status li {
    padding: 14px 0 14px 18px;
    border-top: 1px solid var(--drtx-border);
    color: var(--drtx-text-muted);
}
.status li:last-child { border-bottom: 1px solid var(--drtx-border); }

/* The edge bar is reserved for something that is live, and a feature that
 * actually works is the one thing on this page that qualifies. */
.status-on { box-shadow: inset var(--drtx-edge-bar) 0 0 var(--drtx-live); }
.status-soon { box-shadow: inset var(--drtx-edge-bar) 0 0 var(--drtx-border); }

.status-mark {
    display: inline-block;
    min-width: 72px;
    margin-right: 10px;
    color: var(--drtx-text-muted);
}
.status-on .status-mark { color: var(--drtx-live); }

/* --- foot --------------------------------------------------------------- */

.foot {
    border-top: 1px solid var(--drtx-border);
    padding-top: 28px;
    padding-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.foot-mark { display: block; opacity: 0.7; }
.foot-line { margin-top: 0; margin-bottom: 0; color: var(--drtx-text-muted);
             font-size: 14px; }
.foot a { color: var(--drtx-accent); }

/* Somebody will print it, or save it as a PDF to send to a committee. */
@media print {
    body { background: #fff; color: #000; }
    .top-nav, .hero-actions, .band-cta { display: none; }
    .card, .status li { border-color: #999; background: #fff; }
    a { color: #000; }
}
