/* FreeLand palette and system typography, matching the desktop app and logo. */
:root {
  color-scheme: light;
  --forest: #2e4d3d;
  --forest-deep: #223b2f;
  --sage: #b7c8b4;
  --paper: #f7f8f5;
  --panel: #fff;
  --ink: #202520;
  --muted: #727a73;
  --line: #e2e6e0;
  --accent: #557a5f;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--font);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; isolation: isolate; background: transparent; color: var(--ink); font-family: var(--font); }
body::before, body::after { position: fixed; inset: -16px; content: ""; pointer-events: none; }
body::before { z-index: -2; background: url("../assets/images/BackGround.png") center / cover no-repeat; filter: blur(10px); transform: scale(1.025); }
body::after { z-index: -1; inset: 0; background: rgba(247, 248, 245, .66); }
a { color: inherit; }
.site-header, .layout, .site-footer { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.site-header { height: 84px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-size: 15px; font-weight: 650; letter-spacing: -.02em; }
.brand-logo { display: block; width: 38px; height: 38px; border-radius: 10px; object-fit: cover; }
.header-actions { display: flex; align-items: center; gap: 9px; }
.header-link { padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--forest); text-decoration: none; font-size: 12px; font-weight: 550; transition: background .16s ease, border-color .16s ease; }
.header-link:hover { border-color: #c9d5c9; background: rgba(255,255,255,.7); }
.header-link span { margin-left: 5px; }
.header-download { border-color: var(--forest); background: var(--forest); color: white; }
.header-download:hover { border-color: var(--forest-deep); background: var(--forest-deep); }
.layout { display: grid; grid-template-columns: .92fr 1.08fr; gap: clamp(50px, 9vw, 130px); align-items: center; padding-top: 90px; padding-bottom: 106px; }
.intro { padding: 20px 0; }
.eyebrow { margin: 0; color: var(--forest); font-size: 11px; font-weight: 650; letter-spacing: .11em; text-transform: uppercase; }
.intro > .eyebrow { display: flex; align-items: center; gap: 10px; }
.eyebrow-line { width: 25px; height: 1px; background: var(--accent); }
h1 { margin: 25px 0 19px; color: var(--forest-deep); font-size: clamp(50px, 6vw, 76px); font-weight: 620; line-height: 1.02; letter-spacing: -.065em; }
h1 span { color: var(--accent); font-weight: 430; }
.description { max-width: 415px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.8; }
.logo-lockup { display: inline-flex; align-items: center; gap: 12px; margin-top: 54px; color: var(--forest-deep); font-size: 13px; font-weight: 650; line-height: 1.35; }
.logo-lockup img { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; }
.logo-copy { display: grid; gap: 3px; }
.logo-title { display: inline-flex; align-items: center; gap: 7px; }
.beta-tag { padding: 3px 6px; border-radius: 999px; background: #f8dce8; color: #a63f69; font-size: 8px; font-weight: 750; letter-spacing: .08em; line-height: 1; vertical-align: middle; }
.logo-lockup small { color: var(--muted); font-size: 11px; font-weight: 400; }
.downloads { padding: 27px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255, 255, 255, .82); backdrop-filter: blur(14px); box-shadow: 0 18px 50px #263b2a12; }
.downloads-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 1px 2px 21px; }
.downloads-heading .eyebrow { margin-bottom: 8px; }
h2 { margin: 0; color: var(--ink); font-size: 22px; font-weight: 620; letter-spacing: -.035em; }
.release-label { display: inline-flex; align-items: center; gap: 7px; padding-bottom: 3px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.release-label span { width: 6px; height: 6px; border-radius: 50%; background: #68a56f; }
.platform-card { min-height: 91px; display: flex; align-items: center; gap: 14px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.platform-card + .platform-card { margin-top: 11px; }
.platforms-stack { position: relative; display: grid; overflow: hidden; transition: max-height .45s ease; }
.platforms-stack.is-collapsed { max-height: 174px; }
.platforms-stack.is-expanded { max-height: 900px; overflow: visible; }
.platforms-stack.is-collapsed::after { position: absolute; z-index: 1; right: 0; bottom: 0; left: 0; height: 78px; background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,.97)); content: ""; pointer-events: none; }
.additional-platforms { display: grid; gap: 11px; margin-top: 11px; }
.additional-platforms .platform-card + .platform-card { margin-top: 0; }
.platforms-toggle { z-index: 2; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; border: 0; border-radius: 0; background: transparent; color: var(--forest); font: inherit; font-size: 10px; font-weight: 620; cursor: pointer; opacity: .88; transition: color .16s ease, opacity .16s ease; }
.platforms-stack.is-collapsed .platforms-toggle { position: absolute; right: 0; bottom: 0; left: 0; min-height: 46px; align-items: end; padding-bottom: 9px; }
.platforms-stack.is-expanded .platforms-toggle { position: static; min-height: 34px; margin-top: 8px; }
.platforms-toggle:hover { color: var(--forest-deep); opacity: 1; }
.platforms-toggle:focus-visible { outline: 2px solid #91a891; outline-offset: 2px; }
.toggle-chevron { color: #839083; font-size: 13px; transition: transform .16s ease; }
.platforms-stack.is-expanded .toggle-chevron { transform: translateY(-1px); }
.platform-icon { display: grid; width: 43px; height: 43px; flex: 0 0 43px; place-items: center; border-radius: 11px; background: #eff3ee; color: var(--forest); }
.platform-icon svg, .platform-icon img { width: 23px; height: 23px; fill: currentColor; object-fit: contain; }
.platform-copy { flex: 1; min-width: 0; }
.platform-copy h3 { margin: 0 0 5px; font-size: 14px; font-weight: 620; letter-spacing: -.015em; }
.platform-copy p { margin: 0; color: var(--muted); font-size: 11px; }
.download-button { display: inline-flex; min-height: 39px; flex: 0 0 auto; align-items: center; justify-content: center; gap: 9px; padding: 0 13px; border: 1px solid var(--forest); border-radius: 9px; background: var(--forest); color: #fff; font-family: var(--font); font-size: 11px; font-weight: 580; text-decoration: none; cursor: pointer; transition: background .16s ease, transform .16s ease; }
.download-button:hover:not(:disabled) { transform: translateY(-1px); background: var(--forest-deep); }
.download-button span { font-size: 15px; }
.button-disabled { border-color: var(--line); background: #f5f6f3; color: #929991; cursor: not-allowed; }
.download-note { margin: 17px 2px 0; color: #8b918b; font-size: 10px; line-height: 1.6; }
.site-footer { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.footer-contact { display: flex; align-items: center; gap: 9px; }
.email-copy { display: inline-flex; align-items: center; gap: 7px; padding: 7px 9px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--forest); font: inherit; cursor: pointer; transition: border-color .16s ease, background .16s ease; }
.email-copy:hover, .email-copy:focus-visible { border-color: var(--line); background: rgba(255,255,255,.66); }
.copy-icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5; }
.copy-status { min-width: 46px; color: var(--accent); font-size: 10px; font-weight: 600; }
.copy-status:empty { visibility: hidden; }

.theme-toggle { display: inline-grid; width: 38px; min-width: 38px; height: 38px; place-items: center; padding: 0 !important; background: transparent; font: inherit; cursor: pointer; }
.theme-toggle span { margin: 0; line-height: 1; }

html[data-theme="dark"] { color-scheme: dark; --forest: #b5d2b8; --forest-deep: #d4e5d3; --sage: #82977e; --paper: #151a17; --panel: #202823; --ink: #edf1eb; --muted: #adb8ad; --line: #38453b; --accent: #a9c5a6; }
html[data-theme="dark"] body::before { background-image: url("../assets/images/BachgroundNight.jpg"); }
html[data-theme="dark"] body::after { background: rgba(12, 17, 14, .74); }
html[data-theme="dark"] .header-link { color: var(--forest); }
html[data-theme="dark"] .header-link:hover, html[data-theme="dark"] .email-copy:hover, html[data-theme="dark"] .email-copy:focus-visible { background: #ffffff12; }
html[data-theme="dark"] .downloads, html[data-theme="dark"] .learning-card, html[data-theme="dark"] .player-panel, html[data-theme="dark"] .markdown-document, html[data-theme="dark"] .reader-empty { background-color: rgba(27, 35, 29, .88); }
html[data-theme="dark"] .platform-card { background: rgba(34, 43, 36, .96); }
html[data-theme="dark"] .platform-icon, html[data-theme="dark"] .learning-icon, html[data-theme="dark"] .read-api-mark { background: #344638; color: var(--forest); }
html[data-theme="dark"] .platforms-stack.is-collapsed::after { background: linear-gradient(to bottom, rgba(27,35,29,0), rgba(27,35,29,.98)); }
html[data-theme="dark"] .button-disabled { background: #303832; color: #a1aaa1; }
html[data-theme="dark"] .read-api-button { border-color: var(--line); background: #263129; color: var(--ink); }
html[data-theme="dark"] .read-api-button:hover { background: #303d33; }
html[data-theme="dark"] .video-selectors select, html[data-theme="dark"] .speed-control select, html[data-theme="dark"] .control-button { border-color: var(--line); background: #263129; color: var(--ink); }
html[data-theme="dark"] .markdown-document code { border-color: #405044; background: #2a362d; color: #d8ead6; }
html[data-theme="dark"] .markdown-document th { background: #2d3b30; color: #d3e7d0; }
html[data-theme="dark"] .reader-status { border-color: var(--line); background: #263129; color: var(--muted); }
html[data-theme="dark"] .header-download,
html[data-theme="dark"] .download-button:not(.button-disabled) { border-color: #66856b; background: #355540; color: #fff; }
html[data-theme="dark"] .header-download:hover,
html[data-theme="dark"] .download-button:not(.button-disabled):hover { border-color: #789b7d; background: #41694c; color: #fff; }

@media (max-width: 760px) {
  .site-header, .layout, .site-footer { width: min(100% - 36px, 540px); }
  .site-header { height: auto; min-height: 70px; flex-wrap: wrap; gap: 10px; padding: 12px 0; }
  .header-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .header-link { padding: 9px 6px; text-align: center; font-size: 10px; white-space: nowrap; }
  .theme-toggle { width: 34px; min-width: 34px; height: 34px; justify-self: center; }
  .layout { grid-template-columns: 1fr; gap: 36px; padding-top: 48px; padding-bottom: 65px; }
  .intro { padding: 8px 0 0; }
  h1 { margin-top: 19px; font-size: clamp(54px, 14vw, 72px); }
  .logo-lockup { margin-top: 25px; }
  .downloads { padding: 19px 15px; border-radius: 15px; }
  .platform-card { gap: 10px; padding: 11px 10px; }
  .platform-icon { width: 38px; height: 38px; flex-basis: 38px; }
  .download-button { min-height: 36px; padding-inline: 10px; font-size: 10px; }
  .site-footer { min-height: 64px; flex-wrap: wrap; gap: 8px 12px; font-size: 10px; }
  .footer-contact { order: 3; width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition-duration: .01ms !important; } }
