:root {
  --juno-text: #37352f;
  --juno-text-secondary: #6b6f76;
  --juno-bg: #fbfbfa;
  --juno-bg-transparent: rgba(251, 251, 250, 0);
  --juno-border: #e6e6e6;
  --juno-accent: #0b6efd;
  --juno-muted: #b6b6b6;
  --juno-gutter: 40px; /* space to place heading markers outside content */
  --juno-marker-gap: 12px; /* extra space between marker and heading text */
  --juno-font-sans: "Helvetica Neue", Helvetica, -apple-system,
    BlinkMacSystemFont, Segoe UI, Roboto, Arial, sans-serif;
  --juno-font-mono: Menlo, "SF Mono", SFMono-Regular, ui-monospace,
    "DejaVu Sans Mono", Monaco, Consolas, "Liberation Mono", "Courier New",
    monospace;
  --juno-font-current: var(--juno-font-mono);
  --juno-mark: #fdff32;
  --juno-selection: #d4e3ff;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--juno-bg);
  color: var(--juno-text);
}

/* Hide content until JS is loaded */
body:not(.ready) {
  visibility: hidden;
}

body {
  font-family: var(--juno-font-current);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  max-width: 740px;
  margin: 108px auto 120px;
  padding: 0 24px;
}

/* Font mode classes */
body.font-mono {
  --juno-font-current: var(--juno-font-mono);
}

body.font-sans {
  --juno-font-current: var(--juno-font-sans);
}

/* Hide markdown markers in sans-serif mode */
body.font-sans h1::before,
body.font-sans h2::before,
body.font-sans h3::before,
body.font-sans em::before,
body.font-sans em::after,
body.font-sans strong::before,
body.font-sans strong::after,
body.font-sans mark::before,
body.font-sans mark::after,
body.font-sans a::before,
body.font-sans a::after {
  content: none;
}

h1 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
}

/* Prefix H1 with a light gray '#' */
h1::before {
  content: "# ";
  color: var(--juno-muted);
}

/* Prefix H2 and H3 with light gray '##' and '###' */
h2::before {
  content: "## ";
  color: var(--juno-muted);
}

h3::before {
  content: "### ";
  color: var(--juno-muted);
}

h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 32px 0 12px;
}

p {
  margin: 0 0 12px;
  color: var(--juno-text);
}

mark {
  background: none;
  color: inherit;
  background-image: linear-gradient(var(--juno-mark), var(--juno-mark));
  background-repeat: no-repeat;
  background-size: 100% 0.4em; /* thickness */
  background-position: 0 58%; /* vertical center */
}

ol,
ul {
  margin: 8px 0 16px;
  padding-left: 1.3em;
}

li {
  margin: 4px 0;
}

strong {
  font-weight: 600;
}

em {
  font-style: italic;
}

/* Show markdown markers for emphasis/strong in muted color */
em::before,
em::after {
  content: "_";
  color: var(--juno-muted);
}

strong::before,
strong::after {
  content: "**";
  color: var(--juno-muted);
}

mark::before,
mark::after {
  content: "=";
  color: var(--juno-muted);
}

code {
  font-family: var(--juno-font-mono);
  font-size: 0.9em;
  background: rgba(127, 127, 127, 0.1);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

code::before,
code::after {
  content: "\`";
  color: var(--juno-muted);
}

/* In sans mode, hide the backticks */
body.font-sans code::before,
body.font-sans code::after {
  content: none;
}

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

a::before {
  content: "[";
  color: var(--juno-accent);
}

a::after {
  content: "]";
  color: var(--juno-accent);
}

a:hover {
  text-decoration: underline;
}

hr {
  border: none;
  border-top: 2px solid var(--juno-border);
  margin: 24px -48px;
}

blockquote {
  margin: 12px 0 16px;
  padding-left: 16px;
  border-left: 3px solid var(--juno-border);
}

::selection {
  background: var(--juno-selection);
}

/* Font toggle switch */
.font-toggle {
  position: fixed;
  top: 8px;
  right: 12px;
  z-index: 1000;
}

.font-toggle .switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #3b82f6; /* sans = blue */
  cursor: pointer;
  transition: background 0.2s ease;
  box-shadow: 0 8px 22px rgba(59, 130, 246, 0.35);
}

.font-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.font-toggle .thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: transparent;
  display: grid;
  place-items: center;
  transition: transform 0.2s ease;
  line-height: 1;
}

/* Donut for sans (red) state */
.font-toggle .thumb::after {
  content: "";
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #3b82f6; /* blue center */
  border: 3px solid #fff; /* white ring */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.font-toggle input:checked + .switch .thumb {
  transform: translateX(20px);
}

.font-toggle input:checked + .switch {
  background: #a855f7; /* mono = purple */
  box-shadow: 0 10px 28px rgba(168, 85, 247, 0.35);
}

/* Pill for mono (green) state */
.font-toggle input:checked + .switch .thumb::after {
  width: 6px;
  height: 14px;
  border-radius: 4px;
  background: #ffffff;
  border: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* System dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --juno-text: #e6e6e6;
    --juno-text-secondary: #a3a3a3;
    --juno-bg: #121212;
    --juno-bg-transparent: rgba(18, 18, 18, 0);
    --juno-border: #2a2a2a;
    --juno-accent: #0b4f98;
    --juno-muted: #8a8a8a;
    --juno-mark: #806217;
    --juno-selection: #2a3f62;
  }

  body {
    color-scheme: dark;
  }

  .font-toggle .switch {
    background: #3b82f6;
    box-shadow: 0 8px 22px rgba(59, 130, 246, 0.35);
  }

  .font-toggle .thumb {
    background: transparent;
  }

  .toc-content {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  }
}

/* When viewport is wider than the content width, place heading markers in the left gutter */
@media (min-width: 820px) {
  h1,
  h2,
  h3 {
    position: relative;
  }

  h1::before,
  h2::before,
  h3::before {
    position: absolute;
    left: calc(-1 * var(--juno-gutter) - var(--juno-marker-gap));
    width: var(--juno-gutter);
    text-align: right;
  }
}

/* Table of Contents Styles */
.toc-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  width: 60px;
  background: transparent;
  z-index: 100;
  transition: width 0.3s ease;
  overflow: hidden;
  pointer-events: none;
}

.toc-sidebar.flash {
  width: 280px;
  pointer-events: auto;
}

.toc-sidebar.flash .toc-lines {
  opacity: 0;
}

.toc-sidebar.flash .toc-content {
  opacity: 1;
  transform: translateY(-50%) translateX(0) scale(1);
  pointer-events: auto;
}

.toc-sidebar:hover {
  width: 280px;
}

.toc-lines {
  position: absolute;
  top: 50%;
  left: 20px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: opacity 0.3s ease;
  pointer-events: auto;
}

.toc-sidebar:hover .toc-lines {
  opacity: 0;
}

.toc-line {
  width: 20px;
  height: 2px;
  background: var(--juno-muted);
  border-radius: 50px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.toc-line.h1 {
  width: 32px;
  height: 2px;
  background: var(--juno-text);
}

.toc-line.h2 {
  width: 24px;
  height: 2px;
  background: var(--juno-text-secondary);
}

.toc-line.h3 {
  width: 16px;
  height: 2px;
  background: var(--juno-muted);
}

.toc-line.active {
  background: var(--juno-accent);
  box-shadow: 0 0 8px rgba(11, 110, 253, 0.3);
}

.toc-line:hover {
  background: var(--juno-accent);
  transform: scaleX(1.2);
}

.toc-content {
  position: absolute;
  top: 50%;
  left: 20px;
  transform: translateY(-50%) translateX(-20px) scale(0.95);
  width: 240px;
  max-height: calc(100vh - 80px);
  max-width: calc(100vw - 80px);
  padding: 16px;
  background: var(--juno-bg);
  border: 1px solid var(--juno-border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

.toc-sidebar:hover .toc-content {
  opacity: 1;
  transform: translateY(-50%) translateX(0) scale(1);
  pointer-events: auto;
}

.toc-header {
  font-size: 14px;
  font-weight: 600;
  color: var(--juno-text-secondary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc-item {
  display: block;
  padding: 6px 8px;
  color: var(--juno-text-secondary);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.4;
  border-radius: 4px;
  transition: all 0.2s ease;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toc-item::before,
.toc-item::after {
  content: none;
}

.toc-item:hover {
  color: var(--juno-text);
}

.toc-item.active {
  color: var(--juno-text);
  font-weight: 500;
}

.toc-item.h1 {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.toc-item.h2 {
  padding-left: 16px;
  font-size: 13px;
}

.toc-item.h3 {
  padding-left: 24px;
  font-size: 13px;
  color: var(--juno-text-secondary);
}

/* Hide TOC on smaller screens */
@media (max-width: 1024px) {
  .toc-sidebar {
    display: none;
  }
}

/* Pre-order banner */
.top-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  display: block;
  width: 100%;
  padding: 8px 24px;
  background: var(--juno-text);
  color: var(--juno-bg);
  font-family: var(--juno-font-current);
  font-size: 14px;
  text-align: center;
  text-decoration: none;
  letter-spacing: 0.02em;
  box-sizing: border-box;
  transition: background 0.2s ease;
}

.top-banner::before,
.top-banner::after {
  content: none;
}

.top-banner:hover {
  background: var(--juno-accent);
  color: #fff;
  text-decoration: none;
}

/* Footer links */
.footer-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* ===== Landing Page ===== */

.hero {
  margin: 0 0 64px;
}

.hero h1 {
  font-size: 48px;
  margin-bottom: 4px;
}

.hero h1::before {
  position: static;
  width: auto;
}

.hero .tagline {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 12px;
}

.hero .sub-tagline {
  font-size: 16px;
  color: var(--juno-text-secondary);
  margin-bottom: 32px;
  max-width: 540px;
}

.hero-image {
  display: block;
  margin: 0 auto 24px;
}

.hero-image img {
  max-width: 400px;
  width: 100%;
  height: auto;
}

/* CTA button */
.cta-button {
  display: inline-block;
  padding: 12px 32px;
  background: var(--juno-text);
  color: var(--juno-bg);
  font-family: var(--juno-font-current);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: background 0.2s ease;
}

.cta-button::before,
.cta-button::after {
  content: none;
}

.cta-button:hover {
  background: var(--juno-accent);
  color: #fff;
  text-decoration: none;
}

/* Feature grid */
.feature-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin: 24px 0 0;
}

.feature-item h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.feature-item p {
  color: var(--juno-text-secondary);
  font-size: 15px;
  margin: 0;
}

/* Product configurations */
.config-list {
  margin: 16px 0;
}

.config-item {
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid var(--juno-border);
  font-size: 15px;
}

.config-item:first-child {
  border-top: 1px solid var(--juno-border);
}

.config-price {
  color: var(--juno-text-secondary);
  float: right;
}

/* Section spacing */
.landing-section {
  margin-bottom: 56px;
}

/* Reserve CTA */
.reserve {
  text-align: center;
  margin-top: 20px;
}

/* Go deeper links */
.go-deeper a {
  display: block;
  margin-bottom: 6px;
}

@media (max-width: 600px) {
  .feature-list {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero h1 {
    font-size: 36px;
  }

  .hero .tagline {
    font-size: 18px;
  }
}
