/* homebridge.php - the page's own pictures. The shared hero, section rhythm and closing band
   come from svc-pages.css; everything here is a shape only this page has: a Home screen you
   can press, a before/after strip, a line with six stops, two spec sheets and a link row. */

/* ── 1. The Home screen ─────────────────────────────────────────────────────
   The phone is a dark object in BOTH themes, like the real thing, so its colours are pinned
   here and never read --bg/--surface (those flip to paper in the light theme). */
.hb-demo { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); grid-template-areas: "phone side"; gap: clamp(32px, 6vw, 88px); align-items: center; }
.hb-phone { grid-area: phone; margin: 0; }
.hb-side { grid-area: side; }

.hb-screen {
    --hb-screen: #191622; --hb-edge: rgba(255, 255, 255, .14);
    --hb-tile: rgba(255, 255, 255, .07); --hb-tile-edge: rgba(255, 255, 255, .06);
    --hb-ink: #E4DFEE; --hb-ink-2: #ADA3C8;
    --hb-on: #F5F3F9; --hb-on-ink: #12101A; --hb-on-ink-2: #4C4563;
    background: var(--hb-screen); color: var(--hb-ink);
    border: 1px solid var(--hb-edge); border-radius: 34px; padding: 22px 16px 18px;
    box-shadow: var(--shadow-2, 0 20px 50px rgba(0, 0, 0, .48));
}
.hb-bar { display: flex; align-items: center; gap: 10px; padding: 0 6px 16px; font-size: 22px; color: var(--hb-ink); }
.hb-bar b { font-family: var(--font-display, inherit); font-weight: 700; letter-spacing: -0.01em; }
.hb-bar .hb-ic { width: 22px; height: 22px; color: var(--hb-ink-2); }
.hb-ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.hb-scenes { display: flex; gap: 8px; padding: 0 2px 14px; flex-wrap: wrap; }
.hb-scene {
    font: inherit; font-size: 13.5px; font-weight: 600; color: var(--hb-ink);
    background: transparent; border: 1px solid var(--hb-edge); border-radius: 999px;
    padding: 8px 14px; cursor: pointer; min-height: 36px;
}

.hb-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hb-tile {
    font: inherit; text-align: start; cursor: pointer;
    display: grid; grid-template-rows: auto 1fr auto; gap: 10px; min-height: 112px;
    padding: 12px 12px 11px; border-radius: 18px;
    background: var(--hb-tile); border: 1px solid var(--hb-tile-edge); color: var(--hb-ink);
}
/* the glyph sits in a disc: grey while off, the page's one copper surface while on */
.hb-tile .hb-ic { width: 34px; height: 34px; padding: 7px; box-sizing: border-box; border-radius: 50%; background: rgba(255, 255, 255, .10); color: var(--hb-ink-2); }
.hb-name { font-size: 14px; font-weight: 600; line-height: 1.3; align-self: end; }
.hb-room { display: block; font-weight: 400; font-size: 12.5px; color: var(--hb-ink-2); }
.hb-state { font-family: var(--font-mono); font-size: 12px; color: var(--hb-ink-2); }
/* A toggle is instant: the new state paints on the frame it was pressed. No colour transition. */
.hb-tile[aria-pressed="true"] { background: var(--hb-on); border-color: var(--hb-on); color: var(--hb-on-ink); }
.hb-tile[aria-pressed="true"] .hb-ic { background: #E85622; color: #12101A; }
.hb-tile[aria-pressed="true"] .hb-room,
.hb-tile[aria-pressed="true"] .hb-state { color: var(--hb-on-ink-2); }

.hb-tile:focus-visible, .hb-scene:focus-visible { outline: 2px solid #6FCBBB; outline-offset: 2px; }
/* The press answers the finger: a small scale, on transform only. Space on a keyboard also sets
   :active in Chrome, and a key press should not animate - so a focused-by-keyboard control does not. */
.hb-tile, .hb-scene { transition: transform 150ms cubic-bezier(0.16, 1, 0.3, 1); }
.hb-tile:active, .hb-scene:active { transform: scale(0.97); }
.hb-tile:focus-visible:active, .hb-scene:focus-visible:active { transform: none; }
@media (hover: hover) and (pointer: fine) {
    .hb-scene:hover { background: rgba(255, 255, 255, .08); }
    .hb-tile[aria-pressed="false"]:hover { background: rgba(255, 255, 255, .11); }
}
@media (pointer: coarse) { .hb-scene { min-height: 44px; } }

.hb-cap { margin: 12px 4px 0; font-size: 12.5px; color: var(--text-muted); text-align: center; }

.hb-siri { list-style: none; margin: 0 0 28px; padding: 0; display: grid; gap: 0; }
.hb-siri li { font-family: var(--font-display, inherit); font-size: clamp(18px, 1.8vw, 22px); font-weight: 600; line-height: 1.35; color: var(--text-strong); padding: 14px 0; border-top: 1px solid var(--line); }
.hb-siri li:last-child { border-bottom: 1px solid var(--line); }
.hb-log { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin: 0; font-size: 14px; color: var(--text-2); min-height: 3em; }
.hb-log-k { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--copper-ink); }
/* Arabic labels leave the mono face: its fixed-width space splits two-word labels apart */
html[dir="rtl"] .hb-log-k, html[dir="rtl"] .hb-state { letter-spacing: 0; text-transform: none; font-size: 13px; font-family: inherit; }

/* ── 2. Before / after ────────────────────────────────────────────────────── */
.hb-ba { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.hb-ba-col { padding: 28px 0 30px; }
.hb-ba-col h3 { font-size: 15px; font-weight: 600; margin: 0 0 16px; color: var(--text-strong); }
.hb-ba-col ul { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hb-ba-col li { font-size: 14.5px; padding: 8px 14px; border-radius: 999px; line-height: 1.3; }
.hb-ba-col p { margin: 0; font-size: 14.5px; color: var(--text-2); }
.is-before li { border: 1px dashed var(--line-strong, var(--line)); color: var(--text-muted); }
.is-before h3 { color: var(--text-muted); }
.is-after li { border: 1px solid var(--line-strong, var(--line)); background: var(--surface); color: var(--text-strong); display: inline-flex; align-items: center; gap: 8px; }
.is-after li::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--patina-ink); flex: none; }
.hb-ba-mid { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 0 clamp(20px, 4vw, 48px); border-inline: 1px solid var(--line); margin-inline: clamp(20px, 3vw, 40px); }
.hb-ba-mid span { font-family: var(--font-mono); font-size: 12.5px; color: var(--copper-ink); }
.hb-ba-mid svg { width: 28px; height: 28px; fill: none; stroke: var(--copper-ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
html[dir="rtl"] .hb-ba-mid svg { transform: scaleX(-1); }

/* ── 3. The setup line ────────────────────────────────────────────────────── */
/* one continuous rule: the columns touch, and the space between them is each step's own end padding */
.hb-line { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; }
.hb-line li { position: relative; border-top: 1px solid var(--line-strong, var(--line)); padding: 26px 0 0; padding-inline-end: 24px; }
.hb-line li:last-child { padding-inline-end: 0; }
.hb-line li::before { content: ''; position: absolute; top: -5px; inset-inline-start: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 1px solid var(--copper-ink); box-sizing: border-box; }
.hb-line li:last-child::before { background: var(--copper-ink); }
.hb-n { display: block; font-family: var(--font-mono); font-size: 13px; color: var(--copper-ink); margin-bottom: 10px; font-feature-settings: 'zero' 1; }
.hb-line h3 { font-size: 17px; margin: 0 0 8px; color: var(--text-strong); line-height: 1.3; }
.hb-line p { margin: 0; font-size: 14.5px; line-height: 1.65; color: var(--text-2); }

/* ── 4. Two spec sheets ───────────────────────────────────────────────────── */
.hb-where { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.hb-sheet { border: 1px solid var(--line); border-radius: 18px; padding: clamp(22px, 3vw, 32px); background: var(--bg); }
.hb-sheet-k { margin: 0 0 12px; font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--copper-ink); }
html[dir="rtl"] .hb-sheet-k { letter-spacing: 0; text-transform: none; font-size: 13px; font-family: inherit; }
.hb-sheet h3 { font-size: clamp(20px, 2vw, 24px); margin: 0 0 10px; color: var(--text-strong); }
.hb-sheet > p:not(.hb-sheet-k) { margin: 0 0 20px; color: var(--text-2); font-size: 15px; line-height: 1.7; }
.hb-sheet dl { margin: 0; }
.hb-sheet dl div { display: grid; grid-template-columns: minmax(96px, 30%) minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.hb-sheet dt { font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); padding-top: 2px; }
html[dir="rtl"] .hb-sheet dt { letter-spacing: 0; text-transform: none; font-size: 13px; font-family: inherit; }
.hb-sheet dd { margin: 0; font-size: 15px; color: var(--text-strong); }

/* ── 5. The link row to the camera page, and the honest footnote ─────────── */
.hb-link { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px 28px; margin-top: clamp(28px, 4vw, 44px); padding: 22px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.hb-link-k { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
html[dir="rtl"] .hb-link-k { letter-spacing: 0; text-transform: none; font-size: 13px; font-family: inherit; }
.hb-link-t { font-size: 16px; color: var(--text-strong); }
.hb-link-go { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--copper-ink); white-space: nowrap; }
.hb-link-go svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1); }
html[dir="rtl"] .hb-link-go svg { transform: scaleX(-1); }
.hb-link:focus-visible { outline: 2px solid var(--copper-ink); outline-offset: 4px; border-radius: 4px; }
@media (hover: hover) and (pointer: fine) {
    .hb-link:hover .hb-link-go svg { transform: translateX(4px); }
    html[dir="rtl"] .hb-link:hover .hb-link-go svg { transform: scaleX(-1) translateX(4px); }
}
.hb-note { margin: 20px 0 0; font-size: 13px; line-height: 1.6; color: var(--text-muted); max-width: 70ch; }

/* ── widths ───────────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .hb-line { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 34px; }
    .hb-line li:nth-child(3n) { padding-inline-end: 0; }
}
@media (max-width: 900px) {
    .hb-demo { grid-template-columns: minmax(0, 1fr); grid-template-areas: "side" "phone"; }
    .hb-phone { max-width: 420px; width: 100%; margin-inline: auto; }
    .hb-ba { grid-template-columns: minmax(0, 1fr); }
    .hb-ba-mid { flex-direction: row; border-inline: 0; border-block: 1px solid var(--line); margin: 0; padding: 14px 0; justify-content: flex-start; }
    .hb-ba-mid svg { transform: rotate(90deg); }
    html[dir="rtl"] .hb-ba-mid svg { transform: rotate(90deg); }
    .hb-where { grid-template-columns: minmax(0, 1fr); }
    .hb-link { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}
@media (max-width: 640px) {
    /* the line turns upright: a rail down the start edge, a stop at each step */
    .hb-line { grid-template-columns: minmax(0, 1fr); gap: 0; border-inline-start: 1px solid var(--line-strong, var(--line)); margin-inline-start: 4px; }
    .hb-line li { border-top: 0; padding: 0 0 26px; padding-inline: 22px 0; }
    .hb-line li:last-child { padding-bottom: 0; }
    .hb-line li::before { top: 4px; inset-inline-start: -5px; }
    .hb-screen { padding: 18px 12px 14px; border-radius: 28px; }
    .hb-tile { min-height: 104px; }
}

@media (prefers-reduced-motion: reduce) {
    .hb-tile, .hb-scene, .hb-link-go svg { transition: none; }
    .hb-tile:active, .hb-scene:active { transform: none; }
    .hb-link:hover .hb-link-go svg { transform: none; }
    html[dir="rtl"] .hb-link:hover .hb-link-go svg { transform: scaleX(-1); }
}

/* four facts sit as two pairs, not three and an orphan */
.sp-facts.hb-facts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
