/* DevGrants Daily. Tokens and components from the Claude Design canvas
   "DevGrants Daily.dc.html". The canvas switches themes on [data-theme];
   this site has no toggle, so the dark set rides on prefers-color-scheme. */

:root {
  --bg: oklch(0.98 0.004 80);
  --surface: oklch(1 0 0);
  --fg: oklch(0.21 0.012 250);
  --muted: oklch(0.50 0.015 250);
  --line: oklch(0.90 0.006 80);
  --accent: oklch(0.46 0.16 255);
  --accent-fg: oklch(0.99 0 0);
  --open: oklch(0.50 0.14 150);
  --soon: oklch(0.53 0.17 50);
  --upcoming: oklch(0.50 0.17 300);
  --news: oklch(0.50 0.015 250);
  --radius: 6px;
  --shadow: 0 1px 2px oklch(0 0 0 / 0.05);
  --font: 'Source Sans 3', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  --display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --page: 1280px;
  --gutter: 20px;
  --status-mix: 12%;

  /* Cover tint numbers. The dark palette flips these four, so the per-type
     rules below are written once. */
  --tint-l: 0.93;
  --tint-c: 0.04;
  --tint-fl: 0.38;
  --tint-fc: 0.10;

  color-scheme: light;
}

@media (min-width: 768px) {
  :root { --gutter: 40px; }
}

/* The dark palette is declared twice on purpose. The first block serves
   readers who never touch the toggle and follow their system; :not() keeps an
   explicit light choice winning under a dark system. The second serves an
   explicit dark choice under a light system. Without JS only the first
   applies, which is why system mode carries no attribute at all. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: oklch(0.20 0.012 250);
    --surface: oklch(0.245 0.012 250);
    --fg: oklch(0.95 0.006 250);
    --muted: oklch(0.72 0.015 250);
    --line: oklch(0.32 0.012 250);
    --accent: oklch(0.80 0.10 255);
    --accent-fg: oklch(0.20 0.03 255);
    --open: oklch(0.78 0.14 150);
    --soon: oklch(0.80 0.14 60);
    --upcoming: oklch(0.78 0.12 300);
    --news: oklch(0.72 0.015 250);
    --shadow: 0 1px 2px oklch(0 0 0 / 0.4);
    --status-mix: 22%;
    --tint-l: 0.33;
    --tint-c: 0.05;
    --tint-fl: 0.88;
    --tint-fc: 0.07;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
    --bg: oklch(0.20 0.012 250);
    --surface: oklch(0.245 0.012 250);
    --fg: oklch(0.95 0.006 250);
    --muted: oklch(0.72 0.015 250);
    --line: oklch(0.32 0.012 250);
    --accent: oklch(0.80 0.10 255);
    --accent-fg: oklch(0.20 0.03 255);
    --open: oklch(0.78 0.14 150);
    --soon: oklch(0.80 0.14 60);
    --upcoming: oklch(0.78 0.12 300);
    --news: oklch(0.72 0.015 250);
    --shadow: 0 1px 2px oklch(0 0 0 / 0.4);
    --status-mix: 22%;
    --tint-l: 0.33;
    --tint-c: 0.05;
    --tint-fl: 0.88;
    --tint-fc: 0.07;
    color-scheme: dark;
}

/* Cover tints: one hue per type, chroma quartered for news. */
[data-tint] {
  --tint-mul: 1;
  --tint-bg: oklch(var(--tint-l) calc(var(--tint-c) * var(--tint-mul)) var(--tint-h));
  --tint-fg: oklch(var(--tint-fl) calc(var(--tint-fc) * var(--tint-mul)) var(--tint-h));
}
[data-tint="grant"]       { --tint-h: 255; }
[data-tint="accelerator"] { --tint-h: 300; }
[data-tint="hackathon"]   { --tint-h: 50; }
[data-tint="bounty"]      { --tint-h: 150; }
[data-tint="fellowship"]  { --tint-h: 195; }
[data-tint="news"]        { --tint-h: 250; --tint-mul: 0.25; }

* { box-sizing: border-box; }

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

img { max-width: 100%; }
[hidden] { display: none !important; }

a { color: var(--accent); }
a:focus-visible,
select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1, h2, h3 { font-family: var(--display); font-weight: 500; letter-spacing: -0.02em; margin: 0; text-wrap: pretty; }

/* ---------- chrome ---------- */

.site-header { border-bottom: 1px solid var(--line); }
.site-header__inner { max-width: var(--page); margin: 0 auto; display: flex; flex-direction: column; }
.site-header__bar { display: flex; align-items: baseline; justify-content: space-between; padding: 16px var(--gutter) 10px; }

.brand {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-decoration: none;
}

.site-header__rss { font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; }

.site-nav {
  display: flex;
  gap: 22px;
  padding: 0 var(--gutter) 12px;
  font-size: 15px;
  font-weight: 500;
  overflow-x: auto;
  white-space: nowrap;
}
.site-nav a { color: var(--muted); text-decoration: none; padding-bottom: 2px; }
.site-nav a:hover { color: var(--fg); }
.site-nav a.is-current { color: var(--fg); border-bottom: 2px solid var(--accent); }
.site-nav__rss { display: none; }

.site-nav__theme {
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 26px;
  padding: 0;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
}
.site-nav__theme:hover { color: var(--fg); border-color: var(--muted); }
.site-nav__theme:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* One icon per mode, all three shipped in the markup so nothing is injected. */
.theme-toggle__icon { display: none; }
.site-nav__theme[data-mode="system"] .theme-toggle__icon[data-for="system"],
.site-nav__theme[data-mode="light"] .theme-toggle__icon[data-for="light"],
.site-nav__theme[data-mode="dark"] .theme-toggle__icon[data-for="dark"] { display: block; }

@media (min-width: 768px) {
  .site-header__inner {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 28px;
    padding: 22px var(--gutter);
  }
  .site-header__bar { padding: 0; }
  .site-header__rss { display: none; }
  .brand { font-size: 24px; }
  .site-nav { gap: 28px; padding: 0; overflow: visible; }
  .site-nav__rss { display: inline; }
}

/* The design asks for 44px touch targets. The nav keeps its small type, so
   the target is an invisible box centred on each control instead. */
@media (max-width: 767px) {
  .site-nav a, .site-nav__theme { position: relative; }
  .site-nav a::after, .site-nav__theme::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 44px;
    transform: translateY(-50%);
  }
}

.container { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter) 48px; }

.site-footer { border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.site-footer__inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: 20px var(--gutter);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.site-footer__links { display: flex; gap: 16px; }
.site-footer__browse { display: flex; flex-wrap: wrap; gap: 10px 16px; padding-bottom: 4px; }
.site-footer__browse a { white-space: nowrap; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--fg); }

@media (min-width: 768px) {
  .site-footer__inner { flex-direction: row; justify-content: space-between; }
  .site-footer__links { gap: 20px; }
}

/* ---------- page heads ---------- */

.hero { padding: 28px 0 20px; display: flex; flex-direction: column; gap: 12px; }
.hero h1 { font-size: 34px; line-height: 1.12; }
.hero__lede { margin: 0; font-size: 16px; line-height: 1.5; color: var(--muted); max-width: 640px; text-wrap: pretty; }
.hero__meta { margin: 0; font-size: 13px; color: var(--muted); }

.page-head { padding: 28px 0 4px; display: flex; flex-direction: column; gap: 8px; }
.page-head h1 { font-size: 32px; line-height: 1.1; }
.page-head__lede { margin: 0; font-size: 15px; color: var(--muted); }
.page-head--narrow, .stack--narrow { max-width: 880px; margin-left: auto; margin-right: auto; }

@media (min-width: 768px) {
  .hero { padding: 44px 0 28px; gap: 14px; }
  .hero h1 { font-size: 44px; line-height: 1.1; }
  .hero__lede { font-size: 18px; }
  .page-head { padding: 44px 0 8px; gap: 10px; }
  .page-head h1 { font-size: 40px; }
  .page-head__lede { font-size: 17px; }
}

.stack { display: flex; flex-direction: column; gap: 28px; padding: 20px 0 8px; }
@media (min-width: 768px) { .stack { gap: 40px; padding: 24px 0 8px; } }

/* ---------- filters ---------- */

.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.filter { position: relative; flex: none; }
.filter select {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 30px 11px 12px;
  cursor: pointer;
}
.filter select.is-active { color: var(--accent-fg); background: var(--accent); border-color: var(--accent); }
.filter__caret { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); font-size: 12px; }
.filter select.is-active + .filter__caret { color: var(--accent-fg); }

.filters__count { margin-left: auto; padding-left: 12px; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (min-width: 768px) {
  .filters { padding-bottom: 24px; margin-bottom: 24px; overflow: visible; }
  .filter select { padding: 8px 30px 8px 12px; }
}

/* ---------- card ---------- */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; }
@media (min-width: 768px) { .grid { gap: 20px; } }

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--fg);
  box-shadow: var(--shadow);
  transition: border-color 0.15s;
}
.card:hover { border-color: var(--muted); }

.cover {
  aspect-ratio: 16 / 9;
  background: var(--tint-bg, var(--line));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover__label { font-family: var(--display); font-size: 26px; font-weight: 500; letter-spacing: -0.01em; color: var(--tint-fg); }
.cover--large { border-radius: var(--radius); }

.card__body { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px 18px; }
.card__title { font-size: 22px; line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; }
.card__summary { margin: 0; font-size: 15px; line-height: 1.45; color: var(--muted); text-wrap: pretty; }

.card__facts { display: grid; grid-template-columns: 1.1fr 0.9fr 1.2fr; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.fact { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fact__label { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.fact__value { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fact--org .fact__value { font-weight: 500; line-height: 1.3; text-wrap: pretty; }

/* ---------- badges and chips ---------- */

.badges { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.badge { display: inline-flex; align-items: center; font-weight: 600; }
.badge--type {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--fg);
}
.badge--status {
  gap: 6px;
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--status);
  background: color-mix(in oklch, var(--status) var(--status-mix), transparent);
}
.badge__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--status); }

.badge--open { --status: var(--open); }
.badge--closing_soon { --status: var(--soon); }
.badge--upcoming { --status: var(--upcoming); }
.badge--news { --status: var(--news); }
.badge--closed { --status: var(--muted); }

.tags { list-style: none; padding: 0; margin: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.tags li {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
}

/* ---------- detail ---------- */

.item { max-width: 1120px; margin: 0 auto; padding: 20px 0 40px; display: flex; flex-direction: column; gap: 18px; }
.item__back { font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; }
.item__back:hover { color: var(--fg); }
.item__grid { display: grid; gap: 24px; }
.item__head { display: flex; flex-direction: column; gap: 14px; }
.item__head h1 { font-size: 30px; line-height: 1.15; }
.item__summary { margin: 0; font-size: 17px; line-height: 1.45; color: var(--muted); text-wrap: pretty; }
.item__aside { display: flex; flex-direction: column; gap: 16px; }
.item__body { display: flex; flex-direction: column; gap: 14px; font-size: 16px; line-height: 1.6; text-wrap: pretty; }
.item__body p { margin: 0; }
.item__body h2 { font-size: 22px; line-height: 1.2; letter-spacing: -0.01em; margin-top: 6px; }
.item__body ul, .item__body ol { margin: 0; padding-left: 22px; }
.item__body pre { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.item__source {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.item__host { font-size: 13px; color: var(--muted); text-align: center; }

.facts-block {
  margin: 0;
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  font-size: 15px;
  line-height: 1.4;
}
.facts-block dt { color: var(--muted); font-weight: 500; }
.facts-block dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: var(--accent-fg);
  text-decoration: none;
  font-size: 17px;
  font-weight: 600;
  padding: 15px 20px;
  border-radius: var(--radius);
  text-align: center;
}
.button:hover { filter: brightness(1.08); color: var(--accent-fg); }

@media (min-width: 900px) {
  .item { padding: 28px 0 56px; gap: 28px; }
  .item__grid { grid-template-columns: minmax(0, 1fr) 360px; gap: 56px; align-items: start; }
  .item__head { grid-column: 1; grid-row: 1; gap: 20px; }
  .item__head h1 { font-size: 40px; line-height: 1.12; }
  .item__summary { font-size: 20px; }
  .item__aside { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 24px; }
  .item__body { grid-column: 1; grid-row: 2; font-size: 17px; gap: 16px; max-width: 640px; }
  .facts-block { grid-template-columns: 112px minmax(0, 1fr); gap: 12px 16px; padding: 20px; }
}

.item__related { margin-top: 8px; padding-top: 4px; }

/* ---------- section headings, archive, empty ---------- */

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 8px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--fg);
}
.section-heading h2 { font-size: 22px; line-height: 1.2; letter-spacing: -0.01em; }
.section-heading__meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (min-width: 768px) {
  .section-heading { padding-bottom: 10px; margin-bottom: 18px; }
  .section-heading h2 { font-size: 26px; }
  .section-heading__meta { font-size: 14px; }
}

.archive-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--fg);
}
.archive-row:hover { color: var(--accent); }
.archive-row__title { font-family: var(--display); font-size: 18px; font-weight: 500; line-height: 1.3; text-wrap: pretty; }
.archive-row__type { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.archive-row__org { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.archive-row .badge--status { align-self: flex-start; }

@media (min-width: 768px) {
  .archive-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px 200px 84px;
    gap: 20px;
    align-items: center;
    padding: 14px 0;
  }
  .archive-row__title { font-size: 19px; }
  .archive-row .badge--status { justify-self: end; align-self: center; }
}

.empty {
  padding: 40px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  text-align: center;
}
.empty__title { margin: 0; font-family: var(--display); font-size: 22px; line-height: 1.25; font-weight: 500; text-wrap: pretty; }
.empty__note { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.empty__link { margin-top: 4px; font-size: 15px; font-weight: 600; color: var(--accent); text-decoration: none; }

/* ---------- prose ---------- */

.prose { max-width: 680px; margin: 0 auto; padding: 28px 0 48px; display: flex; flex-direction: column; gap: 18px; font-size: 17px; line-height: 1.6; text-wrap: pretty; }
.prose h1 { font-size: 32px; line-height: 1.1; margin-bottom: 4px; }
.prose h2 { font-size: 22px; line-height: 1.2; letter-spacing: -0.01em; margin-top: 10px; }
.prose p { margin: 0; }

@media (min-width: 768px) {
  .prose { padding: 44px 0 72px; gap: 22px; font-size: 18px; }
  .prose h1 { font-size: 40px; margin-bottom: 6px; }
  .prose h2 { font-size: 26px; margin-top: 12px; }
}
