/* Forest OS website styles. Plain CSS, no build step, no dependencies. */

:root {
  --bg: #ffffff;
  --fg: #1b1b1b;
  --muted: #5c5c5c;
  --accent: #2f6f3e;
  --line: #d8d8d8;
  --code-bg: #f4f4f4;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181a;
    --fg: #e6e6e6;
    --muted: #a0a0a0;
    --accent: #7fbe8c;
    --line: #33383c;
    --code-bg: #202426;
  }
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  margin: 0 auto;
  max-width: 44rem;
  padding: 1.5rem 1.25rem 4rem;
}

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

header { border-bottom: 1px solid var(--line); padding-bottom: 1rem; margin-bottom: 2rem; }

header .title { font-size: 1.5rem; font-weight: 700; text-decoration: none; color: var(--fg); }
header .tagline { color: var(--muted); font-size: 0.95rem; margin: 0.25rem 0 1rem; }

nav a {
  display: inline-block;
  margin-right: 1rem;
  padding: 0.15rem 0;
  text-decoration: none;
}
nav a:hover { text-decoration: underline; }
nav a[aria-current="page"] { color: var(--fg); font-weight: 600; border-bottom: 2px solid var(--accent); }

h1 { font-size: 1.6rem; line-height: 1.3; margin-top: 0; }
h2 { font-size: 1.2rem; margin-top: 2.2rem; }
h3 { font-size: 1rem; margin-top: 1.6rem; }

p, li { overflow-wrap: break-word; }
ul, ol { padding-left: 1.3rem; }

code, pre, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }
code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 3px; }
pre {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
}
pre code { background: none; padding: 0; }

table { border-collapse: collapse; width: 100%; margin: 1rem 0; }
th, td { border: 1px solid var(--line); padding: 0.5rem 0.6rem; text-align: left; vertical-align: top; }
th { background: var(--code-bg); font-weight: 600; }

.note {
  border-left: 3px solid var(--accent);
  background: var(--code-bg);
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
}

.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  padding: 0.55rem 1.1rem;
  border-radius: 4px;
  font-weight: 600;
}
.button:hover { text-decoration: underline; }

@media (prefers-color-scheme: dark) {
  .button { color: #16181a; }
}

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

footer {
  border-top: 1px solid var(--line);
  margin-top: 3rem;
  padding-top: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}
footer a { color: var(--muted); }

/* ---------------------------------------------------------------
   Animation. CSS only — no JavaScript anywhere on this site.
   Everything below is disabled under prefers-reduced-motion.
   --------------------------------------------------------------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(0.6rem); }
  to   { opacity: 1; transform: none; }
}

@keyframes blink {
  0%, 45%  { opacity: 1; }
  50%, 95% { opacity: 0; }
  100%     { opacity: 1; }
}

@keyframes grow-rule {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* Page load: header, then content in sequence */
header {
  border-bottom-color: transparent; /* replaced by the animated rule below */
  animation: rise 0.45s ease-out both;
}

header::after {
  content: "";
  display: block;
  height: 1px;
  background: var(--accent);
  transform-origin: left;
  margin: 1rem -1.25rem -1rem;
  animation: grow-rule 0.7s ease-out 0.15s both;
}

main > * { animation: rise 0.45s ease-out both; }
main > *:nth-child(1) { animation-delay: 0.10s; }
main > *:nth-child(2) { animation-delay: 0.16s; }
main > *:nth-child(3) { animation-delay: 0.22s; }
main > *:nth-child(4) { animation-delay: 0.28s; }
main > *:nth-child(5) { animation-delay: 0.34s; }
main > *:nth-child(n+6) { animation-delay: 0.40s; }

footer { animation: rise 0.5s ease-out 0.45s both; }

/* Blinking block cursor after the wordmark — it's an OS site */
header .title::after {
  content: "_";
  color: var(--accent);
  animation: blink 1.4s steps(1, end) infinite;
}

/* Nav: underline wipes in from the left */
nav a { position: relative; }
nav a:hover { text-decoration: none; }
nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease-out;
}
nav a:hover::after, nav a:focus-visible::after { transform: scaleX(1); }
nav a[aria-current="page"] { border-bottom: none; }
nav a[aria-current="page"]::after { transform: scaleX(1); }

/* Buttons and links */
.button {
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out, filter 0.15s ease-out;
}
.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  filter: brightness(1.05);
  text-decoration: none;
}
.button:active { transform: translateY(0); box-shadow: none; }

main a:not(.button) {
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  transition: text-decoration-color 0.15s ease-out;
}
main a:not(.button):hover { text-decoration-color: var(--accent); }

/* Tables and code blocks respond to the pointer */
tbody tr { transition: background 0.15s ease-out; }
tbody tr:hover { background: var(--code-bg); }

pre { transition: border-color 0.2s ease-out; }
pre:hover { border-color: var(--accent); }

/* Support block */
.support { text-align: center; }
.support .button { margin-top: 0.5rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .button:hover { transform: none; }
  nav a::after { transform: scaleX(0); }
  nav a[aria-current="page"]::after { transform: scaleX(1); }
  header::after { transform: scaleX(1); }
}
