/* Homepage styles.
   Palette, typography and spacing follow the Open GIS brand guidelines:
   warm off-white and near-black green surfaces, monospace type, green and
   orange accents, hairline borders, no shadows. */

:root {
  --font-mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  --content-width: 1080px;
  --radius: 6px;

  --header-bg: #0a120a;
  --header-border: rgba(13, 215, 13, 0.18);
  --header-fg: #ffffff;
  --header-fg-hover: #0dd70d;

  color-scheme: light dark;
}

:root:not([data-theme="dark"]) {
  --bg: #fcfaf5;
  --fg: #2b3129;
  --heading: #18281a;
  --muted: #61685b;
  --border: #dddccd;
  --accent: #0a7d0a;
  --accent-hover: #06630a;
  --orange: #b3571f;
  --footer-bg: #f4f2ea;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #000b00;
    --fg: #eeeeee;
    --heading: #e8f5ea;
    --muted: #9bb0a3;
    --border: #0e3111;
    --accent: #0dd70d;
    --accent-hover: #5cf05c;
    --orange: #dc8f4e;
    --footer-bg: #000500;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.65;
  overflow-wrap: break-word;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: underline dotted;
  text-decoration-thickness: 1px;
  text-decoration-color: currentColor;
  text-underline-offset: 0.15em;
  transition:
    color 0.15s ease,
    text-decoration-color 0.15s ease;
}

a:hover {
  color: var(--accent);
  text-decoration-style: solid;
}

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

.wrap {
  width: min(100% - 2rem, var(--content-width));
  margin-inline: auto;
}

/* Skip link */

.skip-link {
  position: absolute;
  top: -4rem;
  left: 1rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--header-bg);
  color: var(--header-fg);
  border-radius: var(--radius);
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

/* Masthead */

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

.masthead .wrap {
  padding-block: 1.1rem;
}

.brand {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.02em;
}

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

.brand a:hover {
  color: var(--header-fg-hover);
}

.masthead a:focus-visible {
  outline-color: var(--header-fg-hover);
}

/* Intro */

.intro {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  padding-block: 2.5rem;
  border-bottom: 1px solid var(--border);
}

.portrait {
  margin: 0;
}

.portrait img {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.bio p {
  margin: 0 0 1rem;
  max-width: 88ch;
}

.bio p:last-child {
  margin-bottom: 0;
}

.bio .lead {
  max-width: 60ch;
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--heading);
}

/* Link index */

.index__section {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 0.5rem 1.5rem;
  padding-block: 1.75rem;
  border-bottom: 1px solid var(--border);
}

.index__section:last-child {
  border-bottom: 0;
}

.index h2 {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.65;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.index h2::before {
  content: "";
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.5rem;
  border-radius: 1px;
  background: var(--orange);
  vertical-align: 0.05em;
}

.index ul {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 15rem;
  column-gap: 2rem;
}

.index li {
  break-inside: avoid;
  margin-bottom: 0.4rem;
}

.index li:last-child {
  margin-bottom: 0;
}

.index__section ul ul {
  margin: 0.4rem 0 1rem;
  padding-left: 0.85rem;
  border-left: 1px solid var(--border);
  font-size: 0.875rem;
  columns: auto;
}

.index__section ul ul li {
  margin-bottom: 0.25rem;
}

.index a {
  color: var(--fg);
  text-decoration: none;
}

.index ul ul a {
  color: var(--muted);
}

.index a:hover,
.index a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--footer-bg);
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer .wrap {
  padding-block: 1.5rem;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--accent);
  text-decoration: underline;
}

/* Responsive */

@media (max-width: 700px) {
  .intro {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .portrait {
    max-width: 14rem;
  }

  .index__section {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  a {
    transition: none;
  }
}
