/* ═════════════════════════════════════════════════════════════
   House11 — site styles (mobile first)
   ═════════════════════════════════════════════════════════════ */

:root {
  --paper: #F3F1EC;
  --paper-2: #EBE8E1;
  --card: #FFFFFF;
  --ink: #1B1A17;
  --ink-2: #4A4740;
  --muted: #7F7A70;
  --line: rgba(27, 26, 23, .12);
  --line-2: rgba(27, 26, 23, .07);
  --red: #C0392B;
  --red-ink: #A32F23;

  /* energy colours (phone UI) */
  --solar: #F2B544;
  --battery: #69C350;
  --grid: #86B4EA;
  --home: #EDE8DE;
  --app: #141619;
  --app-2: #1E2125;
  --app-3: #2A2E33;
  --app-text: #F3F0EA;
  --app-muted: #8B9097;

  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --header-h: 64px;
  --gutter: 20px;
  --maxw: 1240px;
  --radius: 22px;
  --shadow-soft: 0 1px 2px rgba(27, 26, 23, .04), 0 12px 32px -12px rgba(27, 26, 23, .16);
}
@media (min-width: 960px) {
  :root { --header-h: 76px; --gutter: 40px; }
}

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
html.menu-open, html.menu-open body { overflow: hidden; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 6px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 12px; top: 12px; z-index: 1000;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px;
  text-decoration: none; transform: translateY(-150%); transition: transform .2s;
}
.skip-link:focus { transform: none; }
.anchor-top { position: absolute; top: 0; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }

/* ── Type ── */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 500; letter-spacing: .01em; color: var(--ink-2);
  margin-bottom: 18px;
}
.eyebrow::before { content: ''; width: 8px; height: 8px; background: var(--red); flex: none; }
.h2 {
  font-size: clamp(34px, 8.6vw, 64px);
  line-height: 1.02; letter-spacing: -.035em; font-weight: 500;
  text-wrap: balance;
}
.lead { font-size: 17px; line-height: 1.6; color: var(--ink-2); max-width: 36em; margin-top: 20px; text-wrap: pretty; }
@media (min-width: 960px) { .lead { font-size: 18px; } }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border-radius: 999px; border: 0;
  font-size: 15px; font-weight: 500; letter-spacing: .005em; line-height: 1.1;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .2s, transform .2s var(--ease), box-shadow .2s;
}
.btn--red { background: var(--red); color: #fff; box-shadow: 0 8px 20px -10px rgba(192, 57, 43, .7); }
.btn--red:hover { background: var(--red-ink); }
.btn--red:active { transform: translateY(1px); }
.btn--sm { min-height: 42px; padding: 0 18px; font-size: 14px; }
.btn--block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .55); cursor: pointer; text-decoration: none;
  transition: background-color .2s, border-color .2s;
}
.icon-btn:hover { background: #fff; border-color: rgba(27, 26, 23, .22); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ═════════ HEADER ═════════ */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  padding-top: env(safe-area-inset-top);
  transition: background-color .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.header::before {             /* glass state: soft paper gradient, no hard edge */
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(243, 241, 236, .92), rgba(243, 241, 236, 0));
  transition: opacity .3s;
}
.header.is-solid {
  background: rgba(243, 241, 236, .9);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom-color: var(--line-2);
}
.header.is-solid::before { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .header, .header::before { transition: none; } }

.header__bar {
  height: var(--header-h); max-width: var(--maxw); margin: 0 auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-height: 44px; }
.brand__mark { width: 30px; height: 30px; flex: none; }
.brand__word { font-family: 'Bebas Neue', var(--font); font-size: 22px; letter-spacing: .12em; line-height: 1; padding-top: 2px; white-space: nowrap; }

.nav { display: none; }
.header__actions { display: flex; align-items: center; gap: 8px; }
.header__cta { display: none; }
.lang { display: none; }
.lang button {
  min-width: 34px; height: 32px; padding: 0 6px; border: 0; background: none; border-radius: 8px;
  font-size: 12.5px; font-weight: 500; letter-spacing: .04em; color: var(--muted); cursor: pointer;
}
.lang button:hover { color: var(--ink); }
.lang button[aria-pressed="true"] { color: var(--ink); background: rgba(27, 26, 23, .07); }

@media (min-width: 1080px) {
  .nav { display: flex; gap: 4px; }
  .nav a {
    text-decoration: none; font-size: 14.5px; color: var(--ink-2); padding: 10px 12px; border-radius: 10px;
    transition: color .2s, background-color .2s;
  }
  .nav a:hover { color: var(--ink); background: rgba(27, 26, 23, .05); }
  .lang { display: flex; gap: 2px; margin-right: 6px; }
  .header__cta { display: inline-flex; }
  .header__call, .header__menu { display: none; }
}

/* ═════════ MOBILE MENU ═════════ */
.menu {
  position: fixed; inset: 0; z-index: 200; background: var(--paper);
  display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) max(var(--gutter), env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  overflow-y: auto; overscroll-behavior: contain;
  animation: menu-in .28s var(--ease);
}
.menu[hidden] { display: none; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .menu { animation: none; } }
.menu__top { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; flex: none; }
.menu__nav { display: flex; flex-direction: column; margin-top: 16px; }
.menu__nav a {
  font-size: 32px; font-weight: 500; letter-spacing: -.03em; line-height: 1.1; text-decoration: none;
  padding: 12px 0; border-bottom: 1px solid var(--line-2);
}
.menu__foot { margin-top: auto; padding-top: 32px; display: flex; flex-direction: column; gap: 6px; }
.menu__label { margin-top: 18px; font-size: 13px; color: var(--muted); }
.menu__line { font-size: 17px; text-decoration: none; padding: 6px 0; }
.lang--menu { display: flex; gap: 4px; margin-top: 14px; }
.lang--menu button { height: 44px; min-width: 52px; font-size: 14px; border: 1px solid var(--line); }

/* ═════════ STORY (scroll-driven day) ═════════ */
.story { position: relative; --sky: #F5EEE6; }
.story__stage { position: relative; background: var(--sky); overflow: hidden; }
.story__bg { position: absolute; inset: 0; pointer-events: none; }
.story__glow {
  position: absolute; inset: -20%;
  background: radial-gradient(38% 30% at var(--gx, 20%) var(--gy, 60%), rgba(242, 181, 68, var(--ga, .35)), transparent 70%);
}
.story__media { position: absolute; inset: 0; }
.story__media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0;
  transition: opacity .6s;
}
.sunpath { display: none; }
/* Higgsfield stills (content.js → story.media): photo sits behind the phone, fades out under the copy */
.story.has-media .story__media {
  -webkit-mask-image: linear-gradient(to bottom, transparent 22%, #000 58%);
  mask-image: linear-gradient(to bottom, transparent 22%, #000 58%);
}
.story.has-media .story__glow { opacity: .5; }
@media (min-width: 960px) {
  .story.has-media .story__media {
    -webkit-mask-image: linear-gradient(to right, transparent 34%, #000 66%);
    mask-image: linear-gradient(to right, transparent 34%, #000 66%);
  }
  .story.has-media .sunpath { display: none !important; }
}

.story__inner { position: relative; }

/* chapter copy */
.chapter--intro .intro__title {
  font-size: clamp(42px, 12vw, 58px); line-height: .98; letter-spacing: -.045em; font-weight: 500;
}
.intro__sub { margin-top: 16px; font-size: 16px; line-height: 1.5; color: var(--ink-2); max-width: 30em; text-wrap: pretty; }
.intro__actions { margin-top: 22px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.scroll-cue { display: none; }

.chapter__time { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.chapter__dot {
  width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--dot, var(--ink));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--dot, #1B1A17) 18%, transparent);
}
.chapter__title { margin-top: 10px; font-size: clamp(27px, 7.4vw, 34px); line-height: 1.06; letter-spacing: -.03em; font-weight: 500; text-wrap: balance; }
.chapter__text { margin-top: 12px; font-size: 16px; line-height: 1.55; color: var(--ink-2); max-width: 30em; text-wrap: pretty; }
.chapter__cta { margin-top: 18px; }
.chapter__list { display: none; }

/* device */
.device { position: relative; width: var(--pw, min(76vw, 310px)); margin: 0 auto; }
.device__note { margin-top: 14px; text-align: center; font-size: 12px; color: var(--muted); }
.pops { display: none; }
.timeline { display: none; }

/* ── static layout (no JS / reduced motion) ── */
.story:not(.is-live) .story__stage { background: linear-gradient(#F5EEE6, var(--paper)); }
.story:not(.is-live) .story__inner {
  padding: calc(var(--header-h) + 28px) var(--gutter) 64px; max-width: var(--maxw); margin: 0 auto;
  display: grid; gap: 40px;
}
.story:not(.is-live) .story__copy { display: contents; }
.story:not(.is-live) .chapter--intro { order: 1; }
.story:not(.is-live) .story__device { order: 2; }
.story:not(.is-live) .story__chapters { order: 3; display: grid; gap: 28px; }
.story:not(.is-live) .story__chapters .chapter { padding-top: 22px; border-top: 1px solid var(--line); }
.story:not(.is-live) .chapter__list { display: grid; gap: 6px; margin-top: 14px; }
.chapter__list li {
  position: relative; padding-left: 26px; font-size: 15px; color: var(--ink-2);
}
.chapter__list li::before {
  content: ''; position: absolute; left: 0; top: .2em; width: 16px; height: 16px; border-radius: 50%;
  background: rgba(54, 168, 115, .15) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23268a59' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 10px no-repeat;
}
@media (min-width: 960px) {
  .story:not(.is-live) .story__inner { grid-template-columns: 1.1fr 1fr; align-items: center; column-gap: 64px; }
  .story:not(.is-live) .story__chapters { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); column-gap: 32px; }
  .story:not(.is-live) .chapter__title { font-size: 28px; }
  .story:not(.is-live) .chapter__text { font-size: 16px; }
  .story:not(.is-live) .device { --pw: 330px; }
}

/* ── live layout (pinned stage) ── */
.story.is-live .story__stage {
  position: sticky; top: 0; height: 100vh; height: 100svh;
}
.story.is-live .story__inner { height: 100%; }
.story.is-live .story__copy { display: grid; }
.story.is-live .story__chapters { display: contents; }
.story.is-live .chapter {
  grid-area: 1 / 1; align-self: start;
  opacity: 0; visibility: hidden; will-change: opacity, transform;
}
.story.is-live .chapter--intro { opacity: 1; visibility: visible; }
.story.is-live .pops { display: grid; z-index: 4; pointer-events: none; }

/* ═════════ POPUPS: what the house just did ═════════ */
.pop {
  grid-area: 1 / 1; align-self: end; justify-self: center; width: 100%; max-width: 400px;
  background: #fff; color: var(--ink); border-radius: 22px; padding: 14px 16px 16px;
  box-shadow: 0 1px 2px rgba(27, 26, 23, .06), 0 28px 60px -20px rgba(27, 26, 23, .5), 0 0 0 1px rgba(27, 26, 23, .04);
  opacity: 0; visibility: hidden; transform: translateY(20px) scale(.9); transform-origin: 50% 0;
  transition: opacity .2s ease, transform .3s ease, visibility 0s linear .3s;
}
.pop.is-on {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .25s ease, transform .65s cubic-bezier(.34, 1.45, .5, 1), visibility 0s;
}
.pop__head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.pop__ic { width: 26px; height: 26px; border-radius: 8px; background: var(--ic); display: grid; place-items: center; flex: none; }
.pop__ic svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.pop__app { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.pop__when { margin-left: auto; }
.pop__title { margin-top: 10px; font-size: 18px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.pop__list { margin-top: 10px; display: grid; gap: 7px; }
.pop__list li {
  display: grid; grid-template-columns: 20px 1fr; gap: 9px; align-items: start;
  font-size: 14.5px; line-height: 1.35; color: var(--ink-2);
  opacity: 0; transform: translateX(-8px); transition: opacity .15s, transform .15s;
}
.pop.is-on .pop__list li {
  opacity: 1; transform: none;
  transition: opacity .3s ease calc(.4s + var(--i, 0) * .24s), transform .45s var(--ease) calc(.4s + var(--i, 0) * .24s);
}
.pop__list li i {
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(54, 168, 115, .15) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23268a59' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.pop__list li.is-key span { color: var(--ink); font-weight: 600; }
.pop__list li.is-warn i {
  background: rgba(224, 137, 79, .18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b35d22' stroke-width='3.2' stroke-linecap='round'%3E%3Cpath d='M12 6.5v7M12 17.5v.1'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.pop__list li.is-warn span { color: #9C521D; font-weight: 600; }

/* critical alert */
.pop--critical { box-shadow: 0 0 0 1.5px rgba(192, 57, 43, .35), 0 28px 60px -20px rgba(192, 57, 43, .45); }
.pop--critical .pop__app { color: var(--red); }
.pop--critical .pop__title { color: var(--red-ink); }
.pop--critical.is-on { animation: pop-shake .5s .55s; }
@keyframes pop-shake {
  20% { translate: -4px 0; } 40% { translate: 4px 0; } 60% { translate: -3px 0; } 80% { translate: 2px 0; }
}

/* energy split */
.pop__bar { display: flex; gap: 3px; height: 10px; margin-top: 12px; border-radius: 6px; overflow: hidden; background: var(--paper-2); }
.pop__bar i { display: block; height: 100%; width: 0; transition: width .2s; }
.pop.is-on .pop__bar i { width: var(--w); transition: width .9s var(--ease) .35s; }
.b-bat { background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .32) 0 4px, transparent 4px 8px), var(--battery); background-size: 11.3px 11.3px, auto; animation: bar-flow 1s linear infinite; }
.b-home { background: #3A3833; }
.b-grid { background: var(--grid); }
@keyframes bar-flow { to { background-position: 11.3px 0, 0 0; } }
.pop__legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
.pop__legend span::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--c); }
.l-bat { --c: var(--battery); } .l-home { --c: #3A3833; } .l-grid { --c: var(--grid); }

/* intercom camera */
.pop__cam { position: relative; margin-top: 10px; border-radius: 14px; overflow: hidden; aspect-ratio: 320 / 132; background: #CFD8DD; }
.pop__cam svg { display: block; width: 100%; height: 100%; }
.cam__gate { transition: transform 1.6s var(--ease) .15s; }
.pop--cam.is-tapped .cam__gate { transform: translateX(215px); }
.pop__live {
  position: absolute; left: 8px; top: 8px; display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; border-radius: 999px; background: rgba(0, 0, 0, .5); color: #fff; font-size: 11px; font-weight: 500;
}
.pop__live i { width: 6px; height: 6px; border-radius: 50%; background: #FF4D3D; animation: live-blink 1.2s steps(2) infinite; }
@keyframes live-blink { 50% { opacity: .2; } }
.pop__stamp { position: absolute; right: 9px; top: 8px; font-size: 11px; color: rgba(255, 255, 255, .92); font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0, 0, 0, .55); }
.pop__actions { display: flex; gap: 8px; margin-top: 12px; }
.pop__btn { flex: 1; display: grid; place-items: center; min-height: 40px; border-radius: 12px; background: var(--paper-2); font-size: 14px; font-weight: 600; position: relative; overflow: hidden; }
.pop__btn--go { background: var(--ink); color: #fff; transition: background-color .3s; }
.pop__btn-a, .pop__btn-b { grid-area: 1 / 1; transition: opacity .25s, transform .25s; }
.pop__btn-b { opacity: 0; transform: translateY(8px); }
.pop__btn--go::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border-radius: 50%; background: rgba(255, 255, 255, .55); opacity: 0; transform: scale(0);
}
.pop--cam.is-tapped .pop__btn--go { background: #36A873; }
.pop--cam.is-tapped .pop__btn--go::after { animation: tap .6s ease-out; }
.pop--cam.is-tapped .pop__btn-a { opacity: 0; transform: translateY(-8px); }
.pop--cam.is-tapped .pop__btn-b { opacity: 1; transform: none; }
@keyframes tap { 0% { opacity: .8; transform: scale(0); } 100% { opacity: 0; transform: scale(20); } }
.pop.pop--cam.is-on .pop__list--after li { opacity: 0; transform: translateX(-8px); transition: opacity .15s, transform .15s; }
.pop.pop--cam.is-on.is-tapped .pop__list--after li {
  opacity: 1; transform: none;
  transition: opacity .3s ease calc(.6s + var(--i, 0) * 1s), transform .45s var(--ease) calc(.6s + var(--i, 0) * 1s);
}
@media (prefers-reduced-motion: reduce) {
  .pop, .pop.is-on, .pop__list li, .pop.is-on .pop__list li { transition: none !important; }
  .pop--critical.is-on, .b-bat, .pop__live i { animation: none; }
}

/* timeline */
.story.is-live .timeline { display: flex; align-items: center; }
.timeline__item {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; cursor: pointer;
  min-height: 36px; padding: 0 8px; border-radius: 999px; color: var(--muted); font-size: 13px; font-weight: 500;
}
.timeline__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .5; flex: none; transition: transform .25s, opacity .25s; }
.timeline__t { display: none; font-variant-numeric: tabular-nums; }
.timeline__item.is-active { color: var(--ink); }
.timeline__item.is-active .timeline__dot { opacity: 1; background: var(--red); transform: scale(1.25); }
.story.is-live .timeline__item:not(.is-active) .timeline__l { display: none; }
.timeline__skip {
  display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 12px 0 10px;
  font-size: 13px; font-weight: 500; text-decoration: none; color: var(--ink-2);
  border-left: 1px solid var(--line); margin-left: 2px; white-space: nowrap;
}
.timeline__skip svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ── live: mobile / tablet ── */
@media (max-width: 959px) {
  .story.is-live .story__inner {
    --pw: min(74vw, 300px, calc((100svh - 330px) * .78));
    display: flex; flex-direction: column;
    padding: calc(var(--header-h) + env(safe-area-inset-top) + 6px) var(--gutter) 0;
  }
  .story.is-live .story__copy { flex: none; }
  .story.is-live .story__device {
    flex: 1; min-height: 0; padding-top: 22px;
    transform: translateY(calc(var(--rise, 0px) * var(--rt, 0) * -1));
  }
  .story.is-live .device__note { display: none; }
  .story.is-live .pops { position: absolute; left: var(--gutter); right: var(--gutter); bottom: calc(66px + env(safe-area-inset-bottom)); }
  .pop__title { font-size: 17px; }
  .pop__list li { font-size: 14px; }
  .story.is-live .timeline {
    position: absolute; z-index: 5; left: 50%; transform: translateX(-50%);
    bottom: calc(14px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .92); border-radius: 999px; padding: 4px;
    box-shadow: 0 1px 2px rgba(27, 26, 23, .06), 0 10px 30px -12px rgba(27, 26, 23, .35);
    max-width: calc(100vw - 24px);
  }
  .story.is-live .timeline__item { min-width: 30px; padding: 0 6px; justify-content: center; }
}
@media (max-width: 379px) {
  .timeline__skip span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
@media (max-width: 959px) and (max-height: 720px) {
  .chapter--intro .intro__title { font-size: clamp(36px, 10.5vw, 46px); }
  .intro__sub { font-size: 15px; margin-top: 12px; }
  .intro__actions { margin-top: 16px; }
  .chapter__title { font-size: 26px; }
  .chapter__text { font-size: 15px; }
  .btn { min-height: 48px; }
  .pop { padding: 12px 14px 14px; }
  .pop__title { font-size: 16px; margin-top: 8px; }
  .pop__list { gap: 5px; }
  .pop__cam { aspect-ratio: 320 / 104; }
}
@media (min-width: 600px) and (max-width: 959px) {
  .story.is-live .story__copy { max-width: 560px; }
  .story.is-live .story__inner { --pw: min(300px, calc((100svh - 330px) * .6)); }
}

/* ── live: desktop ── */
@media (min-width: 960px) {
  .story.is-live .story__inner {
    --pw: min(330px, calc((100svh - var(--header-h) - 110px) * .487));
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; column-gap: 48px;
    max-width: var(--maxw); margin: 0 auto; padding: var(--header-h) var(--gutter) 0;
  }
  .story.is-live .story__copy { grid-column: 1; grid-row: 1; align-self: center; padding-bottom: 60px; }
  .chapter--intro .intro__title { font-size: clamp(60px, 6.6vw, 100px); }
  .intro__sub { font-size: 19px; margin-top: 24px; }
  .intro__actions { margin-top: 32px; }
  .story.is-live .scroll-cue { display: inline-flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
  .scroll-cue__line { width: 1px; height: 34px; background: linear-gradient(var(--ink), transparent); position: relative; overflow: hidden; }
  .scroll-cue__line::after { content: ''; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--paper); animation: cue 2s var(--ease) infinite; }
  @keyframes cue { to { top: 110%; } }
  .chapter__title { font-size: clamp(38px, 3.8vw, 54px); margin-top: 14px; }
  .chapter__text { font-size: 18.5px; margin-top: 18px; max-width: 26em; }
  .story.is-live .story__device { grid-column: 2; grid-row: 1; height: 100%; display: flex; align-items: center; justify-content: center; }
  .story.is-live .device { margin-top: -20px; }
  .story.is-live .pops { grid-column: 2; grid-row: 1; align-self: center; justify-self: center; width: calc(var(--pw) * 1.32); margin-top: calc(var(--pw) * .5); }
  .pop { align-self: start; max-width: none; padding: 16px 18px 18px; border-radius: 24px; }
  .pop__title { font-size: 19px; }
  .pop__list li { font-size: 15px; }

  /* arc: rx ≈ .95 × phone width, ry ≈ 1.12 ×, horizon at the phone's middle, apex just above it */
  .story.is-live .sunpath {
    position: absolute; z-index: 0; left: 50%; top: calc(var(--pw) * -.2845);
    width: calc(var(--pw) * 2.635); height: auto; transform: translateX(-50%); overflow: visible; pointer-events: none;
  }
  .story.is-live .phone { z-index: 1; }
  @media (min-width: 1200px) { .story.is-live .sunpath { display: block; } }
  .sunpath__arc { fill: none; stroke: rgba(27, 26, 23, .16); stroke-width: 1.2; stroke-dasharray: 2 7; stroke-linecap: round; }
  .sunpath__horizon { fill: none; stroke: rgba(27, 26, 23, .12); stroke-width: 1; }
  .sunpath__ticks text { font: 500 13px var(--font); fill: rgba(27, 26, 23, .38); font-variant-numeric: tabular-nums; }
  .sun-disc { fill: var(--solar); }
  .sun-halo { fill: rgba(242, 181, 68, .18); }
  .moon-disc { fill: #F7F5F0; stroke: rgba(27, 26, 23, .12); }

  .story.is-live .timeline { position: absolute; left: var(--gutter); bottom: 28px; z-index: 5; gap: 2px; }
  .timeline__t { display: inline; color: inherit; opacity: .75; }
  .timeline__item { padding: 0 10px 0 0; }
  .timeline__skip { margin-left: 8px; padding-left: 16px; }
}
@media (prefers-reduced-motion: reduce) { .scroll-cue__line::after { animation: none; } }

/* ═════════ PHONE: illustrative lock screen ═════════ */
.phone {
  position: relative; width: 100%; aspect-ratio: 300 / 620;
  background: #0D0E10; border-radius: 15.5% / 7.5%; padding: 3.2%;
  box-shadow:
    inset 0 0 0 1.5px #3a3d42, inset 0 0 0 3px #111,
    0 2px 4px rgba(27, 26, 23, .08),
    0 40px 70px -24px rgba(48, 36, 22, .45),
    0 18px 30px -18px rgba(48, 36, 22, .35);
}
.phone__screen {
  position: relative; height: 100%; overflow: hidden; background: var(--app);
  border-radius: 12.6% / 6.1%; container-type: inline-size;
}
.lock {
  position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden;
  font-size: calc(100cqw / 27); line-height: 1.25; color: #fff; font-family: var(--font);
  background:
    radial-gradient(75% 52% at var(--wx, 18%) var(--wy, 88%), rgba(var(--wc, 233, 164, 91), var(--wa, .55)), transparent 72%),
    linear-gradient(172deg, #2B323D 0%, #171B21 55%, #0E1014 100%);
}
.lock p { margin: 0; }
.ui-status { position: relative; height: 4.4em; display: flex; align-items: center; justify-content: space-between; flex: none; padding: .6em 1.9em 0 2.3em; }
.ui-island { position: absolute; left: 50%; top: 1.05em; width: 8.8em; height: 2.55em; margin-left: -4.4em; background: #000; border-radius: 2em; }
.ui-sys { display: flex; gap: .45em; align-items: center; }
.ui-sys svg { height: 1em; width: auto; fill: currentColor; }
.lock__head { text-align: center; margin-top: .5em; flex: none; }
.lock__pad { width: 1.5em; height: 1.5em; margin: 0 auto; fill: none; stroke: rgba(255, 255, 255, .85); stroke-width: 1.8; stroke-linecap: round; }
.lock__date { margin-top: .45em; font-size: 1.28em; font-weight: 500; color: rgba(255, 255, 255, .86); }
.lock__date::first-letter { text-transform: uppercase; }
.lock__clock { font-size: 7em; font-weight: 500; letter-spacing: -.045em; line-height: 1; margin-top: .04em; font-variant-numeric: tabular-nums; }
.lock__widgets { display: flex; justify-content: center; gap: 1.2em; margin-top: 1.3em; flex: none; }
.wdg { position: relative; width: 4.9em; height: 4.9em; border-radius: 50%; background: rgba(255, 255, 255, .1); }
.wdg > svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.wdg__track { fill: none; stroke: rgba(255, 255, 255, .14); stroke-width: 3.2; }
.wdg__ring { fill: none; stroke: var(--wr); stroke-width: 3.2; stroke-linecap: round; transition: stroke .3s; }
.wdg--pv { --wr: var(--solar); } .wdg--bat { --wr: var(--battery); } .wdg--temp { --wr: #F08A5D; }
.wdg--sec { --wr: rgba(255, 255, 255, .28); } .wdg--sec.is-armed { --wr: #FF6B5B; }
.wdg--sec .wdg__ring { stroke-dasharray: 132 132; }
.wdg__in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1em; }
.wdg__in svg { width: 1.35em; height: 1.35em; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.wdg__in b { font-size: 1.05em; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.wdg--sec .wdg__in svg { width: 2em; height: 2em; }
.wdg--sec .wdg__on, .wdg--sec.is-armed .wdg__off { display: none; }
.wdg--sec.is-armed .wdg__on { display: block; }
.lock__list { position: relative; margin: 2.2em 1.3em 0; flex: 1; }
.mini {
  position: absolute; left: 0; right: 0; top: 0; height: 5.4em;
  display: flex; align-items: center; gap: .9em; padding: 0 1em; border-radius: 1.5em;
  background: rgba(255, 255, 255, .16); transform-origin: 50% 0; opacity: 0;
  transition: transform .55s var(--ease), opacity .4s ease;
}
.mini__ic { width: 2.6em; height: 2.6em; border-radius: .75em; background: var(--ic); display: grid; place-items: center; flex: none; }
.mini__ic svg { width: 1.5em; height: 1.5em; fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.mini__txt { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: .15em; opacity: var(--content, 1); transition: opacity .3s; }
.mini__top { display: flex; justify-content: space-between; gap: .6em; }
.mini__top b { font-size: 1.05em; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini__top time { font-size: .9em; color: rgba(255, 255, 255, .6); flex: none; }
.mini__b { font-size: .98em; color: rgba(255, 255, 255, .78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lock__foot { display: flex; justify-content: space-between; padding: 0 2.6em; margin-bottom: 2.6em; flex: none; }
.lock__btn { width: 4.2em; height: 4.2em; border-radius: 50%; background: rgba(255, 255, 255, .14); display: grid; place-items: center; }
.lock__btn svg { width: 1.8em; height: 1.8em; fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lock__bar { position: absolute; left: 50%; bottom: .9em; width: 12em; height: .45em; margin-left: -6em; border-radius: 1em; background: rgba(255, 255, 255, .85); }
@media (prefers-reduced-motion: reduce) { .mini { transition: none; } }

/* ═════════ PHONE: app screens (Loxone-style, illustrative) ═════════ */
.phone__screen { --lx: #69C350; --lx-ink: #0E1A09; --app-bg: #121212; --app-card: #222222; --app-line: rgba(255, 255, 255, .06); }

/* unlock: lock screen slides up, app settles in */
.lock { transition: transform .6s var(--ease), opacity .5s ease; }
.phone__screen:not([data-show="lock"]) .lock { transform: translateY(-100%); opacity: .4; }
.app {
  position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden;
  font-size: calc(100cqw / 27); line-height: 1.25; color: #F2F2F2; font-family: var(--font);
  background: var(--app-bg); padding: 0 1.4em;
  opacity: 0; visibility: hidden; transform: scale(.94);
  transition: opacity .35s ease, transform .5s var(--ease), visibility 0s linear .5s;
}
.phone__screen[data-show="energy"] .app--energy,
.phone__screen[data-show="home"] .app--home {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .4s ease .12s, transform .6s var(--ease) .08s, visibility 0s;
}
.app p { margin: 0; }
.app .ui-status { padding-left: 1em; padding-right: .5em; }
.ui-clock { font-size: 1.32em; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.app__head { display: flex; align-items: center; gap: .9em; margin-top: .8em; flex: none; }
.app__head-t { min-width: 0; }
.app__back, .app__avatar { width: 2.8em; height: 2.8em; border-radius: 50%; background: var(--app-card); display: grid; place-items: center; flex: none; }
.app__avatar { margin-left: auto; }
.app__back svg, .app__avatar svg { width: 1.5em; height: 1.5em; fill: none; stroke: #EDEDED; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.app__kicker { font-size: 1em; color: #8E8E8E; }
.app__title { font-size: 2.2em; font-weight: 600; letter-spacing: -.025em; line-height: 1.1; }
.app__live { margin-left: auto; display: flex; align-items: center; gap: .45em; font-size: .95em; color: var(--lx); }
.app__live i { width: .55em; height: .55em; border-radius: 50%; background: var(--lx); box-shadow: 0 0 0 .25em rgba(105, 195, 80, .2); animation: live-blink 1.6s steps(2) infinite; }
.app__tabs {
  margin: auto -1.4em 0; padding: .9em 1.8em 2.5em; display: flex; justify-content: space-between;
  border-top: 1px solid var(--app-line); background: var(--app-bg); flex: none;
}
.app__tabs span { display: flex; flex-direction: column; align-items: center; gap: .3em; width: 5.2em; color: #777; }
.app__tabs svg { width: 1.9em; height: 1.9em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.app__tabs b { font-size: .78em; font-weight: 500; white-space: nowrap; }
.app__tabs .is-on { color: var(--lx); }

/* energy screen */
.ui-flow { width: 100%; height: auto; margin: .8em 0 .1em; flex: none; overflow: visible; }
.f-orbit { fill: none; stroke: rgba(255, 255, 255, .07); stroke-width: 1; stroke-dasharray: 1 5; }
.f-base { stroke: rgba(255, 255, 255, .1); stroke-width: 1.2; }
.f-dots { stroke: var(--c); stroke-width: 3.4; stroke-linecap: round; stroke-dasharray: 0 8.4; }
.f-spoke[data-spoke="pv"]   { --c: var(--solar); }
.f-spoke[data-spoke="grid"] { --c: var(--grid); }
.f-spoke[data-spoke="bat"]  { --c: var(--lx); }
.f-spoke[data-spoke="home"] { --c: #EDE8DE; }
.f-hub { fill: var(--app-card); }
.f-ring-track { fill: none; stroke: #333; stroke-width: 3.6; }
.f-ring { fill: none; stroke: var(--lx); stroke-width: 3.6; stroke-linecap: round; stroke-dasharray: 0 160.2; }
.f-hub-val { font: 600 15px var(--font); fill: #F2F2F2; text-anchor: middle; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.f-hub-lbl { font: 500 7px var(--font); fill: #8E8E8E; text-anchor: middle; }
.f-node circle { fill: var(--app-card); stroke-width: 1.3; }
.f-node g { fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.f-node--pv circle   { stroke: var(--solar); }  .f-node--pv g   { stroke: var(--solar); }
.f-node--grid circle { stroke: var(--grid); }   .f-node--grid g { stroke: var(--grid); }
.f-node--bat circle  { stroke: var(--lx); }     .f-node--bat g  { stroke: var(--lx); }
.f-node--home circle { stroke: #EDE8DE; }       .f-node--home g { stroke: #EDE8DE; }
.f-bat-fill { fill: var(--lx); stroke: none; }
.f-name { font: 500 8.6px var(--font); fill: #8E8E8E; }
.f-val { font: 600 13px var(--font); fill: #F2F2F2; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.f-st { font: 500 7.6px var(--font); }
.f-st--pv { fill: var(--solar); } .f-st--grid { fill: var(--grid); } .f-st--bat { fill: var(--lx); } .f-st--home { fill: #8E8E8E; }
.ui-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .7em; margin-top: .8em; flex: none; }
.ui-card { background: var(--app-card); border-radius: 1.1em; padding: .9em 1em; }
.ui-card__k { font-size: .92em; color: #8E8E8E; }
.ui-card__v { font-size: 1.55em; font-weight: 600; letter-spacing: -.02em; margin-top: .15em; font-variant-numeric: tabular-nums; }
.ui-card__v small { font-size: .6em; font-weight: 500; color: #8E8E8E; }
.ui-list { margin-top: .8em; background: var(--app-card); border-radius: 1.1em; padding: .9em 1em .5em; flex: none; }
.ui-list__h { font-size: .92em; color: #8E8E8E; margin-bottom: .5em; }
.ui-row { display: grid; grid-template-columns: 7.2em 1fr 2.4em; align-items: center; gap: .7em; padding: .42em 0; font-size: 1.02em; }
.ui-row__n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-row__bar { height: .42em; border-radius: 1em; background: #333; overflow: hidden; }
.ui-row__bar i { display: block; height: 100%; width: 0; background: var(--lx); border-radius: inherit; transition: width .9s var(--ease) .5s; }
.phone__screen[data-show="energy"] .ui-row__bar i { width: var(--w); }
.ui-row__v { text-align: right; font-variant-numeric: tabular-nums; }

/* home dashboard */
.app__status { display: grid; margin-top: .9em; flex: none; }
.app__st {
  grid-area: 1 / 1; display: flex; align-items: center; gap: .55em; padding: .65em .9em; border-radius: .9em;
  font-size: .98em; font-weight: 500; transition: opacity .35s ease;
}
.app__st i { width: .6em; height: .6em; border-radius: 50%; background: currentColor; flex: none; }
.app__st--ok { color: var(--lx); background: rgba(105, 195, 80, .12); }
.app__st--warn { color: #F0A046; background: rgba(240, 160, 70, .14); opacity: 0; }
.app--home.is-tapped .app__st--ok { opacity: 0; transition-delay: 2.2s; }
.app--home.is-tapped .app__st--warn { opacity: 1; transition-delay: 2.2s; }
.scenes { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6em; margin-top: .9em; flex: none; }
.scene {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: .4em;
  padding: .75em .2em .7em; border-radius: 1em; background: var(--app-card); color: #CFCFCF;
  transition: background-color .35s ease, color .35s ease;
}
.scene svg { width: 1.7em; height: 1.7em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.scene b { font-size: .8em; font-weight: 500; text-align: center; line-height: 1.15; }
.app--home.is-arrive .scene--home { background: var(--lx); color: var(--lx-ink); transition-delay: .3s; }
.app--home.is-tapped .scene--home { background: var(--app-card); color: #CFCFCF; transition-delay: 0s; }
.app--home.is-tapped .scene--night { background: var(--lx); color: var(--lx-ink); }
.scene--night::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 1em; height: 1em; margin: -.5em 0 0 -.5em;
  border-radius: 50%; background: rgba(255, 255, 255, .6); opacity: 0; transform: scale(0);
}
.app--home.is-tapped .scene--night::after { animation: tap .6s ease-out; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: .65em; margin-top: .9em; flex: none; }
.tile {
  --tc: #8A8A8A; --d: 0s;
  display: flex; flex-direction: column; gap: .15em; padding: .95em 1em; border-radius: 1.1em; background: var(--app-card);
  transition: box-shadow .4s ease var(--d);
}
.tile__ic {
  width: 2.5em; height: 2.5em; border-radius: .8em; display: grid; place-items: center; margin-bottom: .45em;
  color: var(--tc); background: color-mix(in srgb, var(--tc) 18%, transparent);
  transition: color .4s ease var(--d), background-color .4s ease var(--d);
}
.tile__ic svg { width: 1.45em; height: 1.45em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tile__n { font-size: .98em; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile__v { display: grid; font-size: .92em; }
.tv { grid-area: 1 / 1; color: var(--tc); opacity: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .35s ease var(--d), color .4s ease var(--d); }
.tv--a { opacity: 1; }
/* phase a (before arrival) */
.tile[data-a="alarm"] { --tc: #FF6B5B; }
/* phase b: arrival at 18:10 */
.app--home.is-arrive .tile { --d: calc(.55s + var(--i) * .28s); }
.app--home.is-arrive .tv--a { opacity: 0; }
.app--home.is-arrive .tv--b { opacity: 1; }
.app--home.is-arrive .tile[data-b="on"] { --tc: var(--lx); }
.app--home.is-arrive .tile[data-b="off"] { --tc: #8A8A8A; }
.app--home.is-arrive .tile[data-b="light"] { --tc: #F2C14E; box-shadow: 0 0 1.6em -.4em rgba(242, 193, 78, .45); }
/* phase c: "Dobranoc" tapped at 23:10 */
.app--home.is-tapped .tile, .app--home.is-tapped .tile[data-b="light"] { --d: calc(.45s + var(--i) * .22s); box-shadow: none; }
.app--home.is-tapped .tv--b { opacity: 0; }
.app--home.is-tapped .tv--c { opacity: 1; }
.app--home.is-tapped .tile[data-c="on"] { --tc: var(--lx); }
.app--home.is-tapped .tile[data-c="off"] { --tc: #8A8A8A; }
.app--home.is-tapped .tile[data-c="alarm"] { --tc: #FF6B5B; }
.app--home.is-tapped .tile[data-c="warn"] { --tc: #F0A046; animation: warn-pulse 1.4s ease-in-out 2s 3; }
@keyframes warn-pulse { 50% { box-shadow: 0 0 0 .2em rgba(240, 160, 70, .5); } }
@media (prefers-reduced-motion: reduce) {
  .lock, .app, .tile, .tile__ic, .tv, .scene, .app__st { transition: none !important; }
  .app--home.is-tapped .tile[data-c="warn"], .app--home.is-tapped .scene--night::after, .app__live i { animation: none; }
}

/* ═════════ SECTIONS ═════════ */
.section { padding: 88px 0; }
@media (min-width: 960px) { .section { padding: 140px 0; } }
.section__head { max-width: 760px; margin-bottom: 44px; }
@media (min-width: 960px) { .section__head { margin-bottom: 64px; } }

/* SYSTEM */
.system { background: var(--paper); }
.system__grid { display: grid; gap: 56px; }
.points { margin-top: 36px; display: grid; gap: 22px; }
.points li { display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start; }
.points svg { width: 44px; height: 44px; padding: 11px; border-radius: 12px; background: var(--card); box-shadow: var(--shadow-soft); fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.points h3 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.points p { margin-top: 4px; color: var(--ink-2); font-size: 15.5px; line-height: 1.55; }

.sysmap {
  position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  width: 100%; max-width: 520px; margin: 0 auto; aspect-ratio: 1;
}
.sysmap__lines { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.sysmap__lines path { fill: none; stroke: rgba(27, 26, 23, .14); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.sysmap__lines .sysmap__flow { stroke: var(--red); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 0 12; animation: flow 1.6s linear infinite; opacity: .6; }
@keyframes flow { to { stroke-dashoffset: -12; } }
@media (prefers-reduced-motion: reduce) { .sysmap__lines .sysmap__flow { animation: none; } }
.sysmap__cell, .sysmap__core {
  position: relative; z-index: 1; border-radius: 18px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  margin: 10%;
}
.sysmap__cell { background: var(--card); box-shadow: var(--shadow-soft); font-size: 12.5px; font-weight: 500; color: var(--ink-2); padding: 6px; }
.sysmap__cell svg { width: 26px; height: 26px; fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sysmap__cell span { line-height: 1.15; overflow-wrap: anywhere; }
.sysmap__core { margin: 0; background: var(--ink); color: #fff; gap: 2px; box-shadow: 0 24px 40px -20px rgba(27, 26, 23, .6); }
.sysmap__core b { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.sysmap__core small { font-size: 12px; color: rgba(255, 255, 255, .55); }
.sysmap__status { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: rgba(255, 255, 255, .7); margin-bottom: 6px; }
.sysmap__status i { width: 6px; height: 6px; border-radius: 50%; background: var(--battery); box-shadow: 0 0 0 3px rgba(79, 197, 138, .25); }
@media (min-width: 600px) { .sysmap__cell { font-size: 13.5px; } .sysmap__cell svg { width: 30px; height: 30px; } }
@media (min-width: 960px) {
  .system__grid { grid-template-columns: 1fr 1fr; align-items: center; gap: 80px; }
  .sysmap { max-width: 560px; }
}

/* SERVICES */
.services { background: var(--card); }
.svc { display: grid; border-top: 1px solid var(--line); }
.svc__item {
  display: grid; grid-template-columns: 34px 1fr; column-gap: 14px; row-gap: 6px;
  padding: 26px 0; border-bottom: 1px solid var(--line);
}
.svc__num { grid-row: 1; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 5px; }
.svc__ic { display: none; }
.svc__item h3 { grid-column: 2; font-size: 21px; font-weight: 500; letter-spacing: -.02em; line-height: 1.25; }
.svc__item p { grid-column: 2; color: var(--ink-2); font-size: 15.5px; line-height: 1.55; max-width: 34em; }
@media (min-width: 720px) {
  .svc { grid-template-columns: 1fr 1fr; column-gap: 48px; }
}
@media (min-width: 1080px) {
  .svc { grid-template-columns: repeat(3, 1fr); }
  .svc__item { grid-template-columns: 1fr; padding: 32px 0 40px; row-gap: 0; align-content: start; }
  .svc__num { grid-row: auto; padding: 0; }
  .svc__ic { display: block; width: 30px; height: 30px; margin: 28px 0 22px; fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
  .svc__item h3, .svc__item p { grid-column: 1; }
  .svc__item p { margin-top: 10px; }
}

/* WORK */
.work { background: var(--paper-2); overflow: hidden; }
.work__list {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 0 var(--gutter) 6px; scroll-padding-inline: var(--gutter);
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.work__list::-webkit-scrollbar { display: none; }
.work__item { flex: 0 0 74%; scroll-snap-align: start; }
.work__item--3 { flex-basis: 88%; }
.work__btn { display: block; width: 100%; padding: 0; border: 0; background: var(--paper); border-radius: 18px; overflow: hidden; cursor: zoom-in; }
.work__btn img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; transition: transform .6s var(--ease); }
.work__item--3 .work__btn img { aspect-ratio: auto; height: 100%; }
.work__item--3 .work__btn { height: calc((74vw - var(--gutter)) * 4 / 3); max-height: none; }
.work__btn:hover img { transform: scale(1.03); }
.work__cap { display: flex; gap: 10px; margin-top: 12px; font-size: 14.5px; line-height: 1.35; color: var(--ink-2); }
.work__cap span:first-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.work__hint { margin-top: 18px; font-size: 13px; color: var(--muted); }
@media (min-width: 720px) {
  .work__item { flex-basis: 40%; }
  .work__item--3 { flex-basis: 64%; }
  .work__item--3 .work__btn { height: calc((40vw - var(--gutter)) * 4 / 3); }
}
@media (min-width: 1080px) {
  /* filmstrip: five equal tall frames */
  .work__list {
    display: grid; overflow: visible; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter);
    grid-template-columns: repeat(5, 1fr); gap: 16px;
  }
  .work__item--3 .work__btn { height: auto; }
  .work__btn img, .work__item--3 .work__btn img { aspect-ratio: 3 / 4.4; height: auto; }
  .work__item:nth-child(even) { margin-top: 48px; }
  .work__hint { display: none; }
}

/* PROCESS */
.process { background: var(--paper); }
.steps { display: grid; gap: 0; position: relative; }
.step { display: grid; grid-template-columns: 44px 1fr; gap: 16px; padding-bottom: 30px; position: relative; }
.step:not(:last-child)::before { content: ''; position: absolute; left: 21.5px; top: 48px; bottom: 6px; width: 1px; background: var(--line); }
.step__n {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 15px;
}
.step h3 { font-size: 19px; font-weight: 500; letter-spacing: -.015em; padding-top: 9px; }
.step p { margin-top: 6px; color: var(--ink-2); font-size: 15.5px; line-height: 1.55; }
@media (min-width: 960px) {
  .steps { grid-template-columns: repeat(4, 1fr); gap: 32px; }
  .step { grid-template-columns: 1fr; gap: 20px; padding: 0; align-content: start; }
  .step:not(:last-child)::before { left: 56px; right: -24px; top: 21.5px; bottom: auto; width: auto; height: 1px; }
  .step h3 { padding-top: 0; }
}

/* BRANDS */
.brands { padding: 64px 0; border-top: 1px solid var(--line-2); background: var(--paper); }
.brands__label { font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 22px; }
.brands__list { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 16px; }
.brands__list b { display: block; font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.brands__list span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.brands__note { margin-top: 28px; font-size: 14px; color: var(--ink-2); }
@media (min-width: 720px) { .brands__list { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1080px) {
  .brands__list { grid-template-columns: repeat(7, 1fr); }
  .brands__list b { font-size: 22px; }
}

/* CONTACT */
.contact { background: var(--card); }
.contact__grid { display: grid; gap: 48px; }
.perks { margin-top: 28px; display: grid; gap: 10px; }
.perks li { position: relative; padding-left: 26px; font-size: 15.5px; color: var(--ink-2); }
.perks li::before {
  content: ''; position: absolute; left: 0; top: .45em; width: 14px; height: 14px; border-radius: 50%;
  background: rgba(79, 197, 138, .18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23268a59' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 10px no-repeat;
}
.direct { display: grid; gap: 10px; margin-top: 32px; }
.direct__card {
  display: grid; grid-template-columns: 44px 1fr 20px; gap: 14px; align-items: center;
  padding: 14px 16px; border-radius: 18px; background: var(--paper); text-decoration: none;
  border: 1px solid transparent; transition: border-color .2s, background-color .2s;
}
.direct__card:hover { border-color: var(--line); background: #fff; }
.direct__ic { width: 44px; height: 44px; border-radius: 12px; background: var(--card); display: grid; place-items: center; box-shadow: var(--shadow-soft); }
.direct__ic svg, .direct__arrow { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.direct__body { min-width: 0; display: flex; flex-direction: column; }
.direct__body b { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; line-height: 1.3; }
.direct__body small { font-size: 12.5px; color: var(--muted); }
.direct__arrow { transition: transform .2s; }
.direct__card:hover .direct__arrow { transform: translateX(3px); }

.form-card { background: var(--paper); border-radius: var(--radius); padding: 24px 20px; }
.form-card__title { font-size: 22px; font-weight: 500; letter-spacing: -.02em; margin-bottom: 20px; }
.field-row { display: grid; gap: 0 14px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 500; margin-bottom: 7px; color: var(--ink); }
.field__opt { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 52px; padding: 13px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: 16px/1.4 var(--font); transition: border-color .2s, box-shadow .2s; appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231B1A17' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 18px; padding-right: 44px;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #A7A298; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(27, 26, 23, .08); }
.field input[aria-invalid="true"] { border-color: var(--red); }
.consent { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-size: 13px; line-height: 1.5; color: var(--ink-2); margin-bottom: 12px; cursor: pointer; }
.consent input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--red); cursor: pointer; }
.consent input[aria-invalid="true"] { outline: 2px solid var(--red); outline-offset: 2px; }
.form-card__submit { margin-top: 10px; }
.form-card__submit[disabled] { opacity: .7; cursor: progress; }
.form-card__note { margin-top: 12px; text-align: center; font-size: 12.5px; color: var(--muted); }
.form-card__error { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: rgba(192, 57, 43, .08); color: var(--red-ink); font-size: 14px; display: grid; gap: 2px; }
.form-card__error[hidden] { display: none; }
.form-card__success { text-align: center; padding: 48px 12px; outline: none; }
.form-card__success svg { width: 56px; height: 56px; margin: 0 auto 18px; fill: none; stroke: #268a59; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.form-card__success h3 { font-size: 22px; font-weight: 500; letter-spacing: -.02em; }
.form-card__success p { margin-top: 8px; color: var(--ink-2); }
@media (min-width: 600px) { .field-row { grid-template-columns: 1fr 1fr; } .form-card { padding: 32px; } }
@media (min-width: 960px) {
  .contact__grid { grid-template-columns: 1fr 1fr; gap: 80px; align-items: start; }
  .form-card { padding: 40px; }
}

/* FOOTER */
.footer { background: var(--ink); color: rgba(255, 255, 255, .86); padding: 64px 0 calc(28px + env(safe-area-inset-bottom)); }
.footer .brand { color: #fff; }
.footer__grid { display: grid; gap: 40px; }
.footer__brand p { margin-top: 14px; font-size: 14.5px; color: rgba(255, 255, 255, .6); max-width: 22em; }
.footer__links { display: grid; gap: 4px; }
.footer__links a { text-decoration: none; color: rgba(255, 255, 255, .86); padding: 4px 0; }
.footer__links a:hover { color: #fff; }
.footer__h { font-size: 13px; color: rgba(255, 255, 255, .5); margin-bottom: 14px; }
.social { display: flex; gap: 8px; }
.social a { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .14); transition: background-color .2s, border-color .2s; }
.social a:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .3); }
.social svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.footer__qr { display: none; }
.qr { width: 112px; height: 112px; padding: 8px; background: #fff; border-radius: 12px; }
.qr canvas, .qr img { width: 96px !important; height: 96px !important; }
.footer__bottom { margin-top: 48px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .1); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-size: 13px; color: rgba(255, 255, 255, .45); }
.footer__legal { display: flex; gap: 18px; }
.footer__legal a { text-decoration: none; color: rgba(255, 255, 255, .55); }
.footer__legal a:hover { color: #fff; }
@media (min-width: 960px) {
  .footer__grid { grid-template-columns: 2fr 1fr 1fr; }
  .footer__qr { display: block; justify-self: end; }
}

/* LIGHTBOX */
.lightbox {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(20, 19, 17, .94); color: #fff;
}
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: transparent; }
.lightbox__img { max-width: min(92vw, 1100px); max-height: 80dvh; width: auto; height: auto; border-radius: 12px; }
.lightbox__cap { position: absolute; left: 0; right: 0; bottom: calc(20px + env(safe-area-inset-bottom)); text-align: center; font-size: 14px; color: rgba(255, 255, 255, .75); padding: 0 80px; }
.lightbox .icon-btn { position: absolute; background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .15); color: #fff; }
.lightbox .icon-btn:hover { background: rgba(255, 255, 255, .2); }
.lightbox__close { top: calc(14px + env(safe-area-inset-top)); right: 14px; }
.lightbox__prev { left: 14px; bottom: calc(10px + env(safe-area-inset-bottom)); }
.lightbox__next { right: 14px; bottom: calc(10px + env(safe-area-inset-bottom)); }
@media (min-width: 960px) {
  .lightbox__prev, .lightbox__next { top: 50%; bottom: auto; transform: translateY(-50%); }
  .lightbox__prev { left: 24px; } .lightbox__next { right: 24px; }
}
