/* ==========================================================================
   LinkIT chrome — the group directory and the admin.

   This is the one surface that is never themed by a unit, so its palette is
   fixed: theGafGroup's warm paper and hairline rules, with LinkIT's own blue
   in place of the parent's verdigris.

   The public unit page lives in page.css and shares nothing with this file
   beyond the fonts.
   ========================================================================== */

@font-face {
  font-family: "Archivo Variable";
  src: url("../fonts/archivo-variable.woff2") format("woff2-variations");
  font-weight: 400 700;
  font-stretch: 75% 112%;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --paper:       #FAFAF7;
  --paper-sunk:  #F1F0EA;
  --surface:     #FFFFFF;

  --ink:         #12120F;
  --ink-2:       #3C3C34;
  --ink-3:       #6B6B61;
  --ink-4:       #98988E;

  --rule:        rgba(18, 18, 15, .14);
  --rule-soft:   rgba(18, 18, 15, .07);
  --rule-strong: rgba(18, 18, 15, .30);

  --accent:      #1A62D6;
  --accent-lift: #2BB3F0;
  --accent-deep: #1B2A4A;
  --accent-wash: #EAF2FE;
  --on-accent:   #FFFFFF;

  --ember:       #9A5B00;
  --ember-wash:  #FDF3E2;
  --danger:      #A3231F;
  --danger-wash: #FCEEED;
  --good:        #1A6B45;
  --good-wash:   #E9F4EE;

  --font-sans: "Archivo Variable", Archivo, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --gutter:  clamp(1.15rem, 4.5vw, 3rem);
  --ease:    cubic-bezier(.16, 1, .3, 1);
  --radius:  6px;

  color-scheme: light;
}

/* The admin is a tool used for long stretches, often at night, so it follows
   the operating system. The public directory does not — it is a single
   decisive statement, and it commits to paper. */
@media (prefers-color-scheme: dark) {
  .admin {
    --paper:       #121211;
    --paper-sunk:  #1A1A18;
    --surface:     #1F1F1C;

    --ink:         #F3F2EC;
    --ink-2:       #CBC9C0;
    --ink-3:       #9C9A91;
    --ink-4:       #6E6D66;

    --rule:        rgba(243, 242, 236, .16);
    --rule-soft:   rgba(243, 242, 236, .08);
    --rule-strong: rgba(243, 242, 236, .34);

    --accent:      #7FB2FF;
    --accent-lift: #A9CCFF;
    --accent-wash: #16233A;
    --on-accent:   #0B1220;

    --ember:       #F0B457;
    --ember-wash:  #2C2213;
    --danger:      #F08A86;
    --danger-wash: #2E1716;
    --good:        #7FD0A6;
    --good-wash:   #12271C;

    color-scheme: dark;
  }
}

/* --- reset ---------------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--rule-strong) transparent; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  padding:
    env(safe-area-inset-top, 0px)
    env(safe-area-inset-right, 0px)
    env(safe-area-inset-bottom, 0px)
    env(safe-area-inset-left, 0px);
}

h1, h2, h3, h4, p, ul, ol, figure, fieldset { margin: 0; }
ul, ol { padding: 0; list-style: none; }
fieldset { border: 0; padding: 0; min-width: 0; }
img, svg { max-width: 100%; }
img { display: block; height: auto; }

[hidden] { display: none !important; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.ic { width: 1.25em; height: 1.25em; flex: none; stroke: currentColor; fill: none; vertical-align: middle; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* --- browser surfaces ------------------------------------------------------ */

::selection { background: var(--accent-wash); color: var(--ink); }
:root { accent-color: var(--accent); caret-color: var(--accent); }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rule-strong); border: 3px solid var(--paper); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

a { color: inherit; text-decoration-color: var(--rule-strong); text-underline-offset: 3px; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 50;
  padding: .7rem 1rem; background: var(--ink); color: var(--paper); text-decoration: none;
}
.skip:focus { left: 0; }

/* --- shell ----------------------------------------------------------------- */

.shell { max-width: 72rem; margin: 0 auto; padding: 0 var(--gutter); }

.chrome--centred { display: grid; place-items: center; min-height: 100svh; }

/* ==========================================================================
   Directory
   ========================================================================== */

.masthead {
  padding: clamp(3rem, 9vw, 6rem) 0 clamp(2.5rem, 6vw, 4rem);
  border-bottom: 1px solid var(--rule);
}

.masthead__mark { width: clamp(124px, 15vw, 168px); height: auto; margin-bottom: clamp(1.75rem, 4vw, 2.75rem); }

.masthead__title {
  font-size: clamp(2.3rem, 7vw, 4.6rem);
  font-weight: 700;
  line-height: .98;
  letter-spacing: -.042em;
  max-width: 16ch;
  text-wrap: balance;
}

.masthead__lede {
  margin-top: 1.4rem;
  max-width: 54ch;
  color: var(--ink-3);
  font-size: clamp(1rem, 1.9vw, 1.14rem);
  line-height: 1.55;
}

.index { padding: clamp(1.5rem, 4vw, 2.5rem) 0 clamp(3rem, 8vw, 5rem); }

.units { border-top: 1px solid var(--rule-soft); }

.unit { position: relative; border-bottom: 1px solid var(--rule); }

.unit > a {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 1.25rem;
  padding: 1.4rem .2rem;
  text-decoration: none;
}

.unit__body { min-width: 0; }

.unit__name {
  display: block;
  font-size: clamp(1.28rem, 3.1vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.2;
  font-variation-settings: "wdth" 100;
  transition: font-variation-settings .42s var(--ease);
}

.unit__tag {
  display: block;
  margin-top: .15rem;
  color: var(--ink-3);
  font-size: .875rem;
  line-height: 1.4;
}

.unit__where {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--ink-3);
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 22ch;
}

.unit__go { color: var(--ink-4); display: flex; transition: transform .42s var(--ease), color .22s var(--ease); }

.unit::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left center;
  transition: transform .52s var(--ease);
}

.unit:hover::after, .unit:focus-within::after { transform: scaleX(1); }
.unit:hover .unit__name, .unit:focus-within .unit__name { font-variation-settings: "wdth" 108; }
.unit:hover .unit__go, .unit:focus-within .unit__go { color: var(--accent); transform: translate(3px, -3px); }
.unit:hover .unit__where, .unit:focus-within .unit__where { color: var(--ink-2); }

.blank { color: var(--ink-3); padding: 2.5rem 0; border-top: 1px solid var(--rule); }

.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--rule);
  font-size: .8125rem;
  color: var(--ink-3);
}
.foot a { display: inline-flex; align-items: center; gap: .4rem; text-decoration: none; transition: color .2s var(--ease); }
.foot a:hover { color: var(--accent); }
.foot .ic { width: 15px; height: 15px; }

/* --- 404 -------------------------------------------------------------------- */

.notfound { padding: 3rem 0; max-width: 34rem; }
.notfound h1 { font-size: clamp(1.9rem, 5.5vw, 2.8rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.05; }
.notfound p { margin-top: 1rem; color: var(--ink-3); }
.notfound__go a { display: inline-flex; align-items: center; gap: .5rem; color: var(--accent); text-decoration: none; font-weight: 500; }
.notfound__go a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .unit:hover .unit__name, .unit:focus-within .unit__name { font-variation-settings: "wdth" 100; }
  .unit:hover .unit__go { transform: none; }
}

@media (max-width: 40rem) {
  .unit > a { grid-template-columns: 1fr auto; row-gap: .4rem; }
  .unit__where { grid-column: 1 / 2; max-width: none; }
  .unit__go { grid-row: 1 / 3; grid-column: 2; }
}

/* The masthead already closes with a rule; the list must not open with a
   second one, or the gap between them reads as an empty unit. */
.units { border-top: 0; }
