@charset "UTF-8";
:root {
  color-scheme: dark;
  --bg: #171719;
  --surface: #202022;
  --text: #f2efe8;
  --muted: #bebbc2;
  --line: #514d56;
  --control: #aaa3af;
  --accent: #c0ace2;
  --focus: #d5df8d;
  --mono: "Courier New", monospace;
  --sans: Arial, Helvetica, sans-serif;
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #f2efe9;
  --surface: #e7e2dc;
  --text: #252329;
  --muted: #49424d;
  --line: #aaa0af;
  --control: #655c6b;
  --accent: #503b60;
  --focus: #503b60;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-block: 2rem;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
a,
button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 6px;
}
::selection {
  background: var(--accent);
  color: var(--bg);
}
h1,
h2,
p,
figure {
  margin: 0;
}
h1,
h2 {
  font-weight: 500;
}
h1,
h2,
p {
  overflow-wrap: break-word;
}
p {
  max-width: 65ch;
  line-height: 1.65;
  text-align: start;
}
p + p {
  margin-block-start: 2.5em;
}
em {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}
img {
  display: block;
  max-width: 100%;
  height: auto;
}
.site-wrap {
  max-width: 96rem;
  padding-inline: 6.2%;
  margin-inline: auto;
}
.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  padding: 1rem;
  background: var(--focus);
  color: var(--bg);
  transform: translateY(-200%);
  z-index: 20;
  min-height: 44px;
}
.skip-link:focus {
  transform: translateY(0);
}
.header {
  min-height: 7rem;
  padding-block: 1.25rem;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  gap: 2rem;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.07em;
  line-height: 1.2;
}
.wordmark .trademark {
  color: var(--accent);
  font-size: 1.2rem;
  line-height: 1;
  letter-spacing: 0;
  margin: 0.4rem 0 0 0.35rem;
  align-self: flex-start;
}
.header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-left: auto;
  font-size: 1rem;
}
.header nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem;
  text-underline-offset: 0.3em;
}
.header nav a:hover {
  color: var(--accent);
  text-decoration: underline;
}
.theme-toggle {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border: 1px solid var(--control);
  border-radius: 50%;
  background: transparent;
  display: grid;
  place-items: center;
}
.theme-toggle svg {
  width: 22px;
  height: 22px;
}
.theme-toggle:hover {
  background: var(--surface);
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 6%;
  padding-block: 5rem 4.5rem;
  align-items: center;
}
.hero-copy {
  min-width: 0;
}
.eyebrow,
.section-label {
  font: 400 1rem/1.6 var(--mono);
  letter-spacing: 0.04em;
}
.hero .eyebrow {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.tiny-dot {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  background: var(--focus);
  border-radius: 50%;
}
h1 {
  font-size: clamp(3rem, 2rem + 4.5vw, 6rem);
  letter-spacing: -0.05em;
  line-height: 1.05;
  margin-block: 1.8rem;
  overflow-wrap: anywhere;
}
h1 em {
  color: var(--accent);
}
.headline-trademark {
  display: inline-block;
  font: 400 0.5em/1 var(--sans);
  vertical-align: top;
  color: var(--accent);
  letter-spacing: 0;
  margin: 0.1em 0 0 0.25em;
}
.hero-intro {
  font-size: 1.125rem;
  max-width: 35ch;
  color: var(--muted);
}
.hero-footnote {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--muted);
  font-size: 1rem;
  margin-top: 2.25rem;
}
.small-star {
  color: var(--accent);
  font-size: 1.4rem;
}
.portrait {
  position: relative;
  max-width: 30rem;
  width: 100%;
  justify-self: end;
  min-width: 0;
}
.portrait-frame {
  position: relative;
  aspect-ratio: 4 / 4.85;
  overflow: hidden;
  background: #b4b0aa;
  border-radius: 7rem 0 0 0;
}
.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 43%;
}
.portrait-corner {
  position: absolute;
  right: 1rem;
  top: 1rem;
  width: 1.75rem;
  height: 1.75rem;
  border-top: 1px solid #fff;
  border-right: 1px solid #fff;
}
.portrait-sticker {
  position: absolute;
  left: -2rem;
  bottom: 5rem;
  transform: rotate(-10deg);
  min-height: 7rem;
  min-width: 7rem;
  padding: 1rem;
  aspect-ratio: 1;
  background: #d5df8d;
  color: #171719;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 1.5rem;
  line-height: 1.2;
}
.portrait-sticker em {
  font-size: inherit;
  line-height: inherit;
}
figcaption {
  font: 1rem/1.5 var(--mono);
  letter-spacing: 0.02em;
  margin-top: 1rem;
  color: var(--muted);
}
.stack-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-block: 1px solid var(--line);
  padding-block: 1.75rem;
  color: var(--muted);
  font-size: 1.125rem;
}
.strip-star {
  color: var(--accent);
  font-size: 1.35rem;
}
.section {
  padding-block: 5.5rem;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 2rem;
}
.section-label {
  color: var(--muted);
}
.index {
  color: var(--accent);
  margin-right: 0.75rem;
}
.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
  gap: 2rem;
}
.about > .section-label {
  padding-top: 0;
}
.about-content {
  min-width: 0;
}
h2 {
  font-size: clamp(2rem, 1.5rem + 1.8vw, 3.25rem);
  letter-spacing: -0.035em;
  line-height: 1.2;
}
.about-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.5rem;
  margin-top: 2rem;
}
.about-columns p {
  color: var(--muted);
  font-size: 1.125rem;
  margin: 0;
}
.loki-note {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 6.5rem minmax(13rem, 22rem);
  align-items: center;
  gap: 2rem;
  background: var(--surface);
  padding: 2rem;
  margin-block: 3.75rem;
  border: 1px solid var(--line);
  scroll-margin-top: 2rem;
}
.loki-illustration {
  width: 6.5rem;
  height: 6.5rem;
  border-radius: 50%;
}
.loki-illustration button {
  position: relative;
  overflow: hidden;
  background: #22222a;
  padding: 0;
  width: 100%;
  height: 100%;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid #48434b;
  border-radius: 50%;
}
.loki-illustration picture,
.loki-illustration img {
  display: block;
  width: 100%;
  height: 100%;
}
/* Eyelids sit over the picture in its 640px coordinate space. script.js adds .is-blinking on hover, keyboard focus and each pat. */
.loki-eyelids {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.loki-eyelids .eyelid {
  fill: #161519;
  transform-box: fill-box;
  transform-origin: center;
  transform: scaleY(0);
}
.loki-eyelids .blink-line {
  fill: none;
  stroke: #343139;
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0;
}
.is-blinking .eyelid {
  animation: loki-blink 540ms ease-in-out;
}
.is-blinking .blink-line {
  animation: loki-blink-line 540ms ease-in-out;
}
@keyframes loki-blink {
  0%,
  10%,
  90%,
  100% {
    transform: scaleY(0);
  }
  45%,
  60% {
    transform: scaleY(1);
  }
}
@keyframes loki-blink-line {
  0%,
  35%,
  70%,
  100% {
    opacity: 0;
  }
  47%,
  60% {
    opacity: 1;
  }
}
.loki-note .eyebrow {
  color: var(--accent);
  margin-bottom: 0.6rem;
}
.loki-note h2 {
  font-size: 1.75rem;
}
.loki-note p:not(.eyebrow) {
  font-size: 1rem;
  color: var(--muted);
  margin-top: 0.75rem;
}
.loki-interaction {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
  min-height: 8rem;
  /* Pull the speech bubble a little closer to Loki than the grid gap allows. */
  margin-left: -0.75rem;
}
/* Loki's speech bubble. It pops each time script.js swaps in a new thought. */
.loki-bubble {
  position: relative;
  padding: 0.75rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 1rem;
  background: var(--bg);
  color: var(--accent);
  font-size: 1.125rem;
  line-height: 1.5;
  overflow-wrap: break-word;
}
/* The tail: a rotated square showing two of its borders, pointing left at Loki. */
.loki-bubble::before {
  content: "";
  position: absolute;
  top: 1.1rem;
  left: -0.45rem;
  width: 0.8rem;
  height: 0.8rem;
  background: inherit;
  border-left: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  transform: rotate(45deg);
}
.loki-bubble.is-new {
  animation: loki-says 280ms ease-out;
}
@keyframes loki-says {
  from {
    opacity: 0;
    transform: translateY(0.3rem) scale(0.97);
  }
}
.loki-instructions {
  padding-inline-start: 1rem;
  font-size: 1rem;
  color: var(--muted);
}
footer {
  border-top: 1px solid var(--line);
  min-height: 8rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.5rem;
}
footer p {
  font-size: 1rem;
  color: var(--muted);
}
.back-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 1rem/1.5 var(--mono);
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem;
}
.back-top:hover {
  text-decoration: underline;
  text-underline-offset: 0.3em;
}
@media (max-width: 65rem) {
  .site-wrap {
    padding-inline: 5%;
  }
  .hero {
    gap: 5%;
    padding-block: 4rem;
  }
  .about {
    grid-template-columns: 1fr;
  }
  .loki-note {
    grid-template-columns: 6.5rem minmax(0, 1fr);
  }
  .loki-copy {
    grid-column: 1 / -1;
  }
  .loki-interaction {
    min-height: 6rem;
  }
}
@media (max-width: 48rem) {
  .header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
  }
  .header nav {
    grid-row: 2;
    grid-column: 1 / -1;
    margin: 0;
    gap: 1rem;
  }
  .theme-toggle {
    grid-column: 2;
    grid-row: 1;
  }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 3rem;
    padding-block: 3rem;
  }
  h1 {
    font-size: clamp(3rem, 2rem + 8vw, 5rem);
  }
  .hero-intro {
    max-width: 45ch;
  }
  .hero-footnote {
    margin-top: 1.5rem;
  }
  .portrait {
    width: 90%;
    max-width: 32rem;
  }
  .portrait-frame {
    aspect-ratio: 1 / 1.1;
    border-radius: 5rem 0 0 0;
  }
  .portrait img {
    object-position: center 37%;
  }
  .portrait-sticker {
    left: -1rem;
    bottom: 4rem;
  }
  .stack-strip {
    justify-content: flex-start;
    gap: 0.8rem 1rem;
  }
  .section {
    padding-block: 3.5rem;
  }
  .about-columns {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5em;
  }
  .loki-note {
    margin-block: 2.5rem;
    gap: 1.25rem;
    padding: 1.5rem;
  }
  .loki-interaction {
    margin-left: 0;
  }
  .loki-bubble {
    font-size: 1rem;
  }
  footer .back-top {
    margin-left: auto;
  }
  footer p {
    order: 3;
    width: 100%;
  }
}
@media (max-width: 25rem) {
  .loki-note {
    grid-template-columns: minmax(0, 1fr);
  }
  .loki-bubble::before {
    top: -0.45rem;
    left: 2.85rem;
    transform: rotate(135deg);
  }
  .portrait-sticker {
    min-width: 6rem;
    min-height: 6rem;
    padding: 0.75rem;
    font-size: 1.25rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
@media (forced-colors: active) {
  .theme-toggle,
  .loki-illustration button,
  .loki-note {
    border: 1px solid ButtonText;
  }
  .portrait-sticker {
    border: 1px solid CanvasText;
    background: Canvas;
    color: CanvasText;
  }
  .tiny-dot {
    background: CanvasText;
  }
  a:focus-visible,
  button:focus-visible {
    outline-color: Highlight;
  }
}

/* Added for accessibility and performance (Oct 2026) */
/* Uppercase is now visual only: screen readers get normal words, not letter-by-letter caps. */
.caps {
  text-transform: uppercase;
}
/* The portrait is now a responsive <picture>; keep it filling the frame like the old <img>. */
.portrait-frame picture {
  display: block;
  width: 100%;
  height: 100%;
}
/* Keep in-page jumps clear of the top edge when focus lands on a section. */
:target {
  scroll-margin-top: 2rem;
}
/* Links inside running text need more than colour to stand out (WCAG 1.4.1). */
.hero-intro a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
/* Error pages (404, 500): fill the screen so the footer sits at the bottom instead of mid-page. */
.error-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.error-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: 4rem;
}
/* Code brackets in the accent colour: a little developer flavour. Decorative, so hidden from screen readers in the markup. */
.code-tag {
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: -0.04em;
  white-space: nowrap;
}
/* Opening and closing tags around a content area, on their own lines like in an editor. */
.tag-open,
.tag-close {
  display: block;
  font-size: 1rem;
  line-height: 1.6;
}
.tag-open {
  margin-bottom: 0.75rem;
}
.tag-close {
  margin-top: 1.25rem;
}
