/* ReachCue home. Split stage: two sides held apart by one moving line. */

:root {
  --sc-canvas:     #EEF0EC;
  --sc-surface:    #F8F9F6;
  --sc-ink:        #111513;
  --sc-ink-soft:   #4A524D;
  --sc-accent:     #12683F;
  --sc-accent-ink: #F8F9F6;
  --sc-font-display: "Archivo", "Geist", system-ui, sans-serif;
  --sc-font-text:    "Geist", system-ui, sans-serif;
  --sc-shadow-color: 140 14% 18%;

  --alone: #E2E4DF;
  --with:  #F8F9F6;
  --alone-ink-soft: #4E5550;
  --fail: #B3261E;
  --warn: #8A5A00;
  --pass: #12683F;

  /* Where the line is, as a share of the viewport (width on desktop, height on phones). */
  --split: 0.5;
  /* 1 while the line sits well inside the page, 0 when it has reached the edge. */
  --inside: 1;
  color-scheme: light;
}

body { background: var(--sc-canvas); color: var(--sc-ink); }
::selection { background: color-mix(in oklab, var(--sc-accent) 22%, transparent); color: var(--sc-ink); }
:focus-visible { outline: 2px solid var(--sc-accent); outline-offset: 3px; border-radius: 4px; }

.sc-display { font-family: var(--sc-font-display); font-stretch: 88%; font-weight: 700; letter-spacing: var(--sc-track-tight); line-height: var(--sc-leading-tight); margin: 0; text-wrap: balance; }
.head { font-size: clamp(2.1rem, 1.1rem + 3.1vw, 4.2rem); max-width: 17ch; }
.head--md { font-size: clamp(1.7rem, 1.2rem + 1.7vw, 2.7rem); max-width: 18ch; }
.head--close { font-size: clamp(2.4rem, 1.4rem + 3.8vw, 5.2rem); max-width: 14ch; }
.sub { margin: var(--sc-3) 0 0; font-size: var(--sc-t-lg); line-height: 1.45; color: var(--sc-ink-soft); max-width: 34ch; text-wrap: pretty; }
.body { margin: 0; font-size: var(--sc-t-base); line-height: var(--sc-leading-body); color: var(--sc-ink-soft); max-width: 46ch; text-wrap: pretty; }

/* ------------------------------------------------------------------ the line */
.line { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.line__track { position: absolute; inset: 0; transform: translate3d(calc(var(--split) * 100%), 0, 0); will-change: transform; }
.line__rule { position: absolute; top: 0; bottom: 0; left: 0; width: 1px; background: var(--sc-ink); }
.line__mark {
  position: absolute; top: 0; left: 0;
  transform: translateX(calc(-50% * var(--inside)));
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px 9px; border-radius: 0 0 8px 8px;
  background: var(--sc-surface); color: var(--sc-ink);
  border: 1px solid rgba(17, 21, 19, 0.16); border-top: 0;
  font: 700 0.98rem/1 var(--sc-font-display); font-stretch: 88%; letter-spacing: -0.01em;
  text-decoration: none; pointer-events: auto;
}
.line__label {
  position: absolute; top: 58px; left: 0;
  font: 600 0.72rem/1 var(--sc-font-text); letter-spacing: var(--sc-track-wide); text-transform: uppercase;
  color: var(--sc-ink-soft); white-space: nowrap;
}
.line__label--alone { transform: translateX(calc(-100% - 14px)); opacity: var(--inside); }
.line__label--with { transform: translateX(14px); }
.line__foot { position: absolute; bottom: 20px; left: 0; width: 100%; padding-left: 16px; display: flex; align-items: center; gap: var(--sc-4); pointer-events: none; transform: translateX(calc(var(--split) * 100%)); }
.line__foot a { pointer-events: auto; }
.line__rule, .line__mark, .line__label { transition: opacity 200ms var(--sc-ease-out); }
.line[data-crossing] .line__rule { opacity: 0.16; }
.line[data-crossing] .line__mark, .line[data-crossing] .line__label { opacity: 0; }
.line__foot a { font: 500 0.9rem/1 var(--sc-font-text); color: var(--sc-ink); text-decoration: none; }
.line__foot a:hover { text-decoration: underline; text-underline-offset: 3px; }
.line__cta { padding: 10px 14px; border-radius: 8px; background: var(--sc-accent); color: var(--sc-accent-ink) !important; }
.line__cta:hover { text-decoration: none !important; background: color-mix(in oklab, var(--sc-accent) 88%, black); }
.line[data-hide-cta] .line__foot { visibility: hidden; }

/* ------------------------------------------------------- pinned two-pane stages */
/* .stage is the engine's sticky [data-sc-stage]; never restyle its position or height. */
.pane { position: absolute; inset: 0; }
.pane--alone { background: var(--alone); clip-path: inset(0 calc((1 - var(--split)) * 100%) 0 0); }
.pane--with  { background: var(--with);  clip-path: inset(0 0 0 calc(var(--split) * 100%)); }
.act { --at: 0.5; }
.act--cross { --at-with: 0.38; }
.act--close { --at: 0.38; }
.side { position: absolute; top: 0; bottom: 0; display: flex; flex-direction: column; justify-content: flex-start; gap: var(--sc-7); padding-block: clamp(96px, 14vh, 150px) 88px; }
.side--alone { left: var(--sc-gutter); width: calc(var(--at) * 100% - 2 * var(--sc-gutter)); }
.side--with  { left: calc(var(--at, 0.5) * 100% + var(--sc-gutter)); right: var(--sc-gutter); }
.act--cross .side--with { left: calc(var(--at-with) * 100% + var(--sc-gutter)); }

/* The empty compose box, on your own */
.compose { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: 1fr auto; gap: 10px 16px; min-height: clamp(180px, 26vh, 260px); padding: 22px; max-width: 34rem; border-radius: var(--sc-r-md); background: var(--sc-surface); box-shadow: var(--sc-e1); }
.compose__avatar, .post__avatar { width: 44px; height: 44px; border-radius: 50%; background: #C9CDC7; }
.compose__field { margin: 8px 0 0; font-size: 1.3rem; color: #7E8581; }
.compose__post { grid-column: 2; justify-self: end; padding: 8px 16px; border-radius: var(--sc-r-pill); background: #9EA3A0; color: var(--with); font-weight: 600; font-size: 0.9rem; }
.caret { display: inline-block; width: 2px; height: 1.1em; margin-right: 2px; vertical-align: -0.18em; background: var(--sc-ink); animation: caret 1.05s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

/* Today's posts, with ReachCue */
.today { list-style: none; margin: 0; padding: 0; max-width: 40rem; border-top: 1px solid var(--sc-hairline-strong); }
.today__row { display: grid; grid-template-columns: auto auto 1fr; align-items: baseline; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--sc-hairline); }
.today__job { font-size: 0.82rem; color: var(--sc-ink-soft); }
.today__time { justify-self: end; font-size: 0.82rem; font-variant-numeric: tabular-nums; color: var(--sc-ink-soft); }
.today__line { grid-column: 1 / -1; font-size: 1rem; line-height: 1.4; }
.today__row.is-rec .today__line { font-weight: 500; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 5px; background: #E4E7E2; color: var(--sc-ink-soft); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em; }
.tag--rec { background: var(--sc-accent); color: var(--sc-accent-ink); }
.sample-note { margin: 0; font-size: 0.8rem; color: var(--sc-ink-soft); }

/* ------------------------------------------------------------ flow sections */
.split-flow { display: grid; grid-template-columns: calc(var(--at) * 100%) 1fr; }
.act--unease { --at: 0.5; }
.act--clarity { --at: 0.38; }
.split-flow__col { padding-block: clamp(4rem, 8vw, 8rem); }
.split-flow__col--alone { background: var(--alone); }
.split-flow__col--with { background: var(--with); }
.col-inner { padding-inline: var(--sc-gutter); max-width: 38rem; }
.col-inner--wide { max-width: 44rem; }
.col-inner > * + * { margin-top: var(--sc-5); }
.col-inner--wait { height: 100%; display: flex; align-items: flex-end; }
.wait-line { margin: 0; font: 600 var(--sc-t-lg)/1.3 var(--sc-font-display); font-stretch: 88%; color: var(--sc-ink-soft); }

/* Posts */
.post { max-width: 32rem; padding: 18px 20px; border-radius: var(--sc-r-md); background: var(--sc-surface); box-shadow: var(--sc-e1), var(--sc-edge); }
.post__head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.post__avatar { width: 34px; height: 34px; }
.post__name { font-weight: 600; }
.post__handle { color: var(--sc-ink-soft); font-size: 0.9rem; }
.post__tags { display: flex; gap: 6px; margin-left: auto; }
.post__text { margin: 12px 0 0; font-size: 1.12rem; line-height: 1.5; text-wrap: pretty; }
.swap { transition: opacity 180ms var(--sc-ease-out), filter 180ms var(--sc-ease-out); }
.swap.is-changing { opacity: 0; filter: blur(3px); }
.swap.is-after { color: var(--sc-ink); }
[data-when-after] { opacity: 0; transition: opacity 220ms var(--sc-ease-out); }
.is-rewritten [data-when-after] { opacity: 1; }

/* The signal checks, computed by ReachCue's real rules (signals.js) */
.checks { max-width: 32rem; margin: 0; padding: 0; list-style: none; }
.checks li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 9px 2px; border-bottom: 1px solid var(--sc-hairline); }
.checks__label { font-weight: 500; }
.checks__why { grid-column: 1; font-size: 0.86rem; color: var(--sc-ink-soft); }
.checks__state { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.checks__state[data-s="fail"] { color: var(--fail); }
.checks__state[data-s="warn"] { color: var(--warn); }
.checks__state[data-s="info"] { color: var(--sc-ink-soft); }
.checks__state[data-s="pass"] { color: var(--pass); }
.checks__state { transition: color 200ms var(--sc-ease-out); }
.checks__note { font-size: 0.82rem; color: var(--alone-ink-soft); }

/* The traveller: the post that crosses the line */
.traveller { position: absolute; top: 0; left: 0; width: min(32rem, 40vw); display: grid; gap: var(--sc-4); transform: translate3d(0, 0, 0); will-change: transform; z-index: 3; }
.traveller .post { box-shadow: var(--sc-e2), var(--sc-edge); transition: box-shadow 240ms var(--sc-ease-out); }
.traveller.is-moving .post { box-shadow: var(--sc-e3), var(--sc-edge); }
.traveller .checks { background: color-mix(in oklab, var(--sc-surface) 86%, transparent); border-radius: var(--sc-r-sm); padding-inline: 12px; }
.cross-static { display: none; }

/* Weights and facts */
.weights { margin: 0; border-top: 1px solid var(--sc-hairline-strong); max-width: 30rem; }
.weights div { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--sc-hairline); }
.weights dt { font-size: var(--sc-t-lg); }
.weights dd { margin: 0; font: 700 var(--sc-t-lg)/1 var(--sc-font-display); font-variant-numeric: tabular-nums; color: var(--sc-accent); }
.facts { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sc-5) var(--sc-6); }
.facts li { font-size: 0.98rem; line-height: 1.55; color: var(--sc-ink-soft); }
.facts strong { display: block; margin-bottom: 4px; color: var(--sc-ink); font-weight: 600; }

/* The day, then the close */
.day { list-style: none; margin: 0; padding: 0; }
.day--alone li { padding: 14px 0; border-bottom: 1px solid color-mix(in oklab, var(--sc-ink) 14%, transparent); font-size: var(--sc-t-lg); color: var(--alone-ink-soft); }
.day--with { border-top: 1px solid var(--sc-hairline-strong); max-width: 40rem; }
.day--with li { display: grid; grid-template-columns: 9.5rem 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--sc-hairline); font-size: var(--sc-t-base); line-height: 1.5; }
.day__when { font-weight: 600; color: var(--sc-accent); }
.close { position: absolute; left: var(--sc-gutter); right: var(--sc-gutter); top: 0; bottom: 0; display: flex; flex-direction: column; justify-content: center; padding-block: 96px 64px; }
.close .sub { max-width: 44ch; }
.invite { display: grid; grid-template-columns: minmax(14rem, 20rem) minmax(14rem, 22rem) auto; align-items: end; gap: var(--sc-4); margin-top: var(--sc-7); max-width: 64rem; }
.invite__field { display: grid; gap: 6px; font-size: 0.82rem; font-weight: 500; color: var(--sc-ink-soft); }
.invite__field input { font: inherit; font-size: 1.05rem; color: var(--sc-ink); padding: 12px 2px; border: 0; border-bottom: 1.5px solid var(--sc-ink); border-radius: 0; background: transparent; }
.invite__field input::placeholder { color: #8B918D; }
.invite__field input:focus-visible { outline: none; border-bottom-color: var(--sc-accent); box-shadow: 0 1.5px 0 var(--sc-accent); }
.invite__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.invite__submit { height: 48px; padding: 0 22px; border: 0; border-radius: 8px; background: var(--sc-accent); color: var(--sc-accent-ink); font: 600 1rem/1 var(--sc-font-text); cursor: pointer; white-space: nowrap; transition: background 150ms var(--sc-ease-out), transform 120ms var(--sc-ease-out); }
.invite__submit:hover { background: color-mix(in oklab, var(--sc-accent) 88%, black); }
.invite__submit:active { transform: translateY(1px); }
.invite__submit:disabled { opacity: 0.6; cursor: progress; }
.invite__status { grid-column: 1 / -1; margin: 0; min-height: 1.4em; font-size: 0.95rem; }
.invite__status[data-tone="ok"] { color: var(--pass); }
.invite__status[data-tone="error"] { color: var(--fail); }
.foot { display: flex; flex-wrap: wrap; gap: var(--sc-5); margin-top: var(--sc-8); font-size: 0.86rem; color: var(--sc-ink-soft); }
.foot a { color: var(--sc-ink-soft); text-underline-offset: 3px; }
.foot a:hover { color: var(--sc-ink); }

/* ------------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {
  .caret { animation: none; }
  .traveller { display: none; }
  .cross-static { display: grid; gap: var(--sc-4); position: absolute; top: 50%; transform: translateY(-50%); left: calc(0.5 * 100% + var(--sc-gutter)); width: min(32rem, 40vw); }
  .act--cross .side--with { left: calc(0.5 * 100% + var(--sc-gutter)); }
  .act--cross .cross-copy { display: none; }
}

/* ----------------------------------------------------------------- phones */
@media (max-width: 760px) {
  :root { --split: 0.46; }
  .head { font-size: clamp(1.7rem, 1.2rem + 3vw, 2.2rem); }
  .head--md { font-size: clamp(1.5rem, 1.1rem + 2.4vw, 1.9rem); }
  .head--close { font-size: clamp(2.1rem, 1.4rem + 5vw, 2.8rem); }
  .sub { font-size: 1rem; margin-top: var(--sc-2); }

  /* The line turns horizontal: on your own above, ReachCue below. */
  .line__track { transform: none; }
  .line__rule { top: 0; bottom: auto; left: 0; right: 0; width: auto; height: 1px; transform: translateY(calc(var(--split) * 100svh)); }
  .line__mark { top: 0; left: 12px; transform: translateY(calc(var(--split) * 100svh - 50% * var(--inside))); border-radius: 6px; padding: 8px 10px 7px; font-size: 0.86rem; }
  .line__label { top: 0; left: auto; right: 14px; font-size: 0.64rem; }
  .line__label--alone { transform: translateY(calc(var(--split) * 100svh - 100% - 16px)); opacity: var(--inside); }
  .line__label--with { transform: translateY(calc(var(--split) * 100svh + 16px)); }
  .line__foot { top: auto; bottom: 14px; left: auto; right: 14px; width: auto; padding-left: 0; gap: var(--sc-3); transform: none; }
  .line__cta { padding: 9px 12px; }
  .line[data-flow] .line__rule, .line[data-flow] .line__mark, .line[data-flow] .line__label { opacity: 0; }
  /* The crossing needs the whole phone screen; the links come back after it. */
  .line[data-cross] .line__foot { visibility: hidden; }

  .pane--alone { clip-path: inset(0 0 calc((1 - var(--split)) * 100%) 0); }
  .pane--with  { clip-path: inset(calc(var(--split) * 100%) 0 0 0); }
  .act { --at: 0.46; }
  .act--close { --at: 0.3; }
  .side { justify-content: flex-end; gap: var(--sc-4); padding-block: 0; }
  .side--alone { top: 0; bottom: auto; left: var(--sc-gutter); right: var(--sc-gutter); width: auto; height: calc(var(--at) * 100%); padding-block: 20px 26px; }
  .side--with { top: calc(var(--at) * 100%); bottom: 0; left: var(--sc-gutter); right: var(--sc-gutter); justify-content: flex-start; padding-block: 34px 72px; }
  .act--cross .side--with { top: 20%; left: var(--sc-gutter); padding-top: 30px; }
  .act--hero .side--alone { justify-content: flex-end; }
  .compose { padding: 14px; grid-template-columns: 32px 1fr; }
  .compose__avatar { width: 32px; height: 32px; }
  .compose__field { font-size: 1rem; margin-top: 4px; }
  .today__row:nth-child(n + 3) { display: none; }
  .compose { min-height: 128px; }
  .today__row { padding: 9px 0; }
  .today__line { font-size: 0.92rem; }

  .split-flow { grid-template-columns: 1fr; }
  .split-flow__col { padding-block: 3.5rem; }
  .col-inner--wait { min-height: 30vh; }
  .facts { grid-template-columns: 1fr; }

  .traveller { top: 0; left: var(--sc-gutter); right: var(--sc-gutter); width: auto; transform: translate3d(0, 0, 0); }
  .post { padding: 14px 16px; }
  .post__text { font-size: 1rem; }
  .checks li { padding: 6px 2px; }
  .checks__why { display: none; }

  .day--alone li { font-size: 1rem; padding: 9px 0; }
  .day--with li { grid-template-columns: 1fr; gap: 2px; padding: 10px 0; font-size: 0.95rem; }
  .close { padding-block: 70px 80px; justify-content: flex-start; }
  .invite { grid-template-columns: 1fr; margin-top: var(--sc-5); }
  .foot { margin-top: var(--sc-5); }

  /* Short phones: fewer rows, a smaller empty box, so the footer never covers a draft. */
  @media (max-height: 700px) {
    .today__row:nth-child(n + 2), .sample-note { display: none; }
    .compose { min-height: 92px; }
    .side--with { padding-bottom: 64px; }
  }

  @media (prefers-reduced-motion: reduce) {
    .cross-static { left: var(--sc-gutter); right: var(--sc-gutter); width: auto; top: calc(0.46 * 100% + 20px); transform: none; }
  }
}

/* The no-JavaScript confirmation page */
.requested { background: var(--with); }
.requested__main { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; gap: var(--sc-5); padding-inline: var(--sc-gutter); max-width: 60rem; }
.brand-mark { width: 20px; height: 20px; object-fit: contain; display: block; }
.requested__mark { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px 8px; border-radius: 8px; background: var(--sc-surface); color: var(--sc-ink); border: 1px solid rgba(17, 21, 19, 0.16); font: 700 0.98rem/1 var(--sc-font-display); font-stretch: 88%; text-decoration: none; }
.requested__back a { color: var(--sc-accent); text-underline-offset: 3px; }
