/* Tabsurface landing. Colors mirror the extension (src/canvas/canvas.css). */

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('/fonts/bricolage-grotesque.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}

@font-face {
  font-family: 'Instrument Sans';
  src: url('/fonts/instrument-sans.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --bg: #f3f3f6;
  --dot: #d3d3dc;
  --surface: #ffffff;
  --surface-2: #f6f6f9;
  --border: #e3e3ea;
  --border-strong: #cfcfda;
  --text: #1b1b22;
  --muted: #62626f;
  --accent: #5b5bd6;
  --accent-hover: #4a4ac4;
  --accent-ink: #4f4fcf;
  --accent-soft: #ececfd;
  --up: #17875a;
  --up-soft: #dcf3e8;
  --down: #cf3f55;
  --down-soft: #fbe3e7;
  --amber: #b97a08;
  --shadow: 0 1px 2px rgb(16 16 32 / 6%), 0 8px 24px rgb(16 16 32 / 8%);
  --shadow-lg: 0 2px 4px rgb(16 16 32 / 8%), 0 16px 40px rgb(16 16 32 / 14%);

  --display: 'Bricolage Grotesque', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --body: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --gutter: 24px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131317;
    --dot: #2c2c35;
    --surface: #1d1d23;
    --surface-2: #25252d;
    --border: #2f2f39;
    --border-strong: #3d3d49;
    --text: #ececf2;
    --muted: #a0a0b0;
    --accent: #5b5bd6;
    --accent-hover: #6c6ce2;
    --accent-ink: #a3a3f7;
    --accent-soft: #2a2a4a;
    --up: #4cc38f;
    --up-soft: #17392c;
    --down: #f06b7f;
    --down-soft: #44202a;
    --amber: #e0a63a;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 35%);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / 35%), 0 16px 40px rgb(0 0 0 / 50%);
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: min(1120px, 100%);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--surface);
  border-radius: 8px;
}

/* --- Header ---------------------------------------------------------------- */

.top {
  display: flex;
  align-items: center;
  gap: 28px;
  padding-block: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 650 19px/1 var(--display);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand img {
  width: 28px;
  height: 28px;
}

.top nav {
  display: flex;
  gap: 24px;
  margin-left: auto;
  font-size: 15px;
}

.top nav a {
  color: var(--muted);
  text-decoration: none;
}

.top nav a:hover {
  color: var(--text);
}

/* --- Buttons --------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font: 600 16px/1.2 var(--body);
  text-align: center;
  text-decoration: none;
  transition: background-color 0.15s;
}

.btn:hover {
  background: var(--accent-hover);
}

.btn.small {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 14px;
}

/* Shown until the store link exists (see STORE_URL in app.js). */
.btn.is-soon,
.btn.is-soon:hover {
  border: 1px dashed var(--border-strong);
  background: var(--surface);
  color: var(--muted);
  cursor: default;
}

.link {
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
  text-underline-offset: 3px;
}

.link:hover {
  text-decoration: underline;
}

/* --- Hero ------------------------------------------------------------------ */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: end;
  gap: 32px 56px;
  padding-block: clamp(36px, 7vw, 84px) clamp(32px, 5vw, 56px);
}

.hero h1 {
  font: 700 clamp(2.6rem, 6.3vw, 5.1rem) / 0.98 var(--display);
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.hero-side p {
  max-width: 34em;
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--muted);
}

.hero-side p strong {
  color: var(--text);
  font-weight: 600;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  margin-top: 26px;
}

.fine {
  margin-top: 14px;
  font-size: 14px;
  color: var(--muted);
}

/* --- Stage: a small working canvas ------------------------------------------
   Everything inside is sized in design pixels times --u, so the whole board
   scales with the stage width and needs no script to lay out. */

.stage-wrap {
  width: min(1280px, 100%);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.stage {
  --u: 1px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background-color: var(--bg);
  background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.2px);
  background-size: 22px 22px;
  box-shadow: var(--shadow-lg);
  container-type: inline-size;
}

.world {
  padding: 12px;
  font-size: calc(13 * var(--u));
  line-height: 1.4;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: calc(2 * var(--u));
  width: fit-content;
  max-width: 100%;
  margin-bottom: 12px;
  padding: calc(4 * var(--u));
  border: 1px solid var(--border);
  border-radius: calc(10 * var(--u));
  background: var(--surface);
  box-shadow: var(--shadow);
}

.toolbar button {
  height: calc(28 * var(--u));
  padding: 0 calc(10 * var(--u));
  border: 0;
  border-radius: calc(6 * var(--u));
  background: transparent;
  color: var(--muted);
  font: 500 calc(13 * var(--u)) / 1 var(--body);
  cursor: pointer;
}

.toolbar button:hover {
  background: var(--surface-2);
  color: var(--text);
}

.toolbar button[aria-pressed='true'] {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
}

.toolbar .sep {
  width: 1px;
  height: calc(20 * var(--u));
  margin: 0 calc(4 * var(--u));
  background: var(--border);
}

.toolbar .arrange {
  display: none;
}

.board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 236px;
  border: 1px solid var(--border);
  border-radius: calc(10 * var(--u));
  background: var(--surface);
  box-shadow: var(--shadow);
}

/* The card that has the keyboard: a thin line, as in the extension. */
.card.focused {
  border-color: var(--accent-ink);
  box-shadow: var(--shadow-lg);
}

.card-h {
  display: flex;
  flex: none;
  align-items: center;
  gap: calc(8 * var(--u));
  height: calc(34 * var(--u));
  padding: 0 calc(10 * var(--u));
  border-bottom: 1px solid var(--border);
  border-radius: calc(10 * var(--u)) calc(10 * var(--u)) 0 0;
  background: var(--surface-2);
  user-select: none;
}

.card-h b {
  overflow: hidden;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.card-h .host {
  flex: 0 1000 auto;
  overflow: hidden;
  color: var(--muted);
  font-size: calc(12 * var(--u));
  white-space: nowrap;
  text-overflow: ellipsis;
}

.card-h .dots {
  margin-left: auto;
  color: var(--muted);
  font-size: calc(15 * var(--u));
  letter-spacing: 0.05em;
}

.fav {
  flex: none;
  width: calc(14 * var(--u));
  height: calc(14 * var(--u));
  border-radius: calc(4 * var(--u));
  background: var(--c, var(--accent));
}

.card-b {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: calc(14 * var(--u));
  border-radius: 0 0 calc(10 * var(--u)) calc(10 * var(--u));
}

.kpi {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 calc(10 * var(--u));
}

.kpi span {
  flex: 1 0 100%;
  color: var(--muted);
  font-size: calc(12 * var(--u));
}

.kpi strong {
  font: 650 calc(28 * var(--u)) / 1.2 var(--display);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.kpi em {
  color: var(--muted);
  font-style: normal;
  font-size: calc(12 * var(--u));
  font-variant-numeric: tabular-nums;
}

.kpi em.up,
.kpi em.down {
  font-weight: 600;
}

.kpi em.up {
  color: var(--up);
}

.kpi em.down {
  color: var(--down);
}


.live::before {
  content: '';
  display: inline-block;
  width: calc(7 * var(--u));
  height: calc(7 * var(--u));
  margin-right: calc(6 * var(--u));
  border-radius: 50%;
  background: var(--up);
  animation: pulse 1.8s ease-in-out infinite;
}

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

.chart {
  display: block;
  flex: 1;
  width: 100%;
  min-height: 0;
  margin-top: calc(10 * var(--u));
  color: var(--c, var(--accent-ink));
  overflow: visible;
}

.chart path,
.chart line {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.chart .area {
  fill: currentColor;
  fill-opacity: 0.1;
  stroke: none;
}

.chart .bar {
  fill: currentColor;
  fill-opacity: 0.3;
}

.chart .bar:last-child {
  fill-opacity: 1;
}

.chart .c-up {
  color: var(--up);
  fill: currentColor;
}

.chart .c-down {
  color: var(--down);
  fill: currentColor;
}

.rows {
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: calc(-6 * var(--u)) 0;
}

.rows li {
  display: flex;
  align-items: center;
  gap: calc(9 * var(--u));
  padding: calc(8 * var(--u)) 0;
  border-bottom: 1px solid var(--border);
}

.rows li:last-child {
  border-bottom: 0;
}

.rows span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rows small {
  flex: none;
  color: var(--muted);
  font-size: calc(12 * var(--u));
  font-variant-numeric: tabular-nums;
}

.rows .n {
  flex: none;
  width: calc(16 * var(--u));
  color: var(--muted);
  font-size: calc(12 * var(--u));
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.lvl {
  flex: none;
  width: calc(8 * var(--u));
  height: calc(8 * var(--u));
  border-radius: 50%;
  background: var(--c, var(--muted));
}

.tag {
  flex: none;
  padding: calc(1 * var(--u)) calc(7 * var(--u));
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: calc(11 * var(--u));
  font-weight: 600;
}

.tag.ok {
  background: var(--up-soft);
  color: var(--up);
}

.tag.wait {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.heat {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: 1fr 1fr;
  gap: calc(4 * var(--u));
  min-height: 0;
}

.heat span {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
  overflow: hidden;
  padding: calc(8 * var(--u));
  border-radius: calc(6 * var(--u));
  background: var(--up-soft);
  color: var(--up);
  font-weight: 600;
  font-size: calc(12 * var(--u));
  line-height: 1.25;
}

.heat span.neg {
  background: var(--down-soft);
  color: var(--down);
}

.heat span i {
  font-style: normal;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.stage-note {
  margin-top: 14px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
}

.stage-note .wide-only {
  display: none;
}

/* Phones: one row of cards to swipe through. */
@media (max-width: 639px) {
  .board {
    display: flex;
    overflow-x: auto;
    margin-inline: -12px;
    padding: 0 12px 6px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .card {
    flex: 0 0 82%;
    scroll-snap-align: center;
  }
}

/* Wide screens: the real thing. Cards sit where their --x/--y say, in a
   1080 × 580 design space, and can be dragged (app.js). */
@media (min-width: 1024px) {
  .stage {
    --u: calc(100cqw / 1080);
    aspect-ratio: 1080 / 580;
  }

  .world {
    position: absolute;
    inset: 0;
    padding: 0;
  }

  .toolbar {
    position: absolute;
    left: calc(16 * var(--u));
    top: calc(14 * var(--u));
    z-index: 1000;
    margin: 0;
  }

  .toolbar .arrange {
    display: inline-block;
  }

  .board {
    display: block;
  }

  .card {
    position: absolute;
    left: calc(var(--x) * var(--u));
    top: calc(var(--y) * var(--u));
    width: calc(var(--w) * var(--u));
    height: calc(var(--h) * var(--u));
  }

  .card.settling {
    transition:
      left 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
      top 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
      width 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
      height 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .card-h {
    cursor: grab;
    touch-action: none;
  }

  .card.dragging {
    box-shadow: var(--shadow-lg);
  }

  .card.dragging .card-h {
    cursor: grabbing;
  }

  .stage-note .wide-only {
    display: inline;
  }
}

/* --- Sections -------------------------------------------------------------- */

section {
  padding-block: clamp(64px, 9vw, 120px);
}

h2 {
  font: 650 clamp(1.9rem, 3.6vw, 2.9rem) / 1.05 var(--display);
  letter-spacing: -0.03em;
  text-wrap: balance;
}

h3 {
  font: 650 1.3rem/1.2 var(--display);
  letter-spacing: -0.015em;
}

.lede {
  max-width: 36em;
  margin-top: 16px;
  color: var(--muted);
}

/* Why: heading on the left, four plain statements on the right. */
.why {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 40px 72px;
}

.why-list li {
  padding-block: 24px;
  border-top: 1px solid var(--border-strong);
}

.why-list li:first-child {
  padding-top: 0;
  border-top: 0;
}

.why-list p {
  max-width: 34em;
  margin-top: 8px;
  color: var(--muted);
}

/* How: three steps, in the order you'd do them. */
.how {
  border-block: 1px solid var(--border);
  background: var(--surface);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
  margin-top: 48px;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
}

.steps figure {
  display: grid;
  place-items: center;
  height: 168px;
  margin-bottom: 22px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background-color: var(--bg);
  background-image: radial-gradient(circle, var(--dot) 1px, transparent 1.2px);
  background-size: 18px 18px;
}

.steps h3::before {
  content: counter(step) '. ';
  color: var(--accent-ink);
}

.steps p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 16px;
}

.keys {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

.keys div {
  display: flex;
  align-items: center;
  gap: 6px;
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 3px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: 600 13px/1 var(--mono);
}

.steps svg {
  width: 200px;
  height: 124px;
}

.ill-card {
  fill: var(--surface);
  stroke: var(--border-strong);
}

.ill-head {
  fill: var(--surface-2);
  stroke: var(--border-strong);
}

.ill-ghost {
  fill: none;
  stroke: var(--accent-ink);
  stroke-dasharray: 4 4;
}

.ill-focus {
  fill: var(--surface);
  stroke: var(--accent-ink);
  stroke-width: 1.5;
}

.ill-line {
  fill: none;
  stroke: var(--accent-ink);
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ill-ink {
  fill: var(--text);
}

.ill-frame {
  fill: none;
  stroke: var(--text);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Pricing */
.plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  max-width: 820px;
  margin-top: 44px;
}

.plan {
  display: flex;
  flex-direction: column;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.plan.pro {
  border-color: var(--accent-ink);
}

.plan-name {
  font: 650 1.1rem/1 var(--display);
  color: var(--muted);
}

.plan.pro .plan-name {
  color: var(--accent-ink);
}

.price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 14px;
  font: 700 3.25rem/1 var(--display);
  letter-spacing: -0.04em;
}

.price small {
  font: 500 15px/1.2 var(--body);
  letter-spacing: 0;
  color: var(--muted);
}

.plan ul {
  flex: 1;
  margin-top: 22px;
}

.plan li {
  position: relative;
  padding: 9px 0 9px 26px;
  border-top: 1px solid var(--border);
  font-size: 16px;
}

.plan li::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 16px;
  width: 11px;
  height: 6px;
  border: solid var(--accent-ink);
  border-width: 0 0 2px 2px;
  rotate: -45deg;
}

.plan .btn {
  margin-top: 24px;
}

.plan-note {
  margin-top: 24px;
  font-size: 15px;
  color: var(--muted);
}

/* FAQ */
.faq {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: 32px 72px;
}

.faq details {
  border-top: 1px solid var(--border-strong);
}

.faq details:last-child {
  border-bottom: 1px solid var(--border-strong);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: 18px;
  font: 600 1.15rem/1.3 var(--display);
  letter-spacing: -0.01em;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '+';
  flex: none;
  font: 400 1.5rem/1 var(--body);
  color: var(--muted);
  transition: rotate 0.2s;
}

.faq details[open] summary::after {
  rotate: 45deg;
}

.faq details p {
  max-width: 38em;
  padding-bottom: 20px;
  color: var(--muted);
}

/* Closing call */
.close {
  text-align: center;
}

.close h2 {
  font-size: clamp(2.2rem, 5.2vw, 4rem);
}

.close .cta {
  justify-content: center;
  margin-top: 30px;
}

/* Footer */
.foot {
  padding-block: 28px 40px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--muted);
}

.foot .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
}

.foot .brand {
  font-size: 16px;
  color: var(--text);
}

.foot .brand img {
  width: 22px;
  height: 22px;
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-left: auto;
}

.foot a:not(.brand) {
  text-underline-offset: 3px;
}

.legal {
  flex: 1 0 100%;
  font-size: 13px;
}

/* --- Text pages (privacy, 404) --------------------------------------------- */

.prose {
  max-width: 44rem;
  padding-block: clamp(32px, 6vw, 72px) clamp(56px, 8vw, 104px);
}

.prose h1 {
  font: 700 clamp(2.1rem, 4.6vw, 3.2rem) / 1.02 var(--display);
  letter-spacing: -0.03em;
}

.prose h2 {
  margin-top: 44px;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

.prose p {
  margin-top: 14px;
}

.prose .meta {
  color: var(--muted);
  font-size: 15px;
}

.prose a {
  color: var(--accent-ink);
  text-underline-offset: 3px;
}

/* --- Narrow screens -------------------------------------------------------- */

@media (max-width: 859px) {
  .hero,
  .why,
  .faq {
    grid-template-columns: minmax(0, 1fr);
  }

  .steps {
    grid-template-columns: minmax(0, 1fr);
    max-width: 520px;
  }
}

@media (max-width: 639px) {
  :root {
    --gutter: 18px;
  }

  body {
    font-size: 16px;
  }

  .top nav {
    display: none;
  }

  .top .btn {
    margin-left: auto;
  }

  .plans {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
