/* Home first step (spec 2026-11-28-home-first-step-design.md, design B): the
   home page body behind HH_HOME_FIRST_STEP. One what-line, one question, three
   situation cards, the chat behind a quiet line, three steps and a doors row.
   Follows the tile language of tool-first.css and consumes the shared tokens
   from tokens.css only. Same-origin, no @import. Logical properties throughout,
   so the English page (.tf[dir='ltr']) mirrors by itself. */

.tf:has(.hf-cards) { padding-block-start: 48px; }

.hf-what {
  margin: 0 0 20px;
  margin-inline: auto;
  text-wrap: balance;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
}

.hf-question {
  margin: 0 0 12px;
  color: var(--text-default);
  font-size: 21px;
  font-weight: var(--fw-bold);
  line-height: 1.25;
  text-align: center;
}

.hf-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.hf-cards > li { display: grid; }

.hf-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 14px;
  row-gap: 4px;
  min-height: 88px;
  padding: 16px 18px;
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-default);
  text-decoration: none;
  text-align: start;
}
.hf-card-title {
  text-wrap: balance;
  grid-column: 1;
  grid-row: 1;
  font-size: 18px;
  font-weight: var(--fw-bold);
  line-height: 1.25;
}
.hf-card-line {
  text-wrap: balance;
  grid-column: 1;
  grid-row: 2;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.4;
}
.hf-card::after {
  content: '';
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  width: 9px;
  height: 9px;
  border-block-end: 2px solid var(--control);
  border-inline-end: 2px solid var(--control);
  transform: rotate(45deg);
}
.tf[dir='ltr'] .hf-card::after { transform: rotate(-45deg); }
/* Plain, so a sticky touch hover does not bring the global underline back. */
.hf-card:hover { text-decoration: none; }
@media (hover: hover) {
  .hf-card:hover {
    border-color: var(--control);
    box-shadow: var(--shadow-card);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .hf-card { transition: border-color 150ms, box-shadow 150ms; }
}
.hf-card:focus-visible {
  outline: 3px solid var(--control);
  outline-offset: 3px;
}

.hf-chat-open {
  margin-block: 4px 24px;
  text-align: start;
}

.hf-ask { margin-block-start: 16px; }
.hf-ask-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding-inline: 8px;
  color: var(--link);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.hf-ask-summary::-webkit-details-marker { display: none; }
.hf-ask-summary::after {
  content: '';
  width: 7px;
  height: 7px;
  border-bottom: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
}
.hf-ask[open] > .hf-ask-summary::after { transform: rotate(-135deg) translate(-1px, -1px); }
.hf-ask-summary:focus-visible {
  outline: 3px solid var(--control);
  outline-offset: 3px;
  border-radius: var(--radius-pill);
}
.hf-ask > .hc {
  scroll-margin-block-start: 64px;
  margin-block-start: 10px;
  text-align: start;
}

/* The global p, li max-width of 65ch is narrower than the wide column. */
.hf-chat-open .hc-lead, .hf-ask .hc-lead { margin-inline: auto; }
.hf-chat-open .hc-notice, .hf-ask .hc-notice,
.hf-chat-open .hc-fold-all-item, .hf-ask .hc-fold-all-item { max-width: none; }

.hf-steps {
  list-style: none;
  counter-reset: hf-step;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-block: 20px 0;
  margin-inline: 0;
  padding-block: 14px;
  padding-inline: 0;
  border-block: 1px solid var(--border-subtle);
}
.hf-steps li {
  counter-increment: hf-step;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
}
.hf-steps li::before {
  content: counter(hf-step);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 24px;
  height: 24px;
  border: 1.5px solid var(--text-default);
  border-radius: 50%;
  color: var(--text-default);
  font-size: 13px;
  font-weight: var(--fw-bold);
}

.hf-doors {
  margin: 12px 0 0;
  margin-inline: auto;
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-muted);
  font-size: 14px;
}
.hf-door {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  column-gap: 4px;
}
.hf-doors a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--link);
}

@media (min-width: 860px) {
  .tf:has(.hf-cards) { max-width: 960px; }
  .hf-what { font-size: 18px; }
  .hf-question { font-size: 24px; margin-block-end: 16px; }
  .hf-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .hf-card { min-height: 132px; padding: 22px; }
  .hf-card-title { font-size: 20px; }
  .hf-card-line { font-size: 15px; }
  .hf-steps { max-width: 640px; margin-inline: auto; gap: 12px; }
  .hf-steps li { flex-direction: row; justify-content: center; gap: 8px; font-size: 14px; }
  .hf-doors { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 4px 32px; }
}

@media (max-width: 400px) and (max-height: 700px) {
  .tf:has(.hf-cards) { padding-block-start: 24px; }
  .hf-what { margin-block-end: 14px; }
  .hf-question { margin-block-end: 10px; }
  .hf-cards { gap: 8px; }
  .hf-card { min-height: 76px; padding: 12px 16px; }
}
