/*
 * Eden site framework — public stylesheet.
 *
 * This replaces Bootstrap, AOS, Swiper, GLightbox, Font Awesome and Bootstrap
 * Icons: about 12 MB of vendor code per site, of which the three sites used a
 * grid, a navbar, a modal and a lightbox. What is left is one file with no
 * dependencies.
 *
 * The look is the one those sites already had — the BootstrapMade "Logis"
 * palette of electric blue on deep navy, a photograph faded behind a hero, and
 * a light panel on the pages that carry long text. Every value that differs
 * between sites is a custom property set from the database in the page head,
 * so this file is identical for all of them:
 *
 *   --accent --accent-hover --ink --overlay
 *   --panel-bg --panel-ink --card-bg --font-body --font-head --bg-image
 */

:root {
  /* Fallbacks, overridden per site by the inline token block. */
  --accent: #0d42ff;
  --accent-hover: #2756ff;
  --ink: #0e1d34;
  --overlay: 0.8;
  --panel-bg: #ffffff;
  --panel-ink: #0a0d13;
  --card-bg: rgba(255, 255, 255, 0.10);
  --font-body: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Inter", system-ui, sans-serif;
  --bg-image: none;

  --head-h: 92px;
  --wrap: 1180px;
  --radius: 10px;
  --line: rgba(255, 255, 255, 0.16);

  scroll-behavior: smooth;
  color-scheme: dark;
}

@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: #fff;
  background-color: var(--ink);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/*
 * The background photograph.
 *
 * Fixed and behind everything rather than set per-section: the originals put
 * the image on each .page-header, which meant a long page repeated it and the
 * seam between sections showed. A single fixed layer with the navy wash on top
 * also guarantees heading contrast whichever of the rotating images is picked,
 * which the per-section version could not promise.
 */
body.has-bg::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

body.has-bg::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  /* Three declarations, weakest first, so the last one the browser understands
     wins. Without a plain fallback, an engine that knows neither modern colour
     function drops the wash entirely and the headings sit directly on a
     photograph, where the contrast is whatever that photograph happens to be. */
  background: rgba(14, 29, 52, 0.8);
  background: color-mix(in srgb, var(--ink) calc(var(--overlay) * 100%), transparent);
  background: rgb(from var(--ink) r g b / var(--overlay));
}

main { flex: 1 0 auto; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 20px;
}

.wrap.narrow { max-width: 780px; }

.skip {
  position: absolute;
  left: -9999px;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  z-index: 1000;
}
.skip:focus { left: 12px; top: 12px; }

/* ------------------------------------------------------------- typography -- */

h1, h2, h3, h4, h5 {
  font-family: var(--font-head);
  color: #fff;
  line-height: 1.2;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(30px, 5vw, 52px); font-weight: 600; letter-spacing: -0.02em; }
h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 600; }
h3 { font-size: 20px; font-weight: 600; }

/* eden.fm set this with an inline style on every heading. It is a site
   preference, so it is a body class driven by a setting instead. */
.shadow-headings h1,
.shadow-headings h2,
.shadow-headings .hero-copy p { text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.6); }

/* Inside a light panel the shadow would be noise, so it is switched off. */
.shadow-headings .panel-card h1,
.shadow-headings .panel-card h2,
.shadow-headings .panel-card h3 { text-shadow: none; }

p { margin: 0 0 1em; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

.lede { font-size: 18px; color: rgba(255, 255, 255, 0.82); }
.center { text-align: center; }
.dim { color: rgba(255, 255, 255, 0.6); }
.empty { color: rgba(255, 255, 255, 0.7); text-align: center; padding: 40px 0; }

:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--accent-hover);
  outline-offset: 2px;
}

/* ----------------------------------------------------------------- header -- */

.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  padding: 26px 0;
  transition: background-color 0.3s, padding 0.3s;
}

/* Set by site.js once the page has scrolled. */
.header.stuck {
  background: rgba(14, 29, 52, 0.92);
  background: color-mix(in srgb, var(--ink) 92%, transparent);
  background: rgb(from var(--ink) r g b / 0.92);
  padding: 12px 0;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo:hover { text-decoration: none; }
.logo img { max-height: 40px; }
.logo-text {
  font-family: var(--font-head);
  font-size: clamp(19px, 2.4vw, 28px);
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.navbar { margin-left: auto; }
.navbar ul { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.navbar a {
  display: block;
  padding: 10px 14px;
  font-family: var(--font-head);
  font-size: 16px;
  color: rgba(255, 255, 255, 0.62);
  white-space: nowrap;
  border-radius: 6px;
  transition: color 0.2s, background-color 0.2s;
}
.navbar a:hover, .navbar a.active { color: #fff; text-decoration: none; }
.navbar a.active { background: rgba(255, 255, 255, 0.08); }

/* The Discord entry on every one of these sites. A row with style=button. */
.navbar a.nav-button {
  background: var(--accent);
  color: #fff;
  padding: 9px 20px;
  margin-left: 12px;
  border-radius: 4px;
}
.navbar a.nav-button:hover { background: var(--accent-hover); }

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.10);
  cursor: pointer;
  padding: 12px 10px;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.2s;
}
.nav-toggle span + span { margin-top: 5px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 980px) {
  .nav-toggle { display: block; }
  .navbar {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(320px, 84vw);
    padding: 90px 20px 30px;
    background: var(--ink);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
    transform: translateX(100%);
    transition: transform 0.28s ease;
    overflow-y: auto;
  }
  .navbar.open { transform: translateX(0); }
  .navbar ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .navbar a { padding: 14px 16px; font-size: 17px; }
  .navbar a.nav-button { margin: 10px 0 0; text-align: center; }
}

.announce {
  background: var(--accent);
  color: #fff;
  text-align: center;
  padding: 8px 0;
  font-size: 15px;
  position: relative;
  z-index: 101;
}
.announce p { margin: 0; }
.announce a { color: #fff; text-decoration: underline; }

/* ------------------------------------------------------------------ pages -- */

.page { padding-top: calc(var(--head-h) + 40px); padding-bottom: 70px; }
.page > .wrap + .wrap { margin-top: 26px; }

/* A hero page keeps its content on the photograph — the front page, donate. */
.hero { padding-top: calc(var(--head-h) + 50px); padding-bottom: 70px; }
.hero-head > .wrap:first-child { text-align: center; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
}

.hero-art img { width: 100%; height: auto; border-radius: var(--radius); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* A panel page puts long text on a light card, which is the thing that makes
   terms and privacy readable over a photograph. */
.panel-card {
  background: var(--panel-bg);
  color: var(--panel-ink);
  border-radius: var(--radius);
  padding: 28px 30px;
  margin-bottom: 24px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.28);
}
.panel-card h1, .panel-card h2, .panel-card h3 { color: var(--panel-ink); }
.panel-card .card-meta { color: #5a6472; }

.prose { max-width: 78ch; }
.prose.center { margin-inline: auto; }
.panel-card .prose { max-width: none; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.35em; }
.prose h4 { margin: 1.2em 0 0.4em; font-size: 18px; }
.prose blockquote {
  margin: 0 0 1em;
  padding-left: 16px;
  border-left: 3px solid var(--accent);
  color: inherit;
  opacity: 0.9;
}
.prose pre {
  background: rgba(0, 0, 0, 0.35);
  padding: 14px 16px;
  border-radius: 8px;
  overflow-x: auto;
}
.panel-card .prose pre { background: rgba(0, 0, 0, 0.06); }
.prose img { max-width: 100%; height: auto; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 1.6em 0; }

.notice {
  display: inline-block;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 18px;
  margin-bottom: 18px;
}

.footnote { font-size: 13px; opacity: 0.8; margin-top: 16px; }

/* --------------------------------------------------------------- buttons -- */

.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 500;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.2s, border-color 0.2s;
}
.btn:hover { background: var(--accent-hover); color: #fff; text-decoration: none; }
.btn.ghost { background: transparent; border-color: var(--line); color: #fff; }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.1); }
.btn.wide { width: 100%; padding: 14px; font-size: 17px; }
.btn.disabled, .btn[aria-disabled="true"] {
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.65);
  cursor: not-allowed;
}

/* ----------------------------------------------------------------- cards -- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  text-align: center;
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.card .btn { margin-top: auto; }
.card-title { font-size: 18px; margin-bottom: 2px; }
.card-title a { color: #fff; }
.card-meta { font-size: 13px; color: rgba(255, 255, 255, 0.72); margin-bottom: 10px; }
.card-summary { font-size: 14px; color: rgba(255, 255, 255, 0.85); }

/* A disabled app keeps its card and says why, rather than vanishing. */
.card-off { opacity: 0.55; filter: grayscale(35%); }

.details { margin-top: 34px; }

/* --------------------------------------------------------- app tiles ------ */

/* The "other apps" row on a front page. Built from download rows, so a site
   with one application simply never renders it. */

.apps-heading { margin-top: 46px; }

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.app-tile {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  backdrop-filter: blur(6px);
  transition: border-color 0.2s, transform 0.2s;
}
.app-tile:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }
.app-tile img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; flex: none; }
.app-tile h3 { font-size: 17px; margin-bottom: 4px; }
.app-tile p { font-size: 14px; color: rgba(255, 255, 255, 0.78); margin-bottom: 6px; }
.app-tile .more { font-size: 14px; color: var(--accent-hover); }

/* ------------------------------------------------------------ screenshots -- */

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.shot { display: block; border-radius: 8px; overflow: hidden; line-height: 0; }
.shot img {
  width: 100%;
  height: 100%;
  max-height: 260px;
  object-fit: cover;
  transition: transform 0.3s;
}
.shot:hover img { transform: scale(1.04); }

/* A lightbox is fifteen lines here; it was a vendored library on all three. */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; }
.lightbox button {
  position: absolute;
  top: 18px;
  right: 22px;
  font-size: 34px;
  line-height: 1;
  background: none;
  border: 0;
  color: #fff;
  cursor: pointer;
}

/* ------------------------------------------------------------------ forms -- */

.form .field { margin-bottom: 18px; }
.form label {
  display: block;
  font-family: var(--font-head);
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--panel-ink);
}
.form .req { color: #c0392b; }
.form input[type="text"],
.form input[type="email"],
.form select,
.form textarea {
  width: 100%;
  padding: 11px 13px;
  font: inherit;
  color: var(--panel-ink);
  background: #fff;
  border: 1px solid #ccd3de;
  border-radius: 6px;
}
.form textarea { resize: vertical; min-height: 130px; }
.form .has-error input,
.form .has-error textarea,
.form .has-error select { border-color: #c0392b; }
.form .error { color: #c0392b; font-size: 14px; margin: 6px 0 0; }

/* The honeypot. Off-screen rather than display:none, because some bots skip
   fields that are explicitly hidden. */
.hp {
  position: absolute;
  left: -5000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.alert { padding: 14px 18px; border-radius: 8px; margin-bottom: 18px; }
.alert.ok { background: #e6f6ec; color: #14532d; border: 1px solid #b7e2c6; }
.alert.bad { background: #fdecea; color: #8a1c13; border: 1px solid #f5c2bd; }
.alert p:last-child { margin-bottom: 0; }

/* ----------------------------------------------------------------- donate -- */

.donate-item { text-align: center; margin-bottom: 42px; }
.donate-item img { max-width: 100%; height: auto; }
.donate-item .prose { margin-inline: auto; word-break: break-all; }

/* ------------------------------------------------------------------- ads --- */

.ads { margin: 22px 0; text-align: center; }
.ads img { max-width: 100%; height: auto; }

/* ---------------------------------------------------------------- footer --- */

.footer {
  flex-shrink: 0;
  background: #0b1626;
  background: color-mix(in srgb, var(--ink) 90%, black 10%);
  border-top: 1px solid var(--line);
  padding: 34px 0 22px;
  margin-top: auto;
}
.footer-inner { display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: flex-start; }
.footer-note { flex: 1 1 320px; color: rgba(255, 255, 255, 0.7); font-size: 14px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 22px; list-style: none; margin: 0; padding: 0; }
.footer-links a { color: rgba(255, 255, 255, 0.75); font-size: 14px; }
.footer-links a:hover { color: #fff; }
.copyright {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
}
.copyright p { margin: 0; }

.scroll-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  font-size: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 90;
}
.scroll-top.show { opacity: 1; pointer-events: auto; }
.scroll-top:hover { background: var(--accent-hover); text-decoration: none; }

/* ---------------------------------------------------------------- cookies -- */

/* The browser's own [hidden] rule is display:none at user-agent origin, so any
   class that sets a display value beats it. .cookie does exactly that, which
   is why the rule is restated here. */
[hidden] { display: none !important; }

.cookie {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 200;
  background: rgba(10, 13, 19, 0.97);
  border-top: 1px solid var(--line);
  padding: 16px 0;
}
.cookie .wrap { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.cookie p { margin: 0; font-size: 14px; color: rgba(255, 255, 255, 0.85); }
.cookie a { color: var(--accent-hover); text-decoration: underline; }
.cookie-actions { display: flex; gap: 10px; }
.cookie-actions .btn { padding: 8px 18px; font-size: 14px; }

@media (max-width: 640px) {
  :root { --head-h: 78px; }
  .panel-card { padding: 22px 20px; }
  .cookie .wrap { justify-content: center; text-align: center; }
}
