@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/fonts/JetBrainsMono-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "APL";
  src: url("assets/fonts/APL387.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: "JetBrains Mono", monospace;
  font-synthesis: none;
  --background: #111827;
  --panel: #1f2937;
  --border: #4b5563;
  --text: #e5e7eb;
  --muted: #a3adbd;
  --green: #94e044;
  --cyan: #8be9fd;
  --yellow: #f1fa8c;
  --purple: #bd93f9;
  background: var(--background);
  color: var(--text);
}

* { box-sizing: border-box; }
html { scroll-padding-top: 2rem; }
body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #111827 8%, #1b2535 53%, #111827 100%);
  font-size: 1rem;
  line-height: 1.6;
}

::selection { background: #4b426b; color: #fff; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a:hover { color: var(--cyan); }
a:focus-visible, button:focus-visible, pre:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 5px;
}
svg { flex: none; }
.page-width { width: min(100% - 4rem, 960px); margin-inline: auto; }
.muted { color: var(--muted); }
.icon { width: 1.125rem; height: 1.125rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; padding-block: 1.25rem; }
.wordmark { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 0.9375rem; }
.tree { width: 2rem; height: 2rem; fill: none; stroke: var(--green); stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.wordmark-slash { margin-inline: 0.65rem; color: #657083; }
.header-link { display: inline-flex; align-items: center; gap: 0.65rem; color: var(--muted); font-size: 0.875rem; }
main { padding-bottom: 2rem; }
.intro { padding-block: 1.5rem 2rem; }
h1 { margin: 0; font-family: system-ui, sans-serif; font-size: clamp(2rem, 4vw, 3rem); font-weight: 650; line-height: 1.15; letter-spacing: -0.055em; }
.year { white-space: nowrap; color: var(--muted); }
.title-dot { color: var(--green); }
.intro-description { margin: 0.75rem 0 0; color: var(--muted); }
.language-link { color: var(--text); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 0.3em; }
.solution { padding-block: 0.75rem 1rem; }
.day-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.day-title { display: flex; align-items: center; gap: 1rem; }
.day-title h2 { margin: 0; font-size: 1.125rem; font-weight: 400; letter-spacing: -0.05em; }
.stars { color: var(--yellow); font-size: 1rem; letter-spacing: 0.2em; }
time { color: var(--muted); font-size: 0.8125rem; }
.solution-body { display: flex; align-items: center; gap: 1.5rem; }
.language-mark { flex: 0 0 80px; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.language-mark img { display: block; max-width: 100%; }
.language-mark span { color: var(--muted); font-size: 0.8125rem; }
.code-panel { flex: 1; min-width: 0; overflow: hidden; border: 2px solid var(--border); border-radius: 14px; background: var(--panel); box-shadow: 0 12px 45px #00000010; }
.code-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3rem; padding: 0.25rem 1.25rem; border-bottom: 1px solid #374151; font-size: 0.8125rem; color: var(--muted); }
.copy-button { display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; min-height: 2.5rem; padding: 0.4rem 0.6rem; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; font-size: 0.8125rem; }
.copy-button:hover { background: #ffffff08; color: var(--text); border-color: var(--border); }
.copy-button[data-copied] { color: var(--green); }
[hidden] { display: none !important; }
pre { margin: 0; padding: 1.5rem; overflow-x: auto; scrollbar-color: var(--border) transparent; }
.tinyapl { font-family: "APL", monospace; font-size: clamp(1.75rem, 3vw, 2.25rem); line-height: 1.5; font-variant-ligatures: none; color: #f8f8f2; }
.syntax-function { color: var(--cyan); }
.syntax-monadic { color: #50fa7b; }
.syntax-dyadic, .syntax-string { color: var(--yellow); }
.syntax-number { color: var(--purple); }
.syntax-comment { color: #97a6cc; }
.code-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.5rem; padding: 0.75rem 1.25rem; border-top: 1px solid #374151; font-size: 0.875rem; }
.code-actions a { display: inline-flex; align-items: center; gap: 0.6rem; min-height: 1.5rem; }
.playground-link { color: var(--green); }
.playground-link .icon { width: 1rem; height: 1rem; }
.video-link { color: var(--muted); }
.video-link .icon { fill: #ff0000; stroke: none; }
.video-link .icon path { fill: #ffffff; }
.solution-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; margin: 0.75rem 0 0 104px; color: var(--muted); font-size: 0.75rem; }
.completed { white-space: nowrap; }
.completed > span:not(.part-divider) { color: var(--green); }
.part-divider { margin-inline: 0.65rem; color: #657083; }
.solution + .solution { margin-top: 1.25rem; border-top: 1px solid #374151; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: 1rem; left: 1rem; z-index: 1; padding: 0.75rem 1rem; background: var(--panel); border: 1px solid var(--green); border-radius: 6px; transform: translateY(-200%); }
.skip-link:focus { transform: translateY(0); }

@media (max-width: 700px) {
  .page-width { width: calc(100% - 2.5rem); }
  .site-header { padding-block: 1rem; }
  .intro { padding-block: 1.25rem 1.5rem; }
  .solution-body { gap: 0; }
  .language-mark { display: none; }
  .code-toolbar { padding-inline: 1rem; }
  pre { padding: 1.25rem 1rem; }
  .tinyapl { font-size: clamp(1.125rem, 3.6vw, 1.5rem); }
  .code-actions { gap: 0.75rem 1.5rem; padding-inline: 1rem; }
  .solution-meta { margin-left: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  a, button { transition: color 120ms, background-color 120ms, border-color 120ms; }
}
