@charset "utf-8";

/*
 * bradfrank.me — Web 2.0 revival on a Solarized palette.
 *
 * Mobile-first: the single-column rules are the base, and the two-column
 * layout is added at 60rem.
 *
 * Theming: every colour that changes between light and dark is a custom
 * property. Light is the default; dark comes from the OS setting unless the
 * visitor has picked one with the switch, which writes data-theme onto <html>.
 * Several Solarized hues are shifted from their canonical values because the
 * originals cannot reach a 4.5:1 contrast ratio against the background they
 * sit on; the canonical value is noted beside each one.
 */

/* ── palette: light ──────────────────────────────────────────────────────── */

:root {
  color-scheme: light;

  --canvas:      #eee8d5;  /* base2 */
  --canvas-top:  #e4dcc4;
  --paper:       #fdf6e3;  /* base3 */
  --surface-1:   #fffdf6;
  --surface-2:   #f3ecd8;
  --surface-3:   #eee8d5;

  --ink:         #586e75;  /* base01 */
  --ink-strong:  #073642;  /* base02 */
  --rule:        #d5cdb4;
  --rule-strong: #bdb598;

  --link:         #17638f;  /* Solarized blue #268bd2, darkened for contrast */
  --link-hover:   #cb4b16;  /* orange */
  --link-visited: #4f54a8;  /* Solarized violet #6c71c4, darkened */
  --focus:        #cb4b16;
  --accent-rule:  #1e7f78;  /* Solarized cyan #2aa198, darkened */
  --accent-quote: #7a5c00;  /* Solarized yellow #b58900, darkened */

  /* Accent bars carry white text here, so the hues run dark. The gloss overlay
     lightens their top edge, and these clear 4.5:1 against white at that point. */
  --accent-cyan:    #196b65;
  --accent-blue:    #17638f;
  --accent-violet:  #464a96;
  --accent-magenta: #a52a68;
  --accent-green:   #4f5c00;
  --accent-orange:  #a53a10;
  --accent-ink:     #ffffff;
  --accent-gloss:   linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0,
                                    rgba(0, 0, 0, 0.16) 100%);

  /* Syntax colours, measured against the code background rather than the page:
     Solarized's cyan and base01 both fall short of 4.5:1 on base2, so the
     string and comment hues run darker than canonical. */
  --syn-comment: #52666e;
  --syn-keyword: #5f6f00;
  --syn-string:  #196b65;
  --syn-number:  #a52a68;
  --syn-name:    #17638f;
  --syn-builtin: #7a5c00;
  --syn-error:   #b31f1d;

  --banner-a: #0e5b6b;
  --banner-b: #073642;
  --banner-c: #04262f;
  --banner-border: #04222a;

  --tabstrip-a: #ded6bd;
  --tabstrip-b: #cfc7ad;
  --tab-a: #fbf5e4;
  --tab-b: #e6dfc8;
  --tab-hover-a: #ffffff;
  --tab-hover-b: #f4eeda;

  --boxhead-a: #f4eedb;
  --boxhead-b: #e2dbc2;
  --callout-a: #f7f0d8;
  --callout-b: #ebe3c8;
  --notice-a: #fdf3d2;
  --notice-b: #f5e9bd;
  --notice-border: #d8c47a;

  --btn-a: #fffdf6;
  --btn-b: #e7e0ca;
  --btn-hover-a: #ffffff;
  --btn-hover-b: #f2ecd8;
  --btn-primary-a: #2f86bd;
  --btn-primary-b: #17638f;
  --btn-primary-c: #114f73;
  --btn-primary-hover-a: #3a95cd;
  --btn-primary-hover-b: #1a6f9f;
  --btn-primary-hover-c: #145b83;
  --btn-primary-border: #0e4460;
  --btn-primary-ink: #ffffff;
  --btn-primary-emboss: 0 -1px 0 rgba(0, 0, 0, 0.35);

  --shadow:    0 2px 5px rgba(0, 43, 54, 0.16);
  --shadow-lg: 0 4px 14px rgba(0, 43, 54, 0.20);
  --gloss:     inset 0 1px 0 rgba(255, 255, 255, 0.55);
  --emboss:    0 1px 0 rgba(255, 255, 255, 0.70);
  --emboss-ui: 0 1px 0 rgba(255, 255, 255, 0.80);

  --radius: 8px;
  --radius-lg: 12px;
}

/* ── palette: dark ───────────────────────────────────────────────────────── */

/*
 * The dark values appear twice on purpose. CSS cannot share one declaration
 * block between a media query and a plain selector, and both are needed: the
 * media query serves visitors who have not touched the switch (including those
 * with JavaScript off), the attribute selector serves an explicit choice.
 *
 * KEEP THE TWO BLOCKS IDENTICAL. They are deliberately comment-free so that a
 * diff of the two shows nothing; the notes that would otherwise sit inline are
 * collected here instead:
 *
 *   --paper       base03      --surface-3   base02
 *   --ink         base1       --ink-strong  base2
 *     base0 (#839496) is the canonical body text but only reaches 4.11:1 on
 *     surface-3, so base1 is used instead.
 *   --link        Solarized blue #268bd2, lightened   --> #4fa3e3
 *   --link-hover  Solarized orange #cb4b16, lightened --> #ef8b4c
 *   --link-visited  Solarized violet #6c71c4          --> #9195e0
 *   --accent-rule   Solarized cyan #2aa198            --> #3fbdb2
 *   --accent-quote  Solarized yellow #b58900          --> #d0a215
 */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --canvas:      #00212b;
    --canvas-top:  #001820;
    --paper:       #002b36;
    --surface-1:   #063440;
    --surface-2:   #042c37;
    --surface-3:   #073642;

    --ink:         #93a1a1;
    --ink-strong:  #eee8d5;
    --rule:        #0e3d4a;
    --rule-strong: #17505f;

    --link:         #4fa3e3;
    --link-hover:   #ef8b4c;
    --link-visited: #9195e0;
    --focus:        #ef8b4c;
    --accent-rule:  #3fbdb2;
    --accent-quote: #d0a215;

    --accent-cyan:    #3fbdb2;
    --accent-blue:    #63aee7;
    --accent-violet:  #a0a3e6;
    --accent-magenta: #e78cb4;
    --accent-green:   #9db300;
    --accent-orange:  #f29a62;
    --accent-ink:     #002b36;
    --accent-gloss:   linear-gradient(180deg, rgba(255, 255, 255, 0.10) 0,
                                      rgba(0, 0, 0, 0.08) 100%);

    --syn-comment: #93a1a1;
    --syn-keyword: #9db300;
    --syn-string:  #3fbdb2;
    --syn-number:  #e78cb4;
    --syn-name:    #63aee7;
    --syn-builtin: #d0a215;
    --syn-error:   #f2706e;

    --banner-a: #10606f;
    --banner-b: #084553;
    --banner-c: #05323d;
    --banner-border: #0a4a58;

    --tabstrip-a: #013340;
    --tabstrip-b: #011f28;
    --tab-a: #08404f;
    --tab-b: #052f3b;
    --tab-hover-a: #0a4b5c;
    --tab-hover-b: #073846;

    --boxhead-a: #073642;
    --boxhead-b: #052c37;
    --callout-a: #073642;
    --callout-b: #042933;
    --notice-a: #3a2e0c;
    --notice-b: #2b220a;
    --notice-border: #6b5613;

    --btn-a: #0a4353;
    --btn-b: #063440;
    --btn-hover-a: #0d5163;
    --btn-hover-b: #084150;
    --btn-primary-a: #6bb4e9;
    --btn-primary-b: #4fa3e3;
    --btn-primary-c: #3d90cf;
    --btn-primary-hover-a: #85c4f0;
    --btn-primary-hover-b: #6bb4e9;
    --btn-primary-hover-c: #4fa3e3;
    --btn-primary-border: #2b7fbe;
    --btn-primary-ink: #002b36;
    --btn-primary-emboss: none;

    --shadow:    0 2px 5px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 4px 14px rgba(0, 0, 0, 0.60);
    --gloss:     inset 0 1px 0 rgba(255, 255, 255, 0.07);
    --emboss:    0 1px 0 rgba(0, 0, 0, 0.45);
    --emboss-ui: 0 1px 0 rgba(0, 0, 0, 0.35);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --canvas:      #00212b;
  --canvas-top:  #001820;
  --paper:       #002b36;
  --surface-1:   #063440;
  --surface-2:   #042c37;
  --surface-3:   #073642;

  --ink:         #93a1a1;
  --ink-strong:  #eee8d5;
  --rule:        #0e3d4a;
  --rule-strong: #17505f;

  --link:         #4fa3e3;
  --link-hover:   #ef8b4c;
  --link-visited: #9195e0;
  --focus:        #ef8b4c;
  --accent-rule:  #3fbdb2;
  --accent-quote: #d0a215;

  --accent-cyan:    #3fbdb2;
  --accent-blue:    #63aee7;
  --accent-violet:  #a0a3e6;
  --accent-magenta: #e78cb4;
  --accent-green:   #9db300;
  --accent-orange:  #f29a62;
  --accent-ink:     #002b36;
  --accent-gloss:   linear-gradient(180deg, rgba(255, 255, 255, 0.10) 0,
                                    rgba(0, 0, 0, 0.08) 100%);

  --syn-comment: #93a1a1;
  --syn-keyword: #9db300;
  --syn-string:  #3fbdb2;
  --syn-number:  #e78cb4;
  --syn-name:    #63aee7;
  --syn-builtin: #d0a215;
  --syn-error:   #f2706e;

  --banner-a: #10606f;
  --banner-b: #084553;
  --banner-c: #05323d;
  --banner-border: #0a4a58;

  --tabstrip-a: #013340;
  --tabstrip-b: #011f28;
  --tab-a: #08404f;
  --tab-b: #052f3b;
  --tab-hover-a: #0a4b5c;
  --tab-hover-b: #073846;

  --boxhead-a: #073642;
  --boxhead-b: #052c37;
  --callout-a: #073642;
  --callout-b: #042933;
  --notice-a: #3a2e0c;
  --notice-b: #2b220a;
  --notice-border: #6b5613;

  --btn-a: #0a4353;
  --btn-b: #063440;
  --btn-hover-a: #0d5163;
  --btn-hover-b: #084150;
  --btn-primary-a: #6bb4e9;
  --btn-primary-b: #4fa3e3;
  --btn-primary-c: #3d90cf;
  --btn-primary-hover-a: #85c4f0;
  --btn-primary-hover-b: #6bb4e9;
  --btn-primary-hover-c: #4fa3e3;
  --btn-primary-border: #2b7fbe;
  --btn-primary-ink: #002b36;
  --btn-primary-emboss: none;

  --shadow:    0 2px 5px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 4px 14px rgba(0, 0, 0, 0.60);
  --gloss:     inset 0 1px 0 rgba(255, 255, 255, 0.07);
  --emboss:    0 1px 0 rgba(0, 0, 0, 0.45);
  --emboss-ui: 0 1px 0 rgba(0, 0, 0, 0.35);
}

/* ── reset & base ────────────────────────────────────────────────────────── */

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

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

body {
  margin: 0;
  padding: 0 0.75rem 2rem;
  background-color: var(--canvas);
  background-image: linear-gradient(180deg, var(--canvas-top) 0, var(--canvas) 340px);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: "Lucida Grande", "Lucida Sans Unicode", "Segoe UI", system-ui,
               -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 100%;
  line-height: 1.65;
}

img { max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  color: var(--ink-strong);
  font-weight: 700;
  line-height: 1.25;
  margin: 1.75rem 0 0.6rem;
  text-shadow: var(--emboss);
}

h1 { font-size: 1.85rem; margin-top: 0; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.12rem; }
h4 { font-size: 1rem; }

p, ul, ol, dl, pre, blockquote, table { margin: 0 0 1rem; }

ul, ol { padding-left: 1.4rem; }
li { margin-bottom: 0.3rem; }

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover { color: var(--link-hover); }
a:visited { color: var(--link-visited); }

/* A visible focus ring everywhere — losing the caret on a keyboard-only site
   is unrecoverable. */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

code, kbd, pre, samp {
  font-family: "SFMono-Regular", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  font-size: 0.9em;
}

code {
  background: var(--surface-3);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.05em 0.35em;
}

pre {
  background: var(--surface-3);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent-rule);
  border-radius: var(--radius);
  color: var(--ink-strong);
  overflow-x: auto;
  padding: 0.9rem 1rem;
}
pre code { background: none; border: 0; padding: 0; }

/* ── syntax highlighting ─────────────────────────────────────────────────── */

/* Pygments token classes, grouped onto the seven hues above. Anything not
   listed inherits the <pre> colour, which is the readable default. */

.highlight .c, .highlight .ch, .highlight .cm, .highlight .cp, .highlight .cpf,
.highlight .c1, .highlight .cs { color: var(--syn-comment); font-style: italic; }

.highlight .k, .highlight .kc, .highlight .kd, .highlight .kn, .highlight .kp,
.highlight .kr, .highlight .kt, .highlight .o, .highlight .ow {
  color: var(--syn-keyword);
}

.highlight .s, .highlight .sa, .highlight .sb, .highlight .sc, .highlight .dl,
.highlight .sd, .highlight .s2, .highlight .se, .highlight .sh, .highlight .si,
.highlight .sx, .highlight .sr, .highlight .s1, .highlight .ss {
  color: var(--syn-string);
}

.highlight .m, .highlight .mb, .highlight .mf, .highlight .mh, .highlight .mi,
.highlight .mo, .highlight .il { color: var(--syn-number); }

.highlight .na, .highlight .nc, .highlight .nf, .highlight .fm, .highlight .nn,
.highlight .nt, .highlight .nv, .highlight .vc, .highlight .vg, .highlight .vi,
.highlight .vm { color: var(--syn-name); }

.highlight .nb, .highlight .bp, .highlight .no, .highlight .nd, .highlight .ne,
.highlight .nl { color: var(--syn-builtin); }

.highlight .gr, .highlight .gt, .highlight .gd { color: var(--syn-error); }
.highlight .gi { color: var(--syn-keyword); }
.highlight .gh, .highlight .gu { color: var(--syn-name); font-weight: 700; }
.highlight .ge { font-style: italic; }
.highlight .gs { font-weight: 700; }

/* Pygments marks anything a lexer cannot place as .err. Placeholders like
   <drive> in a shell example trip it constantly, so it stays neutral rather
   than painting half a snippet red. */
.highlight .err { color: inherit; }

blockquote {
  background: linear-gradient(180deg, var(--surface-1) 0, var(--surface-3) 100%);
  border: 1px solid var(--rule);
  border-left: 5px solid var(--accent-quote);
  border-radius: var(--radius);
  color: var(--ink-strong);
  font-style: italic;
  padding: 0.9rem 1.1rem;
}
blockquote p:last-child { margin-bottom: 0; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }

/* ── skip link ───────────────────────────────────────────────────────────── */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #002b36;
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius) 0;
  z-index: 10;
}
.skip-link:focus {
  left: 0;
  outline: 3px solid var(--focus);
  outline-offset: -3px;
}

/* ── shell ───────────────────────────────────────────────────────────────── */

.shell {
  max-width: 62rem;
  margin: 0 auto;
}

/* ── banner ──────────────────────────────────────────────────────────────── */

/* The banner is dark in both themes, so everything inside it is styled against
   a dark ground and does not follow the palette. */

.banner {
  background: linear-gradient(180deg, var(--banner-a) 0, var(--banner-b) 55%, var(--banner-c) 100%);
  border: 1px solid var(--banner-border);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  margin-top: 1rem;
  padding: 1.25rem 1.25rem 1.1rem;
}

/* Full-bleed colour stripe along the bottom edge of the banner. */
.banner::after {
  background: linear-gradient(90deg, var(--accent-cyan) 0, var(--accent-blue) 25%,
                              var(--accent-violet) 50%, var(--accent-magenta) 75%,
                              var(--accent-orange) 100%);
  content: "";
  display: block;
  height: 3px;
  margin: 1.1rem -1.25rem -1.1rem;
}

.banner-inner {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.avatar {
  background: #fdf6e3;
  border: 3px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  flex: none;
  height: 72px;
  width: 72px;
  object-fit: cover;
}

.banner-text { flex: 1 1 12rem; }

.brand {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}
.brand a { color: #fff; text-decoration: none; }
.brand a:visited { color: #fff; }
.brand a:hover { color: #ffd9a0; text-decoration: underline; }

.tagline {
  color: #cfe3e6;
  font-size: 0.95rem;
  margin: 0.15rem 0 0;
}

.banner-side {
  align-items: flex-end;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.45rem;
}

.banner-badge {
  color: #9fbcc1;
  font-size: 0.78rem;
  margin: 0;
}

.beta {
  background: linear-gradient(180deg, #e8722f 0, #cb4b16 55%, #a53a10 100%);
  border: 1px solid #8f320e;
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
  color: #fff;
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.1rem 0.55rem;
  text-transform: uppercase;
}

/* ── theme switch ────────────────────────────────────────────────────────── */

/* Hidden until the script un-hides it, so a visitor without JavaScript is
   never shown a control that cannot do anything. The sliding switch is drawn
   with ::before (track) and ::after (knob) to keep the markup free of empty
   decorative elements. */

.theme-toggle {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: #dbeaec;
  cursor: pointer;
  display: inline-block;
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.5;
  padding: 0.2rem 0.75rem 0.2rem 2.85rem;
  position: relative;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { background: rgba(0, 0, 0, 0.45); color: #fff; }

.theme-toggle::before {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
  content: "";
  height: 1.05rem;
  left: 0.3rem;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.1rem;
}

.theme-toggle::after {
  background: linear-gradient(180deg, #fffdf6 0, #cfc7ad 100%);
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  content: "";
  height: 0.8rem;
  left: 0.46rem;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  transition: left 0.15s ease-out;
  width: 0.8rem;
}

.theme-toggle[aria-pressed="true"]::before {
  background: linear-gradient(180deg, #1c85a0 0, #12657a 100%);
}
.theme-toggle[aria-pressed="true"]::after { left: 1.44rem; }

/* ── tab navigation ──────────────────────────────────────────────────────── */

.tabs {
  background: linear-gradient(180deg, var(--tabstrip-a) 0, var(--tabstrip-b) 100%);
  border: 1px solid var(--rule-strong);
  border-top: 0;
  padding: 0.4rem 0.5rem 0;
}

.tabs ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tabs li { margin: 0; }

.tab {
  background: linear-gradient(180deg, var(--tab-a) 0, var(--tab-b) 100%);
  border: 1px solid var(--rule-strong);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--gloss);
  color: var(--ink-strong);
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.5rem 1rem;
  text-decoration: none;
  text-shadow: var(--emboss-ui);
}
.tab:visited { color: var(--ink-strong); }
.tab:hover {
  background: linear-gradient(180deg, var(--tab-hover-a) 0, var(--tab-hover-b) 100%);
  color: var(--link-hover);
}

.tab.is-current {
  background: var(--paper);
  color: var(--link);
  /* Sits 1px lower so the active tab merges into the page below it. */
  margin-bottom: -1px;
  padding-bottom: calc(0.5rem + 1px);
}

/* ── layout ──────────────────────────────────────────────────────────────── */

.layout {
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-top: 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem 1.25rem 2rem;
}

.main { min-width: 0; }

.aside { margin-top: 2rem; }

@media (min-width: 60rem) {
  body { padding-left: 1.5rem; padding-right: 1.5rem; }
  .layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 17rem;
    gap: 2rem;
    padding: 2rem 2rem 2.5rem;
  }
  .aside { margin-top: 0; }
  h1 { font-size: 2.1rem; }
}

/* ── text helpers ────────────────────────────────────────────────────────── */

/* A small accent marker on section headings in the main column. Post titles in
   the blog index are h2 as well, so they opt back out. */
.main h2::before {
  background: var(--accent-cyan);
  border-radius: 2px;
  content: "";
  display: inline-block;
  height: 0.6em;
  margin-right: 0.5rem;
  vertical-align: baseline;
  width: 0.6em;
}
.main .post-card h2::before { display: none; }

.lede {
  color: var(--ink-strong);
  font-size: 1.1rem;
  line-height: 1.55;
}

.fine { color: var(--ink); font-size: 0.85rem; }

.plain { list-style: none; padding-left: 0; }
.plain li { margin-bottom: 0.35rem; }
.spaced li { margin-bottom: 0.7rem; }

.linklist { list-style: none; padding-left: 0; }
.linklist li {
  border-bottom: 1px dotted var(--rule);
  margin: 0;
  padding: 0.4rem 0;
}
.linklist li:last-child { border-bottom: 0; }

.facts { margin: 0; }
.facts dt {
  color: var(--ink-strong);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.facts dd { margin: 0 0 0.65rem; }

/* ── buttons ─────────────────────────────────────────────────────────────── */

.button {
  background: linear-gradient(180deg, var(--btn-a) 0, var(--btn-b) 100%);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow), var(--gloss);
  color: var(--ink-strong);
  display: inline-block;
  font-size: 0.92rem;
  font-weight: 700;
  margin: 0 0.4rem 0.5rem 0;
  padding: 0.5rem 1.1rem;
  text-decoration: none;
  text-shadow: var(--emboss-ui);
}
.button:visited { color: var(--ink-strong); }
.button:hover {
  background: linear-gradient(180deg, var(--btn-hover-a) 0, var(--btn-hover-b) 100%);
  color: var(--link-hover);
}
.button:active { box-shadow: inset 0 2px 4px rgba(0, 43, 54, 0.3); }

.button-primary {
  background: linear-gradient(180deg, var(--btn-primary-a) 0, var(--btn-primary-b) 55%,
                              var(--btn-primary-c) 100%);
  border-color: var(--btn-primary-border);
  color: var(--btn-primary-ink);
  text-shadow: var(--btn-primary-emboss);
}
.button-primary:visited { color: var(--btn-primary-ink); }
.button-primary:hover {
  background: linear-gradient(180deg, var(--btn-primary-hover-a) 0, var(--btn-primary-hover-b) 55%,
                              var(--btn-primary-hover-c) 100%);
  color: var(--btn-primary-ink);
}

/* ── boxes & panels ──────────────────────────────────────────────────────── */

.box {
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
  overflow: hidden;
  padding: 0 1rem 1rem;
}

.box > h2 {
  background: linear-gradient(180deg, var(--boxhead-a) 0, var(--boxhead-b) 100%);
  border-bottom: 1px solid var(--rule);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  margin: 0 -1rem 0.9rem;
  padding: 0.5rem 1rem;
  text-transform: uppercase;
}

.box-sub {
  border-bottom: 1px dotted var(--rule);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  margin: 1.1rem 0 0.4rem;
  padding-bottom: 0.2rem;
  text-transform: uppercase;
}

.box-feature {
  background: linear-gradient(180deg, var(--surface-1) 0, var(--surface-2) 100%);
}

.box-note { border-left: 4px solid var(--box-accent, var(--accent-quote)); }

/* Sidebar modules get a coloured header bar, cycling through the accents so a
   new box picks up the next hue without anyone having to assign one. */
.aside .box:nth-of-type(6n + 1) { --box-accent: var(--accent-cyan); }
.aside .box:nth-of-type(6n + 2) { --box-accent: var(--accent-blue); }
.aside .box:nth-of-type(6n + 3) { --box-accent: var(--accent-violet); }
.aside .box:nth-of-type(6n + 4) { --box-accent: var(--accent-magenta); }
.aside .box:nth-of-type(6n + 5) { --box-accent: var(--accent-green); }
.aside .box:nth-of-type(6n)     { --box-accent: var(--accent-orange); }

.aside .box > h2 {
  background-color: var(--box-accent);
  background-image: var(--accent-gloss);
  border-bottom-color: rgba(0, 0, 0, 0.3);
  color: var(--accent-ink);
  text-shadow: none;
}

.box p:last-child, .box ul:last-child, .box dl:last-child { margin-bottom: 0; }

.panel-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 34rem) {
  .panel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.panel {
  background: linear-gradient(180deg, var(--surface-1) 0, var(--surface-2) 100%);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow), var(--gloss);
  padding: 1rem 1.1rem;
}
.panel h3 { margin-top: 0; }
.panel p:last-child { margin-bottom: 0; }

.callout {
  background: linear-gradient(180deg, var(--callout-a) 0, var(--callout-b) 100%);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--gloss);
  margin-top: 2rem;
  padding: 1.25rem 1.25rem 0.9rem;
}
.callout h2 { margin-top: 0; }

.notice {
  background: linear-gradient(180deg, var(--notice-a) 0, var(--notice-b) 100%);
  border: 1px solid var(--notice-border);
  border-left: 5px solid var(--accent-quote);
  border-radius: var(--radius);
  color: var(--ink-strong);
  padding: 0.8rem 1rem;
}
.notice p { margin: 0; }

/* ── tags ────────────────────────────────────────────────────────────────── */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}
.tags li { margin: 0; }

.tag {
  background: linear-gradient(180deg, var(--boxhead-a) 0, var(--boxhead-b) 100%);
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  color: var(--ink-strong);
  display: inline-block;
  font-size: 0.78rem;
  padding: 0.1rem 0.6rem;
  white-space: nowrap;
}

/* A tag cloud without the 2006 habit of shrinking text below legibility. */
.tags-cloud .tag-lg { font-size: 0.95rem; font-weight: 700; }

/* ── home page ───────────────────────────────────────────────────────────── */

.intro > h1 { margin-bottom: 0.5rem; }

.panels { margin-top: 2.25rem; }

/* ── résumé ──────────────────────────────────────────────────────────────── */

.cv { margin-top: 1.5rem; }

.job {
  border-top: 1px solid var(--rule);
  margin-bottom: 1.75rem;
  padding-top: 1.25rem;
}

.job > h3 { margin-top: 0; }

.job-at { color: var(--ink); font-weight: 400; }

.job-org { font-size: 1.25rem; }

.job-meta {
  color: var(--ink);
  font-size: 0.88rem;
  margin: 0 0 0.75rem;
}

.role {
  border-left: 3px solid var(--accent-blue);
  margin: 1.1rem 0 0;
  padding: 0 0 0.25rem 1rem;
}
.role h4 { color: var(--link); margin-top: 0; }

.role-meta {
  color: var(--ink);
  font-size: 0.85rem;
  margin: 0 0 0.5rem;
}

/* ── blog ────────────────────────────────────────────────────────────────── */

.post-list { margin-top: 1.5rem; }

.post-card {
  background: linear-gradient(180deg, var(--surface-1) 0, var(--surface-2) 100%);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow), var(--gloss);
  margin-bottom: 1.25rem;
  padding: 1.1rem 1.2rem 0.9rem;
}
.post-card h2 { margin-top: 0; font-size: 1.25rem; }
.post-card .button { margin-bottom: 0; }

.byline { color: var(--ink); font-size: 0.85rem; margin: 0 0 0.6rem; }

.post-head {
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
}
.post-head h1 { margin-bottom: 0.35rem; }

.post-foot {
  border-top: 1px solid var(--rule);
  margin-top: 2rem;
  padding-top: 1rem;
}
.post-foot p { margin: 0; }

/* ── footer ──────────────────────────────────────────────────────────────── */

.site-footer {
  color: var(--ink);
  font-size: 0.9rem;
  margin-top: 1.5rem;
  padding: 0 0.25rem;
}

.footer-cols {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 40rem) {
  .footer-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.footer-col h2 {
  border-bottom: 1px solid var(--rule-strong);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  margin: 0 0 0.5rem;
  padding-bottom: 0.25rem;
  text-transform: uppercase;
}

.copyright {
  border-top: 1px solid var(--rule-strong);
  margin: 1.5rem 0 0;
  padding-top: 0.9rem;
  text-align: center;
}

/* ── motion & print ──────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  /* Print is always light, whatever the screen theme is set to. */
  body { background: #fff; color: #000; font-size: 11pt; padding: 0; }
  .banner, .tabs, .aside, .skip-link, .callout, .button, .post-foot { display: none; }
  .layout, .box, .panel, .post-card {
    background: none;
    border: 0;
    box-shadow: none;
    display: block;
    padding: 0;
  }
  h1, h2, h3, h4 { color: #000; text-shadow: none; }
  a { color: #000; }
  .job, .role { break-inside: avoid; }
  /* Print the destination of every link, since a reader cannot click paper. */
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; }
}
