/* facehugging.ai — dark, condensed, faintly hostile. */

/* Anton, self-hosted: the closest widely-licensed match to the heavy condensed
   face in the banner art. SIL OFL 1.1, see /fonts/OFL.txt. Self-hosted rather
   than linked so the site makes no third-party requests. */
@font-face {
  font-family: "Anton";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/anton-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Anton";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/anton-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #0a0a0b;
  --bg-panel: #101012;
  --ink: #ece7e0;
  --ink-dim: #a9a49c;
  --muted: #6f6b64;
  --accent: #d97742;
  --accent-hot: #f0904f;
  --sage: #8aa09b;
  --line: rgba(236, 231, 224, 0.11);

  /* The ship's computer: CRT green, softened to sit beside the warm palette.
     Small monospaced chrome only -- never the quips, which have to stay easy
     to read. */
  --phosphor: #93d8a4;
  --phosphor-dim: #6f9f7b;
  --glow: 0 0 6px rgba(147, 216, 164, 0.35);

  --display: "Anton", "Impact", "Haettenschweiler", "Franklin Gothic Bold",
             "Arial Narrow Bold", "Arial Narrow", "Helvetica Neue", sans-serif;
  --body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 46rem;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hot); text-decoration: underline; }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: rgba(236, 231, 224, 0.07);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  background: var(--accent);
  color: #0a0a0b;
  padding: 0.5rem 0.9rem;
  border-radius: 3px;
}

.sep { color: var(--muted); margin: 0 0.5rem; }

/* ------------------------------------------------------------- masthead */

.masthead {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  padding: clamp(3rem, 11vw, 7rem) 0 clamp(2.5rem, 7vw, 4rem);
}

.masthead-art {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.masthead-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  opacity: 0.34;
  filter: grayscale(0.35) contrast(1.05);
}

/* Keeps the wordmark legible over the photograph, and adds the faint scanline
   the banner art has. */
.masthead-scrim {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0) 0 2px,
      rgba(0, 0, 0, 0.22) 2px 3px
    ),
    radial-gradient(120% 90% at 50% 30%, rgba(10, 10, 11, 0.35), rgba(10, 10, 11, 0.93) 72%),
    linear-gradient(to bottom, rgba(10, 10, 11, 0.55), var(--bg));
}

/* Wider than the feed: the wordmark needs room the article column does not. */
.masthead-inner {
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 1.5rem;
  text-align: center;
}

.wordmark {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.75rem, 3vw, 2.5rem);
}

.wordmark .hugger {
  width: clamp(4rem, 11vw, 7.5rem);
  height: auto;
  flex: none;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.75));
}

.wordmark-text { min-width: 0; }

.masthead h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.4rem, 9.5vw, 5.6rem);
  line-height: 0.92;
  letter-spacing: 0.01em;
  margin: 0;
  text-transform: uppercase;
  /* The wordmark is one word and must never break mid-name; the clamp above
     shrinks it instead. */
  white-space: nowrap;
  /* The banner art is printed, chipped and slightly uneven; a touch of shadow
     keeps the flat web type from looking anaemic next to it. */
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5), 0 12px 40px rgba(0, 0, 0, 0.6);
}

.tagline {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(0.9rem, 2.7vw, 1.45rem);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--sage);
  margin: 0.6rem 0 0;
  /* Breaks after a full stop or not at all, so the three clauses never split
     mid-phrase the way a plain wrap does. */
  text-wrap: balance;
}

/* The wordmark arrives in pieces, after the 1979 title card: stepped, so it
   stutters rather than slides. `backwards` rather than `both`, so the clip is
   gone once it ends and the text-shadow is not left cut off. Nothing moves for
   anyone who has asked for less motion. */
@media (prefers-reduced-motion: no-preference) {
  .masthead h1 { animation: title-reveal 1.1s steps(14, jump-none) 0.15s backwards; }
  .tagline { animation: fade-up 0.7s ease-out 1.15s backwards; }
}

@keyframes title-reveal {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(0.3rem); }
}

.blurb {
  color: var(--ink-dim);
  font-size: 0.98rem;
  margin: 1.6rem auto 0;
  max-width: 30rem;
}

.blurb::before,
.blurb::after {
  content: "";
  display: block;
  width: 3.5rem;
  height: 2px;
  background: var(--accent);
  margin: 0 auto 1.4rem;
}
.blurb::after { margin: 1.4rem auto 0; opacity: 0; }

.masthead-nav {
  margin-top: 1.5rem;
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  font-family: var(--display);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.masthead-nav a { color: var(--ink-dim); }
.masthead-nav a:hover { color: var(--accent); text-decoration: none; }

/* ---------------------------------------------------------------- filters */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 2rem 0 0;
}

.tag {
  font: inherit;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--phosphor-dim);
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0.1rem 0.3rem;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}

/* Bracketed like a terminal token. The empty alternative text keeps screen
   readers from announcing the brackets; a browser without that syntax drops
   the second declaration and keeps the first. */
.tag::before { content: "["; content: "[" / ""; }
.tag::after { content: "]"; content: "]" / ""; }

.tag:hover { color: var(--phosphor); text-shadow: var(--glow); }

.tag:focus-visible { outline: 1px solid var(--phosphor); outline-offset: 2px; }

/* Reverse video, like the selected line on a menu screen. */
.tag.is-active {
  color: var(--bg);
  background: var(--phosphor);
  text-shadow: none;
}

/* ------------------------------------------------------------------- feed */

.feed { padding: 1rem 0 0; }

.post {
  position: relative;
  padding: 2.4rem 0;
  border-bottom: 1px solid var(--line);
}

.post[hidden] { display: none; }

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--phosphor-dim);
  text-shadow: var(--glow);
  margin-bottom: 0.6rem;
}

.post-meta .source { color: var(--phosphor); }

.byline { color: var(--phosphor); }

/* The entry's permalink, always visible: pushed to the far end of the meta
   line, and onto a line of its own when the column is too narrow. */
.incident {
  margin-left: auto;
  padding-left: 1rem;
  color: var(--phosphor-dim);
}

.incident:hover {
  color: var(--phosphor);
  text-decoration: none;
}

/* Pixel art must never be resampled -- browsers smooth images by default,
   which turns a 32px sprite into a blur at any other size. */
.byline-avatar,
.colophon-avatar {
  image-rendering: pixelated;
  flex: none;
}

.byline-avatar {
  width: 1.35rem;
  height: 1.35rem;
  margin-right: 0.55rem;
  border-radius: 50%;
}

.post-title {
  font-size: clamp(1.25rem, 3.6vw, 1.6rem);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.7rem;
}

.post-title a { color: var(--ink); }

.post-title a:hover {
  color: var(--accent-hot);
  text-decoration: none;
}

.post-title .ext {
  font-size: 0.72em;
  color: var(--muted);
  margin-left: 0.35em;
  vertical-align: 0.12em;
}

.post-title a:hover .ext { color: var(--accent-hot); }

/* The quip is the reason anyone is here. */
.post-quip {
  font-size: 1.12rem;
  line-height: 1.55;
  color: var(--ink-dim);
  margin: 0;
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
}

.post-note {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0.9rem 0 0;
  padding-left: 1rem;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1.1rem;
  padding-left: 1rem;
}

.post-empty .post-title { color: var(--ink); }

.no-matches {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--phosphor-dim);
  padding: 2.5rem 0;
  text-align: center;
}

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

footer {
  border-top: 1px solid var(--line);
  margin-top: 3rem;
  padding: 3rem 0 4rem;
  background: var(--bg-panel);
}

.footer-strip {
  display: block;
  width: 100%;
  max-width: 30rem;
  height: auto;
  border-radius: 3px;
  border: 1px solid var(--line);
  margin-bottom: 1.8rem;
}

.colophon {
  display: flex;
  /* Top-aligned, not centred: once the bio wraps to several lines on a narrow
     screen, centring floats the avatar away from the name it belongs to. */
  align-items: flex-start;
  gap: 1.1rem;
  margin-bottom: 1.8rem;
}

.colophon-avatar {
  width: 4.5rem;
  height: 4.5rem;
}

.colophon-name {
  font-family: var(--display);
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 0.2rem;
}

.colophon-bio {
  color: var(--ink-dim);
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0;
  max-width: 32rem;
}

.footer-note {
  color: var(--ink-dim);
  font-size: 0.95rem;
  margin: 0 0 1.2rem;
  max-width: 34rem;
}

.footer-meta {
  font-family: var(--mono);
  color: var(--phosphor-dim);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  margin: 0;
}

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

.page-404 { display: grid; place-items: center; min-height: 100vh; }
.page-404 .wrap { text-align: center; }
.page-404 img { width: 8rem; height: auto; }

.page-404 h1 {
  font-family: var(--display);
  font-size: clamp(4rem, 20vw, 9rem);
  margin: 0.5rem 0 0;
  line-height: 1;
}

/* ------------------------------------------------------------ small screens */

@media (max-width: 34rem) {
  body { font-size: 16px; }
  /* No room beside the wordmark, so the two specimens sit above it instead. */
  .wordmark { flex-wrap: wrap; gap: 0.9rem 1.5rem; }
  .wordmark .hugger { width: 3.25rem; order: -1; }
  .wordmark-text { flex-basis: 100%; }
  /* Too narrow to share the meta line, where it would wrap flush right under
     the byline; it leads instead, like a log header. */
  .incident { order: -1; flex-basis: 100%; margin: 0 0 0.25rem; padding: 0; }
  .post-quip { font-size: 1.05rem; }
}

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