/* Homepage feature sections: AI assistant (MCP) and auto-categorization.
   Dark is the default theme, light is opted into with html[data-theme="light"].
   Without JavaScript (or with reduced motion) every line is shown at once;
   js/home-features.js adds .is-live and plays them. */

.sbx-section {
  --sbx-card: #181818;
  --sbx-line: #2a2a2a;
  --sbx-text: #ededec;
  --sbx-muted: #999;
  --sbx-faint: #6f6f6f;
  --sbx-bubble: #262626;
  --sbx-green: #22c55f;
  --sbx-green-soft: rgba(34, 197, 95, .14);
  --sbx-mark: rgba(34, 197, 95, .22);
  --sbx-ease: cubic-bezier(.2, .7, .2, 1);
}

/* No divider lines under these sections */
.sbx-section { border-bottom: 0; }
html[data-theme="light"] .sbx-section { border-bottom: 0; }

/* Head */
.sbx-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
/* Two columns: text on one side, the demo on the other */
.sbx-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  align-items: center;
  gap: 72px;
  width: 100%;
  max-width: 1100px;
}
.sbx-split.is-reverse { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.sbx-split.is-reverse .sbx-copy { order: 2; }
.sbx-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}
.sbx-copy .sbx-tag { margin-bottom: -4px; }
.sbx-copy .heading-2 {
  flex: 0 0 auto;
  margin: 0;
  text-align: left;
  font-size: 44px;
}
.sbx-copy .body-copy { flex: 0 0 auto; max-width: 440px; }
.sbx-visual { min-width: 0; }

/* NEW pill: the site's grey pill with a green label */
.sbx-section .label-rounded .time-counter { color: var(--sbx-green); }

/* Claude mark used next to answers */
.sbx-ai-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23D97757' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M12 12h10M12 12l8.66 5M12 12l5 8.66M12 12v10M12 12l-5 8.66M12 12l-8.66 5M12 12H2M12 12 3.34 7M12 12 7 3.34M12 12V2M12 12l5-8.66M12 12l8.66-5'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ═══ AI assistant: one question at a time ═══ */
.sbx-ask {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 28px;
  width: 100%;
  max-width: 620px;
  border: 1px solid var(--sbx-line);
  border-radius: 20px;
  padding: 32px;
  background: var(--sbx-card);
  font-family: Inter, sans-serif;
  box-sizing: border-box;
}
.sbx-ask-pair {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sbx-q {
  align-self: flex-end;
  max-width: 85%;
  margin: 0;
  border-radius: 18px;
  border-bottom-right-radius: 6px;
  padding: 12px 16px;
  background: var(--sbx-bubble);
  color: var(--sbx-text);
  font-size: 16px;
  line-height: 24px;
}
.sbx-a {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  color: var(--sbx-muted);
  font-size: 20px;
  line-height: 28px;
}
.sbx-a .sbx-ai-icon { margin-top: 5px; }
.sbx-a strong { color: var(--sbx-text); font-weight: 600; }
.sbx-ask-status { display: none; }

/* Live: the pairs stack in one slot and play in turn */
.sbx-ask.is-live {
  display: grid;
  min-height: 322px;
  align-content: center;
}
.sbx-ask.is-live > * { grid-area: 1 / 1; }
.sbx-ask.is-live .sbx-ask-pair {
  opacity: 0;
  visibility: hidden;
  transition: opacity .45s ease, visibility 0s linear .45s;
}
.sbx-ask.is-live .sbx-ask-pair.is-on {
  opacity: 1;
  visibility: visible;
  transition: opacity .3s ease;
}
.sbx-ask.is-live .sbx-q.is-typing::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: -3px;
  background: var(--sbx-green);
  animation: sbx-blink .9s steps(1) infinite;
}
.sbx-ask.is-live .sbx-a {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .5s var(--sbx-ease), transform .5s var(--sbx-ease);
}
.sbx-ask.is-live .is-answered .sbx-a {
  opacity: 1;
  transform: none;
}
.sbx-ask.is-live .sbx-ask-status {
  align-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sbx-faint);
  font-size: 14px;
  opacity: 0;
  transition: opacity .25s ease;
}
.sbx-ask.is-live .sbx-ask-status.is-on { opacity: 1; }
.sbx-ask-status .sbx-ai-icon { animation: sbx-spin 1.6s linear infinite; }
.sbx-ask-status span:last-child {
  background: linear-gradient(90deg, var(--sbx-faint) 0%, var(--sbx-text) 50%, var(--sbx-faint) 100%) 0 0 / 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sbx-shimmer 1.4s linear infinite;
}

@keyframes sbx-blink { 50% { opacity: 0; } }
@keyframes sbx-spin { to { transform: rotate(360deg); } }
@keyframes sbx-shimmer { to { background-position: -200% 0; } }

/* ═══ Auto-categorization: a Notion-style table receiving transactions ═══ */
.sbx-notion {
  --n-line: #2f2f2f;
  --n-text: #ffffffcf;
  --n-muted: #ffffff71;
  width: 100%;
  max-width: 720px;
  overflow: hidden;
  border: 1px solid var(--n-line);
  border-radius: 12px;
  background: #191919;
  font-family: Inter, sans-serif;
}
.sbx-n-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  color: var(--n-text);
  font-size: 15px;
  font-weight: 600;
}
.sbx-n-bar svg,
.sbx-n-head svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sbx-n-head,
.sbx-feed-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.6fr);
  align-items: center;
}
.sbx-n-head {
  border-top: 1px solid var(--n-line);
  border-bottom: 1px solid var(--n-line);
  color: var(--n-muted);
  font-size: 13px;
}
.sbx-n-head span {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
}
.sbx-feed {
  display: flex;
  flex-direction: column;
}
.sbx-feed.is-live {
  overflow: hidden;
  height: 236px;
  -webkit-mask-image: linear-gradient(180deg, #000 68%, transparent);
  mask-image: linear-gradient(180deg, #000 68%, transparent);
}
.sbx-feed-row {
  flex: 0 0 auto;
  height: 44px;
  border-bottom: 1px solid var(--n-line);
  color: var(--n-text);
  font-size: 14px;
  box-sizing: border-box;
}
.sbx-feed-row > span {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 12px;
}
.sbx-c-name { font-weight: 500; }
.sbx-c-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbx-c-amt { color: var(--n-text); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Notion select tags */
.sbx-tag-n {
  overflow: hidden;
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 13px;
  line-height: 20px;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--n-text);
}
.sbx-tag-n.is-gray { background: #373c3f; }
.sbx-tag-n.is-green { background: #2b593f; }
.sbx-tag-n.is-purple { background: #492f64; }
.sbx-tag-n.is-blue { background: #28456c; }
.sbx-tag-n.is-orange { background: #854c1d; }
.sbx-tag-n.is-pink { background: #69314c; }
.sbx-tag-n.is-yellow { background: #89632a; }

/* A new row drops in on top with an empty category, then the tag pops in */
.sbx-feed-row.is-entering { animation: sbx-row-in .5s var(--sbx-ease) both; }
.sbx-feed-row.is-entering .sbx-c-cat .sbx-tag-n { animation: sbx-pop .4s cubic-bezier(.3, 1.6, .5, 1) .9s both; }

@keyframes sbx-row-in {
  from { height: 0; opacity: 0; }
  to { height: 44px; opacity: 1; }
}
@keyframes sbx-pop {
  from { opacity: 0; transform: scale(.6); }
}

/* ═══ Footer line ═══ */
.sbx-foot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  max-width: 440px;
  margin-top: 12px;
  text-align: left;
}
.sbx-clients {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--sbx-faint);
  font-family: Inter, sans-serif;
  font-size: 13px;
}
.sbx-icons { display: flex; align-items: center; }
.sbx-icons svg {
  width: 26px;
  height: 26px;
  color: var(--sbx-text);
}
.sbx-icons svg + svg { margin-left: -6px; }
.sbx-fineprint {
  color: var(--sbx-faint);
  margin: 0;
  font-family: Inter, sans-serif;
  font-size: 13px;
  line-height: 19px;
}

/* ═══ Light theme ═══ */
html[data-theme="light"] .sbx-section {
  --sbx-card: #fff;
  --sbx-line: #e5e5e5;
  --sbx-text: #181818;
  --sbx-muted: #4f4d4b;
  --sbx-faint: #8a8886;
  --sbx-bubble: #f1f0ef;
  --sbx-green: #118a3d;
  --sbx-green-soft: rgba(17, 138, 61, .12);
  --sbx-mark: rgba(17, 138, 61, .16);
}
html[data-theme="light"] .sbx-ask { box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .2); }
html[data-theme="light"] .sbx-notion {
  --n-line: #e9e9e7;
  --n-text: #32302c;
  --n-muted: #91918e;
  background: #fff;
}
html[data-theme="light"] .sbx-tag-n.is-gray { background: #e3e2e0; }
html[data-theme="light"] .sbx-tag-n.is-green { background: #dbeddb; }
html[data-theme="light"] .sbx-tag-n.is-purple { background: #e8deee; }
html[data-theme="light"] .sbx-tag-n.is-blue { background: #d3e5ef; }
html[data-theme="light"] .sbx-tag-n.is-orange { background: #fadec9; }
html[data-theme="light"] .sbx-tag-n.is-pink { background: #f5e0e9; }
html[data-theme="light"] .sbx-tag-n.is-yellow { background: #fdecc8; }

/* ═══ Responsive ═══ */
@media screen and (max-width: 991px) {
  .sbx-split,
  .sbx-split.is-reverse { grid-template-columns: minmax(0, 1fr); gap: 40px; max-width: 640px; }
  .sbx-split.is-reverse .sbx-copy { order: 0; }
  .sbx-copy .heading-2 { font-size: 36px; }
  .sbx-copy .body-copy,
  .sbx-foot { max-width: none; }
}

@media screen and (max-width: 767px) {
  .sbx-ask { padding: 22px 18px; gap: 20px; }
  .sbx-ask.is-live { min-height: 210px; }
  .sbx-q { font-size: 15px; line-height: 22px; }
  .sbx-a { font-size: 17px; line-height: 25px; }
  .sbx-n-head,
  .sbx-feed-row { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1.45fr); }
    .sbx-tag-n { font-size: 12px; padding: 1px 6px; }
  .sbx-n-head span:nth-child(2),
  .sbx-feed-row > .sbx-c-acc { display: none; }
  .sbx-n-head span,
  .sbx-feed-row > span { padding: 0 8px; }
  .sbx-feed.is-live { height: 220px; }
}
