/*
 * css/pages/home.css: the home page (SPEC 12 C1), group home. Tokens and shared components come from css/tokens.css
 * and css/site.css; this sheet only lays out the home sections: the stage quote card, the engine cards, the book and
 * recent buys, the analytics preview, the job picker, the fund cards, the migration snippet, the token cards and the FAQ.
 */

/* ------------------------------------------------------------------------------------------------ section frame */
.page--home .section { padding-block: var(--section); }
.home-head { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; margin-bottom: 40px; }
.home-head .lede { max-width: 60ch; }
.home-head--split { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 24px 48px; flex-wrap: wrap; }
.home-head--split > div:first-child { display: flex; flex-direction: column; gap: 18px; min-width: 0; flex: 1 1 520px; }
.home-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 28px; }
.home-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 28px; }
.h2--lines em { display: block; }
.h2--two .l2 { display: block; color: var(--text); }
@media (max-width: 639px) {
  .home-head { margin-bottom: 28px; gap: 14px; }
  .home-head--split { gap: 18px; }
}

/* ------------------------------------------------------------------------------------------------ stage: quote card */
.quote {
  position: relative; display: flex; flex-direction: column; gap: 18px; min-width: 0;
  padding: 22px 24px 20px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r4);
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, .8), 0 0 0 1px rgba(61, 220, 151, .04), 0 0 60px -28px var(--glow);
  color: var(--body);
}
.quote__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); margin: -4px -24px 0; padding: 0 24px; }
.quote__title { position: relative; padding: 4px 0 12px; font: 600 15px/1.2 var(--font-body); letter-spacing: -0.01em; color: var(--text); }
.quote__title::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); border-radius: 1px; }
.quote__chip { display: inline-flex; padding-bottom: 8px; min-height: 24px; }
.quote__field { gap: 8px; }
.quote__field .field__label { font-size: 13px; color: var(--muted); font-weight: 600; }
.quote .amount .input { height: 56px; font-size: 22px; background: var(--panel-3); }
.quote__out { display: flex; flex-direction: column; gap: 6px; min-height: 148px; }
.quote__out .label { margin-bottom: 2px; }
.quote__total { font: 400 40px/1.05 var(--font-display); color: var(--text); letter-spacing: 0; min-height: 42px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 .3em; overflow-wrap: anywhere; }
.quote__total .unit { font-size: .55em; color: var(--muted); }
.quote__total .sk--num { width: 6em; height: 34px; font-size: 16px; }
.quote__rows { display: flex; flex-direction: column; margin-top: 10px; border-top: 1px solid var(--line); }
.quote__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line-row); font: 500 13px/1.45 var(--font-mono); font-variant-numeric: tabular-nums; }
.quote__row dt { color: var(--muted); min-width: 0; }
.quote__row dd { color: var(--text); text-align: right; white-space: nowrap; }
.quote__row .sub { display: block; margin-top: 1px; font-size: 11.5px; color: var(--faint); }
.quote__row--save dd { color: var(--accent); }
.quote__note { font-size: 13.5px; line-height: 1.5; color: var(--dim); margin-top: 8px; }
.quote__note--warn { color: var(--warn); }
.quote__actions { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.quote__go { flex: 1 1 auto; min-width: 0; }
.quote__launch .state { padding: 16px; gap: 10px; background: var(--panel-3); }
.quote__launch .state__text { font-size: 14.5px; }
.quote.is-launch .quote__out { display: none; }
.stage__side { gap: 14px; }
@media (min-width: 1100px) {
  .page--home .stage__content { align-items: end; }
}
@media (max-width: 1099px) {
  .page--home .stage__side { max-width: 30rem; width: 100%; }
}
@media (max-width: 819px) {
  .page--home .stage__side { max-width: none; }
  .quote { padding: 20px 18px 18px; }
  .quote__head { margin: -4px -18px 0; padding: 0 18px; }
  .quote__total { font-size: 34px; }
}

/* ------------------------------------------------------------------------------------------------ engine cards */
.verbs { display: flex; flex-direction: column; gap: 14px; }
.verbs .stagecard { align-items: start; }
.verb__copy { min-width: 0; display: flex; flex-direction: column; }
.verb__copy .h3-display { margin: 12px 0 14px; }
.verb__copy > p:not([class]) { max-width: 54ch; }
.verb__icons { display: flex; gap: 14px; margin-top: 18px; color: var(--muted); }
.verb__status { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 20px; max-width: 460px; }
.verb__status li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 26px; font-size: 14px; font-weight: 500; color: var(--body); }
.verb__status li > span:last-child { display: inline-flex; font: 600 12px/1 var(--font-mono); color: var(--dim); font-variant-numeric: tabular-nums; }
.verbs .slashlist { padding-top: 6px; }
@media (min-width: 1024px) { .verbs .slashlist { margin-top: 42px; } }

/* ------------------------------------------------------------------------------------------------ panels (book, recent, stats) */
.panel { position: relative; min-width: 0; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r4); box-shadow: var(--shadow-card); overflow: hidden; }
.panel__head { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.panel__title { font: 700 16px/1.3 var(--font-body); color: var(--text); letter-spacing: -0.01em; }
.panel__meta { margin-left: auto; font: 500 12px/1.3 var(--font-mono); color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.panel__body { padding: 8px 20px 16px; }
.panel__body .state, .stats__body .state { margin-block: 8px; }

.market { display: grid; grid-template-columns: minmax(0, 1fr) 19rem; gap: 16px; align-items: stretch; }
@media (max-width: 1023px) { .market { grid-template-columns: minmax(0, 1fr); } }

/* liquidity book */
.lbook__table { width: 100%; border-collapse: separate; border-spacing: 0 3px; }
.lbook__table caption { text-align: left; }
.lbook__table th, .lbook__table td { padding: 9px 12px; font: 500 14px/1.3 var(--font-mono); font-variant-numeric: tabular-nums; }
.lbook__table thead th { padding-block: 10px 6px; font: 600 11px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.lbook__table th[scope="row"] { width: 34%; color: var(--accent); text-align: left; white-space: nowrap; }
.lbook__table tr.is-deepest th[scope="row"] { font-weight: 700; }
.lbook__table .r { text-align: right; }
.lbook__amt { position: relative; color: var(--text); white-space: nowrap; }
.lbook__amt span { position: relative; z-index: 1; }
.lbook__bar { position: absolute; right: 0; top: 0; bottom: 0; width: var(--w, 1.5%); min-width: 1.5%; background: var(--accent-tint); border-radius: var(--r1); transition: width 520ms var(--ease-out); }
tr.is-deepest .lbook__bar { background: color-mix(in srgb, var(--accent) 24%, transparent); }
.lbook__foot { margin-top: 12px; }

/* recent buys */
.recent { display: flex; flex-direction: column; }
.recent__body { padding: 0; max-height: 24rem; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.recent__body .skeleton, .recent__body .state { margin: 16px 20px; }
.recent__list { list-style: none; }
.recent__list li + li { border-top: 1px solid var(--line-row); }
.recent__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; min-height: 58px; padding: 10px 20px; transition: background-color var(--t1); }
a.recent__row:hover { background: var(--panel-2); }
.recent__who { font: 500 13px/1.3 var(--font-mono); color: var(--dim); }
.recent__age { grid-column: 1; font: 400 12px/1.3 var(--font-mono); color: var(--faint); }
.recent__amt { grid-column: 2; grid-row: 1; font: 600 13.5px/1.3 var(--font-mono); color: var(--text); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.recent__split { grid-column: 2; grid-row: 2; font: 400 11.5px/1.3 var(--font-mono); color: var(--faint); text-align: right; white-space: nowrap; }

/* analytics preview */
.stats__body { padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.stats .band { border-radius: var(--r3); }
.stats .band dd { font-size: 17px; }
.chart { display: flex; flex-direction: column; gap: 10px; }
.chart__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.chart__title { font: 600 14px/1.3 var(--font-body); color: var(--dim); }
.chart__readout { font: 500 12px/1.3 var(--font-mono); color: var(--muted); font-variant-numeric: tabular-nums; min-height: 16px; }
.chart__plot { position: relative; height: 150px; display: grid; grid-template-columns: repeat(var(--n, 30), minmax(0, 1fr)); align-items: end; border-bottom: 1px solid var(--line); border-radius: var(--r2); outline-offset: 4px; }
.chart__plot::before { content: ""; position: absolute; left: 0; right: 0; top: 0; border-top: 1px solid var(--line-row); }
.chart__col { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.chart__bar { width: min(22px, calc(100% - 2px)); height: var(--h, 0%); min-height: 0; background: var(--series-1); border-radius: 4px 4px 0 0; transition: height 520ms var(--ease-out), opacity var(--t1); }
.chart__col.is-zero .chart__bar { height: 2px; background: var(--line-strong); border-radius: 1px; }
.chart__plot.is-hover .chart__col:not(.is-on) .chart__bar { opacity: .45; }
.chart__axis { display: flex; justify-content: space-between; font: 400 11.5px/1.3 var(--font-mono); color: var(--faint); }
.chart__max { position: absolute; top: -18px; left: 0; font: 400 11.5px/1 var(--font-mono); color: var(--faint); }
.chart__empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; text-align: center; font-size: 14.5px; color: var(--muted); }

/* ------------------------------------------------------------------------------------------------ job picker */
.jobs .tabs { margin-bottom: 16px; }
.jobs__panel {
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 48px;
  padding: 32px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r4); box-shadow: var(--shadow-card);
}
.jobs__intro { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; min-width: 0; }
.jobs__intro p:not([class]) { font-size: 15.5px; color: var(--body); max-width: 40ch; }
.jobs__intro .home-actions { margin-top: auto; padding-top: 12px; gap: 8px 24px; }
.jobs__models { min-width: 0; }
.jobs__models .label { color: var(--accent); margin-bottom: 8px; }
.jobs__list { list-style: none; display: flex; flex-direction: column; min-width: 0; }
.job-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 16px; padding: 12px 10px; margin-inline: -10px; border-radius: var(--r2); border-top: 1px solid var(--line-row); transition: background-color var(--t1); }
.jobs__list li:first-child .job-row { border-top-color: transparent; }
a.job-row:hover { background: var(--panel-2); }
.job-row__id { font: 500 13px/1.35 var(--font-mono); color: var(--dim); overflow-wrap: anywhere; }
.job-row__name { grid-column: 1; font-size: 12px; line-height: 1.35; color: var(--muted); }
.job-row__turn { grid-column: 2; grid-row: 1; font: 600 13px/1.35 var(--font-mono); color: var(--text); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.job-row__price { grid-column: 2; grid-row: 2; font: 400 12px/1.35 var(--font-mono); color: var(--faint); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.jobs__note { margin-top: 14px; max-width: 90ch; }
.jobs__book { margin-top: 4px; }
@media (max-width: 819px) {
  .jobs__panel { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 24px; }
  .jobs__intro .home-actions { margin-top: 4px; }
}
@media (max-width: 479px) {
  .job-row { grid-template-columns: minmax(0, 1fr); }
  .job-row__turn, .job-row__price { grid-column: 1; grid-row: auto; text-align: left; }
}

/* ------------------------------------------------------------------------------------------------ fund cards */
.funds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.funds > .state, .funds > .skeleton { grid-column: 1 / -1; }
@media (max-width: 1023px) { .funds { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) { .funds { grid-template-columns: minmax(0, 1fr); } }
.fundcard { display: flex; flex-direction: column; gap: 12px; padding: 24px; }
.fundcard__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fundcard__id { font: 500 12px/1 var(--font-mono); color: var(--faint); }
.fundcard__title { font: 700 19px/1.3 var(--font-body); color: var(--text); letter-spacing: -0.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.fundcard__agent { font-size: 13.5px; color: var(--muted); }
.fundcard__agent .mono { font-family: var(--font-mono); color: var(--dim); font-size: 13px; }
.progress { height: 6px; border-radius: var(--r-pill); background: var(--panel-2); overflow: hidden; }
.progress i { display: block; height: 100%; width: var(--p, 0%); min-width: 2px; background: var(--accent); border-radius: inherit; }
.fundcard__raised { font: 500 14px/1.4 var(--font-mono); color: var(--dim); font-variant-numeric: tabular-nums; }
.fundcard__raised strong { color: var(--text); font-weight: 600; }
.fundcard__meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font: 400 12px/1.5 var(--font-mono); color: var(--faint); margin-top: auto; }

/* ------------------------------------------------------------------------------------------------ migration snippet */
.snippet__tabs { margin-bottom: 16px; }
.snippet__box { border: 1px solid var(--accent-line); border-radius: var(--r4); background: var(--bg-deep); overflow: hidden; }
.snippet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 8px 12px 8px 16px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--accent-tint) 60%, var(--bg-deep)); }
.snippet__code { margin: 0; padding: 16px 0; border: 0; border-radius: 0; background: transparent; }
.snippet__code code { display: block; min-width: max-content; background: none; padding: 0; font-size: inherit; color: var(--dim); }
.snippet__code .ln { display: inline-block; min-width: 100%; padding: 0 20px; }
.snippet__code .ln.is-changed { background: color-mix(in srgb, var(--accent) 9%, transparent); box-shadow: inset 2px 0 0 var(--accent); color: var(--text); }
.snippet__code .ln.cm { color: var(--muted); }
.snippet__note { margin-top: 12px; }
[role="tabpanel"]:focus-visible { outline-offset: -2px; }

/* ------------------------------------------------------------------------------------------------ token */
.home-token .chain-badge { margin-bottom: 4px; }
.token-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.token-cards .card { display: flex; flex-direction: column; }
.token-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.token-card__top .kicker { margin-bottom: 14px; }
@media (max-width: 819px) { .token-cards { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------------------------------------------ FAQ */
.faq-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 48px; align-items: start; }
@media (min-width: 1024px) { .faq-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1023px) { .faq-cols .faq + .faq { border-top: 0; } }
.faq .faq__a .link { color: var(--text); }

/* ------------------------------------------------------------------------------------------------ touch sizes */
@media (max-width: 819px) {
  .job-row, .recent__row { min-height: 52px; }
  .home-links .btn--quiet, .quote__actions .btn--quiet { min-height: 44px; }
}
