/* The Nightly Build Directory — a single decentralized front page.
   Color/type tokens come from theme.css; this file is layout only. The page is
   a hero + a fused search/scope control + one ruled card grid. It server-renders
   the Articles grid so it reads with no JavaScript; net.js hydrates the toggle,
   live search, and the Authors view. */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
  flex: 1;
}

/* ------------------------------------------------------------------- hero */
.hero {
  text-align: center;
  padding: 50px 0 6px;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.025em;
  font-size: clamp(40px, 11vw, 76px);
  line-height: 0.98;
  margin: 0;
}

.hero h1 .dot {
  color: var(--accent);
}

.hero .tag {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(15px, 4vw, 20px);
  color: var(--ink-soft);
  margin: 14px auto 0;
}

/* ---------------------------------------------- fused search + scope toggle */
.searchbar {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-top: 22px;
}

.searchbar .field {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
}

.searchbar .field:focus-within {
  border-color: var(--accent);
}

.searchbar input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16.5px;
  padding: 12px 0;
}

.searchbar input:focus {
  outline: none;
}

.seg {
  display: inline-flex;
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.seg button {
  border: 0;
  background: var(--panel);
  color: var(--ink-soft);
  cursor: pointer;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13px;
  padding: 0 18px;
}

.seg button + button {
  border-left: 1px solid var(--line);
}

.seg button[aria-selected="true"] {
  background: var(--accent);
  color: var(--bg);
}

.countline {
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--faint);
  margin: 18px 2px 0;
}

/* --------------------------------------------------------- ruled card grid */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 8px 0 30px;
}

@media (min-width: 680px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }
}

.cell {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  padding: 15px 17px 13px;
  text-decoration: none;
  min-height: 128px;
}

.cell:hover h3 {
  color: var(--accent);
}

.cell .eyebrow {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 6px;
}

.cell .eyebrow.at {
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--mono);
  font-size: 12px;
}

.cell h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18.5px;
  line-height: 1.28;
  margin: 0 0 6px;
  letter-spacing: -0.005em;
}

.cell .dek {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cardfoot {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--faint);
}

.cardfoot .left {
  color: var(--ink-soft);
  font-weight: 500;
}

.cardfoot .right {
  white-space: nowrap;
}

.cardfoot .right.star {
  color: var(--accent-2);
  font-weight: 600;
}

/* ghost "start your own" — always the first cell, distinct but same size */
.cell.ghost {
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--wash);
}

.cell.ghost:hover {
  background: var(--panel);
}

.ghost-plus {
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1;
  color: var(--accent);
}

.ghost-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 20px;
  color: var(--ink);
  margin-top: 6px;
}

.ghost-sub {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 5px;
}

.cell.filler {
  background: var(--bg);
  min-height: 0;
}

.empty {
  text-align: center;
  color: var(--ink-soft);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 26px;
  margin: 16px 0 30px;
}

/* ----------------------------------------------------------------- footer */
.foot {
  border-top: 1px solid var(--line);
  margin-top: 6px;
}

.foot-in {
  max-width: 860px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--faint);
}

.appearance {
  margin-left: auto;
  border: 0;
  background: none;
  color: var(--ink-soft);
  min-height: 36px;
  padding: 0;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
}

.appearance:hover {
  color: var(--ink);
}
