/* ===========================================================================
   The shared look: the Horizon design.
   ===========================================================================

   **This file is canon.** It holds the part of the design that the other
   sketches wear too: the palette, the two faces, and the chrome around the
   conversation. mybff-sketch2 must match it, because it is the alternative
   backend shown to the client beside this one and what they should notice
   between the two is the behaviour rather than the paint. mybff-sketch3
   starts from it and is free to vary, because it is where UI variations get
   tried. Their `bin/theme-check.js` reads this file and says so.

   Extracted from `style.css` on 2026-09-18 with no change to a single
   declaration: the two files together render exactly what `style.css` alone
   rendered before. The message family followed it the same day, once the
   editing that would have collided with it had settled. What stayed behind
   is what only this sketch has -- the tabs, the panes, the roadmap, the
   profile panel, the board -- including the two rules that ring the turn
   the panel is showing, which are the panel's, not the message's.

   `index.html` loads this first and `style.css` second, so anything this
   sketch wants to say differently it can still say there.

   The palette is Rosé Pine: Dawn in the light, Moon in the dark
   (rosepinetheme.com/palette), named as the palette names them.
   =========================================================================== */

:root {
  color-scheme: light dark;
  --bg: light-dark(#faf4ed, #232136);
  --surface: light-dark(#fffaf3, #2a273f);
  --overlay: light-dark(#f2e9e1, #393552);
  --text: light-dark(#575279, #e0def4);
  --subtle: light-dark(#797593, #908caa);
  --muted: light-dark(#9893a5, #6e6a86);
  --line: light-dark(#dfdad9, #44415a);
  --foam: light-dark(#56949f, #9ccfd8);
  --pine: light-dark(#286983, #3e8fb0);
  --gold: light-dark(#ea9d34, #f6c177);
  --rose: light-dark(#d7827e, #ea9a97);
  --iris: light-dark(#907aa9, #c4a7e7);
  --love: light-dark(#b4637a, #eb6f92);
  --ink: #232136;
  /* Two columns: the wide one for the header and the roadmap, the narrow
     one for the conversation, each with the gutter that centres it. */
  --gutter: max(20px, calc((100% - 46rem) / 2));
  --gutter-narrow: max(20px, calc((100% - 40rem) / 2));
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* The two faces, served from public/fonts rather than fetched from Google,
   so the page makes no request that leaves the machine. Latin only;
   anything else falls through to the system's fonts. Both are under the SIL
   Open Font License, kept beside them. */
@font-face {
  font-family: Karla;
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(fonts/karla.woff2) format('woff2');
}

@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/instrument-serif.woff2) format('woff2');
}

* { box-sizing: border-box; }

/* Several things below set display on elements that are also toggled with
   the hidden attribute; this keeps hidden meaning hidden. */
[hidden] { display: none !important; }

body {
  margin: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 Karla, system-ui, -apple-system, "Segoe UI", sans-serif;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 14px var(--gutter);
  border-bottom: 1px solid var(--line);
}

/* The wordmark, and what it is, on one baseline. */
h1 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
  margin: 0;
  font-weight: 400;
}

h1 .wordmark {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 30px;
  line-height: 1;
}

h1 .tag {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.actions,
.tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

header button {
  display: flex;
  align-items: center;
  gap: 7px;
  font: inherit;
  font-size: 12px;
  color: var(--subtle);
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
}

header button:hover,
#toggle[aria-expanded="true"] {
  color: var(--text);
  border-color: var(--foam);
}

/* Half a circle filled: the other theme. */
#theme::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid var(--subtle);
  background: linear-gradient(90deg, var(--text) 0 50%, transparent 50% 100%);
}

/* The room the conversation is in: the horizon behind, the log scrolling
   in front of it. */
main {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* The horizon: a sun off the top right corner and the ground rising behind
   the conversation. Faint, because the text is in front and moves and this
   does not.

   It had more in it (2026-09-18): four hairline "waves" across the ground, a
   harder line at the top of it, and a ring at the lower left. They came out
   because on a wide window they stop reading as a landscape and start reading
   as stray horizontal rules with a circle beside them -- the eye takes a 1px
   line across 1600px as a divider, whatever it was meant to be, and looks for
   what it divides. The sun and the wash survive, and they are the two parts
   the client actually named: "the peach tones and the minty". */
#horizon {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#horizon > * {
  position: absolute;
}

#horizon .sun {
  top: -150px;
  right: -70px;
  width: 430px;
  height: 430px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 62%,
    color-mix(in oklab, var(--gold) 52%, var(--bg)),
    color-mix(in oklab, var(--rose) 26%, var(--bg)) 58%,
    transparent 74%);
}

/* The ground: foam rising out of the background, and nothing drawn on it. */
#horizon .ground {
  left: 0;
  right: 0;
  bottom: 0;
  height: 44%;
  background-image:
    linear-gradient(180deg, transparent, color-mix(in oklab, var(--foam) 26%, var(--bg)));
  background-repeat: no-repeat;
}

#log {
  position: relative;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 34px var(--gutter-narrow) 40px;
}

/* A short conversation sits on the floor of the room rather than hanging
   from the ceiling, which is what makes it read as a chat and not a page. */
#log > :first-child {
  margin-top: auto;
}

@keyframes pulse {
  50% { opacity: 0.25; }
}

/* The two sides of the conversation. Both hang in `#log` above; what makes
   them read as two sides is that only one of them is a bubble. */
.msg {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  width: fit-content;
  cursor: pointer;
}

/* The person's own words run the full width, left-justified. Still a bubble,
   but the corner it hangs from moves to the left with it. */
.msg.user {
  align-self: stretch;
  width: auto;
  padding: 11px 18px;
  border-radius: 20px 20px 20px 6px;
  background: var(--overlay);
}

/* A reply is not a bubble: text, with a rule down its left, set in a step
   from the person's edge so the two sides are never flush. */
.msg.assistant {
  align-self: flex-start;
  max-width: 80%;
  margin-left: 20px;
  padding-left: 16px;
  border-left: 2px solid color-mix(in oklab, var(--foam) 70%, var(--bg));
  line-height: 1.6;
}

/* The expander's first line, before anything was said: set large, in the
   serif, with no rule; the conversation starts under it. */
.msg.opening {
  max-width: 88%;
  margin-left: 0;
  padding-left: 0;
  border-left: none;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 24px;
  line-height: 1.35;
}

/* Sent, and waiting for the server to finish the turn before it. A sketch
   that sends one at a time never sets this; the rule costs it nothing. */
.msg.queued {
  opacity: 0.55;
}

/* An empty reply still waiting on its first token. */
.msg.pending::after {
  content: "···";
  color: var(--subtle);
  animation: pulse 1.4s ease-in-out infinite;
}

.note {
  align-self: center;
  margin: 0;
  font-size: 13px;
  color: var(--love);
}

/* The sign at the end of the journey. */
.end {
  align-self: center;
  text-align: center;
  margin: 2.5rem 0 1rem;
}

.end h2 {
  margin: 0;
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 44px;
  font-weight: 400;
  line-height: 1.1;
}

.end p {
  margin: 0.5rem 0 0;
  font-size: 14px;
  color: var(--subtle);
}

#composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 16px var(--gutter-narrow) 20px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

#input {
  flex: 1;
  min-width: 0;
  resize: none;
  max-height: 40vh;
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 11px 16px;
}

#input:focus,
#door input:focus {
  outline: 2px solid var(--iris);
  outline-offset: -1px;
}

#send,
#door button {
  flex: none;
  font: inherit;
  font-size: 14px;
  border: none;
  border-radius: 18px;
  padding: 11px 22px;
  background: var(--pine);
  color: var(--bg);
  cursor: pointer;
}

#send:hover,
#door button:hover {
  background: var(--foam);
}

/* The door: one question in the middle of an otherwise empty page, so the
   first thing on screen is who. */
#door {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 2rem var(--gutter);
}

#door label {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 24px;
  line-height: 1.35;
}

#door input {
  width: min(20rem, 100%);
  font: inherit;
  font-size: 18px;
  text-align: center;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 11px 16px;
}

#door p {
  margin: 0.5rem 0 0;
  max-width: 24rem;
  text-align: center;
  font-size: 13px;
  color: var(--subtle);
}

#door .note {
  color: var(--love);
}
