/* optanik.com/tutorials: its own small site, in optanik.com's colors and type. */
:root {
  --bg: #000000;
  --bg-soft: #070a12;
  --bg-card: #0c111c;
  --bg-raise: #121a29;
  --ink: #f4f7fb;
  --ink-dim: #8b95a8;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --blue: #3aa0ff;
  --blue-hot: #7ec8ff;
  --violet: #8b5cf6;
  --grad: linear-gradient(135deg, #3aa0ff 0%, #6d7dff 48%, #8b5cf6 100%);
  --font: "Space Grotesk", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.tut {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: var(--blue-hot); }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -0.01em; }

.tut-shell { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .tut-shell { padding: 0 28px; } }

.tut-skip { position: absolute; left: -9999px; }
.tut-skip:focus { left: 12px; top: 12px; z-index: 10; background: var(--ink); color: #000; padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------------- header ---------------- */
.tut-top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.tut-top-row { display: flex; align-items: center; gap: 14px; min-height: 64px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.tut-back {
  display: flex; align-items: center; gap: 6px; color: var(--ink-dim); text-decoration: none;
  padding: 6px 10px 6px 4px; border-radius: 10px;
}
.tut-back:hover { color: var(--ink); background: var(--bg-card); }
.tut-back img { height: 22px; width: auto; }
.tut-home {
  color: var(--ink); text-decoration: none; font-weight: 600; padding-left: 14px;
  border-left: 1px solid var(--line-strong); white-space: nowrap;
}
.tut-ask {
  display: flex; align-items: center; gap: 8px; flex: 1 1 320px; max-width: 520px; margin-left: auto;
  background: var(--bg-card); border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 4px 4px 14px;
  color: var(--ink-dim);
}
.tut-ask:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(58, 160, 255, 0.18); }
.tut-ask input {
  flex: 1; min-width: 0; background: none; border: 0; color: var(--ink); font: inherit; padding: 6px 0; outline: none;
}
.tut-ask input::placeholder { color: var(--ink-dim); }
.tut-ask input::-webkit-search-cancel-button { filter: invert(1) opacity(0.5); }
.tut-ask button {
  border: 0; border-radius: 999px; padding: 7px 16px; background: var(--grad); color: #fff; font-weight: 600; cursor: pointer;
}
.tut-ask button:hover { filter: brightness(1.1); }
@media (max-width: 719px) {
  .tut-ask { flex-basis: 100%; max-width: none; order: 3; }
}

.tut-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tut-tabs::-webkit-scrollbar { display: none; }
.tut-tabs a {
  color: var(--ink-dim); text-decoration: none; padding: 10px 14px 12px; border-bottom: 2px solid transparent;
  white-space: nowrap; font-weight: 500;
}
.tut-tabs a:hover { color: var(--ink); }
.tut-tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--blue); }

/* ---------------- home ---------------- */
.tut-hero { padding: 64px 0 40px; background: radial-gradient(60% 80% at 50% 0%, rgba(58, 160, 255, 0.14), transparent 70%); }
.tut-hero .tut-shell { max-width: 860px; text-align: center; }
.tut-kicker { font: 500 13px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue-hot); margin: 0 0 14px; }
.tut-hero h1 { font-size: clamp(34px, 6vw, 58px); font-weight: 700; }
.tut-lede { color: var(--ink-dim); font-size: 18px; margin: 16px auto 0; max-width: 640px; }
.tut-ask-big { margin: 32px auto 0; max-width: 680px; padding: 6px 6px 6px 18px; }
.tut-ask-big input { font-size: 18px; padding: 10px 0; }
.tut-ask-big button { padding: 12px 22px; font-size: 16px; }
.tut-try { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; color: var(--ink-dim); font-size: 14px; align-items: center; }
.tut-try a {
  color: var(--ink); text-decoration: none; border: 1px solid var(--line-strong); border-radius: 999px; padding: 5px 12px; background: var(--bg-soft);
}
.tut-try a:hover { border-color: var(--blue); }

.tut-cards { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); padding-bottom: 64px; }
.tut-card {
  display: flex; flex-direction: column; text-decoration: none; color: inherit; background: var(--bg-card);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color 0.15s, transform 0.15s;
}
.tut-card:hover { border-color: rgba(58, 160, 255, 0.55); transform: translateY(-2px); }
.tut-card-pic { position: relative; aspect-ratio: 16 / 9; background: var(--bg-soft); }
.tut-card-pic img { width: 100%; height: 100%; object-fit: cover; }
.tut-dur {
  position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, 0.78); border-radius: 6px; padding: 2px 7px;
  font: 500 12px/1.4 var(--mono);
}
.tut-card-body { display: flex; flex-direction: column; gap: 6px; padding: 16px; }
.tut-card-body strong { font-size: 18px; }
.tut-card-body span { color: var(--ink-dim); font-size: 14px; }
.tut-card-body small { color: var(--blue-hot); font: 500 12px/1 var(--mono); margin-top: 4px; }

/* ---------------- a video ---------------- */
.tut-watch { padding-top: 28px; padding-bottom: 64px; }
.tut-watch-head h1 { font-size: clamp(26px, 4vw, 38px); }
.tut-watch-head p { color: var(--ink-dim); margin: 8px 0 20px; max-width: 820px; }
.tut-meta { font: 500 13px/1 var(--mono); color: var(--blue-hot); white-space: nowrap; margin-left: 6px; }

.tut-stage { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) { .tut-stage { grid-template-columns: minmax(0, 1fr) 340px; } }
.tut-player { background: #000; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; }
.tut-player video { width: 100%; height: 100%; display: block; background: #000; }

.tut-toc { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 0; }
.tut-toc h2 { font-size: 15px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.tut-toc ol { list-style: none; margin: 0; padding: 6px; overflow-y: auto; max-height: 420px; position: relative; }
@media (min-width: 980px) {
  .tut-stage { align-items: start; }
  .tut-toc { position: relative; height: 0; min-height: 100%; }
  .tut-toc ol { max-height: none; flex: 1; }
}
.tut-toc button {
  display: grid; grid-template-columns: 96px 1fr; grid-template-rows: auto auto; column-gap: 12px; row-gap: 2px; align-items: start;
  width: 100%; text-align: left; background: none; border: 0; border-radius: 10px; padding: 7px; cursor: pointer;
}
.tut-toc button:hover { background: var(--bg-raise); }
.tut-toc button[aria-current] { background: rgba(58, 160, 255, 0.14); box-shadow: inset 3px 0 0 var(--blue); }
.tut-toc img { grid-row: 1 / 3; width: 96px; aspect-ratio: 16 / 9; height: auto; object-fit: cover; border-radius: 6px; background: var(--bg-soft); }
.tut-toc-title { font-size: 14px; font-weight: 500; line-height: 1.3; }
.tut-time { font: 500 12px/1.4 var(--mono); color: var(--blue-hot); }

.tut-script { margin-top: 40px; max-width: 860px; }
.tut-script > h2 { font-size: 22px; }
.tut-hint { color: var(--ink-dim); font-size: 14px; margin: 6px 0 18px; }
.tut-script-ch { padding: 18px 0; border-top: 1px solid var(--line); }
.tut-script-ch h3 button {
  background: none; border: 0; padding: 0; cursor: pointer; font-size: 18px; font-weight: 600; display: flex; gap: 10px; align-items: baseline; text-align: left;
}
.tut-script-ch p { margin: 6px 0 0; }
.tut-script-ch p button {
  display: flex; gap: 12px; align-items: baseline; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px;
  padding: 6px 8px; margin-left: -8px; color: #c9d1de; cursor: pointer; line-height: 1.55;
}
.tut-script-ch p button:hover { background: var(--bg-card); color: var(--ink); }
.tut-script-ch p button.is-now { background: rgba(58, 160, 255, 0.12); color: var(--ink); }
.tut-script-ch .tut-time { flex: none; min-width: 3.4em; }

/* ---------------- an answer ---------------- */
.tut-asked { padding-top: 36px; padding-bottom: 64px; max-width: 920px; }
.tut-q { font-size: clamp(26px, 4vw, 38px); margin-bottom: 24px; }
.tut-asked h2 { font-size: 18px; }

.tut-answer {
  background: linear-gradient(180deg, rgba(58, 160, 255, 0.08), rgba(139, 92, 246, 0.04)), var(--bg-card);
  border: 1px solid rgba(58, 160, 255, 0.35); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 26px;
}
.tut-answer-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.tut-badge { background: var(--grad); color: #fff; font-weight: 700; font-size: 13px; padding: 3px 10px; border-radius: 999px; }
.tut-status { color: var(--ink-dim); font-size: 14px; }
.tut-answer.is-writing .tut-status::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-radius: 50%; background: var(--blue); animation: tut-pulse 1s infinite ease-in-out; }
@keyframes tut-pulse { 50% { opacity: 0.2; } }
@media (prefers-reduced-motion: reduce) { .tut-answer.is-writing .tut-status::after { animation: none; } }
.tut-answer-text { font-size: 17px; line-height: 1.65; min-height: 1.6em; }
.tut-answer-text p { margin: 0 0 10px; }
.tut-answer-text ol, .tut-answer-text ul { margin: 0 0 10px; padding-left: 1.4em; }
.tut-answer-text li { margin: 4px 0; }
.tut-answer.is-writing .tut-answer-text:empty::before { content: "Finding the right part of the tutorials…"; color: var(--ink-dim); }
.tut-answer-note { color: var(--ink-dim); font-size: 13px; margin: 12px 0 0; }
.tut-cite {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.5em; height: 1.5em; padding: 0 5px; margin: 0 2px;
  border: 1px solid rgba(58, 160, 255, 0.6); border-radius: 6px; background: rgba(58, 160, 255, 0.14); color: var(--blue-hot);
  font: 600 12px/1 var(--mono); vertical-align: 0.15em; cursor: pointer;
}
button.tut-cite:hover { background: var(--blue); color: #fff; }
.tut-cite-demo { cursor: default; }

.tut-moment { margin-bottom: 30px; }
.tut-moment-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 10px; }
.tut-moment-where { color: var(--ink-dim); margin: 0; font-size: 14px; }

.tut-sources ol { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.tut-sources button {
  display: grid; grid-template-columns: 120px 1fr; gap: 14px; width: 100%; text-align: left; cursor: pointer;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; position: relative;
}
.tut-sources button:hover { border-color: var(--line-strong); }
.tut-sources li.is-on button { border-color: rgba(58, 160, 255, 0.6); }
.tut-sources img { width: 120px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 7px; }
.tut-sources button > span, .tut-sources strong, .tut-sources .tut-time { display: block; }
.tut-sources strong { font-size: 15px; }
.tut-src-text { color: var(--ink-dim); font-size: 14px; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tut-sources ol { counter-reset: src; }
.tut-sources button::before {
  counter-increment: src; content: counter(src); position: absolute; left: 16px; top: 16px; min-width: 1.6em; height: 1.6em;
  display: flex; align-items: center; justify-content: center; border-radius: 6px; background: rgba(0, 0, 0, 0.75);
  font: 600 12px/1 var(--mono); color: var(--blue-hot);
}
@media (max-width: 560px) {
  .tut-sources button { grid-template-columns: 1fr; }
  .tut-sources img { width: 100%; }
}

.tut-none { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.tut-none p { color: var(--ink-dim); }
.tut-none-links { display: flex; flex-wrap: wrap; gap: 8px; }
.tut-none-links a { color: var(--ink); text-decoration: none; border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 14px; }
.tut-none-links a:hover { border-color: var(--blue); }

/* ---------------- footer ---------------- */
.tut-foot { border-top: 1px solid var(--line); color: var(--ink-dim); font-size: 14px; }
.tut-foot .tut-shell { display: flex; flex-wrap: wrap; gap: 8px 22px; padding-top: 20px; padding-bottom: 28px; }
.tut-foot a { color: var(--ink-dim); text-decoration: none; }
.tut-foot a:hover { color: var(--ink); }

/* ---------- written guides ---------- */
.tut-guide { padding-top: 36px; padding-bottom: 64px; }
.tut-guide h1 { font-size: clamp(28px, 4.4vw, 44px); }
.tut-guide .tut-kicker a { color: inherit; }
.tut-guide-lede { color: var(--ink-dim); font-size: 18px; margin: 10px 0 28px; max-width: 760px; }
.tut-guide-grid { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) { .tut-guide-grid { grid-template-columns: 260px minmax(0, 1fr); align-items: start; } }
.tut-guide-toc { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 10px 10px; }
@media (min-width: 980px) { .tut-guide-toc { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; } }
.tut-guide-toc h2 { font-size: 14px; padding: 0 8px 8px; margin: 0; border-bottom: 1px solid var(--line); }
.tut-guide-toc ol { list-style: none; margin: 6px 0 0; padding: 0; }
.tut-guide-toc a { display: block; padding: 7px 8px; border-radius: 8px; color: var(--ink-dim); font-size: 14px; line-height: 1.35; }
.tut-guide-toc a:hover { color: var(--ink); background: var(--bg-raise); }
.tut-guide-body { max-width: 780px; min-width: 0; }
.tut-guide-body section { padding: 6px 0 22px; border-top: 1px solid var(--line); scroll-margin-top: 16px; }
.tut-guide-body section:first-of-type { border-top: 0; }
.tut-guide-body section:target h2 a { color: var(--blue-hot); }
.tut-guide-body h2 { font-size: 22px; margin: 18px 0 10px; }
.tut-guide-body h2 a { color: inherit; }
.tut-guide-body p, .tut-guide-body li { color: #c9d1de; font-size: 16px; line-height: 1.65; }
.tut-guide-body p { margin: 0 0 12px; }
.tut-guide-body ul, .tut-guide-body ol { margin: 0 0 12px; padding-left: 22px; }
.tut-guide-body strong { color: var(--ink); }
.tut-table { overflow-x: auto; margin: 4px 0 14px; border: 1px solid var(--line); border-radius: 12px; }
.tut-table table { width: 100%; border-collapse: collapse; font-size: 15px; }
.tut-table th, .tut-table td { padding: 10px 12px; text-align: left; border-top: 1px solid var(--line); vertical-align: top; }
.tut-table thead th { border-top: 0; color: var(--ink-dim); font-weight: 500; font-size: 13px; background: var(--bg-card); }
.tut-guide-more { margin-top: 26px !important; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px !important; color: var(--ink-dim) !important; }
.tut-guide-more a { color: var(--blue-hot); }

.tut-guide-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tut-guide-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-card); transition: border-color 0.15s, transform 0.15s; }
.tut-guide-card:hover { border-color: rgba(58, 160, 255, 0.55); transform: translateY(-2px); }
.tut-guide-card strong { font-size: 17px; }
.tut-guide-card span { color: var(--ink-dim); font-size: 14px; }
.tut-guide-card small { color: var(--blue-hot); font: 500 12px/1 var(--mono); margin-top: 4px; }
.tut-home-guides { padding-bottom: 64px; }
.tut-home-guides h2 { font-size: 24px; margin-bottom: 16px; }

/* an answer that came from a guide */
.tut-read { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-card); }
.tut-read-where { margin: 0 0 6px; font: 500 12px/1.4 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--blue-hot); }
.tut-read-title { font-size: 19px; margin: 0 0 8px; }
.tut-read-text { color: #c9d1de; margin: 0 0 12px; line-height: 1.6; }
.tut-read-link { color: var(--blue-hot); font-weight: 600; }
.tut-guide-toc a, .tut-guide-body h2 a, .tut-guide-card, .tut-guide-more a, .tut-read-link, .tut-guide .tut-kicker a { text-decoration: none; }
.tut-guide-body p a, .tut-guide-body li a, .tut-read-link:hover { text-decoration: underline; }
/* a guide source: a tile the size of a video thumbnail, so the number badge sits clear in its corner */
.tut-sources .tut-src-doc { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 120px; aspect-ratio: 16 / 9;
  border-radius: 7px; background: linear-gradient(160deg, rgba(58, 160, 255, 0.16), rgba(139, 92, 246, 0.12)), var(--bg-soft);
  border: 1px solid var(--line); color: var(--blue-hot); font: 500 10px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.tut-sources .tut-src-doc svg { width: 22px; height: 22px; }
@media (max-width: 560px) { .tut-sources .tut-src-doc { width: 100%; } }
/* an answer taken straight from a guide */
.tut-answer.is-guide .tut-badge { background: var(--bg-raise); color: var(--blue-hot); border: 1px solid rgba(58, 160, 255, 0.4); }
.tut-guide-answer-title { font-size: 20px; margin: 4px 0 10px; }
.tut-answer.is-guide .tut-answer-text p, .tut-answer.is-guide .tut-answer-text li { line-height: 1.65; }
.tut-answer.is-guide .tut-answer-text ul, .tut-answer.is-guide .tut-answer-text ol { padding-left: 22px; margin: 0 0 12px; }
.tut-answer.is-guide .tut-read-link { text-decoration: none; }
.tut-back-ticketing img { height: 30px; }

/* how-to guides: a tutorial chapter embedded in the guide */
.tut-guide-video { margin: 6px 0 18px; }
.tut-guide-video video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; background: #000; border: 1px solid var(--line); }
.tut-guide-video figcaption { margin-top: 8px; font-size: 14px; color: var(--ink-dim); }
.tut-guide-video figcaption a { color: var(--blue-hot); }
.tut-guide-group { margin: 28px 0 12px; font-size: 18px; color: var(--ink); }
.tut-related { margin-top: 36px; }
.tut-related h2 { font-size: 20px; margin: 0 0 14px; }
