/* Site color variables */
:root {
  /* Site background + palette (from the Claude Squad logo) */
  --site-bg: #000000;
  --ink: #f3ece4;
  --ink-muted: #a89a8e;
  --accent: #d9835f;
  --accent-dark: #b2633f;
  --on-accent: #120c08;
  --card-bg: #0d0a08;
  --border: #2a2420;
  --rule: rgba(243, 236, 228, 0.14);

  /* Claude's own faces are Anthropic Sans, Serif and Mono, which are not open
     licence. These are the nearest open ones, named after them so a machine
     that has the real fonts uses them. */
  --serif: 'Anthropic Serif', 'Source Serif 4', Georgia, serif;
  --sans: 'Anthropic Sans', 'Hanken Grotesk', system-ui, sans-serif;
  --mono: 'Anthropic Mono', 'JetBrains Mono', ui-monospace, monospace;
  --pixel: 'Press Start 2P', monospace;

  /* Spacing scale: tight inside a group, generous between groups */
  /* Type scale, in rem so it follows the reader's own text size. The small
     steps are for mono labels, which carry most of the terminal look. */
  --text-3xs: 0.625rem;
  --text-2xs: 0.6875rem;
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-md: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.75rem;

  --space-3xs: 4px;
  --space-2xs: 8px;
  --space-xs: 12px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 32px;
  --space-xl: 48px;
  --space-2xl: clamp(64px, 9vw, 128px);

  /* page edge: content lines up just inside the two page hairlines */
  --gutter: calc(6vw + var(--space-md));
  /* every profile picture is a square with the same frame; the small ones
     (rows, posts, today's faces) are all this size */
  --face: 40px;
  --face-frame: 2px solid var(--accent);

  /* stacking, lowest first */
  --z-scene: 1;
  --z-overlay: 2;
  --z-tooltip: 10;
  --z-chrome: 20;
}

@media (max-width: 760px) {
  :root {
    --gutter: var(--space-sm);
  }
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border-radius: 0;
}

/* components set display, which would otherwise beat the hidden attribute */
[hidden] {
  display: none !important;
}

body {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  font-family: var(--sans);
  line-height: 1.7;
  color: var(--ink);
  background-color: var(--site-bg);
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

a {
  color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* the highlighter: a block of accent that swipes in behind the words */
mark {
  background: linear-gradient(var(--accent), var(--accent)) left / 100% 100% no-repeat;
  color: var(--on-accent);
  padding: 0 0.2em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    mark {
      animation: swipe linear both;
      animation-timeline: view();
      animation-range: entry 30% entry 100%;
    }
  }
}

@keyframes swipe {
  from { background-size: 0% 100%; color: var(--ink); }
}

/* corner registration marks on a framed block */
.ticks {
  --t: var(--accent);
  background:
    linear-gradient(var(--t), var(--t)) top left / 14px 2px,
    linear-gradient(var(--t), var(--t)) top left / 2px 14px,
    linear-gradient(var(--t), var(--t)) top right / 14px 2px,
    linear-gradient(var(--t), var(--t)) top right / 2px 14px,
    linear-gradient(var(--t), var(--t)) bottom left / 14px 2px,
    linear-gradient(var(--t), var(--t)) bottom left / 2px 14px,
    linear-gradient(var(--t), var(--t)) bottom right / 14px 2px,
    linear-gradient(var(--t), var(--t)) bottom right / 2px 14px;
  background-repeat: no-repeat;
}

/* Page Layout */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* two hairlines down the full page */
.page::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-chrome);
  background:
    linear-gradient(var(--rule), var(--rule)) 6% 0 / 1px 100% no-repeat,
    linear-gradient(var(--rule), var(--rule)) 94% 0 / 1px 100% no-repeat;
  opacity: 0.5;
}

@media (max-width: 760px) {
  .page::before {
    display: none;
  }
}

/* Topbar (site-wide, under the nav): hazard stripes either side */
.topbar {
  background:
    repeating-linear-gradient(-45deg, var(--on-accent) 0 8px, transparent 8px 16px) left / 48px 100% no-repeat,
    repeating-linear-gradient(-45deg, var(--on-accent) 0 8px, transparent 8px 16px) right / 48px 100% no-repeat,
    var(--accent);
  padding: var(--space-2xs) var(--space-2xl);
}

.topbar__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-2xs) var(--space-sm);
}

.topbar__text {
  font-family: var(--mono);
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-accent);
  text-align: center;
}

.topbar__button {
  display: inline-block;
  flex-shrink: 0;
  padding: var(--space-3xs) var(--space-xs);
  background: var(--on-accent);
  color: var(--accent);
  font-family: var(--mono);
  font-size: var(--text-2xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.topbar__button:focus-visible {
  outline-color: var(--on-accent);
}

.topbar__button:hover {
  background: var(--ink);
  color: var(--on-accent);
}

/* Header */
.header {
  background-color: var(--site-bg);
  border-bottom: 1px solid var(--rule);
  /* clears the status bar when installed to the home screen */
  padding: max(var(--space-xs), env(safe-area-inset-top)) 0 var(--space-xs);
}

.header__container {
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  text-decoration: none;
}

.header__logo-img {
  height: 36px;
  width: auto;
  display: block;
}

.header__logo-text {
  font-family: var(--pixel);
  font-size: var(--text-sm);
  color: var(--accent);
}

@media (max-width: 640px) {
  .header__logo-text {
    display: none;
  }
}

/* Navigation: mono caps, brackets close in on hover and on the current page */
.nav__list {
  display: flex;
  list-style: none;
  gap: var(--space-3xs);
}

.nav__link {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-2xs);
  font-family: var(--mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}

.nav__link::before,
.nav__link::after {
  display: inline-block;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
}

.nav__link::before {
  content: '[';
  margin-right: var(--space-3xs);
  transform: translateX(-6px);
}

.nav__link::after {
  content: ']';
  margin-left: var(--space-3xs);
  transform: translateX(6px);
}

.nav__link:hover::before,
.nav__link:hover::after,
.nav__link[aria-current]::before,
.nav__link[aria-current]::after {
  opacity: 1;
  transform: none;
}

.nav__link[aria-current] {
  color: var(--accent);
}

@media (max-width: 640px) {
  .nav__link {
    padding: 0 var(--space-3xs);
    font-size: var(--text-2xs);
    letter-spacing: 0.03em;
  }

  .header__logo-img {
    height: 28px;
  }

  /* one line of topbar on a phone instead of two */
  .topbar {
    padding: var(--space-2xs) var(--space-lg);
    background-size: 20px 100%, 20px 100%, auto;
  }

  .topbar__text {
    font-size: var(--text-3xs);
  }

  .nav__link::before,
  .nav__link::after {
    display: none;
  }
}

/* the smallest phones (iPhone SE 1st gen, 320px): tighter still */
@media (max-width: 340px) {
  .nav__link {
    padding: 0 2px;
    font-size: var(--text-3xs);
    letter-spacing: 0;
  }

  .header__logo-img {
    height: 22px;
  }
}

/* Page morphs (View Transitions, Chrome and Safari; elsewhere pages just
   change). The page glides across, the title morphs into the next title,
   the nav brackets slide to the link you tapped, the header pig holds still. */
@view-transition {
  navigation: auto;
}

.header__logo-img {
  view-transition-name: pig;
}

main h1 {
  view-transition-name: page-title;
}

.nav__link[aria-current] {
  view-transition-name: nav-current;
}

::view-transition-group(page-title),
::view-transition-group(nav-current) {
  animation-duration: 0.45s;
  animation-timing-function: cubic-bezier(.2, .8, .2, 1);
}

::view-transition-old(root) {
  animation: page-out 0.32s cubic-bezier(.4, 0, 1, 1) both;
}

::view-transition-new(root) {
  animation: page-in 0.45s cubic-bezier(0, 0, .2, 1) both;
}

@keyframes page-out {
  to { opacity: 0; transform: translateX(-24px) scale(.985); }
}

@keyframes page-in {
  from { opacity: 0; transform: translateX(32px) scale(.985); }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
}

/* Main Content */
.main {
  flex: 1;
  width: 100%;
  overflow-x: hidden;
}

/* Typography */
h1,
.page-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.875rem, 5vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
}

h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 3vw, 2.125rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
  padding-bottom: var(--space-xs);
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--rule);
}

.page-subtitle {
  font-family: var(--mono);
  color: var(--ink-muted);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Hero: a giant pixel wordmark behind the 3D pig, telemetry in the corners */
.hero {
  position: relative;
  height: min(90vh, 860px);
  min-height: 600px;
  overflow: hidden;
  background: var(--site-bg);
  isolation: isolate;
}

/* CRT scanlines across the whole stage */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0 2px, rgba(0, 0, 0, 0.16) 2px 4px);
  pointer-events: none;
  z-index: var(--z-overlay);
}

.hero__title {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: clamp(4rem, 17vw, 17.5rem);
  font-weight: 400;
  line-height: 0.88;
  letter-spacing: -0.03em;
  color: rgba(243, 236, 228, 0.16);
  user-select: none;
}

.hero__title span:last-child {
  color: rgba(217, 131, 95, 0.22);
}

.hero__logo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(420px, 80vw);
  height: auto;
  transform: translate(-50%, -50%);
  z-index: var(--z-scene);
}

.hero[data-three] .hero__logo {
  display: none;
}

.hero[data-three] {
  cursor: crosshair;
}

.hero__canvas[hidden] {
  display: none;
}

.hero__canvas:focus-visible {
  outline-offset: -4px;
}

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: var(--z-scene);
}

.hero__hud {
  position: relative;
  z-index: calc(var(--z-overlay) + 1);
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr auto;
  padding: var(--space-md) var(--gutter);
  pointer-events: none;
}

.hero__hud a {
  pointer-events: auto;
}

.hero__tag {
  font-family: var(--mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.hero__meetup {
  grid-row: 3;
  align-self: end;
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
  width: min(320px, 100%);
  padding: var(--space-sm);
  background-color: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.hero__label {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero__label b {
  color: var(--on-accent);
  background: var(--accent);
  padding: 0 var(--space-3xs);
}

.hero__event {
  margin-top: var(--space-2xs);
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.3;
}

.hero__date {
  font-family: var(--mono);
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.hero__cta {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-2xs);
  padding: var(--space-2xs) var(--space-2xs);
  border: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.hero__cta + .hero__cta {
  margin-top: 0;
  border-top: 0;
}

.hero__cta:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.hero__tagline {
  grid-row: 3;
  grid-column: 2;
  align-self: end;
  justify-self: end;
  font-family: var(--pixel);
  font-size: var(--text-2xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  writing-mode: vertical-rl;
}

@media (max-width: 760px) {
  /* header and topbar take ~130px; the meetup panel has to clear the fold */
  .hero {
    height: min(calc(100svh - 130px), 680px);
    min-height: 520px;
  }

  .hero__hud {
    padding: var(--space-sm) var(--gutter) var(--space-md);
  }

  .hero__title {
    justify-content: flex-start;
    padding-top: var(--space-xl);
  }

  .hero__meetup {
    grid-column: 1 / -1;
    width: 100%;
  }

  .hero__tagline {
    display: none;
  }
}

/* sections rise in as they scroll into view, where the browser supports it */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .content,
    .gallery__item,
    .members__item {
      transform-origin: 50% 0;
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 60%;
    }
  }
}

@keyframes rise {
  from { opacity: 0; transform: perspective(900px) translateY(60px) rotateX(18deg); }
}

/* Check-in page: one framed terminal panel */
.here {
  max-width: 560px;
  margin: var(--space-xl) auto var(--space-2xl);
  padding: var(--space-lg) var(--space-md);
  border: 1px solid var(--rule);
}

.here__bar {
  display: flex;
  justify-content: space-between;
  margin: calc(-1 * var(--space-lg)) calc(-1 * var(--space-md)) var(--space-md);
  padding: var(--space-2xs) var(--space-xs);
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--mono);
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.here h2 {
  margin-top: var(--space-lg);
}

.here__status {
  min-height: 1.7em;
  margin: var(--space-xs) 0 var(--space-md);
  font-family: var(--mono);
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

.here__status::before {
  content: '> ';
  color: var(--accent);
}

.here__status::after {
  content: '_';
  color: var(--accent);
  animation: blink 1s steps(1) infinite;
}

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

.here__who {
  font-family: var(--mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

.here__btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: var(--space-sm) var(--space-sm);
  border: 0;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--mono);
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  /* a game button: sits on a darker edge and presses down into it */
  box-shadow: 0 4px 0 var(--accent-dark);
  margin-bottom: var(--space-3xs);
  transition: background 0.15s, transform 0.08s, box-shadow 0.08s;
}

.here__btn:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 0 0 var(--accent-dark);
}

.here__btn::after {
  content: '→';
}

.here__btn:hover {
  background: var(--ink);
}

/* join: two fields and a button, nothing else */
.here__join {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

#here-github + .here__join {
  margin-top: var(--space-md);
}

/* sign in with a code from another phone: below the join, split by a rule */
.here__code {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--rule);
}

.here__code-value {
  color: var(--accent);
  letter-spacing: 0.12em;
  user-select: all;
}

.here__join label {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
  font-family: var(--mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.here__join input {
  padding: var(--space-xs);
  border: 1px solid var(--rule);
  background: var(--site-bg);
  color: var(--ink);
  font: 16px var(--sans);
  letter-spacing: 0;
  text-transform: none;
}

.here__join input:focus-visible {
  border-color: var(--accent);
  outline: none;
}

/* install: last thing in the panel, quiet until it's useful */
.here__install {
  margin-top: var(--space-xl);
  padding-top: var(--space-md);
  border-top: 1px solid var(--rule);
}

.here__install-title {
  margin-bottom: var(--space-xs);
  font-family: var(--serif);
  font-size: var(--text-xl);
}

#here-install-ios {
  color: var(--ink-muted);
}

/* the pig stage: the logo pig on a little gym floor, waiting for shakes */
.here__stage {
  position: relative;
  margin: var(--space-md) 0 var(--space-xs);
  padding: var(--space-lg) var(--space-md) var(--space-sm);
  border-bottom: 2px solid var(--accent);
  text-align: center;
}

.here__pig {
  display: inline-block;
  width: min(260px, 70%);
  transform-origin: 50% 100%;
}

.here__pig svg {
  display: block;
  width: 100%;
  fill: var(--accent);
  overflow: visible;
}

.pig__lid {
  fill: var(--accent);
  opacity: 0;
  animation: blink 4.2s steps(1) infinite;
}

@keyframes blink {
  96% { opacity: 1; }
}

/* armed: the pig bobs while it waits for you */
.here--armed .here__pig {
  animation: bob 0.9s ease-in-out infinite alternate;
}

@keyframes bob {
  to { transform: translateY(-4px); }
}

/* the bump collision: full-screen, above everything, gone in under 2s */
.collide {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-chrome) + 10);
  pointer-events: none;
  perspective: 700px;
  overflow: hidden;
}

.collide__face {
  position: absolute;
  left: 50%;
  top: 44%;
  width: 104px;
  height: 104px;
  margin: -52px 0 0 -52px;
  border: var(--face-frame);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
  background: var(--card-bg);
  object-fit: cover;
  transform-style: preserve-3d;
}

.collide__ring {
  position: absolute;
  left: 50%;
  top: 44%;
  width: 80px;
  height: 80px;
  border: 10px solid var(--accent);
  border-radius: 50%;
}

.collide__flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 44%, var(--ink), rgba(217, 131, 95, 0.5) 30%, transparent 65%);
  opacity: 0;
}

.collide__shard {
  position: absolute;
  left: 50%;
  top: 44%;
  width: 10px;
  height: 10px;
  background: var(--accent);
}

.collide__shard--ink {
  background: var(--ink);
}

.collide__label {
  position: absolute;
  left: 50%;
  top: calc(44% + 84px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2xs);
  opacity: 0;
  text-align: center;
  white-space: nowrap;
}

.collide__word {
  font-family: var(--pixel);
  font-size: clamp(1.75rem, 9vw, 2.75rem);
  color: var(--accent);
  text-shadow: 3px 3px 0 var(--accent-dark), 6px 6px 0 #4a2617;
  text-transform: uppercase;
}

.collide__names {
  font-family: var(--mono);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

/* reduced motion: the faces where they'd have landed (placed by collide.js)
   and the words, no flight */
.collide--still {
  background: rgba(0, 0, 0, 0.7);
}

.collide--still .collide__label {
  opacity: 1;
  transform: translateX(-50%);
}

/* the 3D pig: replaces the flat one where WebGL runs; drag to turn it */
.here__pig3d {
  display: block;
  width: 100%;
  cursor: grab;
}

.here__pig3d:active {
  cursor: grabbing;
}

.here--3d #here-pig {
  display: none;
}

/* asleep in 3D: pixel z's drift up off the pig */
.here--3d.here--sleeping .here__stage::after {
  content: 'z';
  position: absolute;
  right: 22%;
  top: 18%;
  font-family: var(--pixel);
  font-size: var(--text-md);
  color: var(--ink);
  animation: zzz-3d 2.4s ease-out infinite;
  pointer-events: none;
}

@keyframes zzz-3d {
  0% { opacity: 0; transform: translate(0, 8px) scale(0.8); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translate(14px, -22px) scale(1.4); }
}

.here--3d .here__stage {
  padding: 0;
}

/* idle: the pig breathes */
.here__pig svg {
  animation: breathe 3.2s ease-in-out infinite;
  transform-origin: 50% 100%;
}

@keyframes breathe {
  50% { transform: scale(1.015, 0.985); }
}

/* no meetup today: eyes shut, Zs drifting up, nothing to press */
.pig__z {
  display: none;
  fill: var(--ink);
}

.here--sleeping .pig__z {
  display: inline;
  animation: zzz 2.4s ease-out infinite;
}

.here--sleeping .pig__z--2 {
  animation-delay: 1.2s;
}

@keyframes zzz {
  from { opacity: 0; transform: translate(0, 2px); }
  30% { opacity: 1; }
  to { opacity: 0; transform: translate(3px, -4px); }
}

.here--sleeping .pig__lid {
  animation: none;
  opacity: 1;
}

.here--sleeping .here__pips,
.here--sleeping .here__btn--checkin {
  display: none;
}

.here--sleeping .here__pig svg {
  animation-duration: 5s;
}

/* checked in: happy eyes */
.here--checked-in .pig__lid {
  animation: none;
  opacity: 1;
}


.here__pips {
  display: flex;
  justify-content: center;
  gap: var(--space-2xs);
  margin-bottom: var(--space-md);
}

.here__pips i {
  width: 14px;
  height: 14px;
  border: 2px solid var(--accent);
  transition: background 0.1s, transform 0.1s;
}

.here__pips i.on {
  background: var(--accent);
  transform: scale(1.2);
}

/* a bump is out: the pig bobs fast while it waits for the match */
.here--waiting .here__pig {
  animation: bob 0.25s ease-in-out infinite alternate;
}

/* first meetup: the GitHub link, right where the celebration is */
.here__welcome {
  margin-top: var(--space-md);
  padding: var(--space-md);
  border: 2px solid var(--accent);
}

.here__welcome-title {
  margin-bottom: var(--space-sm);
  font-family: var(--serif);
  font-size: var(--text-xl);
  line-height: 1.6;
  color: var(--accent);
}

.here__btn--checkin {
  justify-content: center;
  font-family: var(--pixel);
  font-size: clamp(0.8125rem, 4vw, 1rem);
  line-height: 1.6;
  hyphens: manual;
}

.here__btn--checkin::after {
  content: none;
}

.here__btn:disabled {
  cursor: default;
}

/* while it listens for shakes, hazard tape runs along the button */
.here--armed .here__btn--checkin:disabled {
  background: repeating-linear-gradient(-45deg, var(--on-accent) 0 10px, var(--accent) 10px 20px);
  background-size: 28px 28px;
  color: var(--ink);
  text-shadow: 0 0 6px var(--on-accent), 0 0 2px var(--on-accent);
  animation: hazard 0.6s linear infinite;
}

@keyframes hazard {
  to { background-position: 28px 0; }
}

.here__link {
  background: none;
  border: 0;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.here__score {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: var(--space-md);
  padding: var(--space-sm) 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.here__points {
  font-family: var(--pixel);
  font-size: clamp(2.5rem, 12vw, 4.5rem);
  line-height: 1;
  color: var(--accent);
}

.here--checked-in .here__points {
  animation: here-pop 0.5s steps(4);
}

@keyframes here-pop {
  50% { transform: scale(1.25); }
}

.here__plus {
  position: absolute;
  left: 50%;
  top: 30%;
  font-family: var(--pixel);
  font-size: var(--text-xl);
  color: var(--ink);
  pointer-events: none;
}

.here__px {
  position: absolute;
  left: 50%;
  top: 45%;
  width: 8px;
  height: 8px;
  background: var(--accent);
  pointer-events: none;
}

/* a 5x4 pixel heart: a mask, so it takes whatever background it is given */
.here__px--heart {
  width: 15px;
  height: 12px;
  background: var(--ink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 5 4' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h2v1h1V0h2v2H4v1H3v1H2V3H1V2H0z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 5 4' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h2v1h1V0h2v2H4v1H3v1H2V3H1V2H0z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.here__board li.is-you span::after {
  content: ' (you)';
  color: var(--ink-muted);
}

.here__board li.is-you:first-child span::after {
  color: inherit;
}

.here__label {
  font-family: var(--mono);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-align: right;
}

.here__faces {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3xs);
}

.here__face,
.board__face,
.working__face {
  width: var(--face);
  height: var(--face);
  flex: none;
}

.here__face,
.board__face,
.working__face,
.collide__face,
.profile__photo,
.members__photo {
  aspect-ratio: 1;
  border: var(--face-frame);
  background: var(--card-bg);
  object-fit: cover;
}

/* no GitHub picture: the pig, framed the same, with room around it */
.here__face.is-pig,
.board__face.is-pig,
.working__face.is-pig {
  object-fit: contain;
  padding: var(--space-3xs);
}

.collide__face.is-pig {
  object-fit: contain;
  padding: var(--space-sm);
}

/* today's faces are stickers, each stuck on at its own slight angle */
.here__faces .here__face {
  transform: rotate(-5deg);
  transition: transform 0.2s;
}

.here__faces .here__face:nth-child(even) {
  transform: rotate(4deg);
}

.here__faces .here__face:nth-child(3n) {
  transform: rotate(-2deg) translateY(3px);
}

.here__faces .here__face:hover {
  transform: rotate(0) scale(1.1);
}

.here__board {
  list-style: none;
  counter-reset: rank;
  font-family: var(--mono);
  font-size: var(--text-sm);
}

.here__board li {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-2xs) 0;
  border-bottom: 1px solid var(--rule);
  counter-increment: rank;
}

.here__board li::before {
  content: counter(rank, decimal-leading-zero);
  color: var(--accent);
  font-weight: 700;
  width: 2ch;
}

.here__board li:first-child {
  background: var(--accent);
  color: var(--on-accent);
  padding-inline: var(--space-2xs);
}

.here__board li:first-child span::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 10px;
  margin-right: 6px;
  background: var(--on-accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 5' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1h1v1h1V0h1v2h1V1h1V0h1v5H0z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 5' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1h1v1h1V0h1v2h1V1h1V0h1v5H0z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.here__board li:first-child::before {
  color: var(--on-accent);
}

.here__board span {
  flex: 1;
}

/* motion debug: a quiet switch under the button, a readout pinned top left */
.here__debug {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  margin-top: var(--space-sm);
  font-family: var(--mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  cursor: pointer;
}

.here__debug input {
  accent-color: var(--accent);
}

.motion-debug {
  position: fixed;
  top: env(safe-area-inset-top, 0);
  left: 0;
  z-index: calc(var(--z-chrome) + 20);
  padding: var(--space-2xs);
  border: 1px solid var(--rule);
  background: color-mix(in srgb, var(--site-bg) 94%, transparent);
  color: var(--ink);
  font-family: var(--mono);
  font-size: var(--text-3xs);
  line-height: 1.4;
  pointer-events: none;
}

.motion-debug b {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.motion-debug pre {
  margin: var(--space-3xs) 0;
  font: inherit;
}

.motion-debug canvas {
  display: block;
  width: 200px;
  height: 56px;
}

.here__haptic {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

#here-unlocked p + p {
  margin-top: var(--space-xs);
  font-family: var(--mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

@media (max-width: 600px) {
  .here {
    margin: var(--space-md) var(--gutter) var(--space-xl);
    padding: var(--space-md) var(--space-sm);
  }

  .here__bar {
    margin: calc(-1 * var(--space-md)) calc(-1 * var(--space-sm)) var(--space-md);
  }
}

@media (prefers-reduced-motion: reduce) {
  .here--armed .here__btn--checkin:disabled,
  .here--armed .here__pig,
  .here--waiting .here__pig,
  .here__pig svg,
  .here--sleeping .pig__z,
  .pig__lid,
  .here--checked-in .here__points,
  .here__status::after {
    animation: none;
  }
}

/* Content sections: heading pinned in a narrow left column, material on the
   right, a full-width rule between sections. Stacks on phones. */
.content,
.gallery {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  column-gap: var(--space-xl);
  padding: var(--space-2xl) var(--gutter) var(--space-xl);
  border-top: 1px solid var(--rule);
}

.content > h1,
.content > h2,
.gallery > h2 {
  grid-column: 1;
  grid-row: 1 / span 20;
  align-self: start;
  position: sticky;
  top: var(--space-md);
  margin: 0;
  padding: 0;
  border: 0;
}

.content > *:not(h1, h2),
.gallery > *:not(h2) {
  grid-column: 2;
}

.content p {
  max-width: 62ch;
  font-size: var(--text-lg);
  line-height: 1.75;
  margin-bottom: var(--space-sm);
}

.content p:first-of-type {
  font-size: clamp(1.1875rem, 2.4vw, 1.5rem);
  line-height: 1.6;
  margin-bottom: var(--space-lg);
}

.content p:last-child {
  margin-bottom: 0;
}

.content ul,
.content ol {
  padding: var(--space-sm) 0;
  list-style-position: outside;
}

.content li {
  padding-left: 1em;
}

@media (max-width: 760px) {
  .content,
  .gallery {
    grid-template-columns: minmax(0, 1fr);
    padding: var(--space-xl) var(--gutter);
  }

  .content > h1,
  .content > h2,
  .gallery > h2 {
    position: static;
    grid-row: auto;
    margin-bottom: var(--space-md);
  }

  .content > *:not(h1, h2),
  .gallery > *:not(h2) {
    grid-column: 1;
  }
}

/* Homepage leaderboard: ranked rows, a bar under each that grows to its share
   of the leader's points, rows arriving one after another */
.content p.board__how {
  font-size: var(--text-base);
  color: var(--ink-muted);
  margin-bottom: var(--space-md);
}

.board__list {
  list-style: none;
  border-top: 1px solid var(--rule);
}

/* no rows yet: just the rule, with the status right under it */
.content .board__list:empty {
  padding-block: 0;
}

.content .board__list li {
  padding-left: 0;
}

.board__row {
  position: relative;
  display: grid;
  grid-template-columns: 2.5ch 40px 1fr auto;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--rule);
}

.board__rank {
  font-family: var(--mono);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--accent);
}

.board__who {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.board__name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board__detail {
  font-family: var(--mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.board__pts {
  font-family: var(--pixel);
  font-size: var(--text-xl);
  color: var(--accent);
}

.board__bar {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 3px;
  width: 0;
  background: var(--accent);
  transition: width 0.9s cubic-bezier(.2, .8, .2, 1);
}

.board--in .board__bar {
  width: var(--w);
}

.board__row.is-you .board__name::after {
  content: ' (you)';
  font-weight: 400;
  color: var(--ink-muted);
}

.board__row:first-child .board__face {
  box-shadow: 0 0 0 3px var(--ink), 0 0 0 5px var(--accent);
}

@media (prefers-reduced-motion: no-preference) {
  .board--in .board__row {
    animation: row-in 0.5s calc(var(--i) * 70ms) both cubic-bezier(.2, .8, .2, 1);
  }
}

@keyframes row-in {
  from { opacity: 0; transform: translateX(-16px); }
}

.board--still .board__bar {
  transition: none;
}

.content p.board__status:empty {
  display: none;
}

.content p.board__status {
  padding-top: var(--space-sm);
  color: var(--ink-muted);
}

.content p.board__cta {
  margin-top: var(--space-md);
  font-family: var(--mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Gallery: each cell's 1px shadow fills the 1px gap, so cells share one rule */
.gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1px;
}

.gallery__item {
  box-shadow: 0 0 0 1px var(--rule);
  overflow: hidden;
}

.gallery__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  filter: grayscale(1) contrast(1.1);
  transition: filter 0.3s;
}

.gallery__item:hover .gallery__image {
  filter: none;
}

.gallery__caption {
  padding: var(--space-2xs) var(--space-xs);
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
  font-size: var(--text-xs);
}

.gallery__event {
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.gallery__caption-text {
  color: var(--ink);
}

.gallery__date {
  font-family: var(--mono);
  color: var(--ink-muted);
  font-size: var(--text-2xs);
}

.gallery__empty {
  font-family: var(--mono);
  font-size: var(--text-sm);
  color: var(--ink-muted);
  padding: var(--space-md);
  border: 1px dashed var(--rule);
}

.gallery__empty code {
  color: var(--accent);
}

/* What are you working on: the ask, a two-field form, then the feed */
.working {
  margin-bottom: var(--space-xl);
}

.content .working__title,
.content .projects__title {
  position: static;
  margin: 0 0 var(--space-md);
  padding: 0;
  border: 0;
}

.working__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.working__form[hidden] {
  display: none;
}

.working__form textarea,
.working__form input {
  padding: var(--space-xs);
  border: 1px solid var(--rule);
  background: var(--site-bg);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
  resize: vertical;
}

.working__form textarea:focus-visible,
.working__form input:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.working__form .here__btn,
.working__login .here__btn {
  width: auto;
  align-self: flex-start;
  gap: var(--space-md);
}

.content p.working__status:empty {
  display: none;
}

.content p.working__status {
  margin: var(--space-sm) 0;
  color: var(--ink-muted);
}

.working__feed {
  list-style: none;
  margin-top: var(--space-md);
}

.working__feed:empty {
  display: none;
}

.content .working__feed li {
  padding-left: 0;
}

.working__post {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-top: 1px solid var(--rule);
}

@media (prefers-reduced-motion: no-preference) {
  .working__post:first-child {
    animation: row-in 0.4s both cubic-bezier(.2, .8, .2, 1);
  }
}

.content p.working__meta {
  margin: 0;
  font-family: var(--mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

.working__meta b {
  color: var(--ink);
}

.content p.working__text {
  margin: 2px 0 0;
  font-size: var(--text-base);
  overflow-wrap: anywhere;
}

.working__link {
  font-family: var(--mono);
  font-size: var(--text-xs);
  overflow-wrap: anywhere;
}

.working__delete {
  align-self: start;
  min-height: 44px;
  padding: 0 var(--space-2xs);
  border: 0;
  background: none;
  color: var(--ink-muted);
  font: 11px var(--mono);
  text-transform: uppercase;
  cursor: pointer;
}

.working__delete:hover {
  color: var(--accent);
}

/* Projects: one ruled row each, what it is, what help it wants, where to start */
.projects {
  border-top: 1px solid var(--rule);
}

.project {
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--rule);
}

.content > .projects h2.project__name {
  margin: 0 0 var(--space-3xs);
  padding: 0;
  border: 0;
  position: static;
}

.project__name a {
  color: var(--ink);
  text-decoration: none;
}

.project__name a:hover {
  color: var(--accent);
}

.content p.project__lead {
  font-family: var(--mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.content .project__about p {
  font-size: var(--text-base);
  margin: var(--space-xs) 0;
}

.project__help {
  list-style: none;
  margin: var(--space-xs) 0;
  padding: 0;
}

.content .project__help li {
  padding-left: var(--space-md);
  position: relative;
}

.project__help li::before {
  content: '+';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--mono);
}

.content p.project__links,
.content p.project__lead {
  margin-bottom: 0;
}

.content p.project__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-md);
  margin-top: var(--space-xs);
  font-family: var(--mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}

.projects__empty {
  padding: var(--space-lg) 0;
  color: var(--ink-muted);
}

.projects__add {
  margin-top: var(--space-lg);
}

.projects__add .here__btn {
  width: auto;
  gap: var(--space-md);
}

/* Admin: one row per meetup, a link field each */
.admin__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.admin__row {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
}

.admin__when {
  font-family: var(--mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.admin__row input {
  padding: var(--space-xs);
  border: 1px solid var(--rule);
  background: var(--site-bg);
  color: var(--ink);
  font: 16px var(--sans);
}

.admin__row input:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.admin__form .here__btn {
  width: auto;
  align-self: flex-start;
  gap: var(--space-md);
}

.admin__json {
  max-height: 240px;
  overflow: auto;
  padding: var(--space-sm);
  border: 1px solid var(--rule);
  font: 12px/1.5 var(--mono);
  white-space: pre;
}

/* Profile pages */
.profile {
  max-width: 560px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-sm);
}

.profile__photo {
  width: 180px;
  height: 180px;
  margin: 0 0 var(--space-md);
  display: block;
}

.profile__name {
  margin-bottom: var(--space-2xs);
}

.profile__role {
  margin-bottom: var(--space-md);
}

.profile__role::before {
  content: '[ ';
  color: var(--accent);
}

.profile__role::after {
  content: ' ]';
  color: var(--accent);
}

.profile__bio {
  color: var(--ink);
  padding-top: var(--space-md);
  border-top: 1px solid var(--rule);
}

/* Members index: ruled grid. Photos stay in colour like every other face, so
   the accent frame reads the same everywhere (a grayscale filter would gray it). */
.members__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1px;
}

.members__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
  padding: var(--space-xs);
  box-shadow: 0 0 0 1px var(--rule);
  text-decoration: none;
  transition: background 0.15s;
}

.members__item:hover {
  background: var(--accent);
}

.members__photo {
  width: 100%;
  margin-bottom: var(--space-2xs);
}

/* no photo yet: the same hatched square on the index and the profile page */
.members__photo--placeholder,
.profile__photo--placeholder {
  background:
    repeating-linear-gradient(-45deg, var(--border) 0 1px, transparent 1px 10px),
    var(--card-bg);
}

.members__name {
  font-weight: 600;
  color: var(--ink);
}

.members__role {
  font-family: var(--mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.members__item:hover .members__name,
.members__item:hover .members__role {
  color: var(--on-accent);
}

/* Footer: the tagline set edge to edge */
.footer {
  background-color: var(--site-bg);
  /* clears the home bar on iPhones */
  padding: var(--space-xl) 0 max(var(--space-sm), env(safe-area-inset-bottom));
  border-top: 1px solid var(--rule);
  overflow: hidden;
}

.footer__mark {
  /* extruded: a stack of darker copies behind, like a voxel slab */
  text-shadow:
    1px 1px 0 var(--accent-dark), 2px 2px 0 var(--accent-dark), 3px 3px 0 var(--accent-dark),
    4px 4px 0 #7a3f26, 5px 5px 0 #7a3f26, 6px 6px 0 #4a2617, 7px 7px 0 #4a2617,
    8px 8px 12px rgba(0, 0, 0, 0.6);
  transform: perspective(700px) rotateX(var(--tilt-x, 14deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform 0.4s cubic-bezier(.2, .8, .2, 1);
  font-family: var(--pixel);
  font-size: 5vw;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
  color: var(--accent);
  text-transform: uppercase;
}

.footer__meta {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-md);
  padding: var(--space-xs) var(--gutter) 0;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: var(--text-2xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ============================================================
   Calendar Page: grid/day styling carried over from the
   FractalU calendar; data now comes from events.json
   ============================================================ */
.calendar {
  background: var(--site-bg);
  font-family: var(--sans);
  color: var(--ink);
  padding: var(--space-xl) var(--gutter);
  min-height: calc(100vh - 200px);
}

.calendar__header {
  margin-bottom: var(--space-lg);
  border-bottom: 1px solid var(--rule);
  padding-bottom: var(--space-sm);
}

.calendar__title {
  font-size: var(--text-2xl);
  display: block;
  margin: 0 0 6px;
  color: var(--ink);
}

.calendar__subtitle {
  display: block;
}

.calendar__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.calendar__month-block {
  background: var(--card-bg);
  border: 1px solid var(--rule);
}

.calendar__month-block--past {
  opacity: 0.4;
  filter: grayscale(1);
}

.calendar__month-header {
  padding: var(--space-2xs) var(--space-xs);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.calendar__month-name {
  font-family: var(--serif);
  font-size: var(--text-xl);
  color: var(--ink);
}

.calendar__month-year {
  font-family: var(--mono);
  font-size: var(--text-3xs);
  color: var(--ink-muted);
  letter-spacing: 0.16em;
}

.calendar__table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.calendar__table td {
  text-align: center;
  padding: 0;
  border: none;
  height: 38px;
  width: 14.28%;
  vertical-align: top;
}

.calendar__th {
  font-family: var(--mono);
  font-size: var(--text-3xs);
  letter-spacing: 0.128em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 6px 0;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.calendar__day {
  font-variant-numeric: tabular-nums;
  width: 100%;
  height: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px;
  font-size: var(--text-xs);
  color: var(--ink);
  text-decoration: none;
  cursor: default;
  transition: all 100ms;
  position: relative;
  border: 1px solid var(--card-bg);
  user-select: none;
}

.calendar__day--empty {
  border: none;
  cursor: default;
  color: transparent;
}

.calendar__day-number {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: var(--text-3xs);
  font-weight: 500;
}

.calendar__day-emoji {
  font-size: var(--text-md);
  line-height: 1;
  position: relative;
  top: 1px;
  left: 1px;
}

.calendar__day:hover:not(.calendar__day--empty) {
  border-color: var(--accent);
  z-index: var(--z-scene);
}

.calendar__day--today {
  font-weight: 700;
  outline: 1.5px solid var(--accent);
  outline-offset: -2px;
  color: var(--accent);
}

/* Event days (from events.json) */
.calendar__day--event {
  cursor: pointer;
  position: relative;
  font-weight: 600;
  color: #1a1410;
}

.calendar__day--event::after {
  content: attr(data-event-name);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--ink);
  color: #1a1410;
  padding: var(--space-2xs) var(--space-xs);
  font-size: var(--text-2xs);
  width: max-content;
  max-width: min(220px, 60vw);
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  margin-bottom: 5px;
  z-index: var(--z-tooltip);
  font-family: var(--sans);
}

.calendar__day--event::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  margin-bottom: -5px;
  z-index: var(--z-tooltip);
}

.calendar__day--event:hover::after,
.calendar__day--event:hover::before,
.calendar__day--event:focus-visible::after,
.calendar__day--event:focus-visible::before {
  opacity: 1;
}

.calendar__event-tooltip-click {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--ink);
  color: #1a1410;
  padding: var(--space-2xs) var(--space-xs);
  font-size: var(--text-2xs);
  width: max-content;
  max-width: min(220px, 60vw);
  white-space: normal;
  margin-bottom: 5px;
  z-index: var(--z-tooltip);
  font-family: var(--mono);
  pointer-events: none;
}

/* edge columns: pin the tooltip to the day's own edge so it stays on screen */
.calendar__table td:nth-child(-n+2) .calendar__day--event::after,
.calendar__table td:nth-child(-n+2) .calendar__event-tooltip-click {
  left: 0;
  transform: none;
}

.calendar__table td:nth-child(n+6) .calendar__day--event::after,
.calendar__table td:nth-child(n+6) .calendar__event-tooltip-click {
  left: auto;
  right: 0;
  transform: none;
}

.calendar__event-tooltip-click::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--ink);
}

@media (max-width: 960px) {
  .calendar__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .calendar {
    padding: var(--space-md) var(--gutter);
  }

  .calendar__month-block--past {
    display: none;
  }

  .calendar__title {
    font-size: var(--text-xl);
  }
}

/* Fingers: every control is at least 44px to tap. Where growing the box
   would push the layout around, an invisible ::after grows the hit area. */
@media (pointer: coarse) {
  .hero__cta {
    min-height: 44px;
    align-items: center;
  }

  .calendar__day {
    height: 44px;
  }

  /* above the hero canvas, which would otherwise take the bottom of the
     WhatsApp button's tap area */
  .topbar {
    position: relative;
    z-index: var(--z-overlay);
  }

  .topbar__button,
  .header__brand,
  .project__name a {
    position: relative;
  }

  .topbar__button::after,
  .header__brand::after,
  .project__name a::after {
    content: '';
    position: absolute;
    inset: -11px -4px;
  }
}

/* A phone on its side: the hero fits under the header and topbar (112px
   there) so the next meetup is on screen without scrolling. After the
   phone-width rules so it wins over them. */
@media (orientation: landscape) and (max-height: 500px) {
  .hero {
    height: calc(100svh - 112px);
    min-height: 260px;
  }
}
