/* Styles for index.html, the front page of projects.earthspecies.org. Sizes,
   colors and fonts match the project docs sites (the ESP theme in
   template/docs/stylesheets/extra.css on top of Material for MkDocs). */

@font-face { font-family: 'Euclid Circular B'; src: url('assets/fonts/EuclidCircularB-Regular-WebS.woff2') format('woff2'); font-weight: 400; font-style: normal; }
@font-face { font-family: 'Euclid Circular B'; src: url('assets/fonts/EuclidCircularB-Medium-WebS.woff2') format('woff2'); font-weight: 500; font-style: normal; }
@font-face { font-family: 'Euclid Circular B'; src: url('assets/fonts/EuclidCircularB-Semibold-WebS.woff2') format('woff2'); font-weight: 600; font-style: normal; }

:root {
  --bg: #fff;
  --fg: rgba(0, 0, 0, 0.87);
  --fg-light: rgba(0, 0, 0, 0.54);
  --fg-lightest: rgba(0, 0, 0, 0.07);
  --heading: rgba(0, 0, 0, 0.87);
  --primary: #129c7b;
  --braid: url('assets/braid.svg');
}

/* Material's "slate" scheme, with headings and body text brightened. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: hsl(225, 15%, 14%);
    --fg: hsla(225, 15%, 90%, 0.82);
    --fg-light: hsla(0, 0%, 100%, 0.68);
    --fg-lightest: hsla(225, 15%, 90%, 0.12);
    --heading: #fff;
    --primary: #04d78a;
    --braid: url('assets/braid-light.svg');
  }
  .masthead img.logo-light { display: none; }
  .masthead img.logo-dark { display: block; }
}

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

html {
  font-size: 125%;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Euclid Circular B', sans-serif;
  font-size: 0.85rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Thin bar in "brand-gradient-1" from earthspecies.org. */
body::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, #129c7b 0%, #04d78a 33%, #c3e409 66%, #d5d5d5 100%);
}

a { color: var(--primary); text-decoration: none; }

main {
  max-width: 76rem;
  margin: 0 auto;
  padding: 0 1.4rem 4rem;
}

/* Hidden on screen; gives screen readers and search a page title. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── Masthead: small centered logo under the gradient bar ──────────── */

.masthead {
  text-align: center;
  padding-top: 3.4rem;
}

.masthead a { display: inline-block; }

.masthead img {
  display: block;
  height: 2.5rem;
}

.masthead .logo-dark { display: none; }

/* ── Hero ──────────────────────────────────────────────────────────── */

.hero {
  text-align: center;
  padding: 3rem 1rem 2.5rem;
}

.hero h2 {
  color: var(--heading);
  font-size: 2.3rem;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
}

/* The braid separator from earthspecies.org. */
.braid {
  display: block;
  width: 243px;
  max-width: 100%;
  height: 17px;
  margin: 1.4rem auto;
  background: var(--braid) center / contain no-repeat;
}

.hero p {
  font-size: 1.05rem;
  color: var(--fg-light);
  max-width: 34rem;
  margin: 0 auto;
}

/* The theme's lime pill button (.ext-btn in extra.css), sized up. The text
   and icon stay dark in dark mode since the lime doesn't change. */
.ext-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1.8rem;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.6;
  color: #1a1a1a;
  background: #c3e409;
  padding: 0.75em 1.8em;
  border-radius: 999px;
  transition: background 0.2s ease;
}

.ext-btn:hover {
  background: linear-gradient(90deg, #129c7b 0%, #04d78a 50%, #c3e409 100%);
}

.ext-btn img { height: 1.2em; }

/* ── Project cards ─────────────────────────────────────────────────── */

/* Up to four cards: a centered 2×2. Five or more: as many 17rem columns
   as fit (three on a laptop). */
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
  max-width: 56rem;
  margin: 0 auto;
}

.project-grid:has(> .project-card:nth-child(5)) {
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  max-width: none;
}

.project-card {
  display: flex;
  flex-direction: column;
  padding: 1.6rem 1.5rem 1.4rem;
  border: 1px solid var(--fg-lightest);
  border-radius: 0.8rem;
  color: var(--fg);
  transition: border-color 0.15s, transform 0.15s;
}

a.project-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.project-card h3 {
  color: var(--heading);
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.4;
  margin: 0.4rem 0 0.5rem;
}

.project-card p {
  color: var(--fg-light);
  margin: 0 0 1.2rem;
  flex-grow: 1;
}

.project-kind {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
}

.project-link {
  font-weight: 500;
  color: var(--primary);
}

/* "Coming soon" cards: dashed and greyed, with an optional live GitHub link. */
.project-card--soon { border-style: dashed; }

.project-card--soon .project-kind,
.project-card--soon .project-link {
  color: var(--fg-light);
}

.project-card--soon .project-link--live { color: var(--primary); }

.project-soon {
  font-size: 0.75rem;
  color: var(--fg-light);
  margin-bottom: 0.3rem;
}

/* ── Phones ────────────────────────────────────────────────────────── */

@media (max-width: 44.9375em) {
  main { padding: 0 0.8rem 3rem; }
  .hero { padding: 2.5rem 0 2rem; }
  .hero h2 { font-size: 1.9rem; }
}

@media (max-width: 37.5em) {
  .project-grid { grid-template-columns: 1fr; }
}

/* ── 404 page ──────────────────────────────────────────────────────────── */

.not-found {
  padding-top: 5rem;
}

/* Same look as the hero h2 on the front page. */
.not-found h1 {
  color: var(--heading);
  font-size: 2.3rem;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}
