/* The irie-people home page. One stylesheet, no build step, no web fonts. It
   shares its layout with the sites of Irie, Riddim and Steak, and shows each
   project in its own colour. It follows the system's light or dark setting. */

:root {
  --bg: #FCFCF9;
  --bg-soft: #F1F3EE;
  --ink: #161A17;
  --ink-soft: #4E5651;
  --line: #DCE0D8;
  --line-strong: #7A837D;
  --link: #1E5A42;
  --link-hover: #1D7357;
  --mark: #1E5A42;
  --mark-ink: #EAF6EF;
  --button: #1E5A42;
  --button-ink: #EAF6EF;
  --focus: #1D7357;
  --code-bg: #E8ECE6;
  --syn-key: #1E5A42;
  --syn-type: #1F5E8A;
  --syn-str: #2F6B3F;
  --syn-num: #7A5A00;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1110;
    --bg-soft: #161B18;
    --ink: #EEF2EE;
    --ink-soft: #A8B1AB;
    --line: #29302C;
    --line-strong: #5F6A64;
    --link: #F2B544;
    --link-hover: #F7CD7A;
    --mark: #F2B544;
    --mark-ink: #10231A;
    --button: #F2B544;
    --button-ink: #10231A;
    --focus: #F2B544;
    --code-bg: #18201C;
    --syn-key: #F2B544;
    --syn-type: #8CC8F0;
    --syn-str: #9AD8A8;
    --syn-num: #F2C877;
  }
}

:root {
  color-scheme: light dark;
  --gold: #F2B544;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", "DejaVu Sans Mono", monospace;
  --page: 62rem;
  --measure: 40rem;
  --gutter: 1.25rem;
  --radius: 14px;
}

/* Base */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1.0625rem/1.6 var(--sans);
}

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

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--link-hover); text-decoration-thickness: 2px; }

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

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: var(--gutter); top: 0.75rem; z-index: 10; background: var(--bg); padding: 0.4rem 0.7rem; }

/* Header */

.site-header {
  max-width: var(--page);
  margin: 0 auto;
  padding: 1.25rem var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--ink); }
.brand svg { width: 2.1rem; height: 2.1rem; flex: none; }

.site-header nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
}
.site-header nav a { color: var(--ink-soft); text-decoration: none; font-size: 0.95rem; }
.site-header nav a:hover { color: var(--link); text-decoration: underline; }

/* Content */

main { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter) 2rem; }

.hero { padding: 2.5rem 0 2.25rem; border-bottom: 1px solid var(--line); }

.kicker { margin: 0 0 0.9rem; color: var(--ink-soft); font-size: 0.95rem; }
.kicker dfn { font-style: normal; font-weight: 700; color: var(--ink); }

h1 {
  font-size: clamp(2rem, 3.6vw + 1rem, 3.1rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  max-width: 22ch;
  text-wrap: balance;
}
h2 { font-size: 1.5rem; line-height: 1.25; letter-spacing: -0.01em; margin: 0 0 0.75rem; text-wrap: balance; }
h3 { font-size: 1.1rem; line-height: 1.3; margin: 0 0 0.4rem; }

.lede { font-size: 1.2rem; color: var(--ink-soft); max-width: var(--measure); margin: 0; }

section { padding: 2.25rem 0; border-bottom: 1px solid var(--line); }
main > section:last-child { border-bottom: 0; }

p, ul, ol { max-width: var(--measure); }
main li + li { margin-top: 0.35rem; }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.6rem 0 0; }
.button {
  display: inline-block;
  padding: 0.6rem 1.05rem;
  border-radius: 10px;
  border: 1px solid var(--button);
  background: var(--button);
  color: var(--button-ink);
  text-decoration: none;
  font-weight: 600;
}
.button:hover { color: var(--button-ink); filter: brightness(1.1); }
.button.quiet { background: transparent; color: var(--link); border-color: var(--line-strong); }
.button.quiet:hover { color: var(--link-hover); filter: none; border-color: var(--link); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  max-width: none;
}
.cards > li { margin: 0; }
.cards.two { grid-template-columns: repeat(auto-fit, minmax(20.5rem, 1fr)); }
.card {
  height: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
}
.card p { margin: 0 0 0.6rem; color: var(--ink-soft); }
.card p:last-child { margin-bottom: 0; }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 2.7rem; margin: 0 0 1.1rem; }
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.05rem;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--mark);
  color: var(--mark-ink);
  font-weight: 700;
  font-size: 0.9rem;
}

/* Code */

code, pre, kbd { font-family: var(--mono); font-size: 0.9em; }
:not(pre) > code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 5px; white-space: nowrap; }
pre {
  margin: 1.1rem 0;
  max-width: 100%;
  overflow-x: auto;
  padding: 1rem 1.15rem;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  line-height: 1.5;
  tab-size: 4;
}
pre.term { background: #0B0D0C; color: #E3E8E5; border-color: #26302B; }
pre.term .err { color: #FF7A6E; font-weight: 700; }
pre.term .faint { color: #8E9A94; }
pre.term .fix { color: #6FD39A; }
.k { color: var(--syn-key); font-weight: 600; }
.t { color: var(--syn-type); }
.s { color: var(--syn-str); }
.n { color: var(--syn-num); }
.c { color: var(--ink-soft); font-style: italic; }

/* Tables */

.table-wrap { max-width: 100%; overflow-x: auto; margin: 1rem 0; }
table { border-collapse: collapse; }
th, td { text-align: left; vertical-align: top; padding: 0.55rem 0.9rem 0.55rem 0; border-bottom: 1px solid var(--line); }
th { font-weight: 600; white-space: nowrap; }
td { color: var(--ink-soft); }

/* Footer */

.site-footer {
  max-width: var(--page);
  margin: 0 auto;
  padding: 1.5rem var(--gutter) 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.92rem;
}
.site-footer p { margin: 0.35rem 0; max-width: none; }
.family { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.9rem; margin: 0 0 0.8rem; }
.family strong { color: var(--ink); }
.family a { display: inline-flex; align-items: center; gap: 0.35rem; }
.family .dot { width: 0.7rem; height: 0.7rem; border-radius: 3px; display: inline-block; }
.dot.irie { background: #1E5A42; }
.dot.riddim { background: #1F1F24; box-shadow: inset 0 -0.25rem 0 #F2B544; }
.dot.steak { background: #7A2E1F; }

@media (prefers-color-scheme: dark) {
  .dot.riddim { background: #34343C; }
}

@media (max-width: 40rem) {
  .hero { padding-top: 1.5rem; }
  .lede { font-size: 1.1rem; }
  /* A two-column table reads better stacked on a phone: the label, then its text. */
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap th, .table-wrap td { display: block; }
  .table-wrap tr { padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
  .table-wrap th, .table-wrap td { padding: 0; border: 0; white-space: normal; }
  .table-wrap th { margin-bottom: 0.15rem; }
}

/* The home page's own parts: each project in its colour. */

.projects .card { border-top: 6px solid var(--accent); padding-top: 1.05rem; }
.projects .card.irie { --accent: #1E5A42; }
.projects .card.riddim { --accent: #1F1F24; }
.projects .card.steak { --accent: #7A2E1F; }
.project-head { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 0.7rem; }
.project-head svg { width: 2.6rem; height: 2.6rem; flex: none; }
.project-head h3 { font-size: 1.35rem; margin: 0; }
.project-head h3 a { color: var(--ink); text-decoration: none; }
.project-head h3 a:hover { color: var(--link); text-decoration: underline; }
.links { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin: 0.9rem 0 0; padding: 0; list-style: none; }
.links li + li { margin-top: 0; }

.fit { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem 1.5rem; margin: 1rem 0 0; padding: 0; list-style: none; max-width: none; }
.fit li + li { margin-top: 0; }
.fit strong { display: block; color: var(--ink); margin-bottom: 0.2rem; }
.fit li { color: var(--ink-soft); }

@media (prefers-color-scheme: dark) {
  .projects .card.riddim { --accent: #F2B544; }
}
