/* Nexus Launcher website — inner pages.
   Page hero, long-form prose, sticky table of contents, setup steps,
   data tables and callouts. */

/* ---------- page hero ---------- */

.page-hero {
  position: relative;
  padding-block: clamp(2.4rem, 5vw, 3.8rem) clamp(1.5rem, 3vw, 2.25rem);
  border-bottom: 1px solid var(--line);
}

.page-hero h1 {
  margin-bottom: 0.8rem;
  font-size: clamp(2.1rem, 4.8vw, 3.4rem);
}

.page-hero .lede { max-width: 44rem; }

.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.3rem;
  margin: 1.3rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.page-meta li { margin: 0; }

/* ---------- two-column reading layout ---------- */

.doc-layout {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.25rem);
  align-items: start;
  padding-block: clamp(2rem, 4vw, 3.25rem);
}

.toc {
  position: sticky;
  top: 5.6rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-widget);
  background: linear-gradient(180deg, rgb(255 255 255 / 4.5%), rgb(255 255 255 / 1.2%));
}

.toc h2 {
  margin-bottom: 0.65rem;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.toc li { margin: 0; counter-increment: toc; }

.toc a {
  display: flex;
  gap: 0.55rem;
  padding: 0.32rem 0.45rem;
  border-radius: 0.5rem;
  color: var(--ink-dim);
  font-size: 0.86rem;
  line-height: 1.4;
}

.toc a::before {
  content: counter(toc, decimal-leading-zero);
  flex: none;
  width: 1.2rem;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.65;
}

.toc a:hover { color: var(--ink); background: var(--glass-hover); }

.toc a[aria-current="true"] {
  color: var(--ink);
  background: var(--glass-hover);
  box-shadow: inset 2px 0 0 var(--ink);
}

html[dir="rtl"] .toc a[aria-current="true"] { box-shadow: inset -2px 0 0 var(--ink); }

/* ---------- prose ---------- */

.prose { max-width: 46rem; }

.prose > section {
  padding-block: 1.5rem;
  border-top: 1px solid var(--line);
}

.prose > section:first-of-type { border-top: 0; padding-top: 0; }

/* On screen each section is its own card, so text stays readable over a
   wallpaper in Frosted and Liquid glass. Print keeps the plain dividers. */
@media screen {
  .prose > section,
  .prose > section:first-of-type {
    margin-bottom: 0.9rem;
    padding: clamp(1.15rem, 2.6vw, 1.7rem);
    border: 1px solid var(--line);
    border-radius: var(--radius-widget);
    background: color-mix(in srgb, var(--surface) 55%, transparent);
  }

  .prose > section > :last-child { margin-bottom: 0; }

  /* The summary boxes (How to use, New since…) are cards too, styled with the sections below. */

  html[data-ui="frosted"] .prose > section,
  html[data-ui="frosted"] .summary-box {
    background: color-mix(in srgb, var(--surface) 68%, transparent);
    border-color: color-mix(in srgb, var(--ink) 16%, transparent);
    backdrop-filter: blur(28px) saturate(130%);
    -webkit-backdrop-filter: blur(28px) saturate(130%);
  }

  /* Liquid, not frost: a light blur with strong saturation and contrast, so the wallpaper
     shows through bent and vivid, plus the bright rim, glint and inner glow of the site's
     Liquid cards. A little more tint than those cards (no moving sheen) keeps long text readable. */
  html[data-ui="liquid"] .prose > section,
  html[data-ui="liquid"] .summary-box {
    border-color: color-mix(in srgb, var(--ink) 52%, transparent);
    /* Highlights in fixed sizes, not percentages: on a tall chapter card a percentage
       stretched them into a white haze over the whole top and bottom. */
    background:
      radial-gradient(18rem 7rem at 0 0, color-mix(in srgb, var(--ink) 16%, transparent), transparent 70%),
      linear-gradient(180deg, color-mix(in srgb, var(--ink) 8%, transparent), transparent 2.5rem),
      color-mix(in srgb, var(--surface) 26%, transparent);
    backdrop-filter: blur(5px) saturate(260%) contrast(1.2);
    -webkit-backdrop-filter: blur(5px) saturate(260%) contrast(1.2);
    box-shadow:
      inset 0 1px 0 color-mix(in srgb, var(--ink) 70%, transparent),
      inset 1px 0 0 color-mix(in srgb, var(--ink) 22%, transparent),
      inset 0 -1px 0 color-mix(in srgb, var(--ink) 18%, transparent);
  }

  html[data-ui="neumorph"] .prose > section,
  html[data-ui="neumorph"] .summary-box {
    border-color: transparent;
    background: var(--surface);
    box-shadow:
      0.4rem 0.45rem 1rem rgb(0 0 0 / 42%),
      -0.3rem -0.3rem 0.8rem rgb(255 255 255 / 5%);
  }

  /* Liquid gives cards position: relative; the contents keep sticking on wide screens. */
  html[data-ui="liquid"] .doc-layout .toc { position: sticky; }
}

.prose h2 {
  margin-bottom: 0.65rem;
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
}

.prose h3 {
  margin-top: 1.6rem;
  font-size: 1.1rem;
}

.prose p, .prose li { color: var(--ink-dim); }
.prose strong { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.15rem; }
.prose li::marker { color: var(--cyan-400); }

.prose a { color: var(--cyan-300); text-decoration: underline; text-underline-offset: 0.18em; }
.prose a:hover { color: var(--cyan-400); }

.anchor-offset { scroll-margin-top: 5.6rem; }

/* ---------- summary box ---------- */

.summary-box {
  margin-bottom: 1.75rem;
  padding: clamp(1.15rem, 2.4vw, 1.6rem);
  border: 1px solid color-mix(in srgb, var(--ink) 28%, transparent);
  border-radius: var(--radius-widget);
  background:
    radial-gradient(22rem 12rem at 92% 0%, color-mix(in srgb, var(--ink) 14%, transparent), transparent 70%),
    linear-gradient(160deg, color-mix(in srgb, var(--ink) 7%, transparent), rgb(255 255 255 / 1%));
}

.summary-box h2 {
  margin-bottom: 0.55rem;
  color: var(--cyan-300);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.summary-box p { margin: 0; color: var(--ink); font-size: 1rem; }

/* ---------- callouts ---------- */

.callout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.9rem;
  max-width: 52rem;
  margin: 1.4rem 0;
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan-400);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: rgb(255 255 255 / 3.5%);
}

.callout-spaced { margin-top: 1.75rem; }

.callout-icon {
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 16%, transparent);
  color: var(--cyan-400);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.callout p { margin: 0; font-size: 0.92rem; color: var(--ink-dim); }
.callout strong { display: block; margin-bottom: 0.15rem; color: var(--ink); }

/* ---------- tables ---------- */

.table-wrap {
  margin: 1.5rem 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead th {
  padding: 0.7rem 1rem;
  background: rgb(255 255 255 / 5%);
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody td {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--line);
  color: var(--ink-dim);
  vertical-align: top;
}

tbody td:first-child { color: var(--ink); font-weight: 600; }
tbody tr:hover td { background: rgb(255 255 255 / 2.5%); }

/* ---------- setup steps ---------- */

.step-list {
  display: grid;
  gap: 0.8rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step {
  display: grid;
  grid-template-columns: 2.7rem minmax(0, 1fr);
  gap: 1.1rem;
  padding: clamp(1.05rem, 2.2vw, 1.4rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-widget);
  background: linear-gradient(165deg, rgb(255 255 255 / 5%), rgb(255 255 255 / 1.2%));
  counter-increment: step;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.step:hover { border-color: var(--line-strong); transform: translateY(-0.15rem); }

.step::before {
  content: counter(step, decimal-leading-zero);
  display: grid;
  place-items: center;
  width: 2.7rem;
  height: 2.7rem;
  border: 1px solid color-mix(in srgb, var(--ink) 30%, transparent);
  border-radius: 1rem;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: var(--cyan-300);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
}

.step h3 { margin-bottom: 0.35rem; font-size: 1.08rem; }
.step p { margin: 0; color: var(--ink-dim); font-size: 0.94rem; }
.step p + p { margin-top: 0.5rem; }

.path {
  color: var(--cyan-300);
  font-size: 0.9em;
  white-space: nowrap;
}

/* ---------- responsive ---------- */

@media (max-width: 58rem) {
  /* minmax(0, ...): a wide table must scroll in its box, not widen the page
     (a too-wide page made phones zoom out, leaving blank space under the footer). */
  .doc-layout { grid-template-columns: minmax(0, 1fr); }
  /* Wide tables scroll sideways in their box rather than crush a column to a word per line. */
  .table-wrap table { min-width: 34rem; }
  /* top: auto, or Liquid's position: relative shifts the contents onto the text below. */
  .doc-layout .toc,
  html[data-ui="liquid"] .doc-layout .toc { position: static; top: auto; }
  .toc ol { columns: 2; column-gap: 1rem; }
  .prose { max-width: none; }
}

@media (max-width: 34rem) {
  .toc ol { columns: 1; }
  .step { grid-template-columns: 1fr; gap: 0.75rem; }
}
