:root {
  --coral: #f05d57;
  --coral-soft: #ff8b82;
  --red: #bd3a34;
  --navy: #323232;
  --blue: #323232;
  --blue-deep: #141414;
  --ink: #171717;
  --ink-soft: #5a5a5a;
  --paper: #ffffff;
  --mist: #e3e3e3;
  --tint: #fff5f4;
  --sidebar-w: 280px;
  --max: 56rem;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
}

body.theme-tt {
  font: 16px/1.6 "Rubik", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--red);
  text-decoration: none;
  transition: color .2s ease;
}

a:hover {
  color: var(--ink);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.25rem auto;
  border-radius: 6px;
}

hr {
  border: 0;
  border-top: 1px solid var(--mist);
  margin: 2.25rem 0;
}

code {
  background: var(--mist);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.92em;
  font-family: "Lucida Console", "Courier New", monospace;
}

pre {
  background: var(--mist);
  padding: 1rem 1.1rem;
  border-radius: 8px;
  overflow-x: auto;
  line-height: 1.45;
}

pre code {
  background: transparent;
  padding: 0;
}

/* Copy button: base.njk wraps every multiline fenced block in .code-wrap */
.code-wrap {
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.3em 0.6em;
  border: 1px solid var(--mist);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.code-wrap:hover .copy-btn,
.copy-btn:focus-visible {
  opacity: 1;
}

.copy-btn:hover {
  color: var(--ink);
  border-color: var(--coral-soft);
}

.copy-btn.is-done {
  color: var(--blue-deep);
  border-color: var(--coral-soft);
}

.copy-btn svg {
  width: 0.95em;
  height: 0.95em;
}

@media (hover: none) {
  .copy-btn {
    opacity: 1;
  }
}

blockquote {
  margin: 1.25rem 0;
  padding: 0.75rem 1.1rem;
  border-left: 4px solid var(--coral);
  background: var(--tint);
  color: var(--ink-soft);
  border-radius: 0 6px 6px 0;
}

ul,
ol {
  padding-left: 1.4rem;
}

li {
  margin: 0.3rem 0;
}

button {
  font: inherit;
  cursor: pointer;
}

.layout {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  background: var(--ink);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  z-index: 1000;
}

.skip-link:focus {
  top: 8px;
  color: #fff;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: #171717;
  color: #fff;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #000;
  z-index: 50;
}

.sidebar a {
  cursor: pointer;
}

.sidebar-brand {
  position: relative;
  min-height: 106px;
  padding: 1.6rem 5rem 1.25rem 1.25rem;
  background: #282828;
  border-bottom: 1px solid #393939;
  overflow: hidden;
}

.sidebar-brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
}

.sidebar-brand-link:hover {
  color: var(--coral-soft);
}

.sidebar-brand-sticker {
  position: absolute;
  right: 0.6875rem;
  top: 0.65rem;
  width: 5.2rem;
  height: 5.2rem;
  margin: 0;
  border-radius: 0;
  object-fit: contain;
  transform: rotate(4deg);
  transform-origin: bottom center;
  transition: transform 0.2s ease;
}

.sidebar-brand-link:hover .sidebar-brand-sticker {
  transform: rotate(0deg) translateY(-2px);
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.sidebar-brand-title {
  font-family: "IBM Plex Serif", Georgia, serif;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
}

.sidebar-brand-sub {
  margin-top: 0.625rem;
  font-size: 0.72rem;
  color: #a4a4a8;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-item {
  border-bottom: 1px solid #1f1f23;
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  color: #d8d8db;
  font-family: "Rubik", sans-serif;
  font-weight: 500;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}

.sidebar-link:hover {
  color: #fff;
  background: #1d1d20;
  box-shadow: inset 4px 0 0 var(--coral);
}

.sidebar-item.is-active>.sidebar-link {
  color: #fff;
  background-color: var(--red);
  box-shadow: inset 4px 0 0 rgba(255, 255, 255, 0.4);
  padding-left: 1.5rem;
}

.sidebar-toggle {
  display: inline-block;
  font-family: "Rubik", sans-serif;
  font-weight: 400;
  font-size: 1.2rem;
  line-height: 1;
  color: #8a8a90;
  transition: transform .2s ease;
  cursor: pointer;
  padding: 0 4px;
  user-select: none;
}

.sidebar-item.is-open>.sidebar-link .sidebar-toggle {
  transform: rotate(90deg);
  color: var(--coral-soft);
}

.sidebar-sublist {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0 0.6rem 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
  background: #18181a;
}

.sidebar-item.is-open .sidebar-sublist {
  max-height: 1000px;
}

.sidebar-subitem {
  margin: 0;
}

.sidebar-sublink {
  display: block;
  padding: 0.45rem 1.25rem 0.45rem 1.6rem;
  color: #a4a4a8;
  font-size: 0.86rem;
  font-weight: 400;
  border-left: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}

.sidebar-sublink:hover {
  color: #fff;
  background: #202024;
  border-left-color: var(--coral);
}

.sidebar-sublink[aria-current="page"] {
  color: #fff;
  background: #202024;
  border-left-color: var(--coral);
}

.sidebar-foot {
  padding: 1rem 1.25rem 1.1rem;
  border-top: 1px solid #2a2a2e;
  font-size: 0.75rem;
  color: #8c8c8c;
}

.tinkercademy-brand {
  display: block;
  width: 100%;
  margin-bottom: 0.8rem;
}

.tinkercademy-brand img {
  width: 100%;
  height: auto;
  margin: 0;
  border-radius: 0;
}

.tinkercademy-brand:focus-visible {
  outline: 2px solid var(--coral-soft);
  outline-offset: 4px;
}

.license-lockup {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.license-label {
  flex: 0 0 auto;
  color: #8c8c8c;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ocelliq-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: fit-content;
  margin-bottom: 0;
  color: #b7945e;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: -0.06em;
  line-height: 1;
}

.ocelliq-brand:hover {
  color: #f1eee6;
}

.ocelliq-brand:focus-visible {
  outline: 2px solid #b7945e;
  outline-offset: 4px;
}

.ocelliq-brand-mark {
  width: 2rem;
  height: 2rem;
  margin: 0;
  border-radius: 0;
}

.sidebar-toggle-btn {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 60;
  background: var(--ink);
  color: #fff;
  border: 0;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  font-size: 1.1rem;
}


.page-header {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-deep) 100%);
  color: #fff;
  padding: 3rem 2.5rem 2.5rem;
  position: relative;
  overflow: hidden;
}

.page-header::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 260px;
  height: 260px;
  background: rgba(240, 93, 87, 0.5);
  border-radius: 50%;
}

.page-header::before {
  content: "";
  position: absolute;
  left: -40px;
  bottom: -120px;
  width: 220px;
  height: 220px;
  background: rgba(240, 93, 87, 0.22);
  border-radius: 50%;
}

.page-header-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max);
}

.page-title {
  font-family: "IBM Plex Serif", Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.05;
  margin: 0;
}

.page-subtitle {
  font-family: "Rubik", sans-serif;
  font-weight: 400;
  font-style: italic;
  font-size: 1.1rem;
  margin: 0.6rem 0 0;
  color: rgba(255, 255, 255, 0.9);
}

.page-main {
  flex: 1;
  padding: 2.5rem 2.5rem 4rem;
  max-width: 100%;
}

.content {
  max-width: var(--max);
  margin: 0 auto;
  color: var(--ink);
  font-size: 1rem;
}

.content h1,
.content h2,
.content h3,
.content h4 {
  font-family: "IBM Plex Serif", Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--ink);
}

.content h1 {
  font-size: 1.9rem;
  margin: 2.5rem 0 1rem;
}

.content h1:first-child {
  margin-top: 0;
}

.content h2 {
  font-size: 1.5rem;
  margin: 2.25rem 0 0.9rem;
  padding-bottom: 0.4rem;
  border-bottom: 3px solid var(--coral);
  display: inline-block;
}

.content h3 {
  font-size: 1.15rem;
  margin: 1.6rem 0 0.6rem;
  color: var(--navy);
}

.content h4 {
  font-size: 1rem;
  margin: 1.25rem 0 0.5rem;
  color: var(--blue);
}

.content p {
  margin: 0.9rem 0;
}

.video-embed {
  width: 100%;
  margin: 1.25rem 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 4px solid var(--coral);
  background: var(--ink);
}

.video-embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.content a {
  color: var(--red);
  border-bottom: 1px solid rgba(189, 58, 52, 0.35);
}

.content a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.content strong {
  font-weight: 500;
  color: var(--ink);
}

.content em {
  font-style: italic;
  color: var(--ink-soft);
}

.content ul li::marker {
  color: var(--coral);
}

.content ol li::marker {
  color: var(--coral);
  font-family: "Rubik", sans-serif;
  font-weight: 500;
}

.content .persisted-checklist {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0.5rem;
}

.content .persisted-checklist li {
  margin: 0.45rem 0;
}

.content .persisted-checklist label {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
}

.content .persisted-checklist input {
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.25rem;
  accent-color: var(--coral);
}

.content .persisted-checklist label:has(input:checked) {
  color: var(--ink-soft);
  text-decoration: line-through;
}

.content .checklist-status {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.95rem;
}

.content th,
.content td {
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--mist);
}

.content th {
  font-family: "Rubik", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
  background: var(--mist);
}

.page-foot {
  max-width: var(--max);
  margin: 3rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--mist);
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.content .post-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  grid-auto-rows: 1fr;
  gap: 1rem;
}

.content .post-list li {
  margin: 0;
  padding: 0;
  border: 0;
}

.content .post-list a {
  display: block;
  height: 100%;
  padding: 1.1rem 1.2rem;
  background: var(--paper);
  border: 1px solid var(--mist);
  border-radius: 6px;
  color: var(--ink);
  font-family: "IBM Plex Serif", Georgia, serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.content .post-list strong,
.content .post-list span {
  display: block;
}

.content .post-list span {
  margin-top: 0.3rem;
  color: var(--ink-soft);
  font-family: "Rubik", sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.35;
  text-transform: none;
}

.content .post-list a:hover,
.content .post-list a:focus-visible {
  transform: translateY(-2px);
  box-shadow: inset 4px 0 0 var(--coral), 0 6px 18px -8px rgba(19, 19, 21, 0.25);
  border-color: var(--coral);
  color: var(--ink);
}

.content .word-cloud {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 2.5vw, 1.8rem) clamp(1.2rem, 3vw, 2.6rem);
  margin: 1.5rem 0 2rem;
  padding: clamp(2rem, 6vw, 4.5rem) 0;
  border-block: 1px solid var(--mist);
}

.content .word-cloud li {
  margin: 0;
  line-height: 1;
  animation: word-cloud-in .45s ease-out backwards;
}

.content .word-cloud li:nth-child(4n+2) {
  animation-delay: .06s;
}

.content .word-cloud li:nth-child(4n+3) {
  animation-delay: .12s;
}

.content .word-cloud li:nth-child(4n) {
  animation-delay: .18s;
}

.content .word-cloud a {
  display: inline-block;
  border-bottom: 2px solid rgba(240, 93, 87, 0.28);
  color: var(--navy);
  font-family: "IBM Plex Serif", Georgia, serif;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.1;
  transform: rotate(-1deg);
  transition: color .18s ease, border-color .18s ease, transform .18s ease;
}

.content .word-cloud li:nth-child(3n+2) a {
  transform: rotate(1.25deg);
}

.content .word-cloud li:nth-child(3n) a {
  transform: rotate(-0.25deg);
}

.content .word-cloud a:hover,
.content .word-cloud a:focus-visible {
  border-bottom-color: var(--red);
  color: var(--red);
  transform: rotate(0) translateY(-4px) scale(1.04);
}

.word-cloud-s a {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
}

.word-cloud-m a {
  font-size: clamp(1.3rem, 2.8vw, 1.75rem);
}

.word-cloud-l a {
  font-size: clamp(1.55rem, 3.5vw, 2.15rem);
}

.word-cloud-xl a {
  font-size: clamp(1.8rem, 4.5vw, 2.7rem);
  font-weight: 700;
}

@keyframes word-cloud-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.96);
  }
}

/* ------- Header anchor links (markdown-it-anchor wraps the whole
   heading text in an <a class="header-anchor">, so we have to undo
   the coral link styling and let the heading colour show through) ------- */
.content .header-anchor {
  border-bottom: 0;
  color: inherit;
}

.content .header-anchor:hover {
  color: var(--red);
}

@media (max-width: 820px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .layout {
    margin-left: 0;
  }

  .sidebar-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .page-header {
    padding: 4.25rem 1.5rem 2rem;
  }

  .page-main {
    padding: 1.75rem 1.25rem 3rem;
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: 1.7rem;
  }

  .content h1 {
    font-size: 1.5rem;
  }

  .content h2 {
    font-size: 1.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-brand-sticker {
    transition: none;
  }

  .content .word-cloud li {
    animation: none;
  }

  .content .word-cloud a {
    transition: none;
  }
}

/* Cheatcode-gated content: base.njk removes data-gate once its code is unlocked */
[data-gate] { display: none; }

/* Cheat-code meme images (cheat-image.njk) */
.cheat-image {
  margin: 1.5rem 0;
  padding: 0.75rem;
  border: 4px solid #7A1E2E;
}

.cheat-image figcaption {
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  color: #7A1E2E;
  margin-bottom: 0.75rem;
}

.cheat-image img {
  display: block;
  max-width: 100%;
  margin: 0 auto;
}
