/* IoT SAFE demo hub: one full-height plate per demo, a live drawing behind each. Dark only. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("assets/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --night: #080c33;                    /* page */
  --blue: #242a75;                     /* Thales blue */
  --ice: #eaf0ff;                      /* text */
  --ice-2: rgba(234, 240, 255, .74);   /* secondary text */
  --ice-3: rgba(234, 240, 255, .5);
  --edge: rgba(190, 205, 255, .16);
  --cyan: #4fd6f2;
  --font: "Bricolage Grotesque", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --pad: clamp(20px, 3.4vw, 60px);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--night);
  color: var(--ice);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ── top bar, over the plates ─────────────────────────────── */
.bar {
  position: absolute; z-index: 3; inset: 0 0 auto 0;
  display: flex; align-items: center; gap: 18px;
  padding: 26px var(--pad) 18px;
  pointer-events: none;
  transition: opacity .4s;
}
.bar-logo { height: 19px; width: auto; display: block; }
.bar-name {
  margin: 0; padding-left: 18px; border-left: 1px solid var(--edge);
  font-size: 15px; font-weight: 500; letter-spacing: .01em; color: var(--ice-2);
}
.bar-tag { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: .01em; color: #f0c267; }   /* the gold of the SIM contacts */
.bar-keys { margin: 0 0 0 auto; font-size: 13px; color: var(--ice-3); display: flex; align-items: center; gap: 6px; }
.bar-keys kbd {
  font: inherit; font-size: 12px; min-width: 24px; padding: 1px 7px; text-align: center;
  border: 1px solid var(--edge); border-radius: 6px; color: var(--ice-2);
}
.bar-keys kbd:nth-of-type(3) { margin-left: 12px; }
@media (hover: none), (max-width: 760px) { .bar-keys { display: none; } }

/* ── plates ──────────────────────────────────────────────── */
.plates { display: flex; height: 100dvh; }

.plate {
  --tone: var(--cyan);
  position: relative; flex: 1 1 0; min-width: 0; overflow: hidden;
  display: flex; align-items: flex-end;
  color: inherit; text-decoration: none;
  background:
    radial-gradient(110% 75% at 35% 22%, color-mix(in srgb, var(--glow, var(--blue)) 70%, transparent) 0%, transparent 62%),
    linear-gradient(180deg, #0b1045 0%, var(--night) 78%);
  transition: flex-grow .8s var(--ease), opacity .5s;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.plate + .plate { border-left: 1px solid var(--edge); }
.plate:nth-child(odd) { --glow: #1f3aa8; }
.plate:nth-child(even) { --glow: #45289c; }
.plate.is-active { flex-grow: 1.36; }

.plate-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; transition: opacity 1.2s; }
.plate::after {   /* keeps the text readable over the drawing */
  content: ""; position: absolute; inset: 42% 0 0 0; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(8, 12, 51, .82) 46%, var(--night));
}

.plate-body {
  position: relative; z-index: 1;
  width: 100%; padding: 0 var(--pad) clamp(26px, 4.6vh, 56px);
  transition: opacity .45s;
}
.plates.has-active .plate:not(.is-active) .plate-body { opacity: .5; }

.plate-title {
  margin: 0 0 clamp(12px, 2vh, 22px);
  font-size: clamp(42px, min(5.4vw, 10.5vh), 104px);
  font-weight: 700; font-stretch: 82%;
  line-height: .9; letter-spacing: -.025em;
  white-space: nowrap;
}
.plate-title .tl { display: block; overflow: hidden; padding-bottom: .08em; }
.plate-title .tl > span { display: block; transition: transform 1.1s var(--ease); }

.plate-line {
  margin: 0; max-width: 31em;
  width: min(100%, 34vw);
  min-width: min(100%, 300px);
  font-size: clamp(15px, 1.05vw + 4px, 18px); color: var(--ice-2); text-wrap: pretty;
}

.plate-facts {
  display: grid; grid-template-columns: max-content 1fr; gap: 3px 18px;
  margin: clamp(14px, 2.4vh, 24px) 0 0; padding-top: clamp(12px, 2vh, 18px);
  border-top: 1px solid var(--edge);
  width: min(100%, 34vw); min-width: min(100%, 300px);
  font-size: 14px; white-space: nowrap;
}
.plate-facts dt { color: var(--ice-3); }
.plate-facts dd { margin: 0; color: var(--ice); overflow: hidden; text-overflow: ellipsis; }

.plate-go { display: flex; align-items: center; gap: 16px; margin-top: clamp(18px, 3vh, 30px); white-space: nowrap; }
.go-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 20px 11px 16px; border-radius: 999px;
  font-size: 15px; font-weight: 600;
  color: var(--ice); border: 1px solid color-mix(in srgb, var(--tone) 55%, transparent);
  transition: background .3s, color .3s, border-color .3s;
}
.go-btn svg { width: 16px; height: 16px; flex: none; transition: transform .5s var(--ease); }
.plate.is-active .go-btn { background: var(--tone); border-color: var(--tone); color: #0a0e3a; }
.plate.is-active .go-btn svg { transform: translate(2px, -2px); }
.go-host { font-size: 13px; color: var(--ice-3); overflow: hidden; text-overflow: ellipsis; }

.plate:focus-visible .go-btn { outline: 2px solid var(--ice); outline-offset: 3px; }

/* ── page load: titles rise, drawings fade in ────────────── */
.is-loading .plate-art { opacity: 0; }
.is-loading .plate-title .tl > span { transform: translateY(105%); }
.is-loading .plate-line, .is-loading .plate-facts, .is-loading .plate-go, .is-loading .bar { opacity: 0; }
.plate-line, .plate-facts, .plate-go { transition: opacity .9s .5s; }
.plate:nth-child(2) .plate-title .tl > span { transition-delay: .12s; }
.plate:nth-child(3) .plate-title .tl > span { transition-delay: .24s; }
.plate-title .tl:nth-child(2) > span { transition-duration: 1.3s; }

/* ── opening a demo: its plate takes the screen ──────────── */
.plates.is-opening .plate { flex-grow: 0; pointer-events: none; }
.plates.is-opening .plate:not(.is-opening) { opacity: 0; border: 0; }
.plates.is-opening .plate.is-opening { flex-grow: 1; }
.plates.is-opening .plate-body { opacity: 0; }
body.is-opening .bar { opacity: 0; }

.plate-opening {
  position: absolute; z-index: 2; left: 0; right: 0; bottom: clamp(40px, 12vh, 120px);
  padding: 0 var(--pad); text-align: center;
  opacity: 0; visibility: hidden; transition: opacity .5s .25s, visibility 0s .75s;
}
.plate.is-opening .plate-opening { opacity: 1; visibility: visible; transition: opacity .5s .25s; }
.plate-opening strong { display: block; font-size: clamp(26px, 3vw, 44px); font-weight: 700; font-stretch: 82%; letter-spacing: -.02em; line-height: 1.1; }
.plate-opening span { display: block; margin-top: 8px; font-size: 14px; color: var(--ice-2); }
.plate-opening i {
  display: block; width: min(320px, 60%); height: 2px; margin: 22px auto 0;
  background: var(--edge); border-radius: 2px; overflow: hidden;
}
.plate-opening i::after {
  content: ""; display: block; height: 100%; background: var(--tone);
  transform: scaleX(0); transform-origin: left;
}
.plate.is-opening .plate-opening i::after { transform: scaleX(1); transition: transform 1.25s .2s cubic-bezier(.4, 0, .2, 1); }

.nojs { position: fixed; inset: 40% 0 auto; display: flex; gap: 24px; justify-content: center; }
.nojs a { color: var(--ice); font-size: 22px; }

/* ── narrow screens: plates stack, the page scrolls ──────── */
@media (max-width: 760px) {
  body { overflow: auto; }
  .bar { position: absolute; padding-top: 20px; gap: 12px; white-space: nowrap; }
  .bar-logo { height: 15px; }
  .bar-name { padding-left: 12px; }
  .bar-name, .bar-tag { font-size: 13px; }
  .plates { flex-direction: column; height: auto; }
  .plate { flex: none; min-height: min(88svh, 720px); }
  .plate.is-active { flex-grow: 0; }
  .plate + .plate { border-left: 0; border-top: 1px solid var(--edge); }
  .plate-title { font-size: clamp(44px, 13vw, 72px); }
  .plate-line, .plate-facts { width: 100%; }
  .plate-facts { white-space: normal; }
  .plate-go { flex-wrap: wrap; gap: 10px 16px; }
  .plates.has-active .plate:not(.is-active) .plate-body { opacity: 1; }
  .plates.is-opening .plate:not(.is-opening) { display: none; }
  .plates.is-opening .plate.is-opening { min-height: 100svh; }
}

@media (prefers-reduced-motion: reduce) {
  .plate, .plate-art, .plate-body, .plate-title .tl > span, .plate-line, .plate-facts, .plate-go, .go-btn, .go-btn svg { transition: none !important; }
}

/* touch screens: nothing to hover, so every button is already filled */
@media (hover: none) {
  .go-btn { background: var(--tone); border-color: var(--tone); color: #0a0e3a; }
}

/* very small phones: the top bar may take two lines */
@media (max-width: 380px) {
  .bar { flex-wrap: wrap; row-gap: 4px; }
}
