/* קסטיאל חשמל · "לוח חשמל": מפסקים על פס דין ומדפסת תוויות. design.md הוא המקור. */
:root {
  --bg: #EEF0F6;
  --surface: #FFFFFF;
  --ink: #1A3889;
  --muted: #4B5A86;
  --primary: #23408E;
  --primary-ink: #FFFFFF;
  --soft: #DDE2F0;
  --accent: #C12838;
  --line: #C5CBDD;
  --focus: #C12838;
  --radius: 4px;
  --k-btn-radius: 4px;
  --k-outline-ink: #1A3889;
  --font-head: "Noto Sans Hebrew Variable", system-ui, sans-serif;
  --gutter: 16px;
  --b-w: 50px; --b-h: 110px; --b-lift: -24px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-head); font-size: 18px; line-height: 1.65; overflow-x: clip; }
main { overflow-x: clip; }
img, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p { margin: 0; }
h2 { font-stretch: 75%; font-weight: 700; font-size: 30px; line-height: 1.1; margin-bottom: 24px; }
a { color: var(--primary); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.top :focus-visible, .foot :focus-visible { outline-color: #fff; }
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: #fff; color: var(--ink); padding: 10px 16px; }
.skip-link:focus { top: 12px; }
.demo-banner { min-height: 40px; display: flex; align-items: center; justify-content: center; padding: 8px var(--gutter); background: #10204A; color: #fff; font-size: 14px; line-height: 1.4; text-align: center; }
.wrap { max-width: 1180px; margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Header: the business card ---------- */
.top { position: sticky; top: 0; z-index: 50; background: var(--primary); color: #fff; }
.top__inner { max-width: 1180px; margin-inline: auto; padding: 0 var(--gutter); height: 72px; display: flex; align-items: center; gap: 16px; }
.brand { color: #fff; text-decoration: none; font-stretch: 75%; font-weight: 800; font-size: 26px; line-height: 1; min-height: 44px; display: flex; align-items: center; }
.shin { position: relative; display: inline-block; }
.shin::after { content: ""; position: absolute; left: 50%; top: -.12em; width: .14em; height: .14em; margin-left: -.07em; border-radius: 50%; background: var(--accent); }
.top__phone { display: none; }
.top .top__wa { margin-inline-start: auto; --k-btn-bg: #FFFFFF; --k-btn-ink: #23408E; --k-btn-h: 46px; }

/* ---------- Hero ---------- */
.hero { padding: 32px 0 56px; }
.wordmark { display: block; font-stretch: 75%; font-weight: 800; font-size: 44px; line-height: 1; color: var(--primary); }
.h1-sub { display: block; font-weight: 500; font-size: 19px; line-height: 1.35; margin-top: 10px; }
.hero__lead { margin-top: 14px; color: var(--muted); }
.hero__actions { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.hero__actions .k-btn { width: 100%; }
.rating { margin-top: 14px; font-size: 15px; color: var(--muted); }

/* The DIN rail: modules of equal width, like breakers in a panel */
.din { position: relative; display: flex; gap: 6px; margin-top: 36px; padding-top: 12px; }
.din__rail { position: absolute; inset-inline: -8px; top: calc(12px + var(--b-h) / 2 - 7px); height: 14px; background: repeating-linear-gradient(to bottom, #C5CBDD 0 3px, #B3BAD0 3px 4px); border-radius: 2px; }
.breaker { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: var(--ink); }
.breaker__body {
  position: relative; width: var(--b-w); height: var(--b-h); background: var(--surface); border: 1px solid var(--line); border-radius: 4px;
  box-shadow: 0 2px 0 #C5CBDD; display: flex; flex-direction: column; align-items: center; padding-top: 10px; gap: 10px;
}
.breaker--main .breaker__body { width: calc(var(--b-w) * 2 + 6px); }
.breaker__flag { position: relative; width: 14px; height: 8px; background: #E1E4EC; border-radius: 1px; }
.breaker__flag span { position: absolute; inset: 0; background: var(--accent); border-radius: 1px; }
.breaker__slots { display: flex; gap: 14px; }
.breaker__slot { position: relative; width: 16px; height: 44px; background: #2A3350; border-radius: 2px; }
.breaker__handle { position: absolute; left: -3px; bottom: 2px; width: 22px; height: 18px; background: #fff; border-radius: 3px; box-shadow: 0 2px 3px rgb(0 0 0 / .35); transform: translateY(var(--b-lift)); }
.breaker__slot { overflow: visible; }
.breaker__cap { font-size: 11px; font-weight: 600; font-stretch: 75%; color: var(--muted); }
.breaker__label { display: block; overflow: hidden; }
.breaker__label span { display: block; background: #fff; height: 22px; padding: 0 6px; font-stretch: 75%; font-weight: 600; font-size: 12px; line-height: 22px; white-space: nowrap; box-shadow: 0 1px 2px rgb(26 56 137 / .2); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .breaker:hover .breaker__handle { translate: 0 3px; transition: translate 120ms var(--k-ease); }
}

/* ---------- Modules ---------- */
section:not(.hero) { padding-block: 56px; }
.modules__grid { display: grid; gap: 8px; }
.module { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 16px; display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 96px; }
.module > p:last-child { color: var(--muted); }
.tag { overflow: hidden; align-self: flex-start; }
.tag span { display: block; background: var(--primary); color: #fff; font-stretch: 75%; font-weight: 600; font-size: 14px; line-height: 1; padding: 7px 10px; }
.module__pics { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 96px; gap: 8px; align-items: start; }
.module__pics a, .module__pic { display: block; border-radius: 2px; overflow: hidden; }
.module__thumb img { aspect-ratio: 3 / 4; object-fit: cover; }
.module__pic img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }

/* The wall switch. Without JS: the two photos side by side, with captions. */
.lamp { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; position: relative; }
.lamp__fig { margin: 0; }
.lamp__fig img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 2px; }
.lamp__fig figcaption { font-size: 15px; color: var(--muted); margin-top: 4px; }
.lamp.is-switch { display: block; }
.lamp.is-switch .lamp__fig--on { position: absolute; inset: 0 0 auto 0; opacity: 0; }
.lamp.is-switch.is-on .lamp__fig--on { opacity: 1; }
.lamp.is-switch figcaption { display: none; }
.wallswitch {
  position: absolute; top: 12px; inset-inline-end: 12px; width: 56px; height: 72px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; box-shadow: 0 6px 14px -6px rgb(0 0 0 / .5); display: grid; place-items: center; cursor: pointer; perspective: 200px; z-index: 2;
}
.wallswitch__rocker { width: 26px; height: 40px; border-radius: 4px; background: linear-gradient(#fff, #E5E8F0); border: 1px solid var(--line); transform: rotateX(18deg); }
.wallswitch[aria-pressed="true"] .wallswitch__rocker { transform: rotateX(-18deg); }
.lamp__hint { margin-top: 8px; font-size: 15px; color: var(--muted); }

/* ---------- The card ---------- */
.card-sec__grid { display: grid; gap: 24px; align-items: center; }
.card { max-width: 496px; }
.card img { border-radius: 8px; box-shadow: 0 18px 30px -18px rgb(26 56 137 / .55); }
.card-sec__num a { font-stretch: 75%; font-weight: 800; font-size: 34px; text-decoration: none; display: inline-block; min-height: 44px; }
.k-link { min-height: 44px; display: inline-flex; align-items: center; }

/* ---------- Label tapes ---------- */
.tapes__src { color: var(--muted); margin: -12px 0 24px; font-size: 15px; }
.tapes { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.tapes blockquote { margin: 0; }
.tape { overflow: hidden; clip-path: polygon(2% 0, 100% 0, 98% 100%, 0 100%); background: #fff; box-shadow: 0 1px 2px rgb(26 56 137 / .15); }
.tape span { display: block; padding: 12px 22px; font-stretch: 87.5%; font-weight: 500; font-size: 18px; line-height: 1.45; }
.tape--name { display: inline-block; margin-top: 6px; background: var(--primary); color: #fff; }
.tape--name span { padding: 4px 16px; font-size: 15px; font-weight: 600; font-stretch: 75%; }
.tapes li:nth-child(1) { rotate: -1.5deg; }
.tapes li:nth-child(2) { rotate: 1deg; }
.tapes li:nth-child(3) { rotate: -.5deg; }
.tapes li:nth-child(4) { rotate: 1.5deg; }
.tapes li:nth-child(5) { rotate: -1deg; }
.tapes__more { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; }

.area { padding-block: 8px 24px !important; }
.area p { font-stretch: 75%; font-weight: 700; font-size: 22px; padding: 14px 0; border-block: 1px solid var(--line); }

/* ---------- End ---------- */
.end__grid { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.breaker--big { --b-w: 52px; --b-h: 200px; --b-lift: -40px; }
.breaker--big .breaker__body { width: 120px; }
.breaker--big .breaker__slot { height: 80px; }
.end h2 { margin-bottom: 18px; }
.end__actions { display: flex; flex-direction: column; gap: 12px; }

.foot { background: var(--primary); color: #fff; padding: 28px 0 24px; font-size: 15px; line-height: 1.5; }
.foot__inner { display: grid; gap: 4px; }
.foot a { color: #fff; display: inline-block; min-height: 44px; padding-block: 11px; }
.dock { position: fixed; inset-inline: 0; bottom: 0; z-index: 60; display: flex; gap: 10px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); transition: transform 300ms var(--k-ease), opacity 300ms var(--k-ease); }
.dock > * { flex: 1 1 0; }
.dock.is-hidden { transform: translateY(110%); opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .dock { transition: none; } }
body { padding-bottom: 76px; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  html.intro .hero .breaker__handle { animation: lift 220ms var(--k-spring) both; }
  html.intro .hero .breaker__flag span { animation: on 80ms linear both; }
  html.intro .hero .breaker__body { animation: knock 80ms linear both; }
  html.intro .hero .breaker:nth-of-type(1) :is(.breaker__handle, .breaker__body) { animation-delay: 300ms; }
  html.intro .hero .breaker:nth-of-type(1) .breaker__flag span { animation-delay: 460ms; }
  html.intro .hero .breaker:nth-of-type(2) :is(.breaker__handle, .breaker__body) { animation-delay: 520ms; }
  html.intro .hero .breaker:nth-of-type(2) .breaker__flag span { animation-delay: 680ms; }
  html.intro .hero .breaker:nth-of-type(3) :is(.breaker__handle, .breaker__body) { animation-delay: 640ms; }
  html.intro .hero .breaker:nth-of-type(3) .breaker__flag span { animation-delay: 800ms; }
  html.intro .hero .breaker:nth-of-type(4) :is(.breaker__handle, .breaker__body) { animation-delay: 760ms; }
  html.intro .hero .breaker:nth-of-type(4) .breaker__flag span { animation-delay: 920ms; }
  html.intro .hero .breaker:nth-of-type(5) :is(.breaker__handle, .breaker__body) { animation-delay: 880ms; }
  html.intro .hero .breaker:nth-of-type(5) .breaker__flag span { animation-delay: 1040ms; }
  html.intro .breaker__label span { animation: print 360ms var(--k-ease-out) both; }
  html.intro .breaker:nth-of-type(1) .breaker__label span { animation-delay: 1100ms; }
  html.intro .breaker:nth-of-type(2) .breaker__label span { animation-delay: 1190ms; }
  html.intro .breaker:nth-of-type(3) .breaker__label span { animation-delay: 1280ms; }
  html.intro .breaker:nth-of-type(4) .breaker__label span { animation-delay: 1370ms; }
  html.intro .breaker:nth-of-type(5) .breaker__label span { animation-delay: 1460ms; }
  html.intro .wordmark .shin::after { animation: dot-pop 300ms ease-out 1800ms both; }

  .k-motion .module .tag span { transform: translateX(100%); transition: transform 360ms var(--k-ease-out) 150ms; }
  .k-motion .module.is-in .tag span { transform: none; }
  .k-motion .tapes li .tape:not(.tape--name) span { transform: translateX(100%); transition: transform 500ms var(--k-ease-out) 150ms; }
  .k-motion .tapes li.is-in .tape span { transform: none; }
  .k-motion .end__grid .breaker__handle { transform: none; transition: transform 220ms var(--k-spring) 300ms; }
  .k-motion .end__grid .breaker__flag span { opacity: 0; transition: opacity 80ms linear 460ms; }
  .k-motion .end__grid.is-in .breaker__handle { transform: translateY(var(--b-lift)); }
  .k-motion .end__grid.is-in .breaker__flag span { opacity: 1; }
  .lamp.is-switch .lamp__fig--on { transition: opacity 400ms ease; }
  .wallswitch__rocker { transition: transform 160ms var(--k-ease); }
}
@keyframes lift { from { transform: none; } to { transform: translateY(var(--b-lift)); } }
@keyframes on { from { opacity: 0; } to { opacity: 1; } }
@keyframes knock { 0% { transform: translateY(1px); } 100% { transform: none; } }
@keyframes print { from { transform: translateX(100%); } to { transform: none; } }
@keyframes dot-pop { 0% { transform: scale(0); } 70% { transform: scale(1.25); } 100% { transform: none; } }

/* ---------- Subpages ---------- */
.subpage__main { max-width: 720px; margin-inline: auto; padding: 48px var(--gutter) 64px; }
.subpage__main h1 { font-stretch: 75%; font-weight: 800; font-size: 40px; margin-bottom: 16px; }
.subpage__main h2 { font-size: 24px; margin: 28px 0 10px; }
.subpage__main p, .subpage__main li { margin-bottom: 8px; }
.subpage__eyebrow { color: var(--muted); font-weight: 700; }
.subpage__back { display: inline-block; min-height: 44px; padding-block: 10px; font-weight: 700; }
body.subpage { padding-bottom: 0; }

/* ================= Desktop ================= */
@media (min-width: 1000px) {
  :root { --gutter: 24px; --b-w: 90px; --b-h: 160px; --b-lift: -36px; }
  h2 { font-size: 44px; margin-bottom: 32px; }
  .top__inner { height: 88px; }
  .brand { font-size: 32px; }
  .top__phone { display: inline-flex; align-items: center; min-height: 44px; margin-inline-start: auto; color: #fff; font-weight: 600; text-decoration: none; }
  .top .top__wa { margin-inline-start: 0; }
  .hero { padding: 64px 0 88px; }
  .hero__text { max-width: calc(6 / 12 * 100%); }
  .wordmark { font-size: 80px; }
  .h1-sub { font-size: 24px; }
  .hero__actions { flex-direction: row; }
  .hero__actions .k-btn { width: auto; }
  .din { gap: 8px; margin-top: 56px; }
  .breaker--main .breaker__body { width: calc(var(--b-w) * 2 + 8px); }
  .breaker__slot { height: 64px; }
  .breaker__label span { font-size: 14px; height: 26px; line-height: 26px; padding: 0 10px; }
  section:not(.hero) { padding-block: 88px; }
  .modules__grid { grid-template-columns: 1fr 1fr; }
  .card-sec__grid { grid-template-columns: 496px 1fr; gap: 56px; }
  .tapes { grid-template-columns: 1fr 1fr; gap: 28px 32px; }
  .tape span { font-size: 20px; }
  .end__grid { gap: 48px; }
  .breaker--big { --b-w: 64px; --b-h: 240px; --b-lift: -48px; }
  .breaker--big .breaker__body { width: 150px; }
  .breaker--big .breaker__slot { height: 96px; }
  .end__actions { flex-direction: row; }
  .foot__inner { grid-template-columns: repeat(3, auto); justify-content: space-between; }
  .dock { display: none; }
  body { padding-bottom: 0; }
}
