/* ═══════════════════════════════════════════════════════════════════════════
   THE BARRIER — homepage "How it works" demo: layout only.
   The panel and bubble look comes from extension-panel.css (copied from the
   extension). This file places them on the page instead of fixed to the
   viewport, and lays out the example listing beside them.
   ═══════════════════════════════════════════════════════════════════════════ */

.hiw { padding-top: 88px; }

/* ── Header: mascot pointing at the heading ── */
.hiw-head {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  align-items: center;
  gap: 28px;
  margin-bottom: 36px;
}
.hiw-head barrier-mascot { width: 100%; --barrier-mascot-font: var(--font-body); }
.hiw-head barrier-mascot > img { display: block; width: 100%; height: auto; }

/* ── Tabs ── */
.hiw-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.hiw-tablist { display: flex; gap: 8px; flex-wrap: wrap; }
.hiw-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 100px;
  border: 1px solid var(--border-bright);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.hiw-tab::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tab-color);
}
.hiw-tab:hover { color: var(--text); }
.hiw-tab[aria-selected="true"] {
  color: var(--text);
  border-color: var(--tab-color);
  background: color-mix(in srgb, var(--tab-color) 12%, transparent);
}
.hiw-tab:focus-visible, .hiw-pause:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.hiw-tab[data-sev="critical"] { --tab-color: var(--barrier-critical); }
.hiw-tab[data-sev="medium"]   { --tab-color: var(--barrier-medium); }
.hiw-tab[data-sev="low"]      { --tab-color: var(--barrier-low); }
.hiw-tab[data-sev="minimal"]  { --tab-color: var(--barrier-minimal); }

.hiw-pause {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 6px 2px;
}
.hiw-pause:hover { color: var(--text-muted); }

/* ── Stage: listing (browser frame) + panel ── */
.hiw-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: start;
}

.hiw-browser {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-bright);
  background: #fff;
  box-shadow: 0 24px 64px rgba(0,0,0,0.45);
}
.hiw-chrome {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #1c1c21;
}
.hiw-dots { display: flex; gap: 6px; flex-shrink: 0; }
.hiw-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.18); }
.hiw-url {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 100px;
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.6);
  font-family: var(--font-mono);
  font-size: 11.5px;
}
.hiw-url svg { width: 11px; height: 11px; flex-shrink: 0; opacity: 0.7; }
.hiw-url-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.hiw-page {
  position: relative;
  height: 520px;
  overflow: hidden;
  padding: 26px 28px;
  color: #1f2330;
  font-family: var(--font-body);
  font-weight: 400;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.hiw-page.hiw-in { opacity: 1; }
.hiw-page::after {                          /* the listing continues below */
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 90px;
  background: linear-gradient(rgba(255,255,255,0), #fff 75%);
  pointer-events: none;
}
.hiw-example {
  display: inline-block;
  margin-bottom: 14px;
  padding: 3px 9px;
  border-radius: 4px;
  border: 1px dashed #9aa0ad;
  color: #5b6170;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hiw-job-title { font-family: var(--font-body); font-size: 21px; font-weight: 600; line-height: 1.3; color: #121521; }
.hiw-job-company { margin-top: 4px; font-size: 14px; color: #4a5060; }
.hiw-job-meta { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font-size: 13px; color: #4a5060; }
.hiw-job-meta li + li::before { content: '•'; margin-right: 18px; color: #b5b9c3; }
.hiw-job-posted { margin-top: 10px; font-size: 12px; color: #7a8090; }
.hiw-job-desc-label {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #eceef2;
  font-size: 14px;
  font-weight: 600;
  color: #121521;
}
.hiw-job-desc { margin-top: 8px; white-space: pre-line; font-size: 13.5px; line-height: 1.6; color: #343a48; }

/* The extension's bubble, inside the page instead of fixed to the viewport. */
.hiw .hiw-bubble { position: absolute; bottom: 18px; right: 18px; z-index: 2; cursor: default; }
.hiw .hiw-bubble:hover { transform: none; }

/* The extension's panel, in the page flow; hidden until a result is ready. */
.hiw-panel-slot { position: relative; }
.hiw .hiw-xpanel {
  font-weight: 400;                         /* a typical host page's weight; the homepage body is 300 */
  line-height: normal;
  text-align: left;
  position: relative;
  bottom: auto;
  right: auto;
  width: 100%;                              /* max-height stays the extension's 580px; the body scrolls */
  z-index: auto;
  display: flex;
  visibility: hidden;
  animation: none;
}
.hiw .hiw-xpanel.hiw-open { visibility: visible; animation: barrier-panel-in 0.2s ease; }
.hiw .hiw-probe { position: absolute; top: 0; left: 0; visibility: hidden; pointer-events: none; }
.hiw .barrier-close { cursor: default; }
.hiw .hiw-xpanel .barrier-panel-body { position: relative; }   /* offsetTop reference for auto-scroll */

/* Items revealed one by one. */
.hiw .hiw-pending { opacity: 0; transform: translateY(6px); transition: opacity 0.35s ease, transform 0.35s ease; }
.hiw .hiw-pending.hiw-in { opacity: 1; transform: none; }

/* ── CTA ── */
.hiw-cta { display: flex; justify-content: center; margin-top: 40px; }

/* ── Phones: listing above the panel ── */
@media (max-width: 860px) {
  .hiw-stage { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .hiw-page { height: 360px; padding: 20px 18px; }
  .hiw-job-title { font-size: 18px; }
}
@media (max-width: 640px) {
  .hiw { padding-top: 64px; }
  .hiw-head { grid-template-columns: 1fr; gap: 8px; justify-items: center; text-align: center; }
  .hiw-head barrier-mascot { width: min(220px, 64vw); }
  .hiw-head .section-label { justify-content: center; }
  .hiw-head .section-sub { margin: 0 auto; }
  .hiw-controls { justify-content: center; }
  .hiw-tablist { justify-content: center; }
  .hiw-cta .btn-primary { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .hiw-page, .hiw .hiw-pending { transition: none; }
  .hiw .hiw-xpanel.hiw-open { animation: none; }
  .hiw .barrier-spinner, .hiw .hiw-bubble.state-critical { animation: none; }
}
