/* ————————————————————————————————
   Muxley — muxley.app
   paper & ink, with dark terminal islands
   ———————————————————————————————— */

:root {
  --paper: #f7f4ec;
  --ink: #1b1b1b;
  --muted: #6f6a60;
  --hairline: #dcd7ca;
  --island: #131312;
  --island-edge: #26211f;
  --island-text: #e8e5db;

  /* status colors: neon lives on dark, ink-darkened lives on paper */
  --red: #ff0600;      --red-paper: #c01410;
  --green: #00ff19;    --green-paper: #0a7a1d;
  --yellow: #ffd400;   --yellow-paper: #8a6d00;
  --blue: #00abff;     --blue-paper: #0071bd;
  --lime: #e2ff00;

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --measure: 66ch;
  --gutter: clamp(1.25rem, 5vw, 3rem);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.2rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ——— tmux status bar as nav ——— */

.statusbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1.1em;
  padding: 0.45em var(--gutter);
  background: var(--island);
  color: #9a958a;
  font-family: var(--mono);
  font-size: 0.78rem;
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.statusbar::-webkit-scrollbar { display: none; }

.statusbar-session { color: var(--lime); font-weight: 500; }

.statusbar a {
  color: inherit;
  text-decoration: none;
  padding: 0.1em 0.35em;
  border-radius: 3px;
}
.statusbar a:hover { color: var(--island-text); }
.statusbar a.is-current {
  background: var(--lime);
  color: var(--island);
}
.statusbar a.is-current .w-index { color: var(--island); }
.statusbar a:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 1px;
}

.statusbar-clock { margin-left: auto; opacity: 0.65; }

/* ——— shared text elements ——— */

.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin: 0 0 1.2rem;
}
.eyebrow-dark { color: #9a958a; }
.eyebrow-mark { display: inline-block; }

h1, h2, h3 {
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2.5rem, 1.6rem + 4.5vw, 4.6rem); font-weight: 450; }
h2 { font-size: clamp(1.8rem, 1.3rem + 2.2vw, 2.9rem); font-weight: 460; }
h3 { font-size: 1.35rem; }

h1 em, h2 em {
  font-style: italic;
  font-weight: 380;
}

.essay {
  max-width: var(--measure);
  margin-inline: auto;
  padding: clamp(4rem, 9vw, 7rem) var(--gutter) 0;
}
.essay p { margin: 0 0 1.1em; }

code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: #efeadd;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  white-space: nowrap;
}

.pull {
  font-size: clamp(1.4rem, 1.1rem + 1.4vw, 2rem);
  font-style: italic;
  font-weight: 380;
  line-height: 1.3;
  border-left: 3px solid var(--ink);
  padding-left: 1em;
  margin: 1.6em 0 !important;
}

/* status words in prose */
.dot-word { font-weight: 550; }
.dot-word::before {
  content: "";
  display: inline-block;
  width: 0.55em; height: 0.55em;
  border-radius: 50%;
  margin-right: 0.28em;
  vertical-align: baseline;
}
.dot-red { color: var(--red-paper); }
.dot-red::before { background: var(--red); }

.c-red { color: var(--red-paper); }
.c-green { color: var(--green-paper); }
.c-yellow { color: var(--yellow-paper); }
.c-blue { color: var(--blue-paper); }
.bg-red { background: var(--red); }
.bg-green { background: var(--green); }
.bg-yellow { background: var(--yellow); }
.bg-blue { background: var(--blue); }

/* on dark islands the neon versions apply */
.island .c-red { color: var(--red); }
.island .c-green { color: var(--green); }
.island .c-yellow { color: var(--yellow); }
.island .c-blue { color: var(--blue); }

/* ——— hero ——— */

.hero {
  padding-top: clamp(3.5rem, 8vw, 6.5rem);
}
.hero-inner {
  max-width: var(--measure);
  margin-inline: auto;
  padding: 0 var(--gutter);
}
.hero-sub {
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
  max-width: 46ch;
}

/* ——— waitlist form ——— */

.waitlist-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem;
  max-width: 34rem;
  margin: 2rem 0 0;
}
.waitlist-form input[type="email"] {
  font-family: var(--mono);
  font-size: 0.95rem;
  padding: 0.75em 1em;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: #fffdf7;
  color: var(--ink);
  min-width: 0;
}
.waitlist-form input[type="email"]:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 1px;
}
.waitlist-form button {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.75em 1.4em;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: var(--ink);
  color: var(--lime);
  cursor: pointer;
  transition: transform 120ms ease;
}
.waitlist-form button:hover { transform: translateY(-1px); }
.waitlist-form button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}
.waitlist-form button[disabled] { opacity: 0.6; cursor: wait; }
.form-note {
  grid-column: 1 / -1;
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0.2rem 0 0;
}
.form-note.is-success { color: var(--green-paper); }
.form-note.is-error { color: var(--red-paper); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ——— dark islands & art ——— */

.island {
  position: relative;
  background: var(--island);
  color: var(--island-text);
  overflow: hidden;
}
.art-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hero-island {
  margin: clamp(3rem, 7vw, 5rem) auto 0;
  max-width: min(72rem, calc(100% - 2 * var(--gutter)));
  height: clamp(20rem, 48vw, 30rem);
  border-radius: 14px;
  border: 1px solid var(--island-edge);
  box-shadow: 0 30px 80px -30px rgba(27, 27, 27, 0.45);
}

.fake-menubar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4em 1em;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: #b9b4a8;
  background: rgba(19, 19, 18, 0.85);
  border-bottom: 1px solid var(--island-edge);
  backdrop-filter: blur(4px);
}
.mb-left, .mb-right { display: flex; align-items: center; gap: 1em; }
.mb-left strong { color: var(--island-text); font-weight: 500; }
.mb-apple { font-size: 0.9rem; }
.mb-mark { display: block; }
.mb-left span:not(.mb-apple) { display: none; }
@media (min-width: 40rem) {
  .mb-left span:not(.mb-apple) { display: inline; }
}

.island-caption-out {
  max-width: min(72rem, calc(100% - 2 * var(--gutter)));
  margin: 0.8rem auto 0;
  text-align: right;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  min-height: 1.2em;
}
.island-caption-out strong { font-weight: 500; }

/* ——— the self-launching session ——— */

.hero-island { display: flex; flex-direction: column; }

.sim-screen {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  font-family: var(--mono);
  font-size: 0.78rem;
}

.sim-panes {
  flex: 1;
  display: flex;
  min-height: 0;
  padding: 8px;
  gap: 4px;
  transition: opacity 800ms ease;
}
.sim-panes.is-fading { opacity: 0; }

.sp-node {
  display: flex;
  gap: 4px;
  min-width: 0;
  min-height: 0;
  flex-grow: 1;
  flex-basis: 0;
}
.sp-row { flex-direction: row; }
.sp-col { flex-direction: column; }

.sp-leaf {
  position: relative;
  flex-grow: 1;
  flex-basis: 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #33322e;
  border-radius: 6px;
  background: #0d0d0c;
  transition: flex-grow 550ms cubic-bezier(0.4, 0, 0.2, 1), border-color 300ms ease;
  cursor: pointer;
}
.sp-leaf:hover { border-color: #55534c; }
.sp-leaf:hover::after {
  content: attr(data-title);
  position: absolute;
  top: 4px;
  right: 7px;
  font-size: 0.66rem;
  color: #85806f;
}
.sp-leaf.sp-blocked { border-color: var(--red); }

.sp-body {
  position: absolute;
  inset: 0;
  padding: 0.55rem 0.7rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.22em;
  color: #c9c4b6;
  overflow: hidden;
}
.sp-body.sp-glyphhost { padding: 0; }

.sp-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.sp-prompt { color: var(--lime); }
.sp-ok { color: var(--green); }
.sp-warn { color: var(--red); }
.sp-spin { color: var(--green); display: inline-block; min-width: 1ch; }
.sp-agent-dot {
  display: inline-block;
  width: 0.5em; height: 0.5em;
  border-radius: 50%;
  background: var(--green);
  margin-right: 0.45em;
}
.sp-blocked .sp-agent-dot { background: var(--red); }

.sp-cursor {
  display: inline-block;
  width: 0.55em; height: 1em;
  background: #c9c4b6;
  vertical-align: text-bottom;
  margin-left: 1px;
  animation: sp-blink 1.05s steps(1) infinite;
}
@keyframes sp-blink { 50% { opacity: 0; } }

/* fake editor */
.sp-ed {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}
.sp-ed-code {
  flex: 1;
  padding: 0.55rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.18em;
  overflow: hidden;
  color: #b9b4a8;
}
.sp-ed-code span { white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.sp-ed-code i { font-style: normal; color: #55534c; margin-right: 0.6em; }
.sp-ed-code b { font-weight: 400; color: var(--blue); }
.sp-ed-code em { font-style: normal; color: var(--yellow); }
.sp-ed-tilde { color: #3d3b35; }
.sp-ed-status {
  padding: 0.2em 0.7em;
  background: #22221f;
  color: #85806f;
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* tmux status bar inside the island */
.sim-status {
  display: flex;
  align-items: center;
  gap: 1em;
  padding: 0.32em 0.9em;
  background: #1d1d1b;
  border-top: 1px solid var(--island-edge);
  color: #9a958a;
  font-size: 0.74rem;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 500ms ease, transform 500ms ease;
}
.sim-status.is-on { opacity: 1; transform: none; }
.sim-session { color: var(--lime); font-weight: 500; }
.sim-status-right { margin-left: auto; }

/* ——— feature blocks ——— */

.features { padding-bottom: 2rem; }

.mark-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(1.2rem, 4vw, 3rem);
  max-width: 60rem;
  margin: clamp(2.5rem, 6vw, 4rem) auto;
  padding: 0 var(--gutter);
}
.mark-legend figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}
.mark-legend figcaption {
  display: flex;
  flex-direction: column;
  font-family: var(--mono);
  font-size: 0.78rem;
}
.mark-legend figcaption strong { font-weight: 500; }
.mark-legend figcaption strong::before {
  content: "";
  display: inline-block;
  width: 0.5em; height: 0.5em;
  border-radius: 50%;
  margin-right: 0.4em;
  background: currentColor;
}
.mark-legend .c-red::before { background: var(--red); }
.mark-legend .c-green::before { background: var(--green-paper); }
.mark-legend .c-yellow::before { background: var(--yellow); }
.mark-legend .c-blue::before { background: var(--blue-paper); }
.mark-legend figcaption span { color: var(--muted); }
.legend-hot img { filter: drop-shadow(0 0 10px rgba(255, 6, 0, 0.35)); }

.feature-block {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  max-width: 68rem;
  margin: clamp(3rem, 7vw, 5.5rem) auto 0;
  padding: 0 var(--gutter);
}
.feature-flip .feature-text { order: 2; }
.feature-flip .feature-visual { order: 1; }
@media (max-width: 52rem) {
  .feature-block { grid-template-columns: 1fr; }
  .feature-flip .feature-text { order: 1; }
  .feature-flip .feature-visual { order: 2; }
}
.feature-text p { max-width: 52ch; }

/* mockups (all aria-hidden, decorative) */

.popover-mock {
  background: var(--island);
  border: 1px solid var(--island-edge);
  border-radius: 12px;
  padding: 0.9rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--island-text);
  box-shadow: 0 20px 50px -20px rgba(27, 27, 27, 0.5);
}
.pm-group {
  margin: 0 0 0.5rem;
  color: #85806f;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.pm-row {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.45em 0.5em;
  border-radius: 6px;
}
.pm-row:hover { background: #22221f; }
.pm-live { background: #22221f; }
.pm-appicon { color: #85806f; font-size: 0.9em; }
.pm-dot {
  width: 0.55em; height: 0.55em;
  border-radius: 50%;
  flex-shrink: 0;
}
.pm-name {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-task {
  font-weight: 400;
  color: #85806f;
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pm-meta { color: #85806f; font-size: 0.72rem; white-space: nowrap; }
.pm-act { color: #85806f; padding: 0 0.15em; }
.pm-play { color: var(--island-text); }
.pm-agent { margin-left: 1.4rem; }
.pm-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.7rem;
  padding: 0.55em 0.5em 0.1em;
  border-top: 1px solid var(--island-edge);
  color: #b9b4a8;
}
.pm-brand { display: flex; align-items: center; gap: 0.5em; font-weight: 500; }
.pm-ver { color: #85806f; font-weight: 400; font-size: 0.72rem; }
.pm-tools { color: #85806f; letter-spacing: 0.35em; }

.layout-mock {
  background: var(--island);
  border: 1px solid var(--island-edge);
  border-radius: 12px;
  padding: 0.9rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--island-text);
  box-shadow: 0 20px 50px -20px rgba(27, 27, 27, 0.5);
}
.lm-title {
  color: #85806f;
  margin-bottom: 0.6rem;
  display: flex;
  justify-content: space-between;
  gap: 1em;
}
.lm-tools { color: #55534c; }
.lm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  min-height: 9rem;
}
.lm-pane {
  border: 1px solid #33322e;
  border-radius: 4px;
  padding: 0.5em 0.7em;
  color: var(--lime);
}
.lm-wide { grid-column: 1 / -1; }
.lm-launch {
  margin-top: 0.7rem;
  color: var(--island);
  background: var(--lime);
  display: inline-block;
  padding: 0.35em 0.8em;
  border-radius: 5px;
  font-weight: 500;
}

.yaml-mock {
  background: var(--island);
  border: 1px solid var(--island-edge);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--island-text);
  box-shadow: 0 20px 50px -20px rgba(27, 27, 27, 0.5);
  overflow-x: auto;
}
.ym-title { color: #85806f; margin-bottom: 0.6rem; }
.yaml-mock pre {
  margin: 0;
  line-height: 1.55;
}
.ym-k { color: var(--blue); }

.notif-mock {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: #fffdf7;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 0.9rem 1.1rem;
  box-shadow: 0 16px 40px -18px rgba(27, 27, 27, 0.35);
  font-family: var(--mono);
  font-size: 0.8rem;
}
.notif-mock div { display: flex; flex-direction: column; gap: 0.15em; }
.notif-mock strong { font-weight: 500; }
.notif-mock span { color: var(--muted); font-size: 0.74rem; }

.kbd-mock { text-align: center; }
.kbd {
  display: inline-block;
  font-family: var(--mono);
  font-size: 1.1rem;
  padding: 0.5em 0.75em;
  margin: 0 0.15em;
  background: #fffdf7;
  border: 1.5px solid var(--ink);
  border-bottom-width: 3.5px;
  border-radius: 8px;
}
.kbd-terms {
  margin-top: 1.2rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

/* ——— dark band: how it knows ——— */

.band {
  margin-top: clamp(4rem, 9vw, 7rem);
  padding: clamp(4rem, 8vw, 6.5rem) 0;
}
.band-content {
  position: relative;
  z-index: 2;
  max-width: var(--measure);
  margin-inline: auto;
  padding: 0 var(--gutter);
}
.band h2 { color: #f2efe6; }
.band-lede { color: #c9c4b6; max-width: 52ch; }

.tiers {
  list-style: none;
  margin: 2.5rem 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}
.tiers li {
  border-left: 2px solid #33322e;
  padding-left: 1.3rem;
}
.tiers h3 { color: #f2efe6; margin-bottom: 0.3em; }
.tiers p { color: #b9b4a8; margin: 0; max-width: 56ch; }
.tier-tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--island);
  background: var(--lime);
  padding: 0.15em 0.6em;
  border-radius: 3px;
  display: inline-block;
  margin-bottom: 0.6rem;
}
.band-close {
  color: #c9c4b6;
  font-style: italic;
  font-size: 1.1em;
  max-width: 48ch;
}

/* ——— maker's note ——— */

.note .signature {
  font-size: 1.5rem;
  font-style: italic;
  margin-top: 1.5rem;
}

/* ——— footer ——— */

.footer {
  border-top: 1px solid var(--hairline);
  margin-top: clamp(4rem, 9vw, 7rem);
  padding-bottom: 3rem;
}
.footer .essay { padding-top: clamp(3rem, 6vw, 4.5rem); }
.footer-meta {
  max-width: var(--measure);
  margin: 4rem auto 0;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: 1.2rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
}
.footer-meta img { opacity: 0.85; }
.footer-meta p { margin: 0; }

/* ——— reveals ——— */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 600ms ease, transform 600ms ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .waitlist-form button { transition: none; }
  .sp-leaf { transition: none; }
  .sp-cursor { animation: none; }
  .sim-status { transition: none; }
  .sim-panes { transition: none; }
}
