/* Reto landing page — stylesheet for docutils html5 output */

/* ── Reset & variables ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent:  #4a6aa5;   /* darker #5b7bb5 from the icon, for text contrast */
  --blue:    #5b7bb5;
  --gold:    #f5b83d;
    --dark:    #2b3a55;
  --bg:      #fff;
  --bg-alt:  #f3f5f9;
  --text:    #2c2c2c;
  --muted:   #5a6070;
  --border:  #dbe1ec;
  --radius:  8px;
  --shadow:  0 4px 20px rgba(0,0,0,.10);
  --sans:    system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono:    "JetBrains Mono","Fira Code","Cascadia Code",monospace;
  --font-sm: 0.85rem;   /* 17px — minimum, used for captions, footer, meta */
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 20px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

/* docutils html5 wraps content in <main> */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

/* ── Typography ─────────────────────────────────────────────── */
h2, h3 { line-height: 1.25; font-weight: 700; }
p      { margin-bottom: .9rem; }
p:last-child { margin-bottom: 0; }
a      { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code   { font-family: var(--mono); font-size: var(--font-sm);
         background: #e6eaf2; padding: .1em .4em; border-radius: 4px; }
pre    { font-family: var(--mono); font-size: var(--font-sm);
         background: var(--dark); color: #cdd6e0;
         padding: 1.1rem 1.3rem; border-radius: var(--radius);
         overflow-x: auto; margin: .8rem 0; }
pre code { background: none; padding: 0; }

/* ── Full-width breakout (hero + even sections) ─────────────── */
/* Centers 960px of content regardless of viewport width         */
main > section:first-of-type,
main > section:nth-of-type(even) {
  position: relative;
  width: 100vw;
  left: 50%;
  transform: translateX(-50%);
  padding-left:  max(1.5rem, calc(50vw - 480px));
  padding-right: max(1.5rem, calc(50vw - 480px));
}

/* ── All sections: vertical padding ────────────────────────── */
section { padding: 4rem 0; }

main > section:nth-of-type(even) {
  background: var(--bg-alt);
  padding-top: 4rem;
  padding-bottom: 4rem;
}

/* ── Section title (h2) ─────────────────────────────────────── */
section > h2 {
  font-size: 2rem;
  text-align: center;
  color: var(--dark);
  margin-bottom: 2.2rem;
}

section > h2::after {
  content: '';
  display: block;
  width: 44px; height: 3px;
  background: var(--gold);
  border-radius: 2px;
  margin: .5rem auto 0;
}

/* ── Subsection titles (Debian, FreeBSD etc.) ───────────────── */
section > section > h3 {
  font-size: 1.1rem;
  margin: 2.2rem 0 .6rem;
  color: var(--dark);
}

/* ── Hero (#reto) ────────────────────────────────────────── */
#reto {
  background: linear-gradient(145deg, #1b2438 0%, #2b3a55 60%, #3a4d72 100%);
  color: #f0f4f8;
  padding-top: 5rem;
  padding-bottom: 0;
  text-align: center;
}

#reto > h2 {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -.02em;
  margin-bottom: .4rem;
}

/* Suppress underline on hero title */
#reto > h2::after { display: none; }

#reto > p {
  font-size: 1.3rem;
  color: #a9b9d6;
  max-width: 660px;
  margin: 0 auto 2rem;
}

/* CTA bullet list → flex row of styled buttons */
#reto > ul.simple {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  justify-content: center;
  margin: 0 0 3rem;
  padding: 0;
}

#reto > ul.simple li > p { margin: 0; }

#reto > ul.simple li > p > a {
  display: inline-block;
  padding: .65rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: filter .15s, transform .1s;
}
#reto > ul.simple li > p > a:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
  text-decoration: none;
}

/* Button colors by position */
#reto > ul.simple li:nth-child(1) > p > a { background: var(--gold); color: var(--dark); }
#reto > ul.simple li:nth-child(2) > p > a { background: var(--blue);   color: #fff; }
#reto > ul.simple li:nth-child(3) > p > a {
  background: rgba(255,255,255,.10); color: #e4ebf7;
  border: 1px solid rgba(255,255,255,.3);
}

/* Hero screenshot */
figure.hero-screenshot { margin: 0 auto; max-width: min(900px, 100%); }
figure.hero-screenshot img {
  max-width: min(900px, 100%);
  display: block;
  margin: 0 auto;
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -4px 40px rgba(0,0,0,.5);
  border: 1px solid rgba(255,255,255,.1);
  border-bottom: none;
}
figure.hero-screenshot figcaption {
  background: rgba(0,0,0,.35);
  color: #a9b9d6;
  font-size: var(--font-sm);
  padding: .45rem 1rem;
  text-align: center;
}
figure.hero-screenshot figcaption p { margin: 0; }

/* Hero icon */
img.hero-icon {
  display: block;
  width: 128px;
  height: 128px;
  margin: 0 auto 1.2rem;
}

/* ── Features grid (#features) ──────────────────────────────── */
/* Each feature is a <section> child — styled as a card         */
#features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 1.1rem;
  align-items: start;
}

/* Title and intro span all columns */
#features > h2,
#features > p { grid-column: 1 / -1; }

#features > p {
  text-align: center;
  color: var(--muted);
  max-width: 600px;
  margin: -1.5rem auto 1.5rem;
}

/* Feature cards */
#features > section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  box-shadow: 0 2px 6px rgba(0,0,0,.05);
  transition: box-shadow .2s, transform .15s;
}
#features > section:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
#features > section > h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 .4rem;
  color: var(--dark);
}
#features > section > p { font-size: 1rem; color: var(--muted); margin: 0; }

/* ── Installation ────────────────────────────────────────────── */

#installation > a { display: inline-block; margin-bottom: .8rem; }
#installation > a img { height: 56px; display: block; }

/* Remove extra padding from Debian/FreeBSD subsections */
#installation > section { padding: 0; }
#installation > section > h3 { margin-top: 1.4rem; }

/* ── Callout boxes (admonitions with custom classes) ────────── */
/* docutils html5 renders admonitions as <aside>, not <div>     */
.admonition {
  border-radius: var(--radius);
  padding: 1.6rem 1.8rem;
  margin: 1rem 0;
}
.admonition p.admonition-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: .65rem;
  font-style: normal;
}
.admonition p { font-size: 1rem; }
/* Last paragraph contains the action link — render as a button row */
.admonition p:last-child {
  margin-top: 1rem;
  margin-bottom: 0;
}
.admonition p:last-child > a {
  display: inline-block;
  padding: .65rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  color: #fff;
  transition: filter .15s, transform .1s;
}
.admonition p:last-child > a:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
  text-decoration: none;
}

.callout-bug,
.callout-planned { background: #eef2f9; border: 1px solid #b4c3df; }
.callout-bug  p.admonition-title,
.callout-planned p.admonition-title { color: var(--dark); }
.callout-bug  p:last-child > a,
.callout-planned p:last-child > a   { background: var(--accent); }

.callout-donate { background: #fff7e3; border: 1px solid #f0cd7e; }
.callout-donate p.admonition-title { color: #7a5200; }
.callout-donate p:last-child > a   { background: var(--gold); color: var(--dark); }

/* ── Footer ──────────────────────────────────────────────────── */
footer {
  position: relative;
  width: 100vw;
  left: 50%;
  transform: translateX(-50%);
  background: var(--dark);
  color: #8e9bb3;
  text-align: center;
  padding: 2rem 1.5rem;
  font-size: var(--font-sm);
  margin-top: 4rem;
}
footer p { margin-bottom: .3rem; }
footer a { color: #b9c7e2; }
footer a:hover { color: #fff; text-decoration: none; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 640px) {
  main { padding: 0 1rem 3rem; }
  #reto { padding-top: 3rem; }
  #reto > h2 { font-size: 2.2rem; }
  #reto > ul.simple { flex-direction: column; align-items: center; }
  main > section:nth-of-type(even) { padding-top: 3rem; padding-bottom: 3rem; }
  #features { grid-template-columns: 1fr; }
}
