/* horizon.css — the horizon, a first slice (round 2, AUDACIOUS.md move 1;
 * js/horizon.js). One surface whose only axis is time: now a fixed line, the
 * future above, the past below. Every colour is a base.css token or a
 * color-mix() of one; the accent is the person's (identity, never a data
 * category), the partner's strand wears the partner's own, and nothing here
 * is ever red. Sizes are the type scale's (--t-*) and the 4 px spacing
 * steps (--s-*); one time gutter at every scale (labels end at 36, the spine
 * and the now rule at 48, words start at 64). One curve for every move, 240
 * to 400 ms, and every move is a transform or an opacity. */

.hz {
  --hz-ease: var(--ease-settle);
  --hz-head: 124px;     /* js/horizon.js HEAD: the where line, the title, its line, the axis
                           (js/horizon.js watchHead lowers it under a taller header) */
  --hz-hero: calc(72 * var(--fz-xl));
  /* The time gutter's clocks ("12:40", "8:06") live in a 36 px column that
   * every scale's drawing shares (js/horizon.js GUTTER, SPINE): they keep
   * the floor's size at every text size, where a larger clock would print
   * over the spine. Each row says its own words at the reader's size. */
  --hz-clock-size: var(--t-floor);
  --hz-clock-line: 16px;
  --hz-tab-line: 28px;      /* the partner tab's height (.hz-strand-tab) */
  --hz-glass: color-mix(in srgb, var(--surface) 78%, transparent);
  --hz-glass-edge: color-mix(in srgb, var(--ink) 8%, transparent);
  position: relative;
  /* The face fills the screen and never scrolls: time is the axis, not the
   * page, and a drag moves time (js/horizon.js). The tab bar steps aside
   * here (below), so the face runs to the foot; the lens and the + keep
   * clear of the home indicator. */
  height: calc(100dvh - 6px);
  /* Never taller than the screen: at 200 % zoom (a 422 tall page) a taller
   * face would put the lens and the + under the fold, where a drag (time,
   * not the page) can never bring them (UX audit P4). */
  min-height: min(560px, calc(100dvh - 6px));
  padding-top: env(safe-area-inset-top);
  touch-action: none;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hz {
    --hz-glass: color-mix(in srgb, var(--surface-2) 72%, transparent);
    --hz-glass-edge: color-mix(in srgb, var(--ink) 7%, transparent);
  }
}
:root[data-theme="dark"] .hz {
  --hz-glass: color-mix(in srgb, var(--surface-2) 72%, transparent);
  --hz-glass-edge: color-mix(in srgb, var(--ink) 7%, transparent);
}

/* The horizon draws its own header; the page does not scroll under it. On
 * a phone the tab bar steps aside too: the lens capsule and the ring are the
 * way to every tab (js/horizon.js). A screen pushed over the horizon brings
 * both back; on wide the side rail stays (base.css). */
:root[data-active-tab="horizon"]:not([data-screen]) .top { display: none; }
:root[data-active-tab="horizon"]:not([data-screen]) .tabbar { display: none; }
:root[data-active-tab="horizon"]:not([data-screen]) body { padding-bottom: 0; }
:root[data-active-tab="horizon"]:not([data-screen]) main#view { padding-bottom: 0; }

.hz-stage { position: relative; height: 100%; }

/* ------------------------------------------------- the layers and time --
 *
 * A layer is one scale under one lens. Its parts (.hz-part) are the future
 * (.hz-fut), the present (.hz-pres) and the past (.hz-past); its scroll
 * (.hz-scroll) is moved through time by the drag, the rule with it. */

.hz-layer { position: absolute; inset: 0; overflow: hidden; }
.hz-scroll {
  position: absolute;
  inset: 0;
  /* Its own layer: a drag repaints nothing, the compositor moves it. */
  will-change: transform;
  transition: transform var(--dur-settle) var(--hz-ease);
}
.hz[data-dragging] .hz-scroll { transition: none; }
.hz-rule { pointer-events: none; }

/* A scale change: the now line stays, and the world moves around it. To a
 * coarser scale the old future and past close on the line and the new ones
 * arrive from further out; to a finer one, the reverse. Glyphs are never
 * stretched: the parts slide and cross-fade. */
.hz-layer.is-entering .hz-part { animation: hz-part-in var(--dur-settle) var(--hz-ease) both; }
.hz-layer.is-leaving { pointer-events: none; }
.hz-layer.is-leaving .hz-part { animation: hz-part-out var(--dur-move) var(--hz-ease) both; }
.hz-layer.is-entering.is-coarser .hz-fut,
.hz-layer.is-leaving.is-finer .hz-fut { --hz-dy: -56px; }
.hz-layer.is-entering.is-coarser .hz-past,
.hz-layer.is-leaving.is-finer .hz-past { --hz-dy: 56px; }
.hz-layer.is-entering.is-finer .hz-fut,
.hz-layer.is-leaving.is-coarser .hz-fut { --hz-dy: 56px; }
.hz-layer.is-entering.is-finer .hz-past,
.hz-layer.is-leaving.is-coarser .hz-past { --hz-dy: -56px; }
@keyframes hz-part-in {
  from { opacity: 0; transform: translate3d(0, var(--hz-dy, 0px), 0); }
  to { opacity: 1; transform: none; }
}
/* The old world is gone by mid-move, so two sets of words never sit on
 * top of each other for long; it keeps moving as it goes. */
@keyframes hz-part-out {
  50% { opacity: 0; }
  to { opacity: 0; transform: translate3d(0, var(--hz-dy, 0px), 0); }
}
/* The one action, handed over: the old one steps aside at once, the new
 * one glides from where it stood. */
.hz-next.is-handed { visibility: hidden; }
.hz-layer.is-entering .hz-part.is-flying { animation: none; }
.hz-next.is-flying { transition: transform var(--dur-settle) var(--hz-ease); }
/* A pinch let go short of a change: the parts settle back. */
.hz-part.is-settling { transition: transform var(--dur-move) var(--hz-ease), opacity var(--dur-move) var(--hz-ease); }
/* A lens is the same time through another glass: a cross-fade in place. */
.hz-layer.is-fading-in { animation: hz-fade var(--dur-move) var(--hz-ease) both; }
.hz-layer.is-fading-out { animation: hz-fade var(--dur-move) var(--hz-ease) reverse both; }
@keyframes hz-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* The fades: time scrolls under the header and under the capsule. Each is
 * the ground WITH the person's glow in it (base.css --ground-glow), faded by
 * a mask, so the glow runs on behind the header instead of stopping at a
 * flat band. */
.hz-fade-top {
  position: absolute;
  left: calc(-1 * var(--pad));
  right: calc(-1 * var(--pad));
  top: 0;
  height: var(--hz-head);
  z-index: 2;
  background: var(--ground-glow), var(--bg);
  -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 24px), transparent);
  mask-image: linear-gradient(to bottom, black calc(100% - 24px), transparent);
  pointer-events: none;
}
.hz-fade {
  position: absolute;
  left: calc(-1 * var(--pad));
  right: calc(-1 * var(--pad));
  bottom: 0;
  height: 152px;
  z-index: 2;
  background: var(--ground-glow), var(--bg);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 62%);
  mask-image: linear-gradient(to bottom, transparent, black 62%);
  pointer-events: none;
}

/* ------------------------------------------------------------ the head -- */

.hz-head {
  position: absolute;
  top: var(--s-3);
  left: 0;
  right: 0;
  z-index: 3;
  /* The where line, the title with the scale chip and the ring beside it,
   * the subtitle (UX audit P4). A row that wraps rather than a grid: when a
   * larger text size or a zoomed (narrow) column leaves the title no room
   * beside the chip and the ring, they step down under it, and the title
   * keeps its whole word instead of an ellipsis ("S.."). js/horizon.js
   * reads the header's height (watchHead), so time rests under it. */
  display: flex;
  flex-wrap: wrap;
  column-gap: var(--s-3);
  align-items: center;
}
.hz-head-text { display: contents; }
/* Where you are, said quietly over the title (fb_2630d911): the place by
 * the tab bar's word for it, the lens and the scale. It sits where a pushed
 * screen's back link sits, so the top-left always answers "where am I, and
 * where does back go". */
.hz-where {
  order: 0;
  flex: 1 0 100%;
  min-width: 0;
  min-height: 20px;
  font: 500 var(--t-cap-size)/calc(20 * var(--fz)) var(--font);
  /* ink-2, not ink-3: the line sits in the glow's brightest band, where
   * only ink, ink-2 and the person's ink are measured (cli/accents.py). */
  color: var(--ink-2);
}
/* With the shell's status tags ("As of 12:40", "Offline", UX audit P7) the
 * line is a row: the words give way, the tags never do. */
.hz-where.has-tags { display: flex; align-items: center; gap: var(--s-2); text-overflow: clip; }
.hz-where-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.hz-where .page-tag { flex: none; min-height: 20px; }
.hz-tags { display: contents; }
.hz-title {
  order: 1;
  flex: 1 1 auto;
  min-width: 0;
  font: var(--t-title);
  letter-spacing: -.02em;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.hz-sub {
  order: 3;
  flex: 1 0 100%;
  margin-top: var(--s-1);
  font: var(--t-sub);
  color: var(--ink-2);
  text-wrap: balance;
}
.hz-head-acts {
  order: 2;
  flex: none;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

/* The scale chip, the pinch's visible twin: it opens the three scales. */
.hz-scale {
  position: relative;
  min-height: 36px;
  padding: 0 var(--s-4) 0 var(--s-3);
  border: 0;
  border-radius: 999px;
  background: var(--quiet-bg);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font: 560 var(--t-sub-size)/1 var(--font);
  cursor: pointer;
  transition: transform var(--dur-move) var(--hz-ease);
}
.hz-scale::after { content: ""; position: absolute; inset: -4px 0; }
.hz-scale:active { transform: scale(.96); }
.hz-scale-mark { color: var(--ink-3); }
.hz-scale-menu {
  position: absolute;
  top: 64px;            /* under the chip: the where line (20) and the chip's row (44) */
  right: 44px;
  z-index: 4;
  width: 256px;
  padding: var(--s-1);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--rim), inset 0 0 0 1px var(--line), var(--lift-float);
  transform-origin: 100% 0;
  animation: hz-menu-in var(--dur-enter) var(--ease-spring) both;
}
.hz-scale-menu[hidden] { display: none; }
@keyframes hz-menu-in {
  from { opacity: 0; transform: translate3d(0, -4px, 0) scale(.96); }
  to { opacity: 1; transform: none; }
}
.hz-scale-opt {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px;
  align-items: center;
  gap: var(--s-2);
  width: 100%;
  min-height: 56px;
  padding: var(--s-2) var(--s-3);
  border: 0;
  border-radius: var(--r-field);
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.hz-scale-opt[aria-pressed="true"] { background: var(--quiet-bg); }
.hz-scale-opt-words { display: grid; gap: 2px; min-width: 0; }
.hz-scale-opt-name { font: var(--t-row); }
.hz-scale-opt-sub { font: var(--t-cap); color: var(--ink-2); }
.hz-scale-check { color: var(--accent-ink); opacity: 0; }
.hz-scale-opt[aria-pressed="true"] .hz-scale-check { opacity: 1; }
.hz-scale-tip {
  margin-top: var(--s-1);
  padding: var(--s-3) var(--s-3) var(--s-2);
  border-top: 1px solid var(--line);
  font: var(--t-cap);
  color: var(--ink-2);
}

/* The person mark: a tap opens Me, a press switches person. Under the
 * finger it sinks and its halo fills over the hold; the switch is a pop. */
.hz-me {
  position: relative;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: none;
  box-shadow: inset 0 0 0 2px var(--accent-mark);
  color: var(--accent-ink);
  font: 600 var(--t-body-size)/1 var(--font);
  cursor: pointer;
  -webkit-touch-callout: none;
  transition: transform var(--dur-move) var(--hz-ease);
}
.hz-me::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; }
.hz-me-ini { position: relative; }
.hz-me-hold {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--accent-band);
  opacity: 0;
  transform: scale(.6);
  pointer-events: none;
}
.hz-me.is-pressing { transform: scale(.92); }
.hz-me.is-pressing .hz-me-hold {
  opacity: 1;
  transform: none;
  transition: transform 350ms var(--hz-ease), opacity 350ms var(--hz-ease);
}
.hz-me.is-held .hz-me-hold { animation: hz-held 300ms var(--hz-ease) both; }
@keyframes hz-held {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: scale(1.5); }
}

/* The weight axis (season), fixed under the header over the scrolling time. */
.hz-axis-host {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 2;
  height: var(--hz-head);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-move) var(--hz-ease);
}
.hz-axis-host.is-shown { opacity: 1; }
/* Its ground, under its own numbers: the ground with the glow, masked to the
 * axis's band at the header's foot. */
.hz-axis-host::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--ground-glow), var(--bg);
  -webkit-mask-image: linear-gradient(to bottom, transparent calc(var(--hz-head) - 32px), black calc(var(--hz-head) - 24px));
  mask-image: linear-gradient(to bottom, transparent calc(var(--hz-head) - 32px), black calc(var(--hz-head) - 24px));
}

/* The partner's strand: their colour down the right edge, their initial on
 * a tab at their next moment, riding the time scroll. A tap hands the phone
 * to their view, as the switch does. */
.hz-strand {
  position: absolute;
  right: calc(-1 * var(--pad));
  top: calc(var(--hz-head) + 24px);
  bottom: 96px;
  z-index: 3;
  width: 2px;
  /* Soft at both ends: a strand of the partner's colour, never a bar. */
  background: linear-gradient(to bottom, transparent,
    color-mix(in srgb, var(--partner-mark) 36%, transparent) 16%,
    color-mix(in srgb, var(--partner-mark) 36%, transparent) 84%, transparent);
}
.hz-strand-tab {
  position: absolute;
  right: 0;
  top: 0;
  width: 12px;
  height: 28px;
  padding: 0 0 0 2px;
  border: 0;
  border-radius: 14px 0 0 14px;
  background: var(--partner-mark);
  color: var(--on-accent);
  /* A 12 px sliver: its initial keeps the floor's size and its 28 line at
   * every text size, never pushed past the screen's edge (no overflow
   * clip: that would clip its ::before, the 44 px reach). */
  font: 600 var(--hz-clock-size)/var(--hz-tab-line) var(--font);
  box-shadow: -2px 0 0 var(--bg);
  cursor: pointer;
  transform: translate3d(0, var(--strand-tab, 0px), 0);
  transform-origin: 100% 50%;
  transition: transform var(--dur-move) var(--hz-ease);
}
.hz[data-dragging] .hz-strand-tab { transition: none; }
.hz-strand-tab.is-pressing { transform: translate3d(0, var(--strand-tab, 0px), 0) scale(.88); }
.hz-strand-tab::before { content: ""; position: absolute; inset: -8px 0 -8px -32px; }

/* Back to now: a glass pill docked at the edge now left by. */
.hz-nowpill {
  position: absolute;
  left: 50%;
  top: calc(var(--hz-head) + 8px);
  z-index: 3;
  height: 32px;
  padding: 0 var(--s-4) 0 var(--s-3);
  border: 0;
  border-radius: 999px;
  background: var(--hz-glass);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: var(--rim), inset 0 0 0 1px var(--glass-ring), inset 0 0 0 1px var(--hz-glass-edge), var(--lift-float);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  gap: var(--s-1);
  font: 600 var(--t-cap-size)/1 var(--font);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(-50%, 0, 0) scale(.9);
  transition: opacity var(--dur-move) var(--hz-ease), transform var(--dur-enter) var(--ease-spring);
}
.hz-nowpill::after { content: ""; position: absolute; inset: -6px -4px; }
.hz-nowpill[data-edge="bottom"] { top: auto; bottom: calc(84px + env(safe-area-inset-bottom)); }
.hz-nowpill.is-shown { opacity: 1; pointer-events: auto; transform: translate3d(-50%, 0, 0); }
.hz-nowpill[data-edge="top"] .hz-nowpill-mark { transform: rotate(180deg); }

/* ------------------------------------------------- the lens and the + -- */

.hz-lens {
  position: absolute;
  left: 0;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 3;
  width: min(300px, calc(100% - 68px));
  height: 56px;
  padding: var(--s-1);
  border-radius: 28px;
  /* The tab bar's material (base.css .tabbar-tabs): the same glass, rim,
   * ring and soft drop, so the home's capsule and a face's are one object. */
  background: var(--hz-glass);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: var(--rim), inset 0 0 0 1px var(--glass-ring), inset 0 0 0 1px var(--hz-glass-edge), var(--lift-glass);
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr 1fr;
  /* Its words grow with the text size until the capsule is full (cqi),
   * never past it into each other, never under the floor. */
  container-type: inline-size;
}
.hz-lens-btn {
  position: relative;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: none;
  color: var(--ink-2);
  font: 560 max(var(--t-floor), min(var(--t-sub-size), 5.2cqi))/1 var(--font);
  cursor: pointer;
  transition: color var(--dur-move) var(--hz-ease);
}
/* The lens that is on: the thumb fades in under it; nothing moves. */
.hz-lens-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--thumb);
  box-shadow: var(--rim), var(--thumb-lift), inset 0 0 0 1px var(--thumb-edge);
  opacity: 0;
  transform: scale(.92);
  transition: opacity var(--dur-move) var(--hz-ease), transform var(--dur-enter) var(--ease-spring);
}
.hz-lens-btn[aria-pressed="true"] { color: var(--ink); }
.hz-lens-btn[aria-pressed="true"]::before { opacity: 1; transform: none; }
.hz-lens-word { position: relative; transition: transform var(--dur-move) var(--hz-ease); }
/* The lens that is on opens its tab on a second tap: its chevron says so,
 * and slides in beside the word without moving the capsule. */
.hz-lens-go {
  position: absolute;
  right: 2px;
  top: calc(50% - 7px);
  color: var(--ink-3);
  opacity: 0;
  transform: translate3d(-4px, 0, 0);
  transition: opacity var(--dur-move) var(--hz-ease), transform var(--dur-move) var(--hz-ease);
}
.hz-lens-btn.opens .hz-lens-word { transform: translate3d(-4px, 0, 0); }
.hz-lens-btn.opens .hz-lens-go { opacity: 1; transform: none; }
.hz-plus {
  position: absolute;
  right: 0;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 3;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: var(--hz-glass);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: var(--rim), inset 0 0 0 1px var(--glass-ring), inset 0 0 0 1px var(--hz-glass-edge), var(--lift-glass);
  /* The + is the person's: its mark in their ink, on the shared glass. */
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform var(--dur-move) var(--ease-spring);
}
.hz-plus:active { transform: scale(.9); }
/* Said once above the capsule, the first few times only. */
.hz-hint {
  position: absolute;
  left: 0;
  bottom: calc(80px + env(safe-area-inset-bottom));
  z-index: 3;
  max-width: calc(100% - 68px);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-field);
  background: var(--hz-glass);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  /* The shared glass's rim and ring, as the lens and the + beside it wear. */
  box-shadow: var(--rim), inset 0 0 0 1px var(--glass-ring), inset 0 0 0 1px var(--hz-glass-edge);
  font: var(--t-cap);
  color: var(--ink);
  opacity: 0;
  transform: translate3d(0, 4px, 0);
  transition: opacity var(--dur-move) var(--hz-ease), transform var(--dur-move) var(--hz-ease);
  pointer-events: none;
}
.hz-hint.is-shown { opacity: 1; transform: none; }
/* Reduced transparency: the horizon's glass (the now pill, the lens, the +,
 * the hint) is the opaque surface, as the hero and the tab bar are
 * (base.css): nothing translucent and nothing blurred behind it. */
@media (prefers-reduced-transparency: reduce) {
  .hz-nowpill, .hz-lens, .hz-plus, .hz-hint {
    background: var(--surface);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
/* A narrow (zoomed) column: the four lenses two by two across the whole
 * width, the + over them, so no word runs into the next (UX audit P4). */
@container face (max-width: 300px) {
  .hz-lens {
    width: auto;
    right: 0;
    height: 96px;             /* two rows of 44 in the 4 px padding */
    grid-template-columns: 1fr 1fr;
    border-radius: 24px;
  }
  .hz-lens-btn { min-height: 44px; font-size: var(--t-floor); }
  /* The season's rate steps under the trend's figure instead of printing
   * over it. */
  .hz-rate { position: static; margin-top: var(--s-3); text-align: left; }
  .hz-plus { bottom: calc(12px + 96px + var(--s-2) + env(safe-area-inset-bottom)); }
  .hz-hint { bottom: calc(12px + 96px + 56px + var(--s-4) + env(safe-area-inset-bottom)); }
}

/* The log sheet: the three likeliest logs at this hour. It opens over the
 * page, outside .hz, so it names the curve's own token. */
.hz-log { display: grid; gap: var(--s-2); }
/* Each a tile with its mark in a disc of the person's light (the morning
 * prototype's asks), so the five read as five things to do, not five rows
 * of grey. The first is the likeliest at this hour. */
.hz-log-opt {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  min-height: 64px;
  padding: var(--s-2) var(--s-4) var(--s-2) var(--s-2);
  border: 0;
  border-radius: var(--radius);
  background: var(--quiet-bg);
  box-shadow: var(--rim), inset 0 0 0 1px var(--line);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform var(--dur-move) var(--ease-spring);
}
.hz-log-opt:hover { background: var(--quiet-press); }
.hz-log-opt:active { transform: scale(.98); }
.hz-log-mark {
  justify-self: center;
  box-sizing: content-box;
  padding: var(--s-2);
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-mark) 16%, transparent);
  color: var(--accent-ink);
}
.hz-log-words { display: grid; gap: 2px; min-width: 0; }
.hz-log-title { font: var(--t-row); }
.hz-log-sub { font: var(--t-cap); color: var(--ink-2); }

/* ------------------------------------------------------------- the line -- */

.hz-now-rule {
  position: absolute;
  left: 48px;
  right: 0;
  top: calc(var(--hz-now) - .75px);
  border-top: 1.5px solid var(--accent-mark);
}
.hz-now { position: absolute; left: 0; right: 0; height: 0; z-index: 1; }
/* Now's word in the time gutter, where the clocks and the months are. */
.hz-now-label {
  position: absolute;
  left: 0;
  top: -8px;
  width: 36px;
  text-align: right;
  font: 600 var(--hz-clock-size)/var(--hz-clock-line) var(--font);
  color: var(--accent-ink);
}
/* The season's now: the trend's own point, glowing (Lumen: "today is a
 * glowing point"), a ring of the mark round a filled centre. */
.hz-now-ring {
  position: absolute;
  top: -9px;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: inset 0 0 0 2.5px var(--accent-mark),
              0 0 0 5px color-mix(in srgb, var(--accent-mark) 16%, transparent),
              0 0 22px 2px color-mix(in srgb, var(--accent-mark) 45%, transparent);
}
.hz-now-ring::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--accent-mark);
}
/* At day scale the line carries the clock and a filled dot on the spine. */
.hz-now-dot {
  position: absolute;
  left: 41.5px;
  top: -6.5px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent-mark);
  box-shadow: 0 0 0 3px var(--bg);
}

/* ------------------------------------------------- the present slot -- */

.hz-slot { position: absolute; left: 0; right: 0; }
.hz-big {
  font: 200 var(--hz-hero)/.86 var(--font);
  letter-spacing: var(--track-readout);
  color: var(--ink);
}
.hz-big .honest-unit { margin-left: var(--s-1); font: 500 var(--t-sub-size)/1 var(--font-mono); color: var(--ink-2); letter-spacing: 0; }
.hz-cap {
  margin-top: var(--s-3);
  font: var(--t-cap);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.hz-slot.is-empty .hz-cap { max-width: 26ch; }
/* No trend yet: the three fasted mornings it needs, filling. */
.hz-pips { display: flex; gap: var(--s-2); margin-top: var(--s-3); }
.hz-pips i {
  width: 28px;
  height: 4px;
  border-radius: 2px;
  background: var(--quiet-bg);
  box-shadow: inset 0 0 0 1px var(--line);
}
.hz-pips i.is-on {
  background: var(--accent-mark);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent-mark) 50%, transparent);
}
.hz-rate { position: absolute; right: 0; top: var(--s-1); text-align: right; }
.hz-rate-n {
  font: 300 var(--t-title-size)/1 var(--font);
  letter-spacing: var(--track-readout);
  color: var(--ink);
}
.hz-rate-sub {
  font: var(--t-cap);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.hz-rate-n + .hz-rate-sub { margin-top: var(--s-2); }

/* The one filled action: the rail's own item, words and pill. */
.hz-next {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--s-3);
  z-index: 1;
}
.hz-next-season { position: absolute; left: 0; right: 0; top: calc(var(--hz-now) + 124px); }
.hz-next-week { position: absolute; left: 64px; right: 0; }
button.hz-next-text {
  min-width: 0;
  min-height: var(--tap);
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.hz-next-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s-2); }
.hz-next-title { font: var(--t-row); color: var(--ink); }
.hz-next-sub { margin-top: 2px; font: var(--t-cap); color: var(--ink-2); }
.hz-next-none { font: var(--t-sub); color: var(--ink-2); }

/* -------------------------------------------------------- the season -- */

.hz-chart { position: absolute; left: 0; top: 0; overflow: visible; }
/* Every label is haloed in the ground, so a line crossing it never cuts a
 * word (the charts' own rule, --chart-ground). */
.hz-chart text {
  font: 450 var(--t-cap-size)/1 var(--font);
  fill: var(--ink-3);
  font-variant-numeric: tabular-nums;
  paint-order: stroke;
  stroke: var(--chart-ground);
  /* Wide enough to close the gap between two words too. */
  stroke-width: 6px;
  stroke-linejoin: round;
}
.hz-chart .hz-t-lab { fill: var(--ink-2); }
/* The weight axis is a scale, so its numbers are Calibre's mono. They sit
 * on the axis's own ground (.hz-axis-host::before, the glow with it) with
 * no line under them, so they wear no halo: one in the plain ground drew a
 * dark box round each number over the glow. */
.hz-axis text { font-family: var(--font-mono); font-weight: 500; stroke: none; }
.hz-chart .hz-t-strong { fill: var(--ink); font-weight: 600; }
.hz-chart .hz-t-acc { fill: var(--accent-ink); font-weight: 600; }
.hz-grid line { stroke: var(--grid); stroke-width: 1; }
.hz-goal line { stroke: var(--ink-2); stroke-width: 1.2; stroke-dasharray: 4 4; }
.hz-dexa { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 2 3; }
/* The fan's light and hatch are painted by js/horizon.js (fanDefs): the
 * mark from strong at now to nothing far off, the hatch fading with it. */
.hz-fan-hatch { opacity: .55; }
.hz-hatch-line { stroke: var(--accent-mark); stroke-width: 1; }
/* The open landing's feather and its bar fade out (their gradients' stops):
 * the model's reach ends there, and the drawing says so by ending softly. */
.hz-stop-fan { stop-color: var(--accent-fan); }
.hz-stop-mark { stop-color: var(--accent-mark); }
.hz-mask { mask-type: alpha; }
.hz-fast {
  fill: none;
  stroke: var(--accent-mark);
  stroke-width: 1.2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.hz-centre {
  fill: none;
  stroke: var(--accent-mark);
  stroke-width: 1.5;
  stroke-dasharray: 1 5;
  stroke-linecap: round;
}
.hz-call {
  stroke: var(--accent-mark);
  stroke-width: 1.2;
  stroke-linejoin: round;
}
.hz-call-hatch { opacity: .55; pointer-events: none; }
.hz-land { stroke: var(--accent-mark); stroke-width: 4; stroke-linecap: round; }
.hz-land-ring { fill: var(--bg); stroke: var(--accent-mark); stroke-width: 2; }
.hz-band { fill: var(--accent-fan); }
.hz-band-hatch { opacity: .6; }
.hz-prints circle { fill: var(--ink-3); }
.hz-prints circle.is-out { fill: none; stroke: var(--ink-3); stroke-width: 1; }
.hz-trend { fill: none; stroke: var(--accent-ink); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
/* Its light: the mark, wide and faint under the line (Lumen's luminous
 * curve), a second stroke rather than a filter, so it costs nothing. */
.hz-trend-glow {
  fill: none;
  stroke: var(--accent-mark);
  stroke-width: 9;
  stroke-opacity: .16;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.hz-trend.is-ema { stroke-dasharray: 6 3; }
.hz-thread {
  stroke: var(--line-strong);
  stroke-width: 1.2;
  stroke-dasharray: 1 4;
  stroke-linecap: round;
}
.hz-past-rule { stroke: var(--line); stroke-width: 1; }

/* A scale or a lens that is not built yet says so, in the future's room. */
.hz-say {
  position: absolute;
  left: 0;
  right: 0;
  display: grid;
  justify-items: center;
  gap: var(--s-2);
  text-align: center;
}
.hz-say-title { font: var(--t-head); color: var(--ink); text-wrap: balance; }
.hz-say-sub { font: var(--t-sub); color: var(--ink-2); max-width: 30ch; text-wrap: balance; }
.hz-say-btn {
  margin-top: var(--s-2);
  min-height: var(--tap);
  padding: 0 var(--s-5);
  border: 0;
  border-radius: 999px;
  background: var(--quiet-bg);
  color: var(--ink);
  font: 560 var(--t-body-size)/1 var(--font);
  cursor: pointer;
}

/* -------------------------------------------------------------- the day -- */

/* Above now: soonest first to a screen reader, nearest the line on the
 * screen (the list stacks upward), tomorrow closing the top. */
.hz-coming {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column-reverse;
}
/* It is read after the hero (UX audit P8), so it lives in the block under
 * the line and is drawn from that block's top: its foot 12 over the line,
 * the block's top 16 under it. */
.hz-below > .hz-coming { bottom: calc(100% + 28px); }
.hz-coming::before {
  content: "";
  position: absolute;
  left: 47.25px;
  top: 0;
  bottom: -12px;
  border-left: 1.5px dashed var(--line-strong);
}
/* Tomorrow takes the top of the room (an auto margin on the reversed list's
 * far side), and the dashed spine runs from it down to now. */
.hz-tomorrow {
  position: relative;
  z-index: 1;
  margin-bottom: auto;
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) 0 var(--s-4) 64px;
  background: var(--bg);
  font: var(--t-cap);
  color: var(--ink-2);
}
.hz-tomorrow::after { content: ""; flex: 1 1 0; min-width: var(--s-6); border-top: 1px dashed var(--line-strong); }
.hz-tomorrow-words { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hz-below {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-6);
  padding-bottom: 120px;
}
/* On the line, not a card: the horizon's present is drawn on time itself, so
 * the kit hero's glass (base.css) is taken off here. */
.hz-present .hero { padding: 0; border-radius: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.hz-present .hero-foot { display: none; }
.hz-present .hero-value { font-size: var(--hz-hero); line-height: .86; letter-spacing: -.03em; }
.hz-gone { display: flex; flex-direction: column; gap: var(--s-4); }
.hz-done { position: relative; display: flex; flex-direction: column; }
.hz-done::before {
  content: "";
  position: absolute;
  left: 47.25px;
  top: var(--s-4);
  bottom: 0;
  border-left: 1.5px solid var(--line-strong);
}
/* A row: the clock in the gutter, its mark on the spine, words at 64; every
 * cell sits on the title's first line, so a row of chips keeps its mark
 * level with its name. */
.hz-ev {
  position: relative;
  display: grid;
  grid-template-columns: 36px 24px minmax(0, 1fr) auto;
  align-items: start;
  min-height: 56px;
  width: 100%;
  padding: var(--s-2) 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
div.hz-ev { cursor: default; }
.hz-ev.is-past { min-height: 48px; }
.hz-ev-t {
  font: 500 var(--hz-clock-size)/calc(22 * var(--fz)) var(--font);
  color: var(--ink-3);
  text-align: right;
}
.hz-ev-k {
  justify-self: center;
  /* Level with the title's first line (22 px): an optical offset. */
  transform: translate3d(0, 5px, 0);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: inset 0 0 0 1.5px var(--edge), 0 0 0 3px var(--bg);
}
.hz-ev-k.is-done {
  transform: translate3d(0, 7px, 0);
  width: 8px;
  height: 8px;
  background: var(--ink-3);
  box-shadow: 0 0 0 3px var(--bg);
}
.hz-ev-ti {
  min-width: 0;
  padding-left: var(--s-1);
  font: 560 var(--t-row-size)/calc(22 * var(--fz)) var(--font);
}
.hz-ev-ti small {
  display: block;
  margin-top: 2px;
  font: var(--t-cap);
  color: var(--ink-2);
}
.hz-ev-v {
  padding-left: var(--s-3);
  font: 500 var(--t-body-size)/calc(22 * var(--fz)) var(--font);
  color: var(--ink-2);
}
.hz-ev.is-past .hz-ev-ti { font-weight: 480; color: var(--ink-2); }
.hz-ev.is-past .hz-ev-ti small,
.hz-ev.is-past .hz-ev-v { color: var(--ink-3); }
/* Past its time and not done: quiet, under the line, never red (a missed
 * clock is not past a limit). A hollow mark on a dashed edge. */
.hz-due { position: relative; display: flex; flex-direction: column; }
.hz-due::before {
  content: "";
  position: absolute;
  left: 47.25px;
  top: var(--s-8);
  bottom: 0;
  border-left: 1.5px dashed var(--line-strong);
}
.hz-group {
  padding: 0 0 var(--s-1) 64px;
  font: 600 var(--t-cap-size)/1.35 var(--font);
  color: var(--ink-2);
}
.hz-ev.is-due .hz-ev-ti { font-weight: 500; color: var(--ink-2); }
.hz-ev.is-due .hz-ev-k { box-shadow: inset 0 0 0 1.5px var(--ink-3), 0 0 0 3px var(--bg); }
.hz-ev.is-pending .hz-ev-k { box-shadow: inset 0 0 0 1.5px var(--edge), 0 0 0 3px var(--bg); }
.hz-ev-chips { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-2); }
.hz-later {
  padding: var(--s-1) 0 var(--s-2) 64px;
  font: var(--t-cap);
  color: var(--ink-3);
}
.hz-day-body .hz-cap,
.hz-day-train .hz-cap { margin-top: var(--s-3); }
.hz-train-title {
  font: 600 var(--t-title-size)/1.1 var(--font);
  font-stretch: 88%;
  color: var(--ink);
}

/* ------------------------------------------------------------- the week -- */

.hz-week { position: absolute; inset: 0; }
/* A day a row: a stack of horizons, each line from the spine like now's. */
.hz-wk {
  position: absolute;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 28px;
  padding-top: var(--s-3);
}
.hz-wk::before {
  content: "";
  position: absolute;
  left: 48px;
  right: 0;
  top: 0;
  border-top: 1px solid var(--line);
}
/* Today hangs under the now line: the line is its top edge, and the
 * person's light falls a little way into the row from it (Lumen). */
.hz-wk.is-today::before {
  left: 48px;
  height: 48px;
  border-top: 0;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--accent-mark) 10%, transparent), transparent);
  pointer-events: none;
}
.hz-wk-day { display: grid; gap: 2px; text-align: right; }
.hz-wk-dow { font: 600 var(--t-body-size)/calc(20 * var(--fz)) var(--font); color: var(--ink); }
.hz-wk-date { font: 500 var(--t-cap-size)/calc(16 * var(--fz)) var(--font-mono); letter-spacing: -.02em; color: var(--ink-3); white-space: nowrap; }
.hz-wk.is-today .hz-wk-dow { color: var(--accent-ink); }
.hz-wk-body { min-width: 0; display: grid; gap: var(--s-2); }
.hz-wk-train {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-width: 0;
  font: 560 var(--t-body-size)/calc(20 * var(--fz)) var(--font);
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hz-wk-k {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--edge);
}
.hz-wk-train.is-done .hz-wk-k {
  background: var(--accent-mark);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-mark) 18%, transparent);
}
.hz-wk-train.is-missed,
.hz-wk-train.is-rest,
.hz-wk-train.is-none { color: var(--ink-2); font-weight: 480; }
.hz-wk-train.is-missed .hz-wk-k { box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.hz-wk-train.is-rest .hz-wk-k,
.hz-wk-train.is-none .hz-wk-k { box-shadow: inset 0 0 0 1.5px var(--line-strong); }
/* The day's kcal against its target: the person's mark up to the tick, and
 * a day past a CEILING runs on past it in red, as Food's board does (red only
 * past a limit: ui.pastLimit; a floor's day just fills). A day gone is the
 * mark at 70 % on the ground (never a grey); today is the mark itself. */
.hz-wk-meter {
  position: relative;
  height: 4px;
  margin: 2px 0;
  border-radius: 2px;
  background: var(--quiet-bg);
}
.hz-wk-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 2px;
  background: color-mix(in srgb, var(--accent-mark) 70%, var(--bg));
}
/* Today's is lit: the mark, glowing a little, as the now line is. */
.hz-wk.is-today .hz-wk-fill {
  background: var(--accent-mark);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent-mark) 55%, transparent);
}
.hz-wk-over {
  position: absolute;
  top: 0;
  bottom: 0;
  min-width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--red);
}
.hz-wk-tick {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  margin-left: -1px;
  border-radius: 1px;
  background: var(--ink);
}
.hz-wk-kcal { font: 500 var(--t-cap-size)/calc(16 * var(--fz)) var(--font-mono); letter-spacing: -.02em; color: var(--ink-2); }
.hz-wk-print { text-align: right; }
/* A print is a readout: Geist light in tabular figures, its unit in mono. */
.hz-wk-lb {
  font: 300 calc(20 * var(--fz-lg))/calc(20 * var(--fz)) var(--font);
  letter-spacing: var(--track-readout);
  color: var(--ink);
}
.hz-wk-lb small { font: 500 var(--t-cap-size)/1 var(--font-mono); letter-spacing: 0; color: var(--ink-2); }
.hz-wk-none { font: 500 var(--t-cap-size)/calc(20 * var(--fz)) var(--font-mono); letter-spacing: -.02em; color: var(--ink-3); }
.hz-wk.is-ahead .hz-wk-dow { color: var(--ink-2); }
.hz-wk-wait { position: absolute; left: 0; right: 0; }
/* A lens keeps its own part of each day. */
.hz[data-lens="food"] .hz-wk-train,
.hz[data-lens="food"] .hz-wk-print,
.hz[data-lens="train"] .hz-wk-meter,
.hz[data-lens="train"] .hz-wk-kcal,
.hz[data-lens="train"] .hz-wk-print,
.hz[data-lens="body"] .hz-wk-train,
.hz[data-lens="body"] .hz-wk-meter,
.hz[data-lens="body"] .hz-wk-kcal { display: none; }

/* ------------------------------------------------------------- wide -- */

/* UX audit P10: on wide the horizon was a 420 px phone column beside a pane
 * that said "Nothing open". The horizon takes the main column now (the
 * shell's grid, base.css), and the pane (js/horizon.js `pane`) holds today's
 * plan beside the season or the week, or the season in words beside the day. */
/* Its rows' marks are haloed in the ground they sit on: the pane's here. */
.hz-pane { --bg: var(--pane); --hz-hero: 56px; display: grid; gap: var(--s-4); align-content: start; }
.hz-pane-title { margin: 0; font: var(--t-title); letter-spacing: -.02em; color: var(--ink); }
.hz-pane-sub { margin: 0; font: var(--t-sub); color: var(--ink-2); text-wrap: pretty; }
.hz-pane-group { display: flex; flex-direction: column; }
.hz-pane .hz-say-btn { justify-self: start; }

/* ------------------------------------------------------- reduced motion -- */

@media (prefers-reduced-motion: reduce) {
  .hz-layer.is-entering .hz-part { animation-name: hz-fade; }
  .hz-layer.is-leaving .hz-part { animation-name: hz-fade; animation-direction: reverse; }
  .hz-scroll,
  .hz-part.is-settling,
  .hz-strand-tab,
  .hz-nowpill,
  .hz-hint,
  .hz-me,
  .hz-scale,
  .hz-plus,
  .hz-lens-word,
  .hz-lens-go { transition: none; }
  .hz-me.is-pressing .hz-me-hold { transition: none; }
  .hz-me.is-held .hz-me-hold,
  .hz-scale-menu { animation: none; }
}
