/* Year Out — one stylesheet, no framework, no gradients. */

:root {
  color-scheme: light dark;

  --bg: #faf9f6;
  --text: #1b1c19;
  --muted: #6d6d65;
  --border: #e6e3db;
  --border-strong: #d5d1c7;
  --accent: #0f6b5f;
  --accent-soft: #e7f1ee;
  --accent-contrast: #ffffff;
  --code-bg: #f0eee8;

  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --font-display: ui-serif, Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia,
    "Liberation Serif", serif;

  --wrap: 900px;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121312;
    --text: #ecebe6;
    --muted: #a2a199;
    --border: #2a2c29;
    --border-strong: #3b3e39;
    --accent: #7fe3cd;
    --accent-soft: #17322c;
    --accent-contrast: #08201b;
    --code-bg: #1d1f1c;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

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

h1,
h2,
p,
ul,
ol,
dl,
dd {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 1px 5px;
  border-radius: 4px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 22px;
}

.muted {
  color: var(--muted);
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--accent);
  flex: none;
}

.nav {
  display: flex;
  gap: 22px;
  font-size: 0.9rem;
  color: var(--muted);
}

.nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

/* Intro */

.intro {
  padding: 58px 0 34px;
  max-width: 46rem;
}

.eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent);
}

.intro h1,
.error-page h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.9rem);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.022em;
  text-wrap: balance;
  margin: 8px 0 14px;
}

.lede {
  color: var(--muted);
  font-size: 1.03rem;
  max-width: 44rem;
}

/* List */

.list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--text);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-strong);
}

.posting-list {
  border-bottom: 1px solid var(--border);
}

.posting {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 28px;
  padding: 22px 0;
  border-top: 1px solid var(--border);
}

.posting:first-child {
  border-top: 0;
}

.posting-company {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.posting-title {
  font-size: 1.06rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 4px 0 9px;
  letter-spacing: -0.008em;
}

.posting-title a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.posting-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 16px;
  font-size: 0.86rem;
  color: var(--muted);
}

.posting-meta li {
  position: relative;
  font-variant-numeric: tabular-nums;
}

.posting-meta li + li::before {
  content: "·";
  position: absolute;
  left: -10px;
  color: var(--border-strong);
}

.posting-meta li.tag::before {
  content: none;
}

.tag {
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0 7px;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.posting-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding-top: 20px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.posting-sources {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  text-align: right;
}

/* Keep the markers on one horizontal line even if the parent's flexbox
   layout is unavailable, so they never fall back to a vertical stack. */
.posting-sources > li {
  display: inline-block;
  vertical-align: middle;
}

.posting-sources > li + li {
  margin-left: 4px;
}

.source-icon {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  object-fit: contain;
  vertical-align: middle;
}

.source-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #ffffff;
  background: var(--muted);
  cursor: help;
  text-decoration: none;
  vertical-align: middle;
}

.posting-seen {
  font-size: 0.72rem;
  color: var(--muted);
}

.empty {
  margin: 40px 0;
  padding: 52px 24px;
  text-align: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.empty p + p {
  margin-top: 8px;
  font-size: 0.9rem;
}

/* Filters */

.filters {
  margin: 4px 0 24px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.field-wide {
  grid-column: span 2;
}

.field input,
.field select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
}

.field input::placeholder {
  color: var(--muted);
  opacity: 0.75;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.check {
  display: flex;
  align-items: center;
  gap: 7px;
  align-self: end;
  padding-bottom: 9px;
  font-size: 0.82rem;
  color: var(--text);
  white-space: nowrap;
}

.check input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
}

button.button {
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font-body);
}

.reset {
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--border-strong);
}

.list-note {
  margin: -4px 0 16px;
  font-size: 0.8rem;
  color: var(--muted);
}

.list-note a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  padding: 22px 0 4px;
  border-top: 1px solid var(--border);
  font-size: 0.84rem;
}

.page-link {
  color: var(--accent);
  font-weight: 600;
}

.page-link.disabled {
  color: var(--muted);
  font-weight: 400;
}

/* Detail */

.back {
  display: inline-block;
  margin-top: 28px;
  font-size: 0.85rem;
  color: var(--muted);
}

.detail {
  padding: 22px 0 10px;
  max-width: 46rem;
}

.detail h1 {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 4.2vw, 2.3rem);
  line-height: 1.14;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 8px 0 18px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.chips li {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.detail-excerpt {
  font-size: 1.02rem;
  line-height: 1.68;
  max-width: 40rem;
  white-space: pre-line;
}

.detail-note {
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--muted);
}

.actions {
  margin: 26px 0 8px;
}

.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 650;
  letter-spacing: 0.005em;
}

.button:hover {
  color: var(--accent-contrast);
  filter: brightness(1.06);
}

.facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 9px 28px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}

.facts > div {
  display: contents;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  font-variant-numeric: tabular-nums;
}

.facts a {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--border-strong);
}

/* Sources */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 8px;
}

.table th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 16px 10px 0;
  border-bottom: 1px solid var(--border-strong);
}

.table td {
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.table th:last-child,
.table td:last-child {
  padding-right: 0;
}

.summary {
  margin-top: 28px;
  font-size: 0.88rem;
}

.status-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-top: 8px;
}

.section-title {
  margin: 36px 0 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

.source-list {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.source-card {
  padding: 18px 18px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.source-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.source-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
}

.source-count {
  margin: 10px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.source-count strong {
  color: var(--text);
  font-weight: 600;
}

.source-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  margin: 16px 0 0;
}

.source-stats div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.source-stats dt {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.source-stats dd {
  margin: 0;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}

.source-stats .stat-small {
  padding-top: 3px;
  font-size: 0.86rem;
  color: var(--muted);
}

.source-run {
  margin: 14px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.status-ok {
  background: var(--accent-soft);
  color: var(--accent);
}

.status-partial,
.status-running {
  background: var(--code-bg);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.status-error {
  background: transparent;
  color: #a33232;
  border: 1px solid #a33232;
}

.status-never {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

@media (prefers-color-scheme: dark) {
  .status-error {
    color: #ff9b9b;
    border-color: #ff9b9b;
  }
}

.run-error {
  font-size: 0.8rem;
  color: var(--muted);
}

details.run-error summary {
  cursor: pointer;
}

.run-error pre {
  margin: 8px 0 0;
  padding: 10px;
  overflow-x: auto;
  border-radius: 6px;
  background: var(--code-bg);
  font-size: 0.76rem;
  white-space: pre-wrap;
}

.table-wrap {
  overflow-x: auto;
}

.runs-table td,
.runs-table th {
  padding-right: 12px;
}

/* Error */

.error-page {
  padding: 70px 0 60px;
  max-width: 40rem;
}

/* Footer */

.site-footer {
  margin-top: 72px;
  border-top: 1px solid var(--border);
  padding: 26px 0 44px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.6;
}

.site-footer p + p {
  margin-top: 4px;
}

.site-footer a {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--border-strong);
}

/* Static client */

.loading {
  padding: 44px 0;
}

/* Small screens */

@media (max-width: 560px) {
  .intro {
    padding-top: 40px;
  }

  .filters {
    padding: 14px;
  }

  .field-wide {
    grid-column: 1 / -1;
  }

  .field input,
  .field select {
    font-size: 1rem;
  }

  .runs-table {
    font-size: 0.82rem;
  }

  .runs-table th:nth-child(6),
  .runs-table td:nth-child(6),
  .runs-table th:nth-child(9),
  .runs-table td:nth-child(9) {
    display: none;
  }

  .runs-table td,
  .runs-table th {
    padding-right: 8px;
  }

  .posting {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .posting-side {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    padding-top: 0;
  }

  .facts {
    grid-template-columns: 1fr;
    gap: 2px 0;
  }

  .facts dt {
    margin-top: 10px;
  }

  .table th:nth-child(2),
  .table td:nth-child(2) {
    display: none;
  }
}
