/* bite.ktesio.dev: the bite palette, wordmark, hero art, the terminal mock
   and the animated card elements. Layout and components come from base.css
   (shared/css/base.css), which loads first.
   Dark is the default: harbour ink and mint; [data-theme="light"] is the
   seafoam paper theme. scripts/contrast.py checks every text pair below
   against WCAG AA. */

/* ---------------------------------------------------------------- tokens */
:root {
  color-scheme: dark;
  --bg: #0b1311;
  --bg-2: #101917;
  --bg-3: #17231f;
  --term: #070d0b;
  --term-2: #0b1310;
  --line: #1a2723;
  --line-2: #283a34;
  --fg: #e9f0e9;
  --fg-2: #c0ccc4;
  --muted: #8fa39a;
  --dim: #7d9088;
  --accent: #6cd3a1;
  --ok: #5fc6c0;
  --warn: #e3b34c;
  --bad: #f0876a;
  --bad-bg: rgba(240, 135, 106, 0.1);
  --focus: #9fe8c8;
  --art: rgba(108, 211, 161, 0.2);
  --num: #5d7069;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2ec;
  --bg-2: #e5ebe2;
  --bg-3: #dae2d6;
  --term: #f7faf5;
  --term-2: #edf2e9;
  --line: #cfd8cc;
  --line-2: #b3c1b2;
  --fg: #17211c;
  --fg-2: #35423b;
  --muted: #5a6a61;
  --dim: #56655e;
  --accent: #0d6b4e;
  --ok: #0a6d63;
  --warn: #7a5a0d;
  --bad: #b0431f;
  --bad-bg: rgba(176, 67, 31, 0.08);
  --focus: #0d6b4e;
  --art: rgba(13, 107, 78, 0.13);
  --num: #75857c;
}

/* ---------------------------------------------------------------- wordmark */
.mark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font: 700 23px/1 var(--serif);
  letter-spacing: -0.01em;
}
/* An app tile with a bite out of its corner. */
.tile {
  position: relative;
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 3.5px;
  background: var(--accent);
}
.tile::after {
  content: "";
  position: absolute;
  top: -3.5px;
  right: -3.5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bg);
}
.mark-sm {
  font-size: 19px;
}
.mark-sm .tile {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.mark-sm .tile::after {
  top: -3px;
  right: -3px;
  width: 6px;
  height: 6px;
}

/* ---------------------------------------------------------------- hero art */
.rail {
  position: absolute;
  top: 34px;
  right: -40px;
  width: min(620px, 50vw);
  color: var(--art);
  pointer-events: none;
}
@media (max-width: 900px) {
  .rail {
    display: none;
  }
}

/* ---------------------------------------------------------------- the mock */
.fig {
  padding: 40px var(--pad) 38px;
  border-bottom: 1px solid var(--line);
}
/* A .label-row instance (base.css); only the spacing is ours. */
.fig-head {
  margin-bottom: 16px;
}
.mock {
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: var(--r-term);
  background: var(--term);
  color: var(--fg-2);
  font: 400 12px/1.5 var(--mono);
}
.mock-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: var(--term-2);
  color: var(--dim);
  font-size: 11.5px;
}
.mock-sep {
  margin: 0 4px;
}
.mock-replay {
  padding: 4px 9px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.mock-replay:hover {
  border-color: var(--accent);
  color: var(--fg);
}
.mock-body {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  height: 620px;
}
.side {
  overflow-y: auto;
  padding: 8px 0 14px;
  border-right: 1px solid var(--line);
  background: var(--term-2);
  scrollbar-width: thin;
}
.side-h {
  margin: 10px 14px 4px;
  color: var(--dim);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.side ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
/* An app row: a legend, not a button — the six apps and their tool counts,
   from the same registry the panes run. */
.approw {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 8px 14px 9px 12px;
  border-left: 2px solid transparent;
}
.approw-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.approw-name {
  overflow: hidden;
  color: var(--fg);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.approw-ct {
  margin-left: auto;
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
}
.dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent);
}
.approw-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--dim);
  font-size: 11px;
}
.view-btn {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 8px 14px 9px 12px;
  border: 0;
  border-left: 2px solid transparent;
  background: transparent;
  color: var(--fg-2);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
html:not(.js) .view-btn {
  cursor: default;
}
.view-btn:hover {
  background: color-mix(in srgb, var(--bg-3) 70%, transparent);
}
.view-btn[aria-current="true"] {
  border-left-color: var(--accent);
  background: var(--bg-3);
}
.view-btn .approw-name {
  color: var(--fg);
}
.view-cmd {
  color: var(--dim);
  font-size: 10.5px;
}
.main {
  position: relative;
  min-width: 0;
}
.view {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 16px 12px;
  padding: 18px 14px 12px;
}
.view[hidden] {
  display: none;
}
.layout-single {
  grid-template: "top" minmax(0, 1fr) / minmax(0, 1fr);
}
.area-top {
  grid-area: top;
}
.pane {
  position: relative;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line-2);
  border-radius: 4px;
}
.view[data-view="search"] .pane {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line-2));
}
.pane-t {
  position: absolute;
  top: -8px;
  left: 10px;
  z-index: 1;
  padding: 0 6px;
  background: var(--term);
  color: var(--muted);
  font-size: 11px;
  line-height: 16px;
}
/* column-reverse keeps a full pane scrolled to its newest line, like a
   terminal; the auto margin keeps a short one at the top. */
.pane-b {
  display: flex;
  flex-direction: column-reverse;
  height: 100%;
  padding: 13px 12px 8px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 12px);
}
.pane-b > .term {
  margin-bottom: auto;
}
.pane-b:focus-visible {
  outline-offset: -2px;
}
.term {
  margin: 0;
  font: inherit;
  white-space: pre;
}
.ln.wrap {
  white-space: pre-wrap;
}
.term code {
  font: inherit;
}
/* Pre-replay lines hide with opacity, not display: they stay in the
   accessibility tree, so a screen reader reads the whole terminal before
   the replay. mock.js reveals a line by dropping the class; the transition
   is the fade-in, and reduced motion turns it off globally (base.css). */
.ln {
  transition: opacity 0.18s ease;
}
.ln.pending {
  opacity: 0;
  /* Still in the tree (that is the point), so keep the unseen lines out
     of selection and pointer reach until the class drops. */
  user-select: none;
  pointer-events: none;
}
.ln.flash {
  animation: flash 1.4s ease-out;
}
@keyframes flash {
  from {
    background: color-mix(in srgb, var(--accent) 30%, transparent);
  }
  to {
    background: transparent;
  }
}
.k-dim,
.k-rule,
.k-meter {
  color: var(--dim);
}
.k-label {
  color: var(--muted);
}
.k-prompt,
.k-accent {
  color: var(--accent);
}
.k-cmd,
.k-head {
  color: var(--fg);
}
.k-head {
  font-weight: 600;
}
.k-ok {
  color: var(--ok);
}
.k-warn {
  color: var(--warn);
}
.k-bad {
  color: var(--bad);
}
.figcap {
  margin: 14px 0 0;
  color: var(--muted);
  font: italic 400 14px/1.55 var(--sans);
}
@media (max-width: 1100px) {
  .mock {
    font-size: 11.5px;
  }
}
@media (max-width: 900px) {
  .mock {
    font-size: 11px;
  }
  .mock-bar {
    flex-wrap: wrap;
    padding: 6px 10px;
  }
  .mock-body {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
  }
  .side {
    display: flex;
    gap: 6px;
    padding: 8px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
  }
  .side::-webkit-scrollbar {
    display: none;
  }
  .fig-hint {
    display: none;
  }
  .side-h {
    display: none;
  }
  .side ul {
    display: contents;
  }
  .side li {
    flex: none;
  }
  .approw,
  .view-btn {
    width: 168px;
    height: 100%;
    border: 1px solid var(--line-2);
    border-radius: 4px;
  }
  .view-btn[aria-current="true"] {
    border-color: var(--accent);
  }
  .view {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 16px 10px 12px;
  }
  .view[hidden] {
    display: none;
  }
  .pane {
    height: 300px;
  }
  .layout-single .pane {
    height: 420px;
  }
}

/* ---------------------------------------------------------------- 404 terminal */
.term-404 {
  max-width: 100%;
  margin: 8px 0 28px;
  padding: 16px 18px;
  overflow-x: auto;
  border: 1px solid var(--line-2);
  border-radius: var(--r-term);
  background: var(--term);
  font: 400 13px/1.6 var(--mono);
}

/* ---------------------------------------------------------------- card live elements */
/* The feature-card terminal snippets, next to the animations that drive
   them. Every line is real bite output (data/mock.json cards). */
.ev {
  align-self: center;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-term);
  background: var(--term);
  color: var(--fg-2);
  font: 400 11.5px/1.55 var(--mono);
}
.ev-log {
  margin: 0;
  font: inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ev-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--fg);
}
.ev-note {
  color: var(--dim);
  font-size: 11px;
}
.st {
  padding: 4px 9px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font: 600 11px/1 var(--mono);
  font-style: normal;
}
.st-ok {
  color: var(--ok);
}
.st-bad {
  color: var(--bad);
}
.st-warn {
  color: var(--warn);
}
.st-dim {
  color: var(--muted);
}
@media (max-width: 980px) {
  .ev {
    grid-column: 2;
  }
}
@media (max-width: 600px) {
  .ev {
    grid-column: 1;
  }
}
/* The six-app pill row on card 01, cycling which pill is lit. */
.cycle {
  display: grid;
  justify-items: end;
}
.apps-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.apps-row .st {
  animation: 9s infinite;
  opacity: 0;
}
.apps-row .st:nth-child(6n+1) { animation-name: cyc-1; }
.apps-row .st:nth-child(6n+2) { animation-name: cyc-2; }
.apps-row .st:nth-child(6n+3) { animation-name: cyc-3; }
.apps-row .st:nth-child(6n+4) { animation-name: cyc-4; }
.apps-row .st:nth-child(6n+5) { animation-name: cyc-5; }
.apps-row .st:nth-child(6n+6) { animation-name: cyc-6; }
@keyframes cyc-1 { 0%, 15% { opacity: 1; } 16%, 100% { opacity: 0.35; } }
@keyframes cyc-2 { 0%, 15% { opacity: 0.35; } 16%, 31% { opacity: 1; } 32%, 100% { opacity: 0.35; } }
@keyframes cyc-3 { 0%, 31% { opacity: 0.35; } 32%, 47% { opacity: 1; } 48%, 100% { opacity: 0.35; } }
@keyframes cyc-4 { 0%, 47% { opacity: 0.35; } 48%, 63% { opacity: 1; } 64%, 100% { opacity: 0.35; } }
@keyframes cyc-5 { 0%, 63% { opacity: 0.35; } 64%, 79% { opacity: 1; } 80%, 100% { opacity: 0.35; } }
@keyframes cyc-6 { 0%, 79% { opacity: 0.35; } 80%, 95% { opacity: 1; } 96%, 100% { opacity: 0.35; } }
/* The lock bar on card 05: one tight beam, nothing leaves. */
.wire {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 8px;
}
.wire i {
  position: relative;
  flex: 1;
  height: 1px;
  overflow: hidden;
  background: var(--line-2);
}
.wire i::after {
  content: "";
  position: absolute;
  top: 0;
  left: -12%;
  width: 12%;
  height: 1px;
  background: var(--accent);
  animation: packet 2.2s linear infinite;
}
@keyframes packet {
  to { left: 100%; }
}

/* ---------------------------------------------------------------- more from Ktesio */
.more {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 24px;
  padding: 20px var(--pad);
  border-bottom: 1px solid var(--line);
  font: 400 12.5px/1.6 var(--mono);
}
.more-h {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.more ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.more a {
  color: var(--fg);
  text-underline-offset: 3px;
}
.more span {
  color: var(--muted);
}
.more-all {
  margin-left: auto;
  color: var(--accent);
  text-underline-offset: 3px;
}
@media (max-width: 760px) {
  .more-all {
    margin-left: 0;
  }
}

/* ---------------------------------------------------------------- closing install */
.end {
  padding: clamp(56px, 8vw, 104px) var(--pad);
}
.end h2 {
  max-width: 13ch;
  margin: 0 0 20px;
  color: var(--fg);
  font: 700 clamp(2.2rem, 4.8vw, 3.5rem)/1.03 var(--serif);
  letter-spacing: -0.02em;
}
.end > p:not(.meta) {
  max-width: 34rem;
  margin: 0 0 28px;
}

/* ---------------------------------------------------------------- phones */
/* Nothing under 12px on a phone; base.css floors the shared classes. */
@media (max-width: 600px) {
  .mock,
  .ev,
  .ev-note,
  .more,
  .more-h,
  .st,
  .pane-t,
  .approw-meta,
  .approw-ct,
  .view-cmd,
  .mock-bar {
    font-size: 12px;
  }
}

/* ---------------------------------------------------------------- motion */
@media (prefers-reduced-motion: reduce) {
  .apps-row .st {
    opacity: 0.35;
  }
  .apps-row .st:nth-child(1) {
    opacity: 1;
  }
}
