/* Home page: the room comparison, architecture, device map and security drawings. Uses the site tokens only, so both
   themes work. SVG drawings carry numbered callouts; the readable labels sit in HTML beside them, so they stay legible
   on a phone. */

/* ---------------------------------------------------------------- room drawings */
.cmp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.cmp-card { margin: 0; border: 1px solid var(--line); border-radius: 24px; background: var(--bg); overflow: hidden; display: flex; flex-direction: column; }
.cmp-card header { display: flex; align-items: center; gap: 12px; padding: 20px 24px 0; }
.cmp-card h3 { margin: 0; font: 700 20px/1.25 var(--display); letter-spacing: -0.01em; }
.cmp-tag { font: 600 12px/1 var(--font); letter-spacing: 0.06em; text-transform: uppercase; padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.cmp-tag.old { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.cmp-tag.new { color: var(--brand-ink); background: var(--brand-soft); }
.cmp-card svg { width: 100%; height: auto; margin: 10px 0 0; }
.cmp-key { padding: 4px 24px 24px; display: grid; gap: 14px; }
.cmp-key ol { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; }
.cmp-key li { display: grid; grid-template-columns: 24px 1fr; gap: 8px; font-size: 14.5px; line-height: 1.45; color: var(--ink-2); }
.cmp-key li b { display: block; color: var(--ink); font-weight: 600; }
.cmp-key .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 700 12px/1 var(--font); background: var(--ink); color: var(--bg); margin-top: 1px; }
.cmp-key .n.bad { background: var(--bad); color: #fff; }
.cmp-key h4 { margin: 6px 0 0; font: 600 12px/1 var(--font); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.cmp-lines { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); list-style: none; }
.cmp-lines li { display: flex; align-items: center; gap: 8px; }
.cmp-lines i { width: 26px; height: 0; border-top: 3px solid var(--ink-2); display: inline-block; }
.cmp-lines i.w { border-top: 3px dashed var(--brand); }
.cmp-lines i.m { border-top: 3px dotted var(--muted); }

.rm-wall { fill: var(--bg-tint); }
.rm-floor { fill: var(--bg-soft); }
.rm-edge { stroke: var(--line-strong); stroke-width: 1.5; }
.rm-dev { fill: var(--bg); stroke: var(--ink-2); stroke-width: 2; stroke-linejoin: round; }
.rm-hub { stroke: var(--brand); stroke-width: 2.5; }
.rm-screen { fill: var(--hero-bg); }
.rm-zone { fill: #1f6bff; opacity: 0.55; }
.rm-zone.b { fill: #12a3f5; opacity: 0.5; }
.rm-text { fill: #a6b2c8; font: 600 13px var(--font); }
.rm-table { fill: color-mix(in srgb, var(--ink) 9%, var(--bg)); stroke: var(--line-strong); stroke-width: 1.5; }
.rm-person { fill: color-mix(in srgb, var(--ink) 20%, var(--bg)); }
.rm-door { fill: color-mix(in srgb, var(--ink) 6%, var(--bg)); stroke: var(--line-strong); stroke-width: 1.5; }
.rm-cable { fill: none; stroke: var(--ink-2); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.rm-fixed { fill: none; stroke: var(--ink-2); stroke-width: 2.5; stroke-linecap: round; }
.rm-wire { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 3 8; animation: rm-flow 1.2s linear infinite; }
.rm-mgmt { fill: none; stroke: var(--muted); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 1 7; }
.rm-wifi { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linecap: round; }
.rm-port { fill: var(--brand); }
.rm-lbl text { fill: var(--muted); font: 600 12.5px var(--font); }
.rm-in { fill: var(--ink); font: 700 14px var(--font); }
@media (max-width: 560px) { .rm-lbl { display: none; } }
@media (max-width: 1100px) and (min-width: 861px) { .home .nav a[href="#architecture"] { display: none; } }
.rm-callout circle { fill: var(--ink); }
.rm-callout text { fill: var(--bg); font: 700 12px var(--font); text-anchor: middle; dominant-baseline: central; }
.rm-callout.bad circle { fill: var(--bad); }
.rm-callout.bad text { fill: #fff; }
@keyframes rm-flow { to { stroke-dashoffset: -22; } }

/* ---------------------------------------------------------------- connection flows */
.flows { margin-top: 28px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.flowline { margin: 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg); }
.flowline figcaption { font: 600 12px/1 var(--font); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.flowline ol { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.flowline li { font-size: 14px; font-weight: 600; color: var(--ink); padding: 7px 12px; border-radius: 10px; background: var(--bg-soft); border: 1px solid var(--line); }
.flowline li.hub { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 35%, transparent); color: var(--brand-ink); }
.flowline li.out { font-weight: 500; color: var(--ink-2); }
.flowline li + li::before { content: "→"; color: var(--brand); font-weight: 700; margin: 0 8px 0 -2px; position: relative; left: -12px; }
.flowline li + li { margin-left: 10px; }

/* ---------------------------------------------------------------- why */
.why { margin-top: 28px; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 20px; }
.why-col { border: 1px solid var(--line); border-radius: 22px; padding: 26px 28px; background: var(--bg); }
.why-col.new { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); box-shadow: var(--shadow); }
.why-col h3 { margin: 0 0 16px; font: 700 19px/1.3 var(--display); }
.why-col ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.why-col.new ul { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; }
.why-col li { position: relative; padding-left: 26px; font-size: 15.5px; color: var(--ink-2); line-height: 1.45; }
.why-col li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 12px; height: 2px; background: var(--faint); }
.why-col.new li::before { top: 4px; width: 14px; height: 8px; background: none; border: solid var(--brand); border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg); left: 1px; }
.why-note { margin: 18px 0 0; font-size: 14.5px; color: var(--muted); max-width: 820px; }

/* ---------------------------------------------------------------- layered architecture */
.arcx { border: 1px solid var(--line); border-radius: 26px; background: var(--bg); padding: 26px; display: block; margin: 0; }
.arch-legend { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 0 0 22px; padding: 0; list-style: none; font-size: 13.5px; color: var(--muted); }
.arch-legend li { display: flex; align-items: center; gap: 8px; }
.arch-legend i { width: 28px; border-top: 3px solid var(--brand); }
.arch-legend i.m { border-top: 3px dotted var(--muted); }
.alayer { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 20px; align-items: stretch; }
.alayer > h3 { margin: 0; padding: 18px 0; font: 700 12.5px/1.3 var(--font); letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); border-right: 2px solid var(--line); padding-right: 16px; }
.alayer.ly-room > h3, .alayer.ly-ctl > h3, .alayer.ly-dev > h3 { border-right-color: color-mix(in srgb, var(--brand) 55%, transparent); }
.alayer.ly-net > h3 { border-right-color: var(--ink-2); }
.alayer.ly-mgmt > h3 { border-right: 2px dotted var(--muted); }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 12px 0; }
.cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.node { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; background: var(--bg-soft); display: grid; gap: 4px; align-content: start; }
.node b { font-size: 15px; color: var(--ink); font-weight: 650; display: flex; align-items: center; gap: 8px; }
.node span { font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.node svg { width: 20px; height: 20px; flex: none; color: var(--brand); }
.node.hub { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.node.wide { grid-column: 1 / -1; }
.vbadge { display: inline-block; font: 600 11px/1 var(--font); letter-spacing: 0.04em; padding: 4px 7px; border-radius: 6px; background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--muted); margin-left: 4px; vertical-align: 2px; }
.netbar { margin: 12px 0; border-radius: 14px; padding: 14px 18px; background: var(--ink); color: var(--bg); display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; font-size: 14.5px; }
.netbar b { font-weight: 700; }
.netbar span { opacity: 0.78; }
.hop { margin-left: 190px; display: flex; align-items: center; gap: 10px; padding: 2px 0 2px 26px; font-size: 13px; color: var(--brand-ink); font-weight: 600; position: relative; min-height: 34px; }
.hop::before { content: ""; position: absolute; left: 10px; top: 0; bottom: 0; border-left: 2px solid var(--brand); }
.hop.m { color: var(--muted); }
.hop.m::before { border-left: 2px dotted var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { font-size: 13px; color: var(--ink-2); padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); }
.arch-note { margin: 18px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.arch-note p { margin: 0; padding: 16px 18px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); background: var(--bg-soft); border-left: 3px solid var(--brand); }
.arch-note p.m { border-left: 3px dotted var(--muted); }

/* ---------------------------------------------------------------- device map */
.dmap { margin-top: 64px; }
.dmap h3.sub, .sec-wrap h3.sub { font: 700 clamp(24px, 3vw, 34px)/1.15 var(--display); letter-spacing: -0.02em; margin: 0 0 10px; }
.dmap > p, .sec-wrap > p { color: var(--muted); margin: 0 0 26px; max-width: 680px; font-size: 16.5px; }
.dm { border: 1px solid var(--line); border-radius: 26px; background: var(--bg); padding: 28px; display: grid; justify-items: center; }
.dm-card { border: 1px solid var(--line); border-radius: 16px; background: var(--bg-soft); padding: 14px 18px; text-align: center; min-width: 200px; }
.dm-card b { display: block; font-size: 15.5px; color: var(--ink); }
.dm-card span { display: block; font-size: 13px; color: var(--muted); }
.dm-card.hub { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 45%, transparent); }
.dm-v { width: 0; height: 40px; border-left: 2px dotted var(--muted); position: relative; }
.dm-v em { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); white-space: nowrap; font: 600 12.5px var(--font); font-style: normal; color: var(--muted); }
.dm-net { width: 100%; text-align: center; border-radius: 14px; padding: 13px 16px; background: var(--ink); color: var(--bg); font-size: 14.5px; }
.dm-net b { font-weight: 700; }
.dm-cols { width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.dm-col { display: grid; justify-items: center; align-content: start; }
.dm-col::before { content: ""; height: 34px; border-left: 2px solid var(--brand); }
.dm-col .dm-card { width: 100%; min-width: 0; }
.dm-col .dm-v { border-left: 2px solid var(--brand); height: 26px; }
.dm-col .dm-v em { color: var(--brand-ink); }
.dm-leaf { width: 100%; display: grid; gap: 8px; }
.dm-leaf.row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dm-leaf span { display: block; text-align: center; font-size: 13px; padding: 9px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink-2); }

/* ---------------------------------------------------------------- security layers */
.sec-wrap { margin-top: 64px; }
.stack { display: grid; gap: 10px; counter-reset: lyr; }
.lyr { counter-increment: lyr; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; align-items: start; border: 1px solid var(--line); border-radius: 18px; padding: 18px 22px; background: var(--bg); position: relative; }
.lyr::before { content: counter(lyr, decimal-leading-zero); position: absolute; left: -1px; top: 18px; width: 4px; height: 26px; border-radius: 0 4px 4px 0; background: var(--brand); font-size: 0; }
.lyr h4 { margin: 0; font: 700 16px/1.3 var(--display); color: var(--ink); }
.lyr h4 small { display: block; font: 600 12px/1.6 var(--font); letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-ink); }
.lyr h4 small::before { content: "Layer " counter(lyr) " · "; }
.lyr ul { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 22px; }
.lyr li { font-size: 14.5px; color: var(--ink-2); line-height: 1.45; padding-left: 16px; position: relative; }
.lyr li::before { content: ""; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.lyr li b { color: var(--ink); font-weight: 600; }

@media (max-width: 1080px) {
  .cmp-grid { grid-template-columns: minmax(0, 1fr); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dm-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lyr { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
@media (max-width: 760px) {
  .flows, .why, .arch-note { grid-template-columns: minmax(0, 1fr); }
  .why-col.new ul, .lyr ul { grid-template-columns: minmax(0, 1fr); }
  .alayer { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .alayer > h3 { border-right: 0; padding: 14px 0 4px; }
  .hop { margin-left: 0; }
  .arcx, .dm { padding: 16px; border-radius: 20px; }
}
@media (max-width: 560px) {
  .cmp-key ol, .cards, .cards.two, .dm-cols { grid-template-columns: minmax(0, 1fr); }
  .cmp-card header { padding: 16px 16px 0; flex-wrap: wrap; }
  .cmp-key { padding: 4px 16px 18px; }
  .dm-card { min-width: 0; width: 100%; }
  .dm-v { width: auto; height: auto; padding: 8px 0 8px 12px; }
  .dm-v em { position: static; transform: none; display: block; white-space: normal; }
}
@media (prefers-reduced-motion: reduce) { .rm-wire { animation: none; } }

/* ---------------------------------------------------------------- FAQ */
.faq-wrap { max-width: 900px; }
.faq { display: grid; gap: 10px; }
.faq details { border: 1px solid var(--line); border-radius: 16px; background: var(--bg); padding: 0 22px; }
.faq details[open] { box-shadow: var(--shadow); }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 600 22px/1 var(--font); color: var(--brand); flex: none; transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary h3 { margin: 0; font: 650 17px/1.4 var(--display); color: var(--ink); }
.faq details p { margin: 0 0 20px; color: var(--ink-2); font-size: 16px; line-height: 1.6; max-width: none; }
@media (max-width: 1100px) and (min-width: 861px) { .home .nav a[href="#faq"] { display: none; } }
