/* The main page, plus the light appearance of the Help, Privacy and EULA pages.
   Dark is the default; each page's own dark colors are kept, and this file
   switches them to light with the device. Link it last so it wins. */
:root {
  --home-bg: #0b0a10;
  --home-card: #1a1622;
  --home-text: #f7f3fb;
  --home-muted: #bdb3cc;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --home-bg: #ffffff;
    --home-card: #f3eff8;
    --home-text: #17141d;
    --home-muted: #5b5368;
    color-scheme: light;
    --bg: #ffffff;
    --bg2: #f3eff8;
    --card: #f3eff8;
    --border: #e2daec;
    --text: #17141d;
    --muted: #5b5368;
    --accent: #c2186f;
    --accent-bright: #c2186f;
    --accent-subtle: rgba(194, 24, 111, 0.10);
    --accent-border: rgba(194, 24, 111, 0.30);
  }
  body { background: var(--bg) !important; }
  nav, nav.top { background: rgba(255, 255, 255, 0.88); }
  .sidebar a:hover, .doc-search, .doc-search:focus, .note, .doc-notice { background: var(--card); }
  .footer-copy { color: var(--muted); }
}

/* Top of the Help, Privacy and EULA pages: the logo goes home, and the page
   you're on is the bright one. */
.nav-links { display: flex; gap: 22px; }
.nav-links a { font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; white-space: nowrap; transition: color 0.15s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
@media (max-width: 480px) {
  nav, nav.top { flex-wrap: wrap; row-gap: 10px; }
  .nav-links { gap: 16px; }
}

.motif { display: block; width: 100%; object-fit: cover; object-position: top center; }
.motif-hero { height: 360px; }
.motif-strip { height: 64px; }

body.home {
  margin: 0;
  background: var(--home-bg);
  color: var(--home-text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.home a { color: var(--home-text); }
.home .hero {
  box-sizing: border-box;
  max-width: 1040px;
  margin: 0 auto;
  padding: 8px max(24px, env(safe-area-inset-right, 0px)) 48px max(24px, env(safe-area-inset-left, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.home h1 { margin: 0; font-size: clamp(64px, 11vw, 124px); line-height: 1; font-weight: 800; letter-spacing: -0.045em; }
.home .tagline {
  display: block;
  margin-top: 16px;
  font-size: clamp(19px, 2.4vw, 24px);
  line-height: 1.3;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--home-muted);
}
.home .badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.home .badge { font-size: 13px; line-height: 18px; color: var(--home-muted); padding: 6px 12px; border-radius: 14px; background: var(--home-card); }
.home .features { box-sizing: border-box; width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 36px; text-align: left; }
/* Each feature is cut as a bookmark, notch at the bottom. */
.home .feature {
  background: var(--home-card);
  border-top: 3px solid var(--tab);
  padding: 18px 16px 50px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 26px), 0 100%);
}
.home .feature:nth-child(1) { --tab: #ff9a3d; }
.home .feature:nth-child(2) { --tab: #f63d99; }
.home .feature:nth-child(3) { --tab: #c04bc6; }
.home .feature:nth-child(4) { --tab: #7b5cf0; }
.home .feature h2 { margin: 0 0 6px; font-size: 17px; line-height: 22px; font-weight: 700; }
.home .feature p { margin: 0; font-size: 14px; line-height: 20px; color: var(--home-muted); }
.home .hero-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 26px; margin-top: 28px; }
.home .hero-links a { font-size: 14px; font-weight: 500; text-decoration: none; }
.home .hero-links a:hover { text-decoration: underline; }
@media (max-width: 720px) {
  .home .features { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .motif-hero { height: 290px; }
}
/* Large windows: the artwork and type grow to fill the height. */
@media (min-width: 1400px) and (min-height: 800px) {
  body.home { min-height: 100vh; display: flex; flex-direction: column; }
  .motif-hero { height: min(38vh, 460px); }
  .home .hero { flex: 1; width: 100%; max-width: min(1300px, 80vw); }
  .home .feature h2 { font-size: clamp(17px, 1.2vw, 22px); line-height: 1.3; }
  .home .feature p { font-size: clamp(14px, 1vw, 18px); line-height: 1.4; }
  .home .hero-links { margin-top: auto; padding-top: 24px; }
}
