/* abehoffman.com — black characters on white paper, and nothing else. */

:root {
  color-scheme: light;

  --paper: #fcfcfa;
  --ink: #0b0b0c;
  --mid: #7d7d78;
  --faint: #c9c9c2;
  --rule: #e4e4dd;

  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco, "Cascadia Mono",
    "Roboto Mono", Consolas, "Liberation Mono", monospace;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  font-variant-ligatures: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: #dfe7ff;
}

/* ---- the art ------------------------------------------------------------- */

#screen {
  margin: 0;
  font-family: inherit;
  font-size: 12px;
  /* overwritten in JS with the font's advance width, to make cells square */
  line-height: 0.6;
  letter-spacing: 0;
  white-space: pre;
  color: var(--ink);
  contain: content;
  will-change: contents;
  animation: film-weave 8.7s steps(1, end) infinite;
}

/* Analog movement stays in the dots. No vignette or tinted overlay: the
   empty space must be the website's own paper, without a rectangular panel. */
@keyframes film-weave {
  0%, 100% { transform: translate(0, 0); }
  18% { transform: translate(0.16px, -0.12px); }
  43% { transform: translate(-0.12px, 0.1px); }
  69% { transform: translate(0.08px, 0.16px); }
  86% { transform: translate(-0.1px, -0.06px); }
}

/* the halftone carries every tone; these exist only for the rare accent */
.q1 { color: var(--faint); }
.q2 { color: var(--mid); }
.q3 { color: var(--ink); }

/* ---- overlay chrome ------------------------------------------------------ */

h1 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.caret {
  font-weight: 400;
  animation: blink 1.15s steps(1) infinite;
}

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

.meta {
  margin: 0;
  font-size: 12px;
  color: var(--mid);
}

.masthead i,
.meta i {
  font-style: normal;
  color: var(--faint);
  padding: 0 0.55em;
}

.tnum {
  font-variant-numeric: tabular-nums;
}

.tabs {
  display: flex;
  gap: 1.15rem;
  font-size: 11px;
}

.tab {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--faint);
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: color 0.18s;
}

.tab:hover {
  color: var(--mid);
}

.tab[aria-current="true"] {
  color: var(--ink);
}

.tab[aria-current="true"]::before {
  content: "▸";
  margin-right: 0.35em;
}

/* ---- the page ------------------------------------------------------------ */

main {
  background: var(--paper);
}

/* The masthead is just the top of the page now — the art lives down in the
   hobbies section, where it illustrates something rather than announcing it. */
.masthead {
  width: min(660px, 100% - clamp(2.2rem, 7vw, 5.2rem));
  margin: clamp(2.4rem, 6vw, 4rem) auto 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 1.5rem;
}

/* A quiet band inside the column. No border and no background: a frame around
   it is exactly what makes it shout. */
.stage {
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  /* Matched to the footage the surf scene is screened from — a 3:1 band
     slices straight through a square-composed shot. */
  height: clamp(210px, 34vw, 340px);
  margin: 0.9rem 0 0.6rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.sheet {
  padding: clamp(1.8rem, 5vw, 3rem) 0 3rem;
}

.sheet > * {
  width: min(660px, 100% - clamp(2.2rem, 7vw, 5.2rem));
  margin-inline: auto;
}

section {
  margin-bottom: 2.4rem;
}

.entry {
  margin: 0 0 1.35rem;
}

.entry-head {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
}

.entry-head .k {
  white-space: nowrap;
}

.entry-head .lead {
  flex: 1 1 auto;
  min-width: 1.5rem;
  border-bottom: 1px dotted var(--faint);
  transform: translateY(-0.28em);
}

.entry-head .v {
  color: var(--mid);
  white-space: nowrap;
}

.entry:hover .lead {
  border-bottom-color: var(--ink);
}

.role {
  margin: 0.1rem 0 0.3rem;
  color: var(--mid);
}

.notes {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 66ch;
}

.notes li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: 0.28rem;
  color: var(--mid);
}

.notes li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--faint);
}

.tags {
  color: var(--mid);
  max-width: none;
}

.tags i {
  font-style: normal;
  color: var(--faint);
  padding: 0 0.35em;
}

strong {
  font-weight: 600;
}

h2 {
  margin: 0 0 0.7rem;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--mid);
}

h2::before {
  content: "#";
  color: var(--faint);
  margin-right: 0.6em;
}

p {
  margin: 0 0 0.7rem;
  max-width: 62ch;
}

code {
  font: inherit;
  color: var(--mid);
}

.rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rows li {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  padding: 0.14rem 0;
}

.rows .k {
  white-space: nowrap;
}

.rows .lead {
  flex: 1 1 auto;
  min-width: 1.5rem;
  border-bottom: 1px dotted var(--faint);
  transform: translateY(-0.28em);
}

.rows .v {
  color: var(--mid);
  text-align: right;
}

.rows li:hover .lead {
  border-bottom-color: var(--ink);
}

a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--faint);
  transition: border-color 0.18s;
}

a:hover {
  border-bottom-color: var(--ink);
}

footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-top: 3rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--rule);
  font-size: 11px;
  color: var(--faint);
}

footer p {
  margin: 0;
}

.links i {
  padding: 0 0.5em;
}

footer a {
  color: var(--faint);
  border-bottom-color: transparent;
}

footer a:hover {
  color: var(--ink);
  border-bottom-color: var(--faint);
}

/* ---- a11y ---------------------------------------------------------------- */

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 5;
  background: var(--paper);
  padding: 0.5rem 0.9rem;
}

.skip:focus {
  left: 0.6rem;
  top: 0.6rem;
}

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

@media (max-width: 560px) {
  .rows li {
    flex-wrap: wrap;
  }
  .rows .lead {
    display: none;
  }
  .rows .v {
    text-align: left;
    flex-basis: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  #screen {
    animation: none;
  }
}

@media (prefers-contrast: more), (forced-colors: active) {
  #screen {
    animation: none;
  }
}
