/* ajnapps.com: the same layout as fact-forge.org (one centred column, serif
   display type, uppercase section labels), with a leaf-green accent and
   green-tinted greys of its own. Static, no build step. */

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

:root {
  --ink: #18201B;
  --paper: #FFFFFF;
  --muted: #4E5751;
  --link: #37403A;
  --rule: #E2E8E4;
  --leaf: #2E7D4F;

  --display: Georgia, "Times New Roman", serif;
  --text: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --column: 880px;
  --gutter: 2.5rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #EEF2EF;
    --paper: #0B0F0C;
    --muted: #A3ADA6;
    --link: #D2DAD4;
    --rule: #26302A;
    --leaf: #7CCB98;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --ink: #EEF2EF;
  --paper: #0B0F0C;
  --muted: #A3ADA6;
  --link: #D2DAD4;
  --rule: #26302A;
  --leaf: #7CCB98;
  color-scheme: dark;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  font-family: var(--text);
  font-size: 1.25rem;
  color: var(--muted);
  background: var(--paper);
  line-height: 1.7;
  overflow-wrap: break-word;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Paints the strip above the sticky header on phones with a notch. */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--paper);
}

a {
  color: var(--link);
  text-decoration-color: var(--rule);
  text-underline-offset: 4px;
  transition: color 0.15s, text-decoration-color 0.15s;
}

a:hover {
  color: var(--ink);
  text-decoration-color: var(--leaf);
}

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--leaf);
  outline-offset: 4px;
  border-radius: 2px;
}

/* — Nav — */
header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  background: var(--paper);
  z-index: 100;
}

nav {
  max-width: var(--column);
  margin: 0 auto;
  padding-block: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem 2rem;
}

.wordmark {
  font-family: var(--display);
  font-size: 1.375rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.wordmark::before {
  content: "";
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.5rem;
  border-radius: 50%;
  background: var(--leaf);
  vertical-align: 0.125em;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
}

.nav-links a {
  font-size: 1.0625rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.nav-links a:hover {
  color: var(--ink);
}

/* — Hero — */
.hero {
  max-width: var(--column);
  margin: 0 auto;
  padding-block: 8rem 6rem;
}

.hero-name {
  font-family: var(--display);
  font-size: 5rem;
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--ink);
  text-wrap: balance;
}

.hero-descriptor {
  margin-top: 1.25rem;
  font-size: 1.125rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* — Sections — */
.section {
  max-width: var(--column);
  margin: 0 auto;
  padding-block: 4rem;
  border-top: 1px solid var(--rule);
}

.section h2 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--link);
  margin-bottom: 1.5rem;
}

.section p {
  max-width: 720px;
  font-size: 1.25rem;
}

.section p + p {
  margin-top: 1rem;
}

/* — Apps — */
.app-list {
  list-style: none;
  display: grid;
  gap: 2.5rem;
  margin-top: 2rem;
  max-width: 720px;
}

.app {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.app-icon {
  display: block;
  width: 64px;
  height: 64px;
  max-width: 100%;
  border-radius: 14px;
  box-shadow: 0 0 0 1px var(--rule);
}

.app-body {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.app-name {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}

.section .app-body p {
  margin: 0;
}

.section .app-meta {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--leaf);
}

.section .app-desc {
  font-size: 1.125rem;
}

.app-link {
  justify-self: start;
  margin-top: 0.25rem;
  font-size: 1.0625rem;
}

/* — Subpages — */
.page-section {
  border-top: none;
  padding-top: 6rem;
}

.page-section .back-link {
  margin-bottom: 1.75rem;
}

.page-section .back-link a {
  font-size: 1.0625rem;
  color: var(--muted);
  text-decoration: none;
}

.page-section .back-link a:hover {
  color: var(--ink);
}

.section .page-title {
  font-family: var(--display);
  font-size: 2.25rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  text-transform: none;
  line-height: 1.2;
  color: var(--ink);
  text-wrap: balance;
}

.section .updated {
  font-size: 0.875rem;
  font-style: italic;
}

.page-section h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  text-wrap: balance;
}

.page-section h3:first-of-type {
  margin-top: 2rem;
}

/* An app's section, reached from the policy's links, starts below the
   sticky header. */
.page-section h3[id] {
  scroll-margin-top: 6rem;
}

.page-section h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.5;
  color: var(--link);
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.page-section ul {
  padding-left: 1.5rem;
  margin-top: 0.75rem;
  max-width: 720px;
  font-size: 1.25rem;
  color: var(--muted);
}

.page-section li {
  margin-bottom: 0.5rem;
}

.page-section li strong,
.page-section .question {
  color: var(--ink);
  font-weight: 600;
}

.section .qa {
  margin-top: 1.25rem;
}

.page-section .question {
  display: block;
  margin-bottom: 0.25rem;
}

/* — FAQ — */
.faq details {
  max-width: 720px;
  border-bottom: 1px solid var(--rule);
}

.faq details:first-of-type {
  border-top: 1px solid var(--rule);
}

.faq details summary {
  padding: 1.25rem 0;
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq details summary::-webkit-details-marker {
  display: none;
}

.faq details summary::after {
  content: "+";
  font-family: var(--text);
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--muted);
  flex-shrink: 0;
  margin-left: 1.25rem;
}

.faq details[open] summary::after {
  content: "\2212";
}

.section.faq details p {
  padding-bottom: 1.5rem;
  font-size: 1.125rem;
  line-height: 1.7;
}

/* — Footer — */
footer {
  max-width: var(--column);
  margin: 0 auto;
  padding-block: 2.5rem 3.5rem;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
}

.footer-links a {
  font-size: 1.0625rem;
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--ink);
}

.copyright {
  font-size: 1rem;
  color: var(--muted);
}

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

/* — Phones — */
@media (max-width: 600px) {
  :root {
    --gutter: 1.5rem;
  }

  body {
    font-size: 1.125rem;
  }

  /* Two rows of nav would cover too much of a phone screen if it stuck. */
  header {
    position: static;
  }

  nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding-block: 1.25rem;
  }

  .nav-links {
    gap: 0.5rem 1.25rem;
  }

  .nav-links a {
    font-size: 1rem;
  }

  .hero {
    padding-block: 4rem 3rem;
  }

  .hero-name {
    font-size: 3.25rem;
  }

  .hero-descriptor {
    font-size: 1rem;
  }

  .section {
    padding-block: 3rem;
  }

  .section p,
  .page-section ul {
    font-size: 1.125rem;
  }

  .app {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 1rem;
  }

  .app-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
  }

  .page-section {
    padding-top: 3rem;
  }

  .section .page-title {
    font-size: 2rem;
  }

  footer {
    padding-block: 2rem 2.5rem;
    flex-direction: column;
    gap: 0.75rem;
  }

  .footer-links {
    gap: 0.5rem 1.5rem;
  }
}
