/* =============================================================================
   Keypads & switches — coverflow hero carousel + laser-etched keypad configurator
   ============================================================================= */

/* ---- "stage" band: warm cream by day, the navy showroom by night (follows the site theme) ----------------- */
.kp-stage { color: var(--ink); position: relative; overflow: clip; padding: clamp(64px, 8vw, 112px) 0 clamp(40px, 5vw, 64px);
  background: radial-gradient(1100px 620px at 50% 38%, #fffdf8 0%, #f8eedc 50%, #eedfc4 100%); border-bottom: 1px solid var(--line); }
.kp-stage::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(640px 320px at 50% 46%, rgba(223,182,120,.30), transparent 70%); }
.kp-stage .section-head p { color: var(--ink-2); }
:root[data-theme="dark"] .kp-stage { --ink: #f5e7d2; --ink-2: #cfd8e6; --muted: #9fb0c7; --accent: #dfb678; --line: rgba(245,231,210,.16);
  background: radial-gradient(1100px 620px at 50% 38%, #14305a 0%, #0a1d38 48%, #050f1e 100%); border-bottom: 0; }
:root[data-theme="dark"] .kp-stage::before { background: radial-gradient(600px 300px at 50% 46%, rgba(223,182,120,.14), transparent 70%); }
:root[data-theme="dark"] .kp-stage .gold-text { background: linear-gradient(135deg, #e8c27d 0%, #fbe5b2 48%, #d9a95b 100%); -webkit-background-clip: text; background-clip: text; }

/* ---- coverflow carousel ----------------------------------------------------------------- */
/* Slides are centred by the grid (whole pixels). The centre slide has NO transform at rest, so it is drawn at 1:1
   from a pre-sized image. Motion: side slides sit angled toward the centre in 3D (perspective on .cf) and swing
   round as the carousel turns; the front picture slowly zooms OUT (starts close on the keypad, pulls back to the room). */
.cf { --off: 76%; --sw: 62%; --rot: 26deg; --z: -170px; position: relative; z-index: 1; margin-top: 6px; user-select: none; touch-action: pan-y;
  height: clamp(250px, 36vw, 540px); display: grid; place-items: center; padding-top: 30px;
  perspective: 1800px; perspective-origin: 50% 45%; }
.cf-title { position: absolute; z-index: 5; left: 0; right: 0; top: -6px; text-align: center; font: 600 15px/1.2 var(--font-head); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); pointer-events: none; }
.cf-title span { display: block; transition: opacity .35s; }
.cf-slide { grid-area: 1 / 1; position: relative; width: min(var(--sw), 780px); margin: 0; border-radius: 22px; overflow: hidden;
  transform: none; transition: transform .85s cubic-bezier(.65,.02,.2,1), opacity .7s ease, filter .7s ease; cursor: pointer;
  outline: 1px solid transparent; backface-visibility: hidden;        /* keeps the edges of 3D-turned slides anti-aliased */
  box-shadow: 0 36px 64px -32px rgba(10,34,61,.5), 0 0 0 1px rgba(10,34,61,.1); background: #000; }
:root[data-theme="dark"] .cf-slide { box-shadow: 0 40px 80px -30px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.06); }
.cf-slide img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; pointer-events: none;
  transform: scale(1.16); transform-origin: var(--zo, 20% 50%); transition: transform .85s cubic-bezier(.4,0,.2,1); }
/* two pictures of every shot: the daytime render in the Day theme, the night render in Night (same 16:9 frame, so the swap does not jump) */
.cf-slide .cf-night { display: none; }
:root[data-theme="dark"] .cf-slide .cf-night { display: block; }
:root[data-theme="dark"] .cf-slide .cf-day { display: none; }
.cf-slide[data-pos="0"]  { z-index: 3; opacity: 1; filter: none; cursor: default; }
.cf-slide[data-pos="-1"] { z-index: 2; opacity: .5; filter: saturate(.8) brightness(.9); transform: translateX(calc(var(--off) * -1)) translateZ(var(--z)) rotateY(var(--rot)) scale(.9); }
.cf-slide[data-pos="1"]  { z-index: 2; opacity: .5; filter: saturate(.8) brightness(.9); transform: translateX(var(--off)) translateZ(var(--z)) rotateY(calc(var(--rot) * -1)) scale(.9); }
:root[data-theme="dark"] .cf-slide[data-pos="-1"], :root[data-theme="dark"] .cf-slide[data-pos="1"] { opacity: .55; filter: brightness(.6) saturate(.85); }
/* with more than 3 slides the rest wait, invisible, behind the right-hand one */
.cf-slide[data-pos="2"] { z-index: 1; opacity: 0; pointer-events: none; transform: translateX(var(--off)) translateZ(calc(var(--z) * 1.5)) rotateY(calc(var(--rot) * -1)) scale(.8); }
/* a slide crossing to the far side vanishes, hops behind the others, and fades back in */
.cf-slide.cf-jump { transition: none !important; opacity: 0 !important; }
/* the slow zoom-out of the front slide (starts when the carousel first scrolls into view) */
.cf.cf-live .cf-slide[data-pos="0"] img { transform: scale(1); transition: transform 4.4s cubic-bezier(.16,.5,.28,1) .1s; }
.cf-slide figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 54px 24px 18px; background: linear-gradient(180deg, transparent, rgba(3,9,20,.82)); color: #fff; opacity: 0; transition: opacity .5s .2s; }
.cf-slide[data-pos="0"] figcaption { opacity: 1; }
.cf-slide figcaption b { display: block; font: 600 clamp(15px, 1.6vw, 20px)/1.2 var(--font-head); }
.cf-slide figcaption span { font-size: clamp(12.5px, 1.2vw, 14.5px); opacity: .85; }
.cf-btn { position: absolute; z-index: 6; top: 54%; width: 48px; height: 48px; margin-top: -24px; border-radius: 50%; border: 1px solid rgba(10,34,61,.2); background: rgba(255,252,246,.88); color: var(--ink); box-shadow: 0 6px 18px -8px rgba(10,34,61,.4); cursor: pointer; display: grid; place-items: center; backdrop-filter: blur(8px); transition: background .2s, border-color .2s; }
:root[data-theme="dark"] .cf-btn { border-color: rgba(255,255,255,.28); background: rgba(8,20,40,.55); color: #fff; box-shadow: none; }
.cf-btn:hover { background: rgba(223,182,120,.25); border-color: var(--accent); }
.cf-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cf-btn.prev { left: max(10px, calc(50% - 620px)); } .cf-btn.next { right: max(10px, calc(50% - 620px)); }
.cf-dots { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; position: relative; z-index: 2; }
.cf-dots .cf-play { width: auto; height: 34px; margin-left: 16px; padding: 0 14px 0 11px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px;
  background: rgba(10,34,61,.06); border: 1px solid rgba(10,34,61,.2); color: var(--ink); font: 600 12.5px/1 var(--font-head); letter-spacing: .02em; transition: background .2s, border-color .2s; }
:root[data-theme="dark"] .cf-dots .cf-play { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.22); color: #fff; }
.cf-dots .cf-play:hover { background: rgba(223,182,120,.25); border-color: var(--accent); }
.cf-dots .cf-play svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cf-dots button { appearance: none; width: 34px; height: 5px; border-radius: 4px; border: 0; padding: 0; background: rgba(10,34,61,.2); cursor: pointer; transition: background .3s, width .3s; }
:root[data-theme="dark"] .cf-dots button { background: rgba(255,255,255,.22); }
.cf-dots button[aria-current="true"], :root[data-theme="dark"] .cf-dots button[aria-current="true"] { background: var(--accent); width: 52px; }
@media (max-width: 760px) { .cf { --off: 82%; --sw: 80%; --rot: 20deg; --z: -110px; height: clamp(190px, 52vw, 330px); } .cf-btn { display: none; } }

/* ---- type cards + configurator ----------------------------------------------------------------- */
.kp-types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 38px; }
.kp-type { appearance: none; text-align: left; cursor: pointer; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 20px 18px; display: grid; gap: 12px; font: inherit; transition: border-color .25s, transform .25s, box-shadow .25s; }
.kp-type:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.kp-type[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent), var(--shadow); }
.kp-type h3 { font-size: 18px; }
.kp-type p { color: var(--ink-2); font-size: 14.5px; line-height: 1.45; }
.kp-glyph { display: grid; gap: 4px; width: 46px; height: 64px; padding: 5px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line); }
.kp-glyph i { display: block; border-radius: 3px; background: color-mix(in srgb, var(--ink) 30%, transparent); }
@media (max-width: 760px) { .kp-types { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .kp-type { padding: 16px; } .kp-types { gap: 12px; } }

.kp-config { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 400px) minmax(0, 1fr); gap: clamp(24px, 3.5vw, 56px); align-items: start; }
.kp-config h3 { font-size: 22px; margin-bottom: 6px; }
.kp-config .lead { color: var(--ink-2); font-size: 15px; margin-bottom: 18px; }
.kp-fields { display: grid; gap: 10px; }
.kp-field { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center; }
.kp-field b { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--bg-2); border: 1px solid var(--line); font: 600 13px/1 var(--font-head); color: var(--ink-2); }
.kp-field input { width: 100%; font: 500 15px/1.3 var(--font-body); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; }
.kp-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }

/* the wall + faceplate ------------------------------------------------------------------------------ */
.kp-wall { position: relative; padding: 18px 0 8px; display: grid; place-items: center; }     /* no backdrop: the keypad sits on the page */
.kp-plate { --plate-a: #f8f8f6; --plate-b: #d9d9d4; --key-a: #fcfcfb; --key-b: #e7e7e3; --etch: #26272b; --etch-hi: rgba(255,255,255,.75); --led-off: rgba(20,20,22,.4);
  position: relative; width: 196px; padding: 26px 22px; border-radius: 12px;      /* flat on purpose: a 3D tilt makes the plate's edges and the etched text jagged */
  background: linear-gradient(145deg, var(--plate-a), var(--plate-b)); transition: background .45s;
  box-shadow: 0 1px 0 rgba(255,255,255,.85) inset, 0 -2px 0 rgba(0,0,0,.12) inset, 0 22px 38px -16px rgba(10,34,61,.45), 0 0 0 1px rgba(10,34,61,.22); }
:root[data-theme="dark"] .kp-plate { box-shadow: 0 1px 0 rgba(255,255,255,.85) inset, 0 -2px 0 rgba(0,0,0,.12) inset, 0 24px 44px -14px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.14); }
.kp-bezel { padding: 7px; border-radius: 9px; background: linear-gradient(180deg, rgba(0,0,0,.08), rgba(0,0,0,.02)); box-shadow: inset 0 0 0 1px rgba(0,0,0,.18), inset 0 1px 3px rgba(0,0,0,.25); }
.kp-keys { display: grid; gap: 5px; }
.kp-key { position: relative; appearance: none; border: 0; cursor: pointer; min-height: 64px; padding: 8px 6px; border-radius: 6px; overflow: hidden; display: grid; place-items: center; text-align: center;
  background: linear-gradient(180deg, var(--key-a), var(--key-b));
  box-shadow: 0 1px 0 rgba(255,255,255,.65) inset, 0 -2px 0 rgba(0,0,0,.12) inset, 0 1px 3px rgba(0,0,0,.35); transition: transform .08s, box-shadow .08s; -webkit-tap-highlight-color: transparent; }
.kp-key:active, .kp-key.down { transform: translateY(1.5px); box-shadow: 0 1px 0 rgba(255,255,255,.4) inset, 0 -1px 0 rgba(0,0,0,.18) inset, 0 0 1px rgba(0,0,0,.4); }
.kp-key.big { min-height: 140px; }
.kp-label { position: relative; z-index: 1; font: 500 14.5px/1.18 var(--font-body); color: var(--etch); letter-spacing: .01em; text-wrap: balance; overflow-wrap: anywhere;
  text-shadow: 0 1px 0 var(--etch-hi); -webkit-font-smoothing: antialiased; }
.kp-led { position: absolute; top: 7px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--led-off); transition: background .25s, box-shadow .25s; z-index: 2; }
.kp-key[aria-pressed="true"] .kp-led { background: #4be57f; box-shadow: 0 0 8px 2px rgba(60,225,115,.85); }
.kp-key[aria-pressed="true"] { box-shadow: 0 1px 0 rgba(255,255,255,.65) inset, 0 -2px 0 rgba(0,0,0,.12) inset, 0 1px 3px rgba(0,0,0,.35), 0 0 22px rgba(60,225,115,.2); }
/* laser beam that "etches" a label when it changes */
.kp-key.etching::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 22px; z-index: 3; pointer-events: none; mix-blend-mode: multiply;
  background: linear-gradient(90deg, transparent, rgba(255,70,40,.0) 0, rgba(255,90,50,.95) 70%, rgba(255,150,100,0)); filter: blur(.5px); animation: kp-laser .7s ease-in-out; }
@keyframes kp-laser { from { transform: translateX(-30px); opacity: 1; } to { transform: translateX(260px); opacity: .1; } }
.kp-caption { text-align: center; margin-top: 14px; color: var(--muted); font-size: 13.5px; }
.kp-caption b { color: var(--ink-2); }

.kp-status { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.kp-status h3 { font-size: 18px; margin-bottom: 4px; }
.kp-status .lead { margin-bottom: 14px; font-size: 14px; }
.kp-status #kpStatus { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.kp-status #kpStatus li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 9px 12px; border-radius: 12px; background: var(--bg-2); font-size: 14.5px; color: var(--ink-2); }
.kp-status #kpStatus li .st { font: 600 12.5px/1 var(--font-head); padding: 5px 10px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--muted); }
.kp-status #kpStatus li.on .st { background: color-mix(in srgb, #f5b54a 28%, transparent); color: var(--ink); }
.kp-feats { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; color: var(--ink-2); font-size: 14.5px; }
.kp-feats li { display: flex; gap: 10px; }
.kp-feats li::before { content: ""; flex: none; width: 7px; height: 7px; margin-top: 8px; border-radius: 50%; background: var(--gold-grad); }
@media (max-width: 1060px) { .kp-config { grid-template-columns: minmax(0, 1fr) minmax(260px, 380px); } .kp-status { grid-column: 1 / -1; } }
@media (max-width: 720px) { .kp-config { grid-template-columns: 1fr; } .kp-wall { order: -1; } }

@media (max-width: 760px) {
  .cf-slide figcaption { padding: 26px 14px 10px; }
  .cf-slide figcaption span { display: none; }
  .cf-slide figcaption b { font-size: 14px; }
}
