/* Design tokens (layout and typography follow the DevDojo "Index" template).
   Dark is the default; light applies when data-theme="light", or when the
   system prefers light and no theme was chosen explicitly. */
:root {
  color-scheme: dark;
  --c-canvas: #0e0f11;
  --c-panel: #121316;
  --c-shell: #1a1b1f;
  --c-line: #26272b;
  --c-ink: #f7f8f8;
  --c-muted: #8a8f98;
  --c-accent: #848ce0;
  --c-accent-deep: #616acb;
  --c-accent-soft: #1f2140;
  --c-warn: #fbbf24;
  --c-ok: #34d399;
  --c-select: color-mix(in srgb, var(--c-accent) 40%, transparent);
}

:root[data-theme="light"] {
  color-scheme: light;
  --c-canvas: #f2f3f5;
  --c-panel: #ffffff;
  --c-shell: #f0f1f3;
  --c-line: #e4e5e9;
  --c-ink: #17181a;
  --c-muted: #5f646d;
  --c-accent: #616acb;
  --c-accent-deep: #616acb;
  --c-accent-soft: #e6e8f9;
  --c-warn: #b45309;
  --c-ok: #047857;
  --c-select: color-mix(in srgb, var(--c-accent) 24%, transparent);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --c-canvas: #f2f3f5;
    --c-panel: #ffffff;
    --c-shell: #f0f1f3;
    --c-line: #e4e5e9;
    --c-ink: #17181a;
    --c-muted: #5f646d;
    --c-accent: #616acb;
    --c-accent-deep: #616acb;
    --c-accent-soft: #e6e8f9;
    --c-warn: #b45309;
    --c-ok: #047857;
    --c-select: color-mix(in srgb, var(--c-accent) 24%, transparent);
  }
}

body {
  background-color: var(--c-canvas);
  color: var(--c-ink);
}

::selection {
  background: var(--c-select);
  color: var(--c-ink);
}

:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
  border-radius: 0.125rem;
}

/* Type utilities */
.section-label {
  font-family: var(--font-mono, "Geist Mono", monospace);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.6875rem;
  line-height: 1.4;
  font-weight: 500;
}

.meta-mono {
  font-family: var(--font-mono, "Geist Mono", monospace);
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
  line-height: 1.4;
}

.display-hero {
  letter-spacing: -0.03em;
  font-size: clamp(1.5rem, 2.8vw, 2.125rem);
  line-height: 1.3;
}

/* Motion */
.cursor-blink {
  animation: cursor-blink 1.1s step-end infinite;
}

@keyframes cursor-blink {
  50% { opacity: 0; }
}

.press {
  transition: translate 90ms ease-out, opacity 0.15s ease-out;
}

.press:active {
  translate: 0 1px;
}

@keyframes reveal-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.reveal {
  animation: reveal-in 0.5s ease-out both;
  animation-delay: var(--reveal-delay, 0ms);
}

.reveal-1 { --reveal-delay: 70ms; }
.reveal-2 { --reveal-delay: 140ms; }
.reveal-3 { --reveal-delay: 210ms; }
.reveal-4 { --reveal-delay: 280ms; }

@media (prefers-reduced-motion: reduce) {
  .cursor-blink,
  .reveal {
    animation: none;
  }

  .press,
  .press:active {
    transition: none;
    translate: 0;
  }
}

/* Article prose (rendered Markdown inside .md-content). Tailwind's preflight strips
   list/paragraph defaults, so they are restored here. */
.md-content > * + * { margin-top: 1rem; }
.md-content p { margin: 1rem 0; }
.md-content ul,
.md-content ol { margin: 1rem 0; padding-left: 1.35rem; }
.md-content ul { list-style: disc; }
.md-content ul ul { list-style: circle; }
.md-content ul ul ul { list-style: square; }
.md-content ol { list-style: decimal; }
.md-content ol ol { list-style: lower-roman; }
.md-content ol ol ol { list-style: lower-alpha; }
.md-content li { margin: 0.35rem 0; }
.md-content hr { margin: 2rem 0; border-color: var(--c-line); }
.md-content strong { font-weight: 600; }

.md-content a {
  color: var(--c-accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--c-accent) 40%, transparent);
  text-underline-offset: 3px;
}

.md-content a:hover { text-decoration-color: var(--c-accent); }

.md-content :not(pre) > code {
  background-color: var(--c-shell);
  border: 1px solid var(--c-line);
  border-radius: 0.25rem;
  padding: 0.1em 0.35em;
  font-family: var(--font-mono, "Geist Mono", monospace);
  font-size: 0.875em;
}

.codewrap pre,
.codewrap .chroma { background: transparent !important; margin: 0 !important; }
.codewrap pre { padding: 0 !important; overflow: visible !important; }
.codewrap code {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  font-family: var(--font-mono, "Geist Mono", monospace);
  font-size: 0.8125rem;
  line-height: 1.65;
  tab-size: 4;
}

/* Table of contents (Hugo's generated <nav id="TableOfContents"> list) */
.toc { font-size: 0.8125rem; line-height: 1.4; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0.4rem 0; overflow-wrap: anywhere; }
.toc ul ul { margin: 0.4rem 0 0.4rem 0.25rem; padding-left: 0.75rem; border-left: 1px solid var(--c-line); }
.toc a { display: block; padding: 0.1rem 0; color: var(--c-muted); text-decoration: none; }
.toc a:hover { color: var(--c-ink); }
