/* Markelangelo — User Manual site styles.
   Standalone static site (not the app), so raw values are fine here.
   Editorial, warm, gilded — matching the Athenaeum brand. */

:root {
  --paper: #faf7f0;
  --paper-2: #f3eee3;
  --ink: #2b2620;
  --ink-soft: #6b6152;
  --ink-faint: #9a8f7d;
  --gild: #b8860b;
  --gild-soft: #cda434;
  --line: #e6ddcd;
  --sidebar: #f5efe2;
  --card: #fffdf8;
  --shadow: 0 1px 2px rgba(43, 38, 32, 0.06), 0 8px 24px rgba(43, 38, 32, 0.06);
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Newsreader', Georgia, serif;
  --sans:
    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace;
  --sidebar-w: 288px;
}

/* Dark palette: on system preference unless the reader forced light, and always
   when the reader chose dark (the theme toggle). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #1a1713;
    --paper-2: #211d17;
    --ink: #ece4d4;
    --ink-soft: #b3a892;
    --ink-faint: #7d745f;
    --gild: #d8b24a;
    --gild-soft: #e3c463;
    --line: #332c22;
    --sidebar: #16130f;
    --card: #211d16;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.28);
  }
}
:root[data-theme='dark'] {
  --paper: #1a1713;
  --paper-2: #211d17;
  --ink: #ece4d4;
  --ink-soft: #b3a892;
  --ink-faint: #7d745f;
  --gild: #d8b24a;
  --gild-soft: #e3c463;
  --line: #332c22;
  --sidebar: #16130f;
  --card: #211d16;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 1.5rem;
}

body {
  margin: 0;
  background: var(--paper-2);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--gild);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
  max-width: 1180px;
  margin-inline: auto;
  background: var(--paper);
  border-inline: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  padding: 1.5rem 1rem 3rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0.5rem 1rem;
}
.brand .mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: radial-gradient(circle at 30% 30%, var(--gild-soft), var(--gild));
  color: #1a1713;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 20px;
  box-shadow: var(--shadow);
}
.brand .name {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
}
.brand .ver {
  font-size: 0.7rem;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

/* Light/dark toggle, pinned to the sidebar's top-right corner. */
.theme-toggle {
  position: absolute;
  top: 1.5rem;
  right: 0.9rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--ink-faint);
  padding: 0.2rem 0.3rem;
}
.theme-toggle:hover {
  color: var(--gild);
}

.search {
  width: 100%;
  margin: 0 0 1rem;
  padding: 0.5rem 0.7rem;
  font: inherit;
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.search:focus {
  outline: 2px solid var(--gild-soft);
  outline-offset: 1px;
}

.nav a {
  display: block;
  padding: 0.32rem 0.6rem;
  margin: 1px 0;
  border-radius: 7px;
  color: var(--ink-soft);
  font-size: 0.85rem;
  border-left: 2px solid transparent;
}
.nav a:hover {
  background: var(--paper-2);
  color: var(--ink);
  text-decoration: none;
}
.nav a.active {
  background: var(--paper-2);
  color: var(--ink);
  border-left-color: var(--gild);
  font-weight: 600;
}
.nav .group-label {
  padding: 1rem 0.6rem 0.3rem;
  font-size: 0.68rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
}
.nav a.hidden {
  display: none;
}

/* ---------- Content ---------- */
.content {
  max-width: 820px;
  padding: 3rem 3.5rem 6rem;
}

.hero {
  border-bottom: 1px solid var(--line);
  padding-bottom: 2rem;
  margin-bottom: 1rem;
}
.hero h1 {
  font-family: var(--serif);
  font-size: 2.6rem;
  line-height: 1.1;
  margin: 0 0 0.5rem;
}
.hero .lede {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 56ch;
}

.manual-section {
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 1.5rem;
}
.manual-section > h2 {
  font-family: var(--serif);
  font-size: 1.8rem;
  margin: 0 0 0.4rem;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.manual-section > h2 .eyebrow {
  font-family: var(--sans);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gild);
  font-weight: 700;
}
.manual-section h3 {
  font-family: var(--serif);
  font-size: 1.25rem;
  margin: 2rem 0 0.5rem;
}
.manual-section p {
  margin: 0.7rem 0;
}
.lead {
  font-size: 1.08rem;
  color: var(--ink-soft);
}

/* Figures — large centred + small floated */
.figure {
  margin: 1.6rem 0;
}
.figure img {
  max-width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  background: var(--card);
}
.figure figcaption {
  margin-top: 0.55rem;
  font-size: 0.82rem;
  color: var(--ink-faint);
  text-align: center;
}
.figure--small {
  float: right;
  width: 260px;
  margin: 0.4rem 0 1rem 1.6rem;
}
.figure--small img {
  border-radius: 10px;
}
.figure--inline {
  width: 150px;
  display: inline-block;
  vertical-align: middle;
  margin: 0 0.4rem;
}
.figure--inline img {
  border-radius: 8px;
}
@media (max-width: 900px) {
  .figure--small {
    float: none;
    width: 100%;
    margin: 1.2rem 0;
  }
}

/* In-manual callouts (mirror the app's) */
.note {
  margin: 1.3rem 0;
  padding: 0.85rem 1.1rem;
  border-left: 3px solid var(--gild);
  background: color-mix(in oklab, var(--gild) 8%, transparent);
  border-radius: 0 10px 10px 0;
}
.note .note-title {
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--gild);
  display: block;
  margin-bottom: 0.2rem;
}
.note.tip {
  border-color: var(--gild-soft);
  background: color-mix(in oklab, var(--gild-soft) 10%, transparent);
}

/* Numbered how-to steps */
ol.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 1.2rem 0;
}
ol.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0.15rem 0 0.7rem 2.6rem;
}
ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.7rem;
  height: 1.7rem;
  background: var(--gild);
  color: #fffdf8;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.8rem;
  font-family: var(--sans);
}

/* Benefit / feature grids */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.4rem 0;
}
.grid .cell {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem 1.1rem;
}
.grid .cell h4 {
  margin: 0 0 0.3rem;
  font-size: 0.98rem;
}
.grid .cell p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

kbd {
  font-family: var(--mono);
  font-size: 0.78em;
  background: var(--card);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0.05em 0.4em;
  color: var(--ink);
  white-space: nowrap;
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--paper-2);
  padding: 0.1em 0.35em;
  border-radius: 5px;
}
pre {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  overflow-x: auto;
}
pre code {
  background: none;
  padding: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0;
  font-size: 0.9rem;
}
th,
td {
  text-align: left;
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--line);
}
th {
  color: var(--ink-soft);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.12em 0.6em;
  border-radius: 999px;
  background: color-mix(in oklab, var(--gild) 14%, transparent);
  color: var(--gild);
}

/* Feature-launch badge — celebrates a newly arrived feature at a section's top. */
.launch-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
  padding: 0.32em 0.8em;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gild);
  background: color-mix(in oklab, var(--gild) 15%, transparent);
  border: 1px solid color-mix(in oklab, var(--gild) 32%, transparent);
}

.footer {
  padding: 2.5rem 0 0;
  color: var(--ink-faint);
  font-size: 0.85rem;
}

/* Mobile */
.menu-toggle {
  display: none;
}
@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    z-index: 40;
    width: 82%;
    max-width: 320px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .content {
    padding: 4rem 1.4rem 4rem;
  }
  .menu-toggle {
    display: grid;
    place-items: center;
    position: fixed;
    top: 0.8rem;
    left: 0.8rem;
    z-index: 50;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    cursor: pointer;
    color: var(--ink);
  }
}
