/* Palette and component styles follow nova.storage's default dark theme,
   so the client's page sits next to the service it's built for. */
:root {
  color-scheme: dark;
  --link: #5cad1e;
  --input_bg: #163300;
  --input_hover_bg: #214c00;
  --input_text: #e5e5e5;
  --highlight: #68c322;
  --background: #040a00;
  --body: #081400;
  --card: #0d1e00;
  --text: #e2fecc;
  --text_dim: #a9c393;
  --separator: #163300;
  --shadow: #070e01;
  --notice_bg: rgba(0, 255, 0, 0.07);
  --notice_border: #3f8a0c;

  --font: system-ui, sans-serif;
  --font_head: "Open Sans Light", "Open Sans", system-ui, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 56px; }
body {
  margin: 0;
  font: 17px/1.5 var(--font);
  color: var(--text);
  background: var(--background);
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}
* { scrollbar-color: var(--separator) var(--background); }

a { color: var(--link); }
a:hover { color: var(--highlight); }
img { max-width: 100%; }
p { margin: 0.6em 0; }
b, strong { font-weight: 700; }
ul, ol { padding-left: 1.5em; }

h1, h2, h3 {
  font-family: var(--font_head);
  font-weight: 300;
  line-height: 1;
  margin: 0.6em 0 0.3em;
}
h1 { font-size: 2.4em; }
h2 { font-size: 1.8em; border-bottom: 1px solid var(--separator); padding-bottom: 2px; }
h3 { font-size: 1.6em; border-bottom: 1px solid var(--separator); padding-bottom: 2px; }

code, kbd {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--background);
  border-radius: 5px;
  padding: 0 0.3em;
}
kbd {
  border: 1px solid var(--separator);
  box-shadow: 1px 1px 0 var(--shadow);
  white-space: nowrap;
}

.icon {
  width: 1.4em;
  height: 1.4em;
  flex: 0 0 auto;
  fill: currentColor;
  vertical-align: middle;
}

/* Buttons: flat dark green, a thin highlight ring on hover and a pressed-in look. */
.button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 2px;
  padding: 3px 8px;
  border: none;
  border-radius: 6px;
  background: var(--input_bg);
  color: var(--input_text);
  font: inherit;
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 1px 1px 0 0 var(--shadow);
  transition: background 0.1s, box-shadow 0.1s, padding 0.1s;
  vertical-align: middle;
}
.button:hover, .button:focus-visible {
  color: var(--input_text);
  background: var(--input_hover_bg);
  box-shadow: 0 0 0 1px var(--highlight);
  outline: none;
}
.button:active {
  box-shadow: inset 4px 4px 6px var(--shadow);
  padding: 5px 6px 1px 10px;
}
.button.highlight { box-shadow: 0 0 0 1px var(--highlight); }
.button.flat { background: none; box-shadow: none; color: var(--text); }
.button.flat:hover { background: var(--input_bg); }
.button.big { padding: 6px 12px; }
.button.big:active { padding: 8px 10px 4px 14px; }
.button.big .icon { width: 1.6em; height: 1.6em; }
.button span { display: flex; flex-direction: column; text-align: left; }
.button small { font-size: 0.8em; opacity: 0.8; }
.button strong { font-weight: 700; }

.bubble {
  background: var(--body);
  border-radius: 8px;
  border-top: 1px solid var(--separator);
  border-left: 1px solid var(--separator);
}

/* ---------- Layout: sticky sidebar + page, like nova.storage ---------- */
.wrap { display: flex; min-height: 100vh; }
.nav_container { flex: 0 0 auto; z-index: 9; }
.nav_scroll {
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
  padding: 4px;
}
.nav {
  display: flex;
  flex-direction: column;
  width: 15em;
  padding: 4px;
}
.nav .button {
  background: none;
  box-shadow: none;
  color: var(--input_text);
  padding: 3px 4px;
}
.nav .button:hover, .nav .button:focus-visible { background: var(--input_bg); box-shadow: 0 0 0 1px var(--highlight); }
.nav .button.sub { padding-left: 1.6em; }
.nav .brand { justify-content: space-between; box-shadow: 0 0 0 1px var(--highlight); margin-bottom: 4px; }
.nav .brand img { width: 1.5em; height: 1.5em; }
.nav_title {
  margin: 6px 2px 2px;
  padding: 6px 6px 0;
  border-top: 1px solid var(--separator);
  font-size: 0.85em;
  color: var(--text_dim);
}

.page { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.header {
  position: sticky;
  top: 4px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px;
  padding: 0 8px 0 4px;
  min-height: 36px;
  backdrop-filter: blur(3px);
}
.menu_button { display: none; padding: 2px; }
.crumbs { flex: 1 1 auto; padding-left: 4px; }
.header_version { font-size: 0.85em; color: var(--text_dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.logo_header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 40px auto 36px;
  padding: 0 16px;
}
.logo_header img { width: 88px; height: 88px; }
.logo_header h1 {
  margin: 0;
  font-size: 3.6em;
  color: #fff;
  letter-spacing: 0.02em;
  text-shadow: 1px 1px 5px #000;
}
.logo_header p { margin: 6px 0 0; color: var(--text_dim); letter-spacing: 0.02em; }

.page_content {
  background: var(--body);
  border-radius: 8px;
  margin: 4px;
  overflow: hidden;
}
section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 8px 16px 16px;
}

.highlight_green {
  text-align: center;
  padding: 0.5em 16px;
  background: var(--notice_bg);
  border-top: 2px solid var(--notice_border);
  border-bottom: 2px solid var(--notice_border);
  border-radius: 8px;
}

/* ---------- Intro ---------- */
.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
  gap: 32px;
  align-items: center;
  padding-top: 16px;
}
.cta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 1.2em; }
.cta .button { margin: 0; }

/* A small, flat sketch of the app window. */
.window {
  margin: 0;
  background: var(--background);
  border: 1px solid var(--separator);
  border-radius: 8px;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.4;
  position: relative;
}
.w_bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: var(--body);
  border-bottom: 1px solid var(--separator);
}
.w_path { display: flex; align-items: center; gap: 4px; min-width: 0; }
.w_path b { font-weight: 400; padding: 1px 6px; border-radius: 5px; background: var(--input_bg); }
.w_path b.on { box-shadow: 0 0 0 1px var(--highlight); }
.w_path i { font-style: normal; color: var(--text_dim); }
.w_dots { display: flex; gap: 5px; }
.w_dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--input_bg); }
.w_body { display: flex; min-height: 210px; }
.w_side {
  list-style: none;
  margin: 0;
  padding: 6px;
  width: 104px;
  flex: 0 0 auto;
  border-right: 1px solid var(--separator);
  color: var(--text_dim);
}
.w_side li { padding: 1px 6px; border-radius: 5px; }
.w_side li.on { background: var(--input_bg); color: var(--text); }
.w_side li.sep { margin-top: 5px; padding-top: 6px; border-top: 1px solid var(--separator); border-radius: 0; }
.w_grid {
  list-style: none;
  margin: 0;
  padding: 10px 8px 40px;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
  gap: 6px 4px;
  align-content: start;
}
.w_grid li {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3px 2px;
  border-radius: 5px;
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.w_grid svg { width: 38px; height: 38px; }
.w_grid .f { fill: var(--highlight); }
.w_grid .p { fill: #5b9bd5; }
.w_grid .d { fill: #c9d7bd; }
.w_grid .v { fill: #d5705b; }
.w_grid li.sel { background: var(--input_bg); box-shadow: 0 0 0 1px var(--highlight); }
.w_toast {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--card);
  border: 1px solid var(--separator);
  box-shadow: 1px 1px 0 var(--shadow);
}
.w_toast u { color: var(--highlight); text-decoration: none; margin-left: 8px; }

/* ---------- Features ---------- */
.features li { margin: 0.25em 0; }
.features li::marker { color: var(--highlight); }

/* ---------- Download ---------- */
.section_header { text-align: center; padding: 28px 16px 12px; }
.section_header h1 { margin: 0 0 12px; color: #fff; text-shadow: 1px 1px 5px #000; }
.section_header p { margin: 0 auto; max-width: 640px; color: var(--text_dim); }

.platforms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-width: 1016px;
  width: 100%;
  margin: 0 auto;
  padding: 8px;
  align-items: start;
}
.platform {
  min-width: 0;
  background: var(--body);
  border: 1px solid var(--separator);
  border-radius: 8px;
}
.platform.recommended { border-color: var(--highlight); }
.p_head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--separator);
}
.p_head .logo { width: 36px; height: 36px; color: var(--highlight); flex: 0 0 auto; }
.p_head div { flex: 1 1 auto; min-width: 0; }
.p_head h2 { margin: 0 0 4px; border: 0; padding: 0; font-size: 1.6em; }
.p_head small { color: var(--text_dim); font-size: 0.85em; }
.rec {
  display: none;
  flex: 0 0 auto;
  font-size: 0.8em;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--input_bg);
  box-shadow: 0 0 0 1px var(--highlight);
}
.recommended .rec { display: inline-block; }
.p_part { padding: 10px 14px; }
.p_part + .p_part { border-top: 1px solid var(--separator); }
.label { margin: 0 0 6px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.tag {
  font-weight: 400;
  font-size: 0.78em;
  color: var(--highlight);
  border: 1px solid var(--separator);
  border-radius: 6px;
  padding: 0 6px;
}
.hint { margin: 6px 0 0; font-size: 0.9em; color: var(--text_dim); }

.code {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--background);
  border-radius: 6px;
  box-shadow: inset 1px 1px 0 var(--shadow);
  padding: 4px 4px 4px 10px;
}
.code code {
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  padding: 4px 0;
  background: none;
  font-size: 0.85em;
}
.code .copy { flex: 0 0 auto; margin: 0; }
.copy.done { box-shadow: 0 0 0 1px var(--highlight); color: var(--highlight); }

.pkgs { width: 100%; border-collapse: collapse; }
.pkgs td { padding: 0.25em 0.5em; border-top: 1px solid var(--separator); }
.pkgs tr:first-child td { border-top: 0; }
.pkgs td:last-child { text-align: right; font-family: var(--mono); font-size: 0.82em; color: var(--text_dim); white-space: nowrap; }
.pkgs tr:hover td { background: var(--card); }

details { margin-top: 10px; }
summary { cursor: pointer; color: var(--link); }
summary:hover { color: var(--highlight); }
dl { margin: 6px 0 0; }
dt { font-size: 0.9em; color: var(--text_dim); margin-top: 6px; }
dd { margin: 2px 0 0; }
dd code { display: block; overflow-x: auto; white-space: nowrap; padding: 4px 8px; }

.wide { width: calc(100% - 0px); margin: 0; justify-content: center; }
.steps { margin: 12px 0 0; }
.steps li { margin: 0.2em 0; }
.qr { display: flex; align-items: center; gap: 14px; }
.qr img { width: 120px; height: 120px; flex: 0 0 auto; border-radius: 6px; background: #fff; padding: 4px; }
.qr p { margin: 0; color: var(--text_dim); font-size: 0.9em; }

/* ---------- Closing + footer ---------- */
.closing { margin-top: 12px; }
.closing section { text-align: center; padding-bottom: 20px; }
.closing h2 { border: 0; }

footer { text-align: center; padding: 14px 16px 24px; }
footer p { margin: 0.2em 0; }
footer .links { color: var(--text_dim); }

.nav_backdrop { display: none; }

/* ---------- Small screens: sidebar becomes a drawer ---------- */
@media (max-width: 1000px) {
  .menu_button { display: inline-flex; }
  .nav_container {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.25s, visibility 0.25s;
  }
  .nav_scroll { height: 100%; max-height: none; }
  .nav { min-height: 100%; }
  .nav_open .nav_container { transform: none; visibility: visible; }
  .nav_open + .nav_backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 8;
    background: rgba(0, 0, 0, 0.5);
  }
  .intro { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .window { max-width: 460px; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .platforms { grid-template-columns: minmax(0, 1fr); }
  .logo_header { margin: 28px auto 24px; gap: 14px; }
  .logo_header img { width: 64px; height: 64px; }
  .logo_header h1 { font-size: 2.8em; }
  .logo_header p { font-size: 0.95em; }
  section { padding-left: 12px; padding-right: 12px; }
  .header_version { max-width: 55vw; }
  .w_side { display: none; }
  .cta .button { flex: 1 1 auto; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
