
:root {
  --red: #d62e26;
  --navy: #0d2a7a;        /* CHIPulse blue */
  --navy-deep: #071a52;
  --blue-hi: #1a47b8;
  --vis: #4f9ae8;
  --olive: #8a9a00;
  --blue: #1b56a6;
  --ink: #16213a;
  --muted: #5d6880;
  --line: #e1e5ec;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: 'Segoe UI Variable Text', 'Segoe UI', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', Arial, sans-serif; color: var(--ink); background: #fff; font-size: 16px; line-height: 1.5; }
[hidden] { display: none !important; }

.gate { height: 100vh; display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(420px, 1fr); }

/* Hero */
.hero { position: relative; color: #fff; background: var(--navy); isolation: isolate; overflow: hidden; display: flex; align-items: center; }
.hero.has-bg { background: var(--navy) var(--login-bg) center / cover no-repeat; }
.hero::after { content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, rgba(7, 26, 82, .94) 0%, rgba(13, 42, 122, .84) 45%, rgba(13, 42, 122, .5) 100%); }
.hero:not(.has-bg)::after { background: linear-gradient(160deg, var(--blue-hi) 0%, var(--navy) 48%, var(--navy-deep) 100%); }

/* Floor-marking tape: the one bold element */
.tape { position: absolute; left: 0; top: 0; bottom: 0; width: 22px;
  background: repeating-linear-gradient(-45deg, var(--vis) 0 18px, var(--navy-deep) 18px 36px); }

.hero-inner { width: 100%; padding: clamp(28px, 5vh, 56px) 56px clamp(28px, 5vh, 56px) 80px;
  display: grid; gap: clamp(20px, 3.5vh, 40px); align-items: center; }
.hero-brand { display: flex; align-items: center; gap: 14px; margin-bottom: clamp(20px, 5vh, 48px); font-weight: 700; font-size: 20px; letter-spacing: .3px; }
.hero-brand img { width: 52px; height: 52px; object-fit: contain; }

h1 { margin: 0 0 16px; font-weight: 700; font-size: clamp(36px, min(4.6vw, 8vh), 72px); line-height: 1.02; letter-spacing: -.5px; max-width: 12ch; text-wrap: balance; }
.lede { margin: 0 0 clamp(18px, 4vh, 36px); font-size: 17px; line-height: 1.55; color: rgba(255, 255, 255, .82); max-width: 46ch; }

.kinds { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(10px, 2vh, 16px); }
.kinds li { display: flex; align-items: center; gap: 14px; }
.kinds .ico { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); color: rgba(255, 255, 255, .9); }
.kinds strong { display: block; font-weight: 700; font-size: 15px; line-height: 1.3; }
.kinds span { display: block; color: rgba(255, 255, 255, .68); font-size: 14px; line-height: 1.4; }

/* The video sits in a framed screen: a dark bezel, layered shadow and a strip of the hazard stripe */
.film { position: relative; margin: 0; width: 100%; max-width: min(560px, calc((100vh - 360px) * 1.78));
  padding: 12px 12px 22px; border-radius: 20px;
  background: linear-gradient(160deg, #232c44 0%, #121a2e 55%, #0b1122 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .14),
    inset 0 0 0 1px rgba(255, 255, 255, .05),
    0 2px 4px rgba(2, 8, 28, .35),
    0 18px 36px rgba(2, 8, 28, .45),
    0 46px 90px rgba(2, 8, 28, .5),
    0 0 80px rgba(70, 120, 255, .18);
  transform: perspective(1400px) rotateY(-9deg) rotateX(3deg);
  transform-origin: left center;
  transition: transform .5s cubic-bezier(.2, .7, .2, 1), box-shadow .5s ease; }
.film::after { content: ''; position: absolute; left: 22px; right: 22px; bottom: 8px; height: 5px; border-radius: 3px;
  background: repeating-linear-gradient(-45deg, #4f9ae8 0 8px, #141a2a 8px 16px); opacity: .9; }
.film video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .6); }
/* Straightens when the person points at it or plays it */
.film:hover, .film:focus-within, .film.playing { transform: perspective(1400px) rotateY(0) rotateX(0);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 0 0 1px rgba(255, 255, 255, .05),
    0 2px 4px rgba(2, 8, 28, .35), 0 22px 44px rgba(2, 8, 28, .45), 0 56px 110px rgba(2, 8, 28, .5), 0 0 90px rgba(70, 120, 255, .22); }
@media (max-width: 1279px) { .film { transform: none; } }
@media (prefers-reduced-motion: reduce) { .film { transform: none; transition: none; } }

/* Wide screens: text and video side by side, so nothing needs scrolling */
@media (min-width: 1280px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 48px; }
  .film { max-width: none; }
}

/* Sign-in panel */
.panel { display: flex; flex-direction: column; background: #f5f6fa; overflow-y: auto; }
.panel-inner { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 56px 48px 32px; }
.panel-inner > * { width: 100%; max-width: 460px; }
.company { height: 40px; object-fit: contain; object-position: left center; margin-bottom: 44px; }
h2 { margin: 0 0 6px; font-size: 28px; font-weight: 700; }
.help { margin: 0 0 28px; color: var(--muted); font-size: 15px; }

.buttons { display: grid; gap: 12px; }
.buttons a { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 18px; border-radius: 6px;
  font-weight: 600; font-size: 15px; text-decoration: none; border: 1px solid var(--line); color: var(--ink); background: #fff;
  transition: border-color .15s, background .15s; }
.buttons a:hover { border-color: #b9c2d0; background: #f7f9fc; }
.buttons a:focus-visible { outline: 3px solid var(--vis); outline-offset: 2px; }
.buttons img { width: 22px; height: 22px; object-fit: contain; flex: none; }
.buttons .btn-ms { background: var(--navy); border-color: var(--navy); color: #fff; }
.buttons .btn-ms:hover { background: var(--blue-hi); border-color: var(--blue-hi); }
.buttons a.off { opacity: .45; pointer-events: none; }

.error { background: #fdecec; color: #a3201a; border-left: 4px solid var(--red); padding: 10px 14px; margin-bottom: 18px; font-size: 14px; }

.foot { display: flex; justify-content: space-between; gap: 12px; padding: 18px max(48px, calc((100% - 460px) / 2)); border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* One load moment: the tape draws down, then the headline settles */
@media (prefers-reduced-motion: no-preference) {
  .tape { animation: tape .7s cubic-bezier(.2, .7, .2, 1) both; transform-origin: top; }
  h1 { animation: settle .6s .25s ease both; }
  @keyframes tape { from { transform: scaleY(0); } }
  @keyframes settle { from { opacity: 0; transform: translateY(10px); } }
}

@media (max-width: 900px) {
  .gate { height: auto; min-height: 100vh; grid-template-columns: 1fr; }
  .panel { overflow: visible; }
  .tape { top: 0; bottom: auto; right: 0; width: auto; height: 10px; background: repeating-linear-gradient(-45deg, var(--vis) 0 12px, var(--navy-deep) 12px 24px); }
  .hero-inner { padding: 40px 24px 32px; }
  .film { max-width: none; }
  .hero-brand { margin-bottom: 28px; }
  .lede { margin-bottom: 24px; font-size: 16px; }
  .film { margin-bottom: 0; }
  .kinds { display: none; }
  .panel-inner { padding: 32px 24px 24px; }
  .company { margin-bottom: 28px; height: 34px; }
  .foot { padding: 16px 24px; }
}

/* Keep the last content clear of the emergency button */
body:has(#emergency) .foot { padding-bottom: 92px; }
@media (min-width: 901px) { body:has(#emergency) .foot { padding-bottom: 18px; } }
