/* Dark version (body.theme-night): near-black with a hint of purple, Aneetta's purple as the
   brand colour (brighter for dark), and loud little pops of butter, lime and pink, the way
   extrafazant.nl uses colour: work framed in thick solid colour, small pop-colour buttons.
   Headings mix a condensed bold sans (Archivo) with a narrow serif (Instrument Serif), both
   served from assets/fonts (Latin subset, from Google Fonts, SIL Open Font License). */
@font-face { font-family: "Archivo"; src: url("../assets/fonts/Archivo-latin.woff2") format("woff2"); font-weight: 600 900; font-stretch: 62% 100%; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("../assets/fonts/InstrumentSerif-latin.woff2") format("woff2"); font-weight: 400; font-display: swap; }
.theme-night {
  --bg: #0f0b14; --surface: #1a1422; --surface-2: #241c2f;
  --ink: #f3eff8; --ink-2: #a59cb2; --line: #f3eff8;
  --accent: #9a6bff; --accent-soft: #5d3a99; --brand: #330466;
  --butter: #fee897; --lime: #c8f54a; --pink: #ff77cd; --tomato: #f44a32; --orange: #ff8a3d;
  --yellow: #fee897;
  --card-line: rgba(243, 239, 248, .16);   /* the quiet outline on the tool and blog cards */
  background-color: #0f0b14; color: var(--ink);
}
.theme-night ::selection { background: var(--accent); color: #0f0b14; }

/* ---- Type ---- */
.theme-night .sec__head h2, .theme-night .contact__title, .theme-night .ofoot__title, .theme-night .faq__title {
  font-family: "Archivo", "Arial Narrow", sans-serif !important; font-stretch: 62%; font-weight: 800 !important;
  text-transform: uppercase; letter-spacing: -.02em !important; line-height: .9 !important; color: var(--ink);
}
.theme-night .sec__head h2 { font-size: clamp(42px, 6.4vw, 104px); }
.theme-night .serif { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-stretch: 100%; letter-spacing: -.01em; text-transform: uppercase; }
.theme-night .sec__sub { color: var(--ink-2); }
.theme-night .orbit__role, .theme-night .orbit__ringlabel, .theme-night .orbit__hint { color: var(--ink-2); }

/* ---- Bars, buttons, bubbles ---- */
.theme-night .topbar { background: rgba(26, 20, 34, .9); box-shadow: 0 0 0 2px var(--ink); }
.theme-night .section-label { color: var(--ink); }
.theme-night .logo-tile, .theme-night .topbar__tile { background: var(--accent); }
.theme-night .hero__links a { color: var(--ink); }
/* Nav words: smaller, and no colour change on hover (the plucked underline is the hover). */
.theme-night .hero__links a:not(.btn) { font-size: 15px; transition: none; }
.theme-night .hero__links a:not(.btn):hover { color: var(--ink); }
.theme-night .hero__nav .btn { font-size: 14px; }
.theme-night .btn--black { background: var(--accent); color: #0f0b14; border-color: var(--accent); }
.theme-night .btn--light { background: transparent; color: var(--ink); border-color: var(--ink); }
.theme-night .btn:hover, .theme-night .btn:focus-visible { box-shadow: 4px 5px 0 var(--butter); }
.theme-night .btn--black:hover, .theme-night .btn--black:focus-visible { box-shadow: 4px 5px 0 var(--butter); }
.theme-night .btn-round { background: var(--butter); color: #0f0b14; }
.theme-night .bubble { background: var(--butter); color: #0f0b14; border-color: #0f0b14; box-shadow: 4px 5px 0 var(--accent); }
.theme-night .bubble::after { background: var(--butter); border-color: #0f0b14; }
.theme-night :focus-visible { outline-color: var(--butter); }

/* Text swap adapted from https://microinteractions.dev/text-swap/
   Copyright (c) 2026 Juan Di Nella. MIT: ../shared/licenses/microinteractions.txt */
.theme-night .btn--swap {
  --swap-state: 0;
  --swap-ease: cubic-bezier(.23, 1, .32, 1);
  overflow: hidden;
  touch-action: manipulation;
  height: auto;
  min-height: 47px;
}
.btn__swap-labels { display: inline-grid; }
.btn__swap-labels > span {
  grid-area: 1 / 1;
  text-align: center;
  text-wrap: balance;
  transition-property: opacity, transform, filter;
  transition-duration: calc(160ms + var(--swap-state) * 60ms);
  transition-timing-function: var(--swap-ease);
}
.btn__swap-current {
  opacity: calc(1 - var(--swap-state));
  filter: blur(calc(var(--swap-state) * 5px));
  transform: translateY(calc(var(--swap-state) * 120%));
}
.btn__swap-next {
  opacity: var(--swap-state);
  filter: blur(calc((1 - var(--swap-state)) * 5px));
  transform: translateY(calc((var(--swap-state) - 1) * 120%));
}
.theme-night .btn--swap:focus-visible {
  --swap-state: 1;
  outline: 2px solid var(--butter);
  outline-offset: 4px;
}
.theme-night .topbar__cta.btn--swap:focus-visible { opacity: 1; pointer-events: auto; }
.btn--swap:focus-visible .btn__swap-labels > span { transition-duration: 0ms; }
@media (hover: hover) and (pointer: fine) {
  .theme-night .btn--swap:hover { --swap-state: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  .theme-night .btn--swap:active { transform: scale(.97); }
}
@media (prefers-reduced-motion: reduce) {
  .theme-night .btn--swap { transition: none; }
  .theme-night .btn--swap:hover, .theme-night .btn--swap:focus-visible { transform: none; }
  .btn__swap-labels > span {
    transform: none;
    filter: none;
    transition: opacity 150ms var(--swap-ease);
  }
  .btn--swap:focus-visible .btn__swap-labels > span { transition-duration: 0ms; }
}

/* The face is black-and-white line art: a light outline keeps it readable on black. */
.theme-night .avatar__stage { filter: drop-shadow(1.5px 0 0 #f3eff8) drop-shadow(-1.5px 0 0 #f3eff8) drop-shadow(0 1.5px 0 #f3eff8) drop-shadow(0 -1.5px 0 #f3eff8); }

/* ---- Case studies: framed in thick solid colour, a different one each ---- */
.theme-night .ocard__in { background: var(--surface); color: var(--ink); border: 4px solid var(--frame, var(--accent)); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8); }
.theme-night .ocard:nth-child(6n+1) { --frame: #9a6bff; }
.theme-night .ocard:nth-child(6n+2) { --frame: #c8f54a; }
.theme-night .ocard:nth-child(6n+3) { --frame: #ff77cd; }
.theme-night .ocard:nth-child(6n+4) { --frame: #fee897; }
.theme-night .ocard:nth-child(6n+5) { --frame: #ff8a3d; }
.theme-night .ocard:nth-child(6n+6) { --frame: #f3eff8; }
.theme-night .ocard__kind { color: var(--ink-2); }
.theme-night .ocard__media { border-color: #0f0b14; background: #000; }
.theme-night .ocard__links a { text-decoration-color: var(--frame, var(--accent)); }
.theme-night .orbit__stage::after { content: none; }
.theme-night .ochip { background: var(--surface); color: var(--ink); border-color: var(--ink); box-shadow: 2px 3px 0 var(--accent); }
.theme-night .ochip.is-on, .theme-night .ochip:focus-visible { background: var(--butter); color: #0f0b14; border-color: var(--butter); }
.theme-night .ochip.is-morph { background: var(--surface); }
.theme-night .orbit__arrow { background: var(--surface); color: var(--ink); border-color: var(--ink); box-shadow: 3px 4px 0 var(--accent); }

/* ---- Play, blogs, words, FAQ ---- */
.theme-night .tile { border-color: #2b2335; background: #000; }
.theme-night .wcard { background: var(--surface); color: var(--ink); border: 4px solid var(--frame, var(--accent)); box-shadow: none; }
.theme-night .wcard:nth-child(3n+1) { --frame: #fee897; }
.theme-night .wcard:nth-child(3n+2) { --frame: #ff77cd; }
.theme-night .wcard:nth-child(3n+3) { --frame: #c8f54a; }
.theme-night .wcard__meta { color: var(--ink-2); }
.theme-night .wcard__media { border-color: #0f0b14; }
.theme-night .wcard__go { text-decoration-color: var(--frame); }

/* ---- Blogs: small portrait cards. Plain row by default; blogdeck.js adds .is-deck on wide
   screens, where the section holds still and the cards ride a wheel into place. ---- */
.bdeck__cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; max-width: 1000px; }
.bcard { display: block; color: var(--ink); text-decoration: none; aspect-ratio: 1 / 1.36; }
.bcard__in { display: flex; flex-direction: column; gap: 5px; height: 100%; box-sizing: border-box; padding: 8px 8px 11px; overflow: hidden;
  background: var(--surface, #1a1422); border: 1.5px solid var(--card-line); border-radius: 16px;
  box-shadow: 0 24px 40px -26px rgba(0, 0, 0, .8); transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s, border-color .25s; }
.bcard:hover .bcard__in, .bcard:focus-visible .bcard__in { transform: translateY(-6px) rotate(-1.5deg); border-color: var(--accent); box-shadow: 6px 10px 0 var(--accent-soft); }
.bcard:focus-visible { outline: none; }
.bcard__media { display: block; flex: 0 0 auto; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 10px; background: #0f0b14; }
.bcard__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bcard__meta { margin: 3px 3px 0; font: 700 calc(var(--bw, 200px) * .05) ui-monospace, Menlo, monospace; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bcard__title { margin: 0 3px; font: 800 calc(var(--bw, 200px) * .07)/1.25 var(--font-body); letter-spacing: -.005em;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
.bcard__go { margin: auto 3px 0; font: 800 calc(var(--bw, 200px) * .058) var(--font-body); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
/* The last card: the way to everything else on Medium. */
.bcard--more .bcard__in { justify-content: flex-end; background: var(--surface-2, #241c2f); border-style: dashed; }
.bcard__big { margin: 0 0 auto 3px; font: 800 calc(var(--bw, 200px) * .34)/1 var(--font-body); color: var(--accent); }
.bcard--more .bcard__title { font-size: calc(var(--bw, 200px) * .1); }
.blogs .writing__more { margin-top: 26px; }

/* Wide screens: three screens of scrolling, the stage pinned for all of it. */
.blogs.is-deck { max-width: none; padding: 0; }
.is-deck .bdeck { height: 400vh; }
.is-deck .bdeck__stage { position: sticky; top: 0; height: 100vh; overflow: hidden; }
.is-deck .bdeck__inner { max-width: 1280px; margin: 0 auto; padding: 96px 32px 0; box-sizing: border-box; }
.is-deck .sec__head { margin-bottom: 0; }
.is-deck .bdeck__cards { display: block; position: absolute; inset: 0; max-width: none; pointer-events: none; }
.is-deck .bcard { position: absolute; left: 0; top: 0; aspect-ratio: auto; pointer-events: auto; will-change: transform; transform: translate3d(-200vw, 0, 0); }
/* The picture takes whatever room the text leaves in the card. */
.is-deck .bcard__media { aspect-ratio: auto; flex: 1 1 0; min-height: 0; }
.is-deck .bcard__meta, .is-deck .bcard__title, .is-deck .bcard__go { flex: none; }

@media (max-width: 700px) {
  .bdeck__cards { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; margin: 0 -20px; padding: 4px 20px 24px; scrollbar-width: none; }
  .bdeck__cards::-webkit-scrollbar { display: none; }
  .bcard { flex: 0 0 56vw; scroll-snap-align: center; --bw: 56vw; }
}

/* ---- Tools: two short cards (Squish, Gather) in place of the blogs. Picture on the left,
   text and a call to action on the right; the whole card opens the tool's landing page. ---- */
.writing__grid--tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tcard { flex-direction: row; align-items: stretch; gap: 18px; padding: 12px; }
/* One quiet outline for the cards, purple only on hover (not a colour per card). */
.theme-night .tcard { --frame: var(--accent); border: 1.5px solid var(--card-line); transition: transform .25s, border-color .25s, box-shadow .25s; }
.theme-night .tcard:hover, .theme-night .tcard:focus-visible { border-color: var(--accent); box-shadow: 6px 10px 0 var(--accent-soft); }
.tcard .wcard__media { flex: 0 0 44%; aspect-ratio: 4 / 3; margin: 0; }
.tcard .wcard__media img { object-position: top center; }
.tcard__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 4px 4px 2px 0; }
.tcard .wcard__meta, .tcard .wcard__title { margin: 0; }
.tcard .wcard__title { font-size: 24px; }
.tcard__desc { font: 400 14.5px/1.45 var(--font-body); color: var(--ink-2); }
.tcard__cta { align-self: flex-start; margin-top: auto; padding: 9px 16px; border-radius: 999px; background: var(--accent); color: #0f0b14; font: 800 14px var(--font-body); transition: transform .2s ease; }
.tcard:hover .tcard__cta, .tcard:focus-visible .tcard__cta { transform: translateX(3px); }
@media (max-width: 1000px) and (min-width: 701px) { .writing__grid--tools { grid-template-columns: 1fr; max-width: 640px; } }
/* Phones: stacked, not swiped (no dots), with a smaller picture. */
@media (max-width: 700px) {
  .writing__grid.writing__grid--tools { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 0; padding: 0; overflow: visible; }
  .tools .mdots { display: none; }
  .tcard { gap: 12px; padding: 10px; }
  .tcard .wcard__media { flex-basis: 38%; aspect-ratio: 3 / 4; }
  .tcard .wcard__title { font-size: 20px; }
  .tcard__desc { font-size: 13.5px; }
  .tcard__cta { padding: 7px 13px; font-size: 13px; }
}
.theme-night .testi { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.theme-night .testi:nth-child(odd) { border-color: var(--accent); }
.theme-night .quotes__btn { background: var(--surface); color: var(--ink); border-color: var(--ink); box-shadow: 3px 4px 0 var(--accent); }
.theme-night .faq__dots { color: var(--accent); }
.theme-night .faq h3, .theme-night .faq dt { color: var(--ink); }
.theme-night .faq p, .theme-night .faq dd { color: var(--ink-2); }

/* ---- Swirl and game ---- */
.theme-night .whirl__count { color: var(--ink); }
.theme-night .whirl__count b { background: var(--butter); color: #0f0b14; border-color: var(--butter); }
.theme-night .pgame__cv { border-color: rgba(243, 239, 248, .18); }
.theme-night .pgame--breakout .pgame__cv { background: rgba(255, 255, 255, .03); }
.theme-night .pgame__hud { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.theme-night .pgame__btn { background: var(--surface); color: var(--ink); border-color: var(--ink); }
.theme-night .pgame__btn.is-main { background: var(--accent); color: #0f0b14; border-color: var(--accent); }
/* The DX-Ball credit under the board; on phones the thumb strip takes its place during a round. */
.pgame__note { position: absolute; left: 0; right: 0; top: calc(100% + 14px); margin: 0; padding: 0 12px; text-align: center; color: var(--ink-2); font: 500 13px/1.5 ui-monospace, Menlo, monospace; }
.pgame.is-live .pgame__pad ~ .pgame__note { display: none; }
/* Phones: the thumb strip under the board (pixelgame.js), shown while a round is on. */
.pgame__pad { position: absolute; left: 0; right: 0; top: calc(100% + 12px); height: 64px; display: none; align-items: center; justify-content: center;
  border: 2px dashed var(--accent); border-radius: 18px; background: rgba(155, 109, 255, .1); color: var(--ink-2);
  font: 700 12px ui-monospace, Menlo, monospace; letter-spacing: .04em; text-transform: uppercase; touch-action: none; }
.pgame.is-live .pgame__pad { display: flex; }
/* Phones: holding a thumb on the board mustn't select the message or pop up the magnifier. */
.pgame--breakout { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }

/* ---- Footer: the brand purple as a big block ---- */
.theme-night .footer.ofoot { background: var(--brand); color: var(--ink); }
.theme-night .ofoot__main { border-bottom-color: rgba(243, 239, 248, .2); }
.theme-night .ofoot__dot { background: var(--lime); }
.theme-night .ofoot__links a:hover, .theme-night .ofoot__top:hover { color: var(--butter); }
.theme-night .ofoot__big:hover { color: var(--butter); }

/* ---- Colour mask-and-reveal for each section (shared/wipe.js) ---- */
/* The colour layer lives in the section (so it holds with it) but spans the full screen width. */
.wipe { position: absolute; top: 0; bottom: 0; left: calc(50% - 50vw); width: 100vw; z-index: 20; visibility: hidden; pointer-events: none; }

/* ---- Phones: the case studies are a one-card carousel you swipe (night/orbit.js) ---- */
.orbit__dots { display: none; }
@media (max-width: 700px) {
  .orbit__pin[data-layout="thought"] .orbit__arrows { display: none; }
  .orbit__pin { touch-action: pan-y; }   /* sideways drags move the row; up/down still scrolls the page */
  .orbit__dots {
    display: flex; justify-content: center; gap: 8px; position: absolute; left: 0; right: 0; z-index: 8; pointer-events: none;
    top: calc(var(--row-y, 60%) + var(--row-h, 320px) / 2 + 20px); opacity: 0;
  }
  .orbit__dots i { width: 7px; height: 7px; border-radius: 4px; background: rgba(243, 239, 248, .28); transition: width .3s cubic-bezier(.2, .8, .2, 1), background .3s; }
  .orbit__dots i.is-on { width: 22px; background: var(--accent); }
}
@media (max-width: 700px) {
  /* Dragging on a card is a swipe, not a long-press on its link or picture. */
  .orbit__pin .ocard a, .orbit__pin .ocard img { -webkit-touch-callout: none; -webkit-user-drag: none; user-select: none; -webkit-user-select: none; }
}
@media (max-width: 700px) {
  /* Top bar: a plain solid strip that fades out at its bottom edge (not the desktop pill
     stretched across the screen), with the same rounded-square logo as the hero. */
  .theme-night .topbar { border-radius: 0; box-shadow: none; padding: 14px 16px 30px; background: linear-gradient(to bottom, #0f0b14 0, #0f0b14 66%, rgba(15, 11, 20, 0) 100%); }
  .theme-night .topbar__tile { width: 44px; height: 44px; border-radius: var(--radius-tile, 12px); }
  .theme-night .topbar__tile img { width: 72%; }
  .theme-night .topbar .section-label { font-size: 18px; letter-spacing: .04em; }
  /* While the game is on screen, the face's bubbles stay out of the way of the bar. */
  .game-in-view .final .dock .bubble { display: none; }
  /* The game's message keeps a steady three-line height, so the wall under it doesn't jump. */
  .pgame--below .pgame__hud { min-height: 72px; display: flex; align-items: center; justify-content: center; font-size: 13px; }
}
@media (max-width: 700px) {
  /* The menu's face is the full live avatar (eyes, brow; site.js), not the bare drawing. */
  .mmenu__face { position: absolute; height: auto; top: auto; right: -16vw; bottom: calc(max(24px, env(safe-area-inset-bottom)) + 118px); width: 74vw; transform: rotate(-10deg); }
  .mmenu__face .avatar__stage { filter: drop-shadow(1.5px 0 0 #f3eff8) drop-shadow(-1.5px 0 0 #f3eff8) drop-shadow(0 1.5px 0 #f3eff8) drop-shadow(0 -1.5px 0 #f3eff8); }
}

/* ---- Belief: the quote before Contact. It sits stuck to the bottom of the screen on a lower
   layer; the FAQ, painted edge to edge with the page background, slides up off it like a lid.
   belief.js lights the words up (--lit per word) as it is uncovered. ---- */
.faq { position: relative; z-index: 2; }
.faq::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(50% - 50vw); right: calc(50% - 50vw); z-index: -1;
  background: var(--bg) var(--grain, none) repeat 0 0 / 256px 256px; background-attachment: fixed;
  border-bottom: 1px solid rgba(243, 239, 248, .08); box-shadow: 0 40px 60px -30px rgba(0, 0, 0, .7); }
.belief { position: sticky; bottom: 0; z-index: 1; display: grid; place-items: center; box-sizing: border-box;
  height: 92vh; min-height: 480px; padding: 0 32px; }
.belief__in { max-width: 1000px; text-align: center; }
.belief__mark { display: block; height: .42em; margin-bottom: 22px; font: 400 clamp(64px, 7vw, 112px)/1 "Instrument Serif", Georgia, serif; color: var(--ink-2); opacity: calc(var(--shown, 0) * .6); }
.belief__quote { margin: 0; font: italic 400 clamp(36px, 4.9vw, 74px)/1.12 "Instrument Serif", Georgia, serif; letter-spacing: -.005em; color: var(--ink-2); }
.belief__w { opacity: calc(.14 + .86 * var(--lit, 0)); }
.belief__w.is-key { color: var(--ink); }
.belief__by { max-width: 560px; margin: 36px auto 0; font: 400 16px/1.6 var(--font-body); color: var(--ink-2);
  opacity: calc(var(--shown, 0) * 1.6 - .6); transform: translateY(calc((1 - var(--shown, 0)) * 14px)); }
.belief.is-lit .belief__w { --lit: 1; }
.belief.is-lit { --shown: 1; }
@media (max-width: 700px) { .belief { height: 78vh; padding: 0 22px; } .belief__by { font-size: 15px; } }
