
/* Elm-package docs layout · Savannah Bananas palette
   Generated from Styles.selm — edit that file, then run selm sync_css */
:root {
  --banana: #f5c518;
  --navy: #0a1f44;
  --lime: #b8f000;
  --text: #0a1f44;
  --muted: #4a5d7a;
  --page: #fffdf5;
  --panel: #ffffff;
  --panel-2: #f7f4e8;
  --line: #d8deea;
  --code-bg: #f3f5f9;
  --accent: var(--lime);
  --accent-2: #6a8a00;
  --tok-kw: #5a7200;
  --tok-type: #0a1f44;
  --tok-ident: #0a1f44;
  --tok-str: #8a5a00;
  --tok-num: #3d6b8a;
  --tok-com: #8a96a8;
  --tok-op: #4a5d7a;
  --tok-punct: #4a5d7a;
  --max: 72rem;
  --side: 14.5rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(900px 420px at 8% -10%, rgba(245, 197, 24, 0.2), transparent 55%),
    radial-gradient(700px 380px at 96% 0%, rgba(184, 240, 0, 0.14), transparent 50%),
    var(--page);
}

a {
  color: var(--navy);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 160ms ease;
}

a:hover { color: var(--accent-2); }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  margin: 0;
  padding: 0.85rem clamp(1rem, 3vw, 2rem);
  background: var(--banana);
  border-bottom: 3px solid var(--navy);
  color: var(--navy);
}

.brand {
  font-family: "Bricolage Grotesque", "IBM Plex Sans", sans-serif;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
  color: var(--navy);
  text-decoration: none;
}

.brand span { color: #5a7200; }

.nav {
  display: flex;
  gap: 1.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav a {
  color: var(--navy);
  text-decoration: none;
  opacity: 0.78;
  position: relative;
  font-weight: 500;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.3rem;
  height: 2px;
  background: var(--navy);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--navy);
  opacity: 1;
}

.nav a:hover::after,
.nav a[aria-current="page"]::after { transform: scaleX(1); }

.hero {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  min-height: calc(100vh - 5.5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 0 4rem;
  animation: rise 700ms ease both;
}

.hero-brand {
  font-family: "Bricolage Grotesque", "IBM Plex Sans", sans-serif;
  font-size: clamp(4rem, 12vw, 7.5rem);
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 0.92;
  margin: 0 0 1.25rem;
  color: var(--navy);
}

.hero-brand span { color: #5a7200; }

.hero h1 {
  font-family: "Bricolage Grotesque", "IBM Plex Sans", sans-serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  max-width: 22ch;
  margin: 0 0 0.85rem;
  color: var(--navy);
  animation: rise 700ms ease 80ms both;
}

.hero p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
  max-width: 36rem;
  margin: 0 0 1.75rem;
  animation: rise 700ms ease 140ms both;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  animation: rise 700ms ease 200ms both;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.1rem;
  border-radius: 0;
  border: 2px solid transparent;
  font-weight: 600;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--lime);
  border-color: var(--navy);
  color: var(--navy);
}

.btn-primary:hover { background: #cfff33; color: var(--navy); }

.btn-ghost {
  background: transparent;
  border-color: var(--navy);
  color: var(--navy);
}

.btn-ghost:hover {
  background: rgba(245, 197, 24, 0.35);
  border-color: var(--navy);
  color: var(--navy);
}

/* Content left, sidebar right (Elm packages); DOM may list sidebar first */
.shell,
.shell-api {
  width: min(var(--max), calc(100% - 2rem));
  margin: 1.5rem auto 3rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--side);
  gap: 2rem;
  animation: rise 500ms ease both;
}

.shell > .content,
.shell-api > .content {
  grid-column: 1;
  grid-row: 1;
}

.shell > .side,
.shell > .side-stack,
.shell-api > .side,
.shell-api > .side-stack {
  grid-column: 2;
  grid-row: 1;
}

.side {
  align-self: start;
  position: sticky;
  top: 1rem;
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.85rem 0.7rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
}

.side h2 {
  margin: 0 0 0.9rem;
  padding: 0 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.side ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.12rem;
}

.side a {
  display: block;
  padding: 0.38rem 0.55rem;
  border-radius: 0.35rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  line-height: 1.35;
  transition: color 140ms ease, background 140ms ease;
}

.side a:hover {
  color: var(--navy);
  background: rgba(247, 244, 232, 0.9);
}

.side a[aria-current="page"] {
  color: var(--navy);
  background: rgba(184, 240, 0, 0.42);
  font-weight: 600;
}

.side-groups {
  display: grid;
  gap: 1.15rem;
}

.side-group h3,
.side-module-group h3 {
  margin: 0 0 0.3rem;
  padding: 0 0.55rem;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy);
}

.side-group ul,
.side-module-group ul {
  list-style: none;
  margin: 0 0 0 0.55rem;
  padding: 0.1rem 0 0.1rem 0.7rem;
  display: grid;
  gap: 0.1rem;
  border-left: 2px solid var(--line);
}

.folder-tree {
  white-space: pre;
  line-height: 1.45;
  font-size: 0.86rem;
}

.content {
  min-width: 0;
  padding: 0.2rem 0 2rem;
}

.content h1 {
  font-family: "Bricolage Grotesque", "IBM Plex Sans", sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: -0.04em;
  margin: 0 0 0.75rem;
  color: var(--navy);
}

.content h2 {
  font-family: "Bricolage Grotesque", "IBM Plex Sans", sans-serif;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  margin: 0 0 0.85rem;
  color: var(--navy);
}

.content p,
.content li {
  color: var(--muted);
  line-height: 1.65;
}

.content p { margin: 0 0 1rem; }

.content ul { padding-left: 1.2rem; margin: 0 0 1rem; }

.content strong { color: var(--text); font-weight: 600; }

.content a code {
  color: inherit;
}

.lead {
  font-size: 1.08rem;
  color: var(--text);
  margin: 0 0 1.35rem;
}

.lead > .md > p:first-child {
  margin-top: 0;
}

.lead > .md > p:last-child {
  margin-bottom: 0;
}

.doc-section {
  margin: 0 0 1.35rem;
  padding: 1.15rem 1.25rem 0.45rem;
  border: 2px solid var(--navy);
  background: var(--panel);
}

.doc-section > h2 {
  margin: 0 0 0.85rem;
}

.doc-section > :last-child {
  margin-bottom: 0.85rem;
}

.doc-section pre,
.doc-section .code-block {
  border-color: var(--line);
  background: var(--code-bg);
}

.doc-section .table-wrap {
  border-color: var(--line);
}

.doc-field {
  margin: 0 0 1.15rem;
}

.doc-field > h3 {
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
}

.doc-field > .code-block {
  margin-bottom: 0.65rem;
}

.doc-field > p:last-child {
  margin-bottom: 0;
}

.doc-note {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  border-left: 4px solid var(--banana);
  background: rgba(245, 197, 24, 0.16);
  color: var(--text);
}

.doc-note > .md > p:last-child {
  margin-bottom: 0;
}

.doc-note > .md > p {
  color: var(--text);
}

.doc-next {
  margin: 0.35rem 0 0.85rem;
  padding: 0.9rem 1rem;
  border: 2px solid var(--navy);
  background: rgba(184, 240, 0, 0.14);
}

.doc-next-label {
  margin: 0 0 0.55rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--navy);
}

.doc-next ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.doc-next a {
  display: block;
  text-decoration: none;
  color: var(--text);
}

.doc-next a:hover .doc-next-title {
  color: var(--accent-2);
}

.doc-next-title {
  display: block;
  font-weight: 600;
  color: var(--navy);
}

.doc-next-blurb {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.api-doc {
  margin: 0;
}

.api-doc .md > p:last-child {
  margin-bottom: 0;
}

.api-examples {
  margin: 0.85rem 0 0;
}

.doc-examples {
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--navy);
}

.md .code-block {
  margin: 0.65rem 0 1rem;
}

.card-list {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.card-list a {
  display: block;
  padding: 0.9rem 1rem;
  border: 2px solid var(--navy);
  border-radius: 0;
  background: var(--panel);
  text-decoration: none;
  color: var(--text);
  transition: background 160ms ease, transform 160ms ease;
}

.card-list a:hover {
  background: rgba(245, 197, 24, 0.28);
  transform: translateY(-1px);
}

.card-list span {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.92rem;
}

pre, code {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

code {
  font-size: 0.9em;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0.1rem 0.35rem;
}

pre {
  overflow-x: auto;
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: 0;
  border: 2px solid var(--navy);
  background: var(--code-bg);
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.55;
}

pre code {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: inherit;
}

.code-block .tok-kw { color: var(--tok-kw); font-weight: 500; }
.code-block .tok-type { color: var(--tok-type); font-weight: 600; }
.code-block .tok-ident { color: var(--tok-ident); }
.code-block .tok-str { color: var(--tok-str); }
.code-block .tok-num { color: var(--tok-num); }
.code-block .tok-com { color: var(--tok-com); font-style: italic; }
.code-block .tok-op { color: var(--tok-op); }
.code-block .tok-punct { color: var(--tok-punct); }

.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.25rem;
  border: 2px solid var(--navy);
  border-radius: 0;
}

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

th, td {
  text-align: left;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--text);
  background: var(--panel-2);
  font-weight: 600;
}

td { color: var(--muted); }

tr:last-child td { border-bottom: 0; }

.site-footer {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 2px solid var(--navy);
}

.site-footer strong { color: var(--navy); font-weight: 700; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.side-stack {
  display: grid;
  gap: 1.25rem;
  align-content: start;
}

.side-modules ul {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.84rem;
}

.side-module-group {
  margin-top: 1.1rem;
}

.api-group {
  margin: -0.35rem 0 0.85rem;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.api-module-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.api-module-list a {
  display: block;
  padding: 0.7rem 0.85rem;
  border: 2px solid var(--navy);
  border-radius: 0;
  background: var(--panel);
  text-decoration: none;
  color: var(--text);
}

.api-module-list a:hover {
  background: rgba(184, 240, 0, 0.28);
}

.api-module-list code {
  font-size: 0.95rem;
}

.api-module-list span {
  display: block;
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.api-item {
  margin: 0 0 1.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--line);
}

.api-item:last-child {
  border-bottom: 0;
}

.api-item h3 {
  margin: 0 0 0.45rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 1.05rem;
  font-weight: 500;
}

.api-anchor {
  color: var(--text);
  text-decoration: none;
}

.api-anchor:hover {
  color: var(--accent-2);
}

.api-sig {
  margin-bottom: 0.65rem;
}

@media (max-width: 860px) {
  .shell,
  .shell-api {
    grid-template-columns: 1fr;
  }

  .shell > .content,
  .shell-api > .content,
  .shell > .side,
  .shell > .side-stack,
  .shell-api > .side,
  .shell-api > .side-stack {
    grid-column: 1;
    grid-row: auto;
  }

  .hero { min-height: auto; padding-top: 3rem; }

  .tour-panes { grid-template-columns: 1fr; }

  body.tour-body {
    height: auto;
    overflow: auto;
  }

  .tour-fs {
    grid-template-columns: 1fr;
    height: auto;
    overflow: auto;
  }

  .tour-fs-lesson {
    border-right: 0;
    border-bottom: 2px solid var(--navy);
    max-height: none;
  }

  .tour-fs-ide {
    min-height: 70vh;
  }
}

body.tour-body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--page);
}

body.tour-body > .site-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.tour-fs {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(20rem, 28rem) minmax(0, 1fr);
  background: var(--page);
}

.tour-fs-lesson {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  overflow: auto;
  padding: 1.25rem 1.35rem 1.5rem;
  border-right: 2px solid var(--navy);
  background: var(--panel);
}

.tour-fs-kicker {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.tour-fs-kicker a {
  color: var(--muted);
  text-decoration: none;
}

.tour-fs-kicker a:hover { color: var(--navy); }

.tour-fs-steps ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
}

.tour-fs-steps a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.86rem;
}

.tour-fs-steps a:hover,
.tour-fs-steps a[aria-current="page"] {
  color: var(--navy);
  background: rgba(184, 240, 0, 0.35);
}

.tour-fs-copy {
  flex: 1;
  min-height: 0;
  padding: 0;
}

.tour-fs-copy h1 {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
}

.tour-fs-lesson .tour-nav {
  margin-top: auto;
  padding-top: 0.75rem;
}

.tour-fs-ide {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel-2);
}

.tour-ide-host,
.tour-fs-ide .tour-editor {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 0;
  border: 0;
  background: var(--panel);
}

.tour-fs-ide .tour-code-wrap {
  flex: 1 1 auto;
  height: auto;
  min-height: 12rem;
  max-height: none;
  resize: none;
}

.tour-fs-ide .tour-panes {
  flex: 0 0 auto;
  max-height: 40%;
  overflow: auto;
}

.tour-editor {
  margin: 1.5rem 0 1.25rem;
  border: 2px solid var(--navy);
  background: var(--panel);
}

.tour-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 2px solid var(--navy);
  background: var(--panel-2);
}

.tour-toolbar .btn {
  cursor: pointer;
  font: inherit;
}

.tour-toolbar .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.tour-status {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.88rem;
}

.tour-code-wrap {
  display: flex;
  align-items: stretch;
  height: 22rem;
  min-height: 12rem;
  max-height: 70vh;
  overflow: hidden;
  resize: vertical;
  background: var(--code-bg);
}

.tour-code-gutter {
  box-sizing: border-box;
  flex: 0 0 auto;
  min-width: 2.75ch;
  min-height: 0;
  margin: 0;
  padding: 1rem 0.55rem 1rem 0.65rem;
  border: 0;
  border-right: 1px solid var(--line);
  overflow: hidden;
  scrollbar-gutter: stable;
  scrollbar-width: none;
  pointer-events: none;
  user-select: none;
  white-space: pre;
  text-align: right;
  tab-size: 4;
  background: var(--panel-2);
  color: var(--muted);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.86rem;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.55;
}

.tour-code-gutter::-webkit-scrollbar {
  display: none;
}

.tour-code-main {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}

.tour-code-highlight {
  box-sizing: border-box;
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 1rem 1.1rem;
  border: 0;
  overflow: hidden;
  scrollbar-gutter: stable;
  scrollbar-width: none;
  pointer-events: none;
  white-space: pre;
  word-wrap: normal;
  overflow-wrap: normal;
  tab-size: 4;
  background: transparent;
  color: var(--text);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.86rem;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.55;
}

.tour-code-highlight::-webkit-scrollbar {
  display: none;
}

.tour-code-highlight code {
  font: inherit;
  font-weight: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
}

/* Bold glyphs shift caret hit-testing vs the plain textarea; keep color only. */
.tour-code-highlight .tok-kw,
.tour-code-highlight .tok-type {
  font-weight: 400;
}

.tour-code {
  box-sizing: border-box;
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 1rem 1.1rem;
  border: 0;
  resize: none;
  background: transparent;
  color: transparent;
  -webkit-text-fill-color: transparent;
  caret-color: var(--text);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.86rem;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 1.55;
  tab-size: 4;
  white-space: pre;
  overflow: auto;
  scrollbar-gutter: stable;
}

.tour-code::selection {
  background: rgba(184, 240, 0, 0.35);
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.tour-code:focus {
  outline: 2px solid var(--lime);
  outline-offset: -2px;
}

.tour-panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 2px solid var(--navy);
}

.tour-output-wrap,
.tour-diagnostics-wrap {
  min-width: 0;
  padding: 0.85rem 1rem 1rem;
}

.tour-output-wrap {
  border-right: 2px solid var(--navy);
}

.tour-output-wrap h3,
.tour-diagnostics-wrap h3 {
  margin: 0 0 0.55rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  font-family: "IBM Plex Sans", sans-serif;
  border: 0;
  padding: 0;
}

.tour-output {
  min-height: 6rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.5;
}

.tour-output .tour-demo h1 {
  font-size: 1.25rem;
  margin: 0 0 0.4rem;
  border: 0;
  padding: 0;
}

.tour-diagnostics {
  margin: 0;
  min-height: 6rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  background: var(--code-bg);
  color: var(--muted);
  white-space: pre-wrap;
  font-size: 0.82rem;
}

.tour-diagnostics.is-error { color: #8a1f1f; }
.tour-diagnostics.is-ok { color: var(--accent-2); }

.tour-nav {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 1.5rem 0 0;
  flex-wrap: wrap;
}

.tour-nav-spacer { flex: 1; }
