/* Front Door (design pass 2026-10-31): the frame of every public page apex serves a browser, the
   org's list at / and /public/repositories/, and the not-found page. The repository, package and
   file pages move onto it next (Front Door b and c).

   Components carry Open Plan's names (one-house system.md section 2), so a page is drawn from the
   same vocabulary as the portal, www and docs: Button, Notice, Section, Table, Tag, Line. Every
   colour, face, radius and shadow is a brand token by reference (brand/tokens.css, the one
   source); the Open Plan spacing and control tokens fall back to their spec values until
   tokens.css carries them. No script: the pages run under a sandbox CSP. Light and dark follow
   the visitor's OS. */

@import url("brand/tokens.css");

@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/hanken-grotesk-latin.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-latin.woff2") format("woff2");
}

:root {
  color-scheme: light dark;

  --paper: var(--brand-color-paper);
  --paper-2: var(--brand-color-paper-2);
  --surface: var(--brand-color-surface);
  --ink: var(--brand-color-ink);
  --muted: var(--brand-color-muted);
  --faint: var(--brand-color-faint);
  --line: var(--brand-color-line);
  --primary: var(--brand-color-primary);
  --primary-solid: var(--brand-color-primary-solid);
  --primary-ink: var(--brand-color-primary-ink);
  --focus: var(--brand-color-focus);
  --band: var(--brand-color-band);
  --band-edge: var(--brand-color-band-edge);
  --on-ink: var(--brand-color-on-ink);
  --on-ink-2: var(--brand-color-on-ink-2);
  --marigold: var(--brand-color-marigold);
  --marigold-ink: var(--brand-color-marigold-ink);

  --sans: var(--brand-font-body);
  --mono: var(--brand-font-mono);

  --s1: var(--brand-space-1, 4px);
  --s2: var(--brand-space-2, 8px);
  --s3: var(--brand-space-3, 12px);
  --s4: var(--brand-space-4, 16px);
  --s5: var(--brand-space-5, 24px);
  --s6: var(--brand-space-6, 32px);
  --s7: var(--brand-space-7, 48px);
  --s8: var(--brand-space-8, 64px);

  --r: var(--brand-radius-control);
  --r-inner: var(--brand-radius-inner, 8px);
  --r-tag: var(--brand-radius-tag, 6px);
  --control-sm: var(--brand-control-sm, 2rem);
  --control-md: var(--brand-control-md, 2.5rem);
  --control-lg: var(--brand-control-lg, 3rem);
  --dur-press: var(--brand-dur-press, 120ms);
  --ease-out: var(--brand-ease-out, ease-out);

  --t-h1: clamp(1.875rem, 1.35rem + 1.9vw, 2.5rem);
  --t-title: 1.375rem;
  --t-body: 1.0625rem;
  --t-small: 0.9375rem;
  --t-mono: 0.875rem;
  --maxw: 72rem;
  --gutter: clamp(16px, 4vw, 40px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font: 400 var(--t-body) / 1.6 var(--sans);
  color: var(--ink);
  background: var(--paper);
  overflow-wrap: anywhere;
  font-variant-ligatures: no-contextual;
}
main {
  flex: 1;
}
h1,
h2 {
  margin: 0;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-wrap: balance;
}
p {
  margin: 0;
}
a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover {
  text-decoration-thickness: 2px;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}
.wrap {
  width: 100%;
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}
/* The one fun moment: whatever a visitor selects lights up marigold. */
::selection {
  background: var(--marigold);
  color: var(--marigold-ink);
}

/* The bar: the mark (to www), the path from the org down, Sign in. */
.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.bar-in {
  display: flex;
  align-items: center;
  gap: var(--s4);
  min-height: 56px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  flex: none;
  color: var(--ink);
  text-decoration: none;
}
.brand .mark {
  width: 26px;
  height: 26px;
  color: var(--primary);
}
.wordmark {
  font-weight: 750;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}
.wordmark span {
  color: var(--primary);
}
.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--s2);
  min-width: 0;
  padding-left: var(--s4);
  border-left: 1px solid var(--line);
  font-size: var(--t-small);
  color: var(--faint);
}
.crumb a {
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}
.crumb a:hover {
  color: var(--primary);
  text-decoration: underline;
}
.crumb [aria-current] {
  color: var(--ink);
  font-weight: 650;
}
.bar .signin {
  margin-left: auto;
  flex: none;
  padding: var(--s2) var(--s1);
  font-size: var(--t-small);
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.bar .signin:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* The band: the one ink surface a page carries. */
.band {
  color: var(--on-ink);
  background: var(--band);
  border-top: 1px solid var(--band-edge);
  border-bottom: 1px solid var(--band-edge);
}
.band-grid {
  display: grid;
  gap: var(--s7);
  padding-top: var(--s6);
  padding-bottom: var(--s6);
}
.ident {
  display: grid;
  gap: var(--s3);
  align-content: start;
}
.ident h1 {
  font-size: var(--t-h1);
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--on-ink);
}
.lead {
  max-width: 38rem;
  line-height: 1.55;
  color: var(--on-ink-2);
}

/* Button (Open Plan 2.4): primary by default; on the band it is paper with a marigold hover. */
.button {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-height: var(--control-md);
  padding: 0 var(--s4);
  border: 1px solid transparent;
  border-radius: var(--r);
  background: var(--primary-solid);
  color: var(--primary-ink);
  font-size: var(--t-small);
  font-weight: 650;
  text-decoration: none;
  transition: transform var(--dur-press) var(--ease-out);
}
.button:active {
  transform: translateY(1px);
}
.button.secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
.band .button {
  min-height: var(--control-lg);
  margin-top: var(--s3);
  padding: 0 var(--s5);
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
}
.band .button:hover {
  background: var(--marigold);
  color: var(--marigold-ink);
}

/* Section (Open Plan 2.8): a title, then rows. No box. */
.body {
  padding-top: var(--s7);
  padding-bottom: var(--s8);
}
.section + .section {
  margin-top: var(--s7);
}
.section-head {
  margin-bottom: var(--s4);
}
.section-head h2 {
  font-size: var(--t-title);
}

/* Table (Open Plan 2.9): the whole row is the link, a chevron at its end. */
.table {
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--paper);
}
.thead,
.row {
  display: grid;
  align-items: center;
  gap: var(--s4);
  padding: 0 var(--s5);
}
.thead {
  min-height: 44px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  font-size: 0.8125rem;
  font-weight: 650;
  color: var(--muted);
}
.row {
  min-height: 52px;
  border-top: 1px solid var(--line);
  font-size: var(--t-small);
  color: var(--muted);
  text-decoration: none;
}
.thead + .row {
  border-top: 0;
}
a.row:hover {
  background: color-mix(in oklab, var(--primary) 5%, var(--paper));
}
a.row:hover .name {
  color: var(--primary);
}
.row .name {
  min-width: 0;
  font-weight: 650;
  color: var(--ink);
}
.chev {
  width: 0.5rem;
  height: 0.5rem;
  border-right: 1.75px solid var(--faint);
  border-top: 1.75px solid var(--faint);
  transform: rotate(45deg);
}
a.row:hover .chev {
  border-color: var(--primary);
}
.cols-repos {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 1rem;
}
.pages {
  display: flex;
  justify-content: flex-end;
  gap: var(--s3);
  margin-top: var(--s4);
}

/* Tag (Open Plan 2.6): marks the exception, never the default. */
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 var(--s2);
  border: 1px solid var(--line);
  border-radius: var(--r-tag);
  background: var(--paper-2);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

/* Notice (Open Plan 2.7): a page state, one sentence; quiet is the early-access line. */
.notice {
  max-width: 44rem;
  padding: var(--s5);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper-2);
}
.notice h2 {
  font-size: 1.125rem;
  margin-bottom: var(--s2);
}
.notice p {
  color: var(--muted);
}
.notice.quiet {
  padding: 0;
  border: 0;
  background: none;
}

/* Line (Open Plan 2.10, the public pages' no-script form): one click selects the whole line. */
.line {
  margin: 0;
  padding: var(--s3) var(--s4);
  border-radius: var(--r);
  background: var(--band);
  color: var(--on-ink);
  font: 400 0.8125rem / 1.7 var(--mono);
  font-feature-settings: "calt" 0;
  overflow-x: auto;
  user-select: all;
}

/* Footer: Hosted on CloudRepo, and the early-access line. */
.footer {
  border-top: 1px solid var(--line);
  background: var(--paper-2);
}
.foot-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3) var(--s6);
  padding-top: var(--s6);
  padding-bottom: var(--s6);
  font-size: var(--t-small);
  color: var(--muted);
}
.foot-in .hosted a {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-weight: 750;
  color: var(--ink);
  text-decoration: none;
}
.foot-in .dot {
  margin: 0 var(--s2);
  color: var(--faint);
}

@media (max-width: 640px) {
  .wordmark {
    display: none;
  }
  .crumb {
    padding-left: var(--s3);
  }
  .thead {
    display: none;
  }
  .row {
    padding: var(--s3) var(--s4);
  }
  .cols-repos {
    grid-template-columns: minmax(0, 1fr) 1rem;
    grid-template-areas: "name chev" "kind chev";
    row-gap: 0;
  }
  .cols-repos .name {
    grid-area: name;
  }
  .cols-repos .kind {
    grid-area: kind;
  }
  .cols-repos .chev {
    grid-area: chev;
  }
  .foot-in {
    flex-direction: column;
    align-items: flex-start;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
