/* hose — static site styles
   Palette, type and one line-drawing vocabulary: hairline axis + event marks.
   Vermilion is reserved for the present moment (live dot, cursor, restart). */

:root {
  --paper:  #F5F7F7;
  --cell:   #FFFFFF;
  --ink:    #0C1416;
  --muted:  #5A6A6E;
  --rule:   #DCE2E2;
  --accent: #146C60;
  --live:   #E04A20;

  /* the stream panel is the one dark surface on the page */
  --term-bg:     #0C1416;
  --term-chrome: #131F21;
  --term-rule:   #22302F;
  --term-fg:     #DCE6E5;
  --term-dim:    #6B7F82;
  --term-accent: #5FD3C0;
  --term-live:   #FF7A4D;

  --mono-display: "Martian Mono", ui-monospace, SFMono-Regular, monospace;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --shell: 1120px;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --section: clamp(3.5rem, 8vw, 6.5rem);

  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, p { margin: 0; }

a { color: inherit; }

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

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 0.6rem 1rem;
  z-index: 10;
}
.skip:focus { left: 0; }

/* ---------- shared atoms ---------- */

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- top bar ---------- */

.topbar {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
}

.brand__mark {
  width: 30px;
  height: 16px;
  overflow: visible;
  fill: none;
  stroke-linecap: butt;
  stroke-width: 1.6;
}
.brand__ticks { stroke: var(--accent); }
.brand__live  { stroke: var(--live); }

.brand__name {
  font-family: var(--mono-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.05em;
}

.topbar__tag {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
}

/* ---------- hero ---------- */

.hero {
  padding-top: clamp(3rem, 7vw, 5.5rem);
  padding-bottom: clamp(1.75rem, 4vw, 2.75rem);
  max-width: calc(var(--shell));
}

.hero__title {
  font-family: var(--mono-display);
  font-weight: 600;
  font-size: clamp(1.72rem, 0.72rem + 3.5vw, 3.35rem);
  line-height: 1.16;
  letter-spacing: -0.062em;
  max-width: 19ch;
  margin-top: 1.1rem;
  text-wrap: balance;
}

.hero__lead {
  margin-top: 1.5rem;
  max-width: 56ch;
  font-size: clamp(1.02rem, 0.96rem + 0.3vw, 1.19rem);
  line-height: 1.66;
  color: var(--muted);
}

/* ---------- signature: the live stream panel ---------- */

.stream-wrap { padding-bottom: var(--section); }

.term {
  margin: 0;
  background: var(--term-bg);
  border: 1px solid var(--term-bg);
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(12, 20, 22, 0.06), 0 14px 34px -18px rgba(12, 20, 22, 0.35);
}

.term__bar {
  display: flex;
  align-items: baseline;
  gap: 0.5rem 1.35rem;
  flex-wrap: wrap;
  padding: 0.6rem 1rem;
  background: var(--term-chrome);
  border-bottom: 1px solid var(--term-rule);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  color: var(--term-dim);
}

.term__target { color: var(--term-accent); }
.term__clock { font-variant-numeric: tabular-nums; }
.term__count { font-variant-numeric: tabular-nums; }

.term__live {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  margin-left: auto;
  color: var(--term-live);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.term__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--term-live);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%      { opacity: 0.3; transform: scale(0.72); }
}

.term__body {
  font-family: var(--mono);
  font-size: 0.775rem;
  line-height: 1.85;
  height: calc(12 * 1.85em);
  padding: 0.55rem 1rem 0.7rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  color: var(--term-fg);
  /* the oldest lines recede off the top */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 18%, #000 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 18%, #000 100%);
}

/* the prompt cursor, always at the foot of the stream */
.term__body::after {
  content: "";
  flex: none;
  width: 0.55em;
  height: 1.1em;
  margin-top: 0.28em;
  background: var(--term-live);
  animation: caret 1.15s steps(1, end) infinite;
}

@keyframes caret {
  0%, 55%   { opacity: 1; }
  56%, 100% { opacity: 0; }
}

.ln {
  flex: none;
  display: flex;
  gap: 1ch;
  white-space: nowrap;
  overflow: hidden;
  animation: land 0.28s ease-out both;
}

@keyframes land {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

/* lines present on first paint arrive without the entrance */
.ln--seed { animation: none; }

.ln__t   { flex: none; width: 8ch; color: var(--term-dim); font-variant-numeric: tabular-nums; }
.ln__op  { flex: none; width: 6ch; }
.ln__tbl { flex: none; width: 9ch; color: var(--term-fg); }
.ln__key { flex: none; width: 8ch; color: var(--term-dim); }

.ln__op--insert { color: var(--term-accent); }
.ln__op--update { color: var(--term-live); }

.ln__v {
  flex: 1 1 auto;
  min-width: 0;
  color: #A9BCBB;
  overflow: hidden;
  text-overflow: ellipsis;
}

.term__cap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 1.5rem;
  padding: 0.7rem 1rem 0.75rem;
  border-top: 1px solid var(--term-rule);
  font-family: var(--mono);
  font-size: 0.71rem;
  line-height: 1.5;
  color: var(--term-dim);
}

.term__cap-note { color: #4E6265; }

/* ---------- the problem ---------- */

.problem { padding-bottom: var(--section); }

.problem__title {
  margin-top: 1rem;
  max-width: 34ch;
  font-family: var(--mono-display);
  font-weight: 600;
  font-size: clamp(1.22rem, 0.9rem + 1.3vw, 1.72rem);
  line-height: 1.28;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.problem__body {
  margin-top: 1.15rem;
  max-width: 58ch;
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.1rem);
  line-height: 1.66;
  color: var(--muted);
}

/* ---------- properties ---------- */

.props { padding-bottom: var(--section); }

.props__eyebrow {
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--rule);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(272px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-top: 0;
  border-radius: 0 0 4px 4px;
  overflow: hidden;
}

.cell {
  background: var(--cell);
  padding: clamp(1.4rem, 2.6vw, 2rem);
  display: flex;
  flex-direction: column;
  transition: background 0.2s ease;
}
.cell:hover { background: #FBFCFC; }

.fig {
  width: 100%;
  max-width: 200px;
  margin-bottom: 1.35rem;
}
.fig svg { display: block; width: 100%; height: auto; overflow: visible; }

.fig__axis { stroke: var(--rule); stroke-width: 1; fill: none; }
.fig__hair { stroke: var(--rule); stroke-width: 1; fill: none; }
.fig__lanes path { stroke: var(--rule); stroke-width: 1; fill: none; }
.fig__seeds circle { fill: var(--accent); opacity: 0.5; }
.fig__ticks path { stroke: var(--accent); stroke-width: 1.4; fill: none; opacity: 0.72; }
.fig__fan path { stroke: var(--accent); stroke-width: 1.2; fill: none; opacity: 0.8; }
.fig__graph path { stroke: var(--accent); stroke-width: 1.2; fill: none; opacity: 0.55; }
.fig__graph circle { fill: var(--accent); opacity: 0.86; }
.fig__cursor { stroke: var(--live); stroke-width: 1.5; fill: none; }
.fig__dot { fill: var(--live); }
.fig__break { stroke: var(--live); stroke-width: 1.5; fill: none; stroke-dasharray: 3 3.5; }

.fig__label text {
  font-family: var(--mono);
  font-size: 10px;
  fill: var(--muted);
}

.cell__title {
  font-family: var(--mono-display);
  font-weight: 600;
  font-size: 0.94rem;
  letter-spacing: -0.045em;
  line-height: 1.3;
}

.cell__body {
  margin-top: 0.7rem;
  font-size: 0.97rem;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- closer ---------- */

.closer {
  padding-bottom: clamp(2.75rem, 5vw, 4.25rem);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.1rem 2rem;
}

.closer__text {
  max-width: 58ch;
  font-size: clamp(1.05rem, 1rem + 0.25vw, 1.2rem);
  line-height: 1.6;
  color: var(--ink);
}

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

.foot {
  border-top: 1px solid var(--rule);
}

.foot__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem 1.5rem;
  padding-block: 1.5rem 2rem;
}

.foot__brand {
  font-family: var(--mono-display);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: -0.05em;
}

.foot__meta {
  font-family: var(--mono);
  font-size: 0.71rem;
  color: var(--muted);
}

/* ---------- entrance ---------- */

.reveal {
  animation: rise 0.7s cubic-bezier(0.22, 0.68, 0.32, 1) both;
  animation-delay: calc(var(--d) * 90ms);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- narrow screens ---------- */

@media (max-width: 760px) {
  .term__bar { font-size: 0.67rem; gap: 0.35rem 1rem; }
  .term__live { margin-left: 0; }
  .term__body { font-size: 0.7rem; }
  .term__cap {
    font-size: 0.66rem;
    flex-direction: column;
    gap: 0.3rem;
  }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .topbar__tag { display: none; }
  .hero__title { max-width: 100%; }
  /* the key column is the first thing to go when space runs out */
  .ln__key { display: none; }
  .ln { gap: 0.8ch; }
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .term__dot, .ln { animation: none; }
  .term__body::after { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
