/* ==========================================================================
   sites.charlessieg.com
   --------------------------------------------------------------------------
   One family with charlessieg.com and its other sites: the same graphite ground and type (a serif display over a
   neutral sans body, mono for labels), with one azure accent. Every color is a token below, defined for light, for
   dark by preference, and for an explicit dark choice. Contrast targets WCAG 2.1 AA: body text 4.5:1 or better on
   every surface it sits on.
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --ground: #eef1f3;
  --surface: #fbfcfd;
  --surface-2: #f5f7f9;
  --band: #e4e8eb;
  --ink: #11161b;
  --ink-2: #4b5661;
  --ink-3: #5d6873;
  --rule: #d2d8dc;
  --rule-2: #b3bcc3;
  --accent: #1f5fae;
  --accent-hover: #164a8a;
  --accent-wash: #dde8f5;
  --on-accent: #ffffff;
  --shadow: 0 1px 2px rgba(17, 22, 27, .05);
  --shadow-lift: 0 6px 22px rgba(17, 22, 27, .10);

  --f-display: "Newsreader", "Hoefler Text", "Iowan Old Style", Palatino, Georgia, serif;
  --f-body: "Google Sans Flex", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --f-data: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --t-xs: .75rem;
  --t-sm: .8125rem;
  --t-md: .9375rem;
  --t-base: 1.0625rem;
  --t-lg: 1.25rem;
  --t-xl: 1.625rem;
  --t-2xl: 2.25rem;
  --t-3xl: 3.25rem;

  --wrap: 1440px;
  --measure: 70ch;
  --gutter: 1.25rem;
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0e1216;
    --surface: #161b21;
    --surface-2: #12171c;
    --band: #1d242b;
    --ink: #e3e8ec;
    --ink-2: #a3afb9;
    --ink-3: #8f9ba5;
    --rule: #28313a;
    --rule-2: #3c4751;
    --accent: #7fb0ea;
    --accent-hover: #a6c9f2;
    --accent-wash: #15212f;
    --on-accent: #0e1216;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lift: 0 6px 24px rgba(0, 0, 0, .55);
  }
}

:root[data-theme="dark"] {
  --ground: #0e1216;
  --surface: #161b21;
  --surface-2: #12171c;
  --band: #1d242b;
  --ink: #e3e8ec;
  --ink-2: #a3afb9;
  --ink-3: #8f9ba5;
  --rule: #28313a;
  --rule-2: #3c4751;
  --accent: #7fb0ea;
  --accent-hover: #a6c9f2;
  --accent-wash: #15212f;
  --on-accent: #0e1216;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-lift: 0 6px 24px rgba(0, 0, 0, .55);
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 8rem; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: var(--t-base);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

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

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 400; line-height: 1.15; color: var(--ink); margin: 0; text-wrap: balance; }

p, ul, ol { margin: 0 0 1.1rem; }

.skip {
  position: absolute; left: -999px; top: .5rem; z-index: 100;
  background: var(--surface); color: var(--ink); padding: .5rem .9rem; border-radius: 6px; box-shadow: var(--shadow-lift);
}
.skip:focus { left: .75rem; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.eyebrow {
  font-family: var(--f-data); font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 .6rem;
}

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* 3. Header ---------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--ground) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-header__inner { display: flex; align-items: center; gap: 1rem; min-height: 3.75rem; }
.brand {
  display: inline-flex; align-items: baseline; gap: .45rem; text-decoration: none; color: var(--ink);
  font-family: var(--f-display); font-size: 1.3rem; white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand__sub { font-family: var(--f-data); font-size: var(--t-xs); color: var(--ink-3); letter-spacing: .04em; }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.75rem; min-height: 2.75rem; padding: 0 .6rem;
  border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); color: var(--ink);
  font: inherit; font-size: var(--t-sm); cursor: pointer; margin-left: auto;
}
.theme-toggle:hover { border-color: var(--rule-2); }
.theme-toggle svg { width: 1.1rem; height: 1.1rem; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

@media (max-width: 420px) { .brand__sub { display: none; } }

/* 4. Introduction ---------------------------------------------------------- */
.intro { padding-top: 2.75rem; padding-bottom: 1.25rem; }
.intro h1 { font-size: clamp(2.1rem, 5vw, var(--t-3xl)); letter-spacing: -.01em; max-width: 22ch; }
.intro__lede { max-width: var(--measure); margin-top: 1rem; color: var(--ink-2); line-height: 1.6; }
.intro__lede p:last-child { margin-bottom: 0; }
.intro__dek { color: var(--ink-2); margin: .8rem 0 1.5rem; }

/* 5. Company tabs ---------------------------------------------------------- */
/* The tabs sit under the sticky header and stay in reach while the list scrolls. Without script they stay hidden
   and every company shows, one after another. */
.tabs {
  position: sticky; top: 3.8rem; z-index: 40;
  display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: thin;
  padding: .75rem 0; margin: 0 0 .5rem;
  background: color-mix(in srgb, var(--ground) 94%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.tab {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: .45rem;
  min-height: 2.5rem; padding: 0 .95rem;
  border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); color: var(--ink);
  font: inherit; font-size: var(--t-md); font-weight: 500; cursor: pointer; white-space: nowrap;
}
.tab:hover { border-color: var(--rule-2); }
.tab[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.tab__count { font-family: var(--f-data); font-size: var(--t-xs); opacity: .8; }
.tabs__status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }

/* 6. Companies, sections, and cards --------------------------------------- */
.directory { padding-bottom: 2rem; }
.company { padding-top: 1.75rem; }
.company + .company { margin-top: 1.25rem; border-top: 1px solid var(--rule); }
.directory[data-filtered] .company { margin-top: 0; border-top: 0; }
.company__title { font-size: var(--t-2xl); margin: 0 0 1.25rem; }
.section__title {
  font-family: var(--f-data); font-size: var(--t-xs); font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3); margin: 1.75rem 0 .9rem;
}
.company__title + .section__title { margin-top: 0; }

.cards {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 1.25rem;
}
.card { min-width: 0; }
.card__link {
  display: flex; flex-direction: column; height: 100%;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: var(--ink); box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card__link:hover { color: var(--ink); border-color: var(--rule-2); box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.card__link:focus-visible { outline-offset: 2px; border-radius: var(--radius); }
.card__art { display: block; aspect-ratio: 40 / 21; background: var(--band); border-bottom: 1px solid var(--rule); }
.art { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.art--dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .art--light { display: none; }
  :root:not([data-theme="light"]) .art--dark { display: block; }
}
:root[data-theme="dark"] .art--light { display: none; }
:root[data-theme="dark"] .art--dark { display: block; }

.card__body { display: flex; flex-direction: column; gap: .3rem; padding: 1rem 1.1rem 1.2rem; }
.card__name { font-family: var(--f-display); font-size: var(--t-lg); line-height: 1.2; }
.card__host { font-family: var(--f-data); font-size: var(--t-xs); color: var(--accent); overflow-wrap: anywhere; }
.card__host::after { content: " \2197"; }
.card__desc { color: var(--ink-2); font-size: var(--t-md); line-height: 1.5; margin-top: .25rem; }

@media (prefers-reduced-motion: reduce) {
  .card__link { transition: none; }
  .card__link:hover { transform: none; }
}

/* 7. The missing page ------------------------------------------------------ */
.missing { padding-top: 3.5rem; padding-bottom: 3rem; }
.missing h1 { font-size: clamp(2.1rem, 6vw, var(--t-3xl)); }
.prose { max-width: var(--measure); }

/* 8. Footer ---------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--rule); background: var(--surface-2); margin-top: 2rem; padding: 2.25rem 0 2.5rem; font-size: var(--t-sm); color: var(--ink-2); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 1.5rem; }
.footer-grid h2 { font-family: var(--f-data); font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 500; margin: 0 0 .6rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin: 0 0 .4rem; }
.footer-grid a { color: var(--ink-2); }
.footer-grid a:hover { color: var(--accent); }
.footer-fine { margin-top: 1.75rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-size: var(--t-xs); color: var(--ink-3); }
.footer-fine p { margin: 0 0 .4rem; max-width: 100ch; }

/* 9. Small screens and paper ------------------------------------------------ */
@media (max-width: 640px) {
  :root { --gutter: 1rem; }
  body { font-size: 1rem; }
  .intro { padding-top: 1.75rem; }
  .company__title { font-size: var(--t-xl); }
}

@media print {
  .site-header, .theme-toggle, .tabs, .site-footer { display: none !important; }
  body { background: #fff; color: #000; }
  a { color: #000; }
  .card__art { display: none; }
}
