/* The house look: fonts, color tokens, type, grain, the header and sigil avatars. */

/* Starheart house type: Roboto Condensed is the slam (his Word Becomes World face), Cormorant Garamond
   italic is the turn ("and thank you for"), Roboto Serif carries the reading, Roboto Mono keeps the score. */
@font-face {
  font-family: "Roboto Condensed";
  src: url("/assets/fonts/roboto-condensed.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Roboto Condensed";
  src: url("/assets/fonts/roboto-condensed-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("/assets/fonts/cormorant-garamond-italic.woff2") format("woff2");
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Roboto Serif";
  src: url("/assets/fonts/roboto-serif.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Roboto Mono";
  src: url("/assets/fonts/roboto-mono.woff2") format("woff2");
  font-weight: 100 700;
  font-display: swap;
}

/* hidden always wins, even over a class that sets display */
[hidden] {
  display: none !important;
}

:root {
  color-scheme: dark;
  --ink: #07060a;
  --ink-2: #0e0c13;
  --ink-3: #16131d;
  --ink-4: #211d2a;
  --ink-5: #2c2737;
  --line: rgba(244, 241, 234, 0.08);
  --line-2: rgba(244, 241, 234, 0.15);
  --line-3: rgba(244, 241, 234, 0.28);
  --bone: #f4f1ea;
  --bone-2: #d9d5cc;
  --mute: #9b97a7;
  --dim: #6a6676;
  --acid: #d2ff1f;
  --acid-2: #b9e60c;
  --acid-ink: #0b0f00;
  --acid-glow: rgba(210, 255, 31, 0.32);
  --hot: #ff3d7f;
  --hot-glow: rgba(255, 61, 127, 0.3);
  --gold: #ffd25a;
  --gold-glow: rgba(255, 210, 90, 0.3);
  --ice: #8fd8ff;
  --danger: #ff5a4f;
  --display: "Roboto Condensed", "Arial Narrow", sans-serif;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --read: "Roboto Serif", Georgia, serif;
  --mono: "Roboto Mono", ui-monospace, Menlo, monospace;
  /* corners: cut, not melted. tight radii read as tailoring; pills read as a toy. */
  --r-1: 2px;
  --r-2: 4px;
  --r-3: 7px;
  --radius: var(--r-3);
  --radius-small: var(--r-2);
  --gutter: clamp(16px, 4vw, 40px);
  --measure: 1180px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --top-height: 64px;
  --dock-height: 0px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--top-height) + 16px);
  background: var(--ink);
}

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(255, 61, 127, 0.09), transparent 60%),
    radial-gradient(900px 700px at -10% 30%, rgba(210, 255, 31, 0.05), transparent 60%), var(--ink);
  color: var(--bone);
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.5;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  padding-bottom: calc(var(--dock-height) + var(--safe-bottom));
}

/* Film grain: the paper tooth, zero JavaScript. */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  pointer-events: none;
  z-index: 90;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}

@keyframes grain {
  0% {
    transform: translate(0, 0);
  }
  20% {
    transform: translate(-3%, 2%);
  }
  40% {
    transform: translate(2%, -3%);
  }
  60% {
    transform: translate(-2%, -1%);
  }
  80% {
    transform: translate(3%, 3%);
  }
  100% {
    transform: translate(0, 0);
  }
}

::selection {
  background: var(--acid);
  color: var(--acid-ink);
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
  border-radius: var(--r-1);
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 200;
  background: var(--acid);
  color: var(--acid-ink);
  padding: 10px 16px;
  border-radius: var(--r-1);
  font-weight: 700;
  text-decoration: none;
  transition: top 0.2s var(--ease-out);
}
.skip:focus {
  top: 12px;
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
}
.with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.22em;
}
.with-icon .icon {
  width: 1.05em;
  height: 1.05em;
}
.with-icon .icon-flame {
  color: var(--hot);
}

/* ---------- Header ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--top-height);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 var(--gutter);
  padding-top: env(safe-area-inset-top, 0px);
  height: calc(var(--top-height) + env(safe-area-inset-top, 0px));
  background: linear-gradient(to bottom, rgba(7, 6, 10, 0.97), rgba(7, 6, 10, 0.88));
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}

.mark {
  display: inline-flex;
  align-items: baseline;
  padding: 11px 0;
  text-decoration: none;
  white-space: nowrap;
  font-size: 22px;
  line-height: 1;
}
.mark-fy {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--acid);
}
.mark-to {
  font-family: var(--serif);
  font-weight: 500;
  font-size-adjust: 0.47;
  font-style: italic;
  font-size: 1.08em;
  color: var(--bone);
  margin-left: 1px;
}
.mark:hover .mark-fy {
  text-shadow: 0 0 22px var(--acid-glow);
}

.top-nav {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}
.top-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--r-1);
  color: var(--mute);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition:
    color 0.2s,
    background 0.2s;
}
.top-nav a:hover {
  color: var(--bone);
  background: var(--ink-3);
}
.top-nav a[aria-current="page"] {
  color: var(--bone);
}
.top-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--acid);
  box-shadow: 0 0 12px var(--acid-glow);
}

.top-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  position: relative;
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--r-1);
  border: 1px solid var(--line);
  background: var(--ink-2);
  color: var(--bone-2);
  text-decoration: none;
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s,
    transform 0.15s;
}
.icon-button:hover {
  background: var(--ink-3);
  border-color: var(--line-2);
  color: var(--bone);
}
.icon-button:active {
  transform: scale(0.94);
}
.icon-button[aria-pressed="false"] {
  color: var(--dim);
}

.bell-count {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-1);
  background: var(--hot);
  color: #fff;
  font: 700 11px/20px var(--mono);
  text-align: center;
  box-shadow:
    0 0 0 3px var(--ink),
    0 0 16px var(--hot-glow);
  animation: pop 0.5s var(--ease-spring);
}

.me-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: var(--r-1);
  border: 1px solid var(--line);
  background: var(--ink-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  max-width: 220px;
  transition:
    border-color 0.2s,
    background 0.2s;
}
.me-chip:hover {
  border-color: var(--line-2);
  background: var(--ink-3);
}
.me-chip .sigil {
  width: 34px;
  height: 34px;
  font-size: 15px;
}
.me-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Sigil avatars ---------- */

.sigil {
  --hue: 80;
  --hue-2: 320;
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.35), transparent 40%),
    conic-gradient(from 200deg, hsl(var(--hue) 95% 58%), hsl(var(--hue-2) 90% 55%), hsl(var(--hue) 95% 58%));
  color: rgba(7, 6, 10, 0.9);
  font: 800 17px/1 var(--display);
  text-transform: lowercase;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  text-decoration: none;
}
.sigil-house {
  background: radial-gradient(circle at 30% 25%, #fff6, transparent 45%), linear-gradient(135deg, #2a2633, #0e0c13);
  color: var(--acid);
  box-shadow: inset 0 0 0 1px var(--line-2);
}

/* ---------- Easter eggs ---------- */

/* gold hour (↑↑↓↓←→←→ba, or a long press on the mark): every acid light in the bar turns to gold */
:root.is-gold {
  --acid: #ffd25a;
  --acid-2: #f0bb2e;
  --acid-ink: #1a1200;
  --acid-glow: rgba(255, 210, 90, 0.4);
}
:root.is-gold body {
  transition: background 0.8s;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(255, 210, 90, 0.14), transparent 60%),
    radial-gradient(900px 700px at -10% 30%, rgba(255, 210, 90, 0.08), transparent 60%), var(--ink);
}
/* five taps on the mark: it says the other half of the toast */
.mark.is-flipped .mark-fy {
  color: var(--gold);
  text-shadow: 0 0 22px var(--gold-glow);
  animation: flip-in 0.5s var(--ease-spring);
}
@keyframes flip-in {
  from {
    transform: rotateX(90deg);
    opacity: 0;
  }
}
/* hold the glass six seconds past full */
:root.is-overcharged .pour-glow {
  background:
    radial-gradient(45% 55% at 50% 92%, rgba(255, 61, 127, 0.45), transparent 70%),
    radial-gradient(35% 45% at 80% 30%, rgba(255, 210, 90, 0.3), transparent 70%);
}
:root.is-overcharged .drip-word {
  animation: overcharge 0.09s steps(2) infinite;
}
@keyframes overcharge {
  50% {
    transform: translate(1px, -1px);
  }
}
.foot-stamp {
  cursor: default;
  -webkit-user-select: none;
  user-select: none;
}
@media (prefers-reduced-motion: reduce) {
  :root.is-overcharged .drip-word,
  .mark.is-flipped .mark-fy {
    animation: none;
  }
}
