/* Super Parrot documentation — turquoise / coral, light and dark. */

:root {
  --brand: #0f8f87;
  --brand-strong: #0b6f69;
  --accent: #e8603f;
  --bg: #f7faf9;
  --surface: #ffffff;
  --text: #1c2a2a;
  --muted: #5b6b6a;
  --border: #dbe5e3;
  --code-bg: #eef4f3;
  --note-bg: #e7f5f3;
  --warn-bg: #fff3e8;
  --radius: 10px;
  --sidenav: 270px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #3cc7bd;
    --brand-strong: #6fd9d1;
    --accent: #ff8f72;
    --bg: #0f1716;
    --surface: #162120;
    --text: #e3eceb;
    --muted: #9aaeac;
    --border: #2a3a39;
    --code-bg: #1d2b2a;
    --note-bg: #17302d;
    --warn-bg: #33241b;
  }
}

* { box-sizing: border-box; }

html { scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 17px;
}

a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-strong); }

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--surface); padding: 8px 12px; border-radius: var(--radius);
}
.skip:focus { left: 8px; z-index: 10; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.1rem;
}
.brand small { color: var(--muted); font-weight: 400; font-size: .9rem; }
.languages { margin-left: auto; display: flex; gap: 6px; }
.languages a, .languages .current {
  padding: 4px 10px; border-radius: 999px; font-size: .9rem; text-decoration: none;
  border: 1px solid var(--border);
}
.languages .current { background: var(--brand); border-color: var(--brand); color: #fff; }
.menu-toggle {
  display: none;
  font: inherit; font-size: .9rem;
  padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: transparent; color: var(--text);
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: var(--sidenav) minmax(0, 1fr);
  max-width: 1200px; margin: 0 auto;
}
.sidenav {
  position: sticky; top: 57px; align-self: start;
  max-height: calc(100vh - 57px); overflow-y: auto;
  padding: 24px 16px 24px 20px;
  border-right: 1px solid var(--border);
}
.sidenav-title {
  margin: 18px 0 6px; font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.sidenav-title:first-child { margin-top: 0; }
.sidenav ul { list-style: none; margin: 0; padding: 0; }
.sidenav a {
  display: block; padding: 5px 10px; border-radius: 8px;
  color: var(--text); text-decoration: none; font-size: .95rem;
}
.sidenav a:hover { background: var(--code-bg); }
.sidenav a[aria-current="page"] { background: var(--note-bg); color: var(--brand-strong); font-weight: 600; }

.content { padding: 28px 40px 48px; min-width: 0; }
.content > h1 { margin-top: 0; font-size: 2rem; line-height: 1.25; }
.content h2 { margin-top: 2.2em; padding-top: .4em; border-top: 1px solid var(--border); font-size: 1.4rem; }
.content h3 { margin-top: 1.6em; font-size: 1.12rem; }
.lead { font-size: 1.12rem; color: var(--muted); }

/* Text blocks */
code, kbd {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .88em;
  background: var(--code-bg); padding: 1px 5px; border-radius: 5px;
}
kbd { border: 1px solid var(--border); }
pre {
  background: var(--code-bg); padding: 14px 16px; border-radius: var(--radius);
  overflow-x: auto; line-height: 1.45; font-size: .9rem;
}
pre code { background: none; padding: 0; font-size: inherit; }

.note, .warning, .premium {
  padding: 12px 16px; border-radius: var(--radius); margin: 1.2em 0;
  border-left: 4px solid var(--brand); background: var(--note-bg);
}
.warning { border-left-color: var(--accent); background: var(--warn-bg); }
.premium { border-left-color: var(--accent); background: var(--warn-bg); }
.premium::before { content: "🔒 "; }
.note > :first-child, .warning > :first-child, .premium > :first-child { margin-top: 0; }
.note > :last-child, .warning > :last-child, .premium > :last-child { margin-bottom: 0; }

.ui { font-weight: 600; }   /* a label as it appears in the app */

table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: .95rem; display: block; overflow-x: auto; }
th, td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { background: var(--code-bg); }

/* Cards (home page, catalogue) */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 1.4em 0; }
.card {
  display: block; padding: 16px 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); text-decoration: none;
}
a.card:hover { border-color: var(--brand); color: var(--text); }
.card h3 { margin: 0 0 6px; font-size: 1.05rem; color: var(--brand-strong); }
.card p { margin: 0; color: var(--muted); font-size: .95rem; }
.card .meta { margin-top: 10px; font-size: .85rem; }
.card .download { display: inline-block; margin-top: 12px; font-weight: 600; }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 44px; margin-bottom: 1em; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 700;
  display: grid; place-items: center; font-size: .9rem;
}

/* Screenshots: phone-sized, side by side when there is room */
.shots { display: flex; flex-wrap: wrap; gap: 18px; margin: 1.4em 0; align-items: flex-start; }
.shot { margin: 1.4em 0; max-width: 260px; }
.shots .shot { margin: 0; flex: 0 1 230px; }
.shot img {
  display: block; width: 100%; height: auto;
  border-radius: 22px; border: 1px solid var(--border);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .10);
}
.shot figcaption { margin-top: 8px; font-size: .88rem; color: var(--muted); text-align: center; }
@media (max-width: 860px) {
  .shots .shot { flex-basis: calc(50% - 9px); }
  .shot { max-width: 220px; }
}

/* CSV examples: the same file as a spreadsheet and as text, one colour per column */
:root {
  --c0: #0f8f87; --c1: #d9532f; --c2: #7b4fd0; --c3: #2f6fd6;
  --c4: #a86a12; --c5: #c2417a; --c6: #3f8a2c; --c7: #56658a;
  --sheet-grid: #cfdcd9;
}
@media (prefers-color-scheme: dark) {
  :root {
    --c0: #3cc7bd; --c1: #ff8f72; --c2: #b39bff; --c3: #7fb0ff;
    --c4: #f0b85a; --c5: #ff8fbf; --c6: #8fd17a; --c7: #a8b6d6;
    --sheet-grid: #2f4140;
  }
}
.c0 { --c: var(--c0); } .c1 { --c: var(--c1); } .c2 { --c: var(--c2); } .c3 { --c: var(--c3); }
.c4 { --c: var(--c4); } .c5 { --c: var(--c5); } .c6 { --c: var(--c6); } .c7 { --c: var(--c7); }

.csv { margin: .6em 0 1.6em; }
.csv figure { margin: 0 0 .8em; }
.csv figcaption { font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.csv-scroll { overflow-x: auto; border: 1px solid var(--sheet-grid); border-radius: 6px; background: var(--surface); }
.csv-sheet table {
  display: table; width: auto; min-width: 100%; margin: 0; border-collapse: collapse;
  font: .82rem/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.csv-sheet th, .csv-sheet td {
  padding: 3px 8px; border: 1px solid var(--sheet-grid); white-space: nowrap; text-align: left;
}
.csv-sheet td[class^="c"] { background: color-mix(in srgb, var(--c) 7%, transparent); }
.csv-sheet thead th {
  background: var(--code-bg); color: var(--c, var(--muted)); text-align: center; font-weight: 600;
  border-top: 3px solid var(--c, var(--sheet-grid));
}
.csv-sheet tbody th { background: var(--code-bg); color: var(--muted); font-weight: 400; text-align: right; }
.csv-sheet .csv-header td { color: var(--c); font-weight: 700; }
.csv-sheet .csv-corner { border-top-color: var(--sheet-grid); }
.csv-comment { color: var(--muted); font-style: italic; }
.csv-sheet td.csv-comment { white-space: normal; background: none; }
.csv-text pre { margin: 0; font-size: .82rem; }
.csv-text span[class^="c"] { color: var(--c); }
.csv-text .csv-header-line span[class^="c"] { font-weight: 700; }
.csv-sep { color: var(--muted); opacity: .55; font-weight: 700; }
.csv-legend table { display: table; margin: 0; font-size: .9rem; }
.csv-legend th { background: none; white-space: nowrap; font-weight: 400; width: 1%; border-left: 3px solid var(--c); }
.csv-legend th code { color: var(--c); font-weight: 700; background: color-mix(in srgb, var(--c) 10%, transparent); }
.csv-legend .csv-letter {
  display: inline-block; min-width: 1.6em; text-align: center; font-weight: 700; font-size: .8rem;
  color: var(--surface); background: var(--c); border-radius: 4px; padding: 0 4px;
}
.csv-legend small { display: block; color: var(--muted); font-size: .75rem; margin-top: 2px; }
@media (max-width: 600px) {
  .csv-legend th { white-space: normal; }
}

/* Downloadable examples */
.files { list-style: none; padding: 0; }
.files li { margin: .3em 0; }
.files a::before { content: "⬇ "; }

/* Previous / next */
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 3em; }
.pager a {
  flex: 1; max-width: 48%; padding: 12px 16px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); text-decoration: none;
}
.pager a:hover { border-color: var(--brand); }
.pager small { display: block; color: var(--muted); }
.pager-next { text-align: right; margin-left: auto; }

.footer {
  border-top: 1px solid var(--border); color: var(--muted);
  text-align: center; font-size: .9rem; padding: 18px 16px;
}

/* Phones and narrow windows */
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .menu-toggle { display: inline-block; }
  .brand small { display: none; }
  .sidenav {
    display: none; position: static; max-height: none;
    border-right: none; border-bottom: 1px solid var(--border);
    padding: 12px 16px;
  }
  .sidenav.open { display: block; }
  .content { padding: 20px 16px 40px; }
  .content > h1 { font-size: 1.6rem; }
  .topbar { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
  .brand { white-space: nowrap; }
  /* Six languages do not fit beside the title: they get their own row, scrolling sideways. */
  .languages {
    order: 3; flex: 1 0 100%; margin-left: 0;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .languages::-webkit-scrollbar { display: none; }
  .languages a, .languages .current { flex: none; white-space: nowrap; }
  .pager { flex-direction: column; }
  .pager a { max-width: none; }
}
.brand img { border-radius: 8px; }
.hero { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.hero img { width: 150px; height: auto; }
.hero .lead { flex: 1 1 280px; margin: 0; }
