/* BrainFriends Studio. One stylesheet, no fonts or scripts from anywhere else. */

:root {
  color-scheme: dark;
  --bg: #040506;          /* the logo's own black */
  --text: #edebe7;
  --muted: #a3a1a8;
  --faint: #7f7d86;
  --line: #1f2024;
  --pink: #f3b9cc;
  --blue: #a9bdf3;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --gutter: clamp(1.25rem, 0.6rem + 3vw, 3rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4, p, ul, ol { margin: 0; }

a { color: inherit; text-decoration-color: var(--faint); text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--pink); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; border-radius: 2px; }

.skip {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--text); color: var(--bg);
  padding: 0.6rem 1rem; border-radius: 4px; text-decoration: none; z-index: 10;
}
.skip:focus { top: 1rem; }

/* The two-tone word, pink half and blue half, like the two brains. */
.duo .a { color: var(--pink); }
.duo .b { color: var(--blue); }

/* ---------- small header on inner pages ---------- */

.top {
  padding: 1.25rem var(--gutter) 0;
}
.home-link {
  display: inline-flex; align-items: center; gap: 0.6rem;
  min-height: 44px;
  font-size: 0.875rem; letter-spacing: 0.01em; color: var(--muted);
  text-decoration: none;
}
.home-link img { width: 30px; height: 30px; border-radius: 50%; }
.home-link:hover { color: var(--text); }

/* ---------- footer ---------- */

.foot {
  margin-top: auto;
  padding: 2.5rem var(--gutter) 2rem;
  font-size: 0.8125rem; color: var(--faint);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem;
}
.foot a { color: var(--muted); }

/* ---------- home ---------- */

.home-main {
  flex: 1;
  width: 100%;
  max-width: 36rem;
  margin: 0 auto;
  padding: clamp(2rem, 8vh, 6rem) var(--gutter) 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
/* The picture carries its own glow, so pull it left by the glow's width to line the brains up
   with the text below. */
.home-main .logo {
  width: clamp(8.5rem, 6rem + 6vw, 11rem);
  margin: 0 0 0.75rem calc(clamp(8.5rem, 6rem + 6vw, 11rem) * -0.11);
}

.intro h1 {
  font-size: clamp(2rem, 1.3rem + 3vw, 3.4rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.intro .line {
  margin-top: 0.9rem;
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.35rem);
  color: var(--text);
}
.intro .bffs {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.intro .bffs .duo { font-weight: 650; letter-spacing: 0.02em; }

.games { margin-top: clamp(2.5rem, 7vh, 4.5rem); }
.label {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 400;
}
.index { list-style: none; padding: 0; margin-top: 0.6rem; border-top: 1px solid var(--line); }
.index li { border-bottom: 1px solid var(--line); }
.index a {
  display: flex; align-items: baseline; gap: 1rem;
  padding: 0.95rem 0.1rem;
  text-decoration: none;
}
.index .name { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em; }
.index .status { margin-left: auto; font-size: 0.875rem; color: var(--muted); }
.index .arrow { color: var(--faint); transition: transform 0.2s ease, color 0.2s ease; }
.index a:hover .arrow, .index a:focus-visible .arrow { color: var(--pink); transform: translateX(3px); }

/* ---------- Memdoku ---------- */

.game {
  flex: 1;
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  padding: clamp(2.5rem, 10vh, 6rem) var(--gutter) 0;
}
.game h1 {
  font-size: clamp(2.6rem, 1.6rem + 5vw, 4.75rem);
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1;
}
.game .lead { margin-top: 1rem; font-size: clamp(1.15rem, 1rem + 0.6vw, 1.4rem); }
.game .soon { margin-top: 0.4rem; color: var(--muted); }

/* One sudoku box. Some numbers are showing; the others are the ones you have to remember. */
.box {
  margin: clamp(2.5rem, 7vh, 4rem) 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(100%, 15rem);
  border: 2px solid #3a3b42;
  border-radius: 6px;
  overflow: hidden;
}
.box span {
  aspect-ratio: 1;
  display: grid; place-items: center;
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  border-right: 1px solid #26272c;
  border-bottom: 1px solid #26272c;
  color: var(--text);
}
.box span:nth-child(3n) { border-right: 0; }
.box span:nth-child(n+7) { border-bottom: 0; }
.box .p { color: var(--pink); }
.box .b { color: var(--blue); }
.box .gone { font-size: 0; }
.box .gone::after {
  content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%;
  background: #2c2d33;
}

.links { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.links li { border-bottom: 1px solid var(--line); }
.links a { display: flex; justify-content: space-between; padding: 0.9rem 0.1rem; text-decoration: none; }
.links a span { color: var(--faint); }
.links a:hover span { color: var(--pink); }

/* ---------- privacy policy ---------- */

.doc {
  flex: 1;
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  padding: clamp(2rem, 6vh, 4rem) var(--gutter) 0;
}
.doc .crumb { font-size: 0.875rem; color: var(--muted); }
.doc .crumb a { color: var(--muted); }
.doc h1 { margin-top: 0.4rem; font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem); font-weight: 650; letter-spacing: -0.03em; line-height: 1.1; }
.doc h2 { margin-top: 2.75rem; font-size: 1.35rem; font-weight: 650; letter-spacing: -0.015em; line-height: 1.25; }
.doc h3 { margin-top: 1.9rem; font-size: 1.08rem; font-weight: 650; }
.doc h4 { margin-top: 1.4rem; font-size: 1rem; font-weight: 650; color: var(--muted); }
.doc p, .doc ul, .doc ol { margin-top: 0.85rem; color: #d6d4cf; }
.doc ul, .doc ol { padding-left: 1.3rem; }
.doc li + li { margin-top: 0.35rem; }
.doc strong { color: var(--text); font-weight: 650; }
.doc code { font-family: var(--mono); font-size: 0.86em; color: var(--blue); overflow-wrap: anywhere; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0 0; }
.doc a { overflow-wrap: anywhere; }

.draft {
  margin-top: 1.5rem;
  padding: 1rem 1.15rem;
  border: 1px solid #5a4630;
  border-left: 3px solid #e2a15c;
  border-radius: 4px;
  background: #15110c;
  color: #f1dcc0;
  font-size: 0.95rem;
}
.draft strong { color: #ffe7c7; }
.doc mark {
  background: #3a2a14;
  color: #ffd7a3;
  padding: 0 0.25em;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.86em;
}

/* ---------- 404 ---------- */

.lost {
  flex: 1;
  display: grid; place-content: center; justify-items: center; text-align: center;
  padding: 3rem var(--gutter) 0;
  gap: 1rem;
}
.lost img { width: 7rem; opacity: 0.9; }
.lost h1 { font-size: 1.6rem; font-weight: 650; letter-spacing: -0.02em; }
.lost p { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
