/* The demo page around the phone: logo, how to use it, the three scenarios. Nothing else. */

:root {
  --red: #c21b17;            /* Generali red, as used on generali.sk */
  --ink: #17181a;
  --muted: #5d6166;
  --ground: #f4f4f3;
  --surface: #ffffff;
  --border: #e4e4e2;
  --rule: #ededeb;
  --control: #cfd1d4;
  --active: #e9e9e7;
  --positive: #1f7a4d;
  --pill-positive-bg: #dff5e7;
  --pill-positive-ink: #0b3d24;
  --pill-neutral-bg: #ededeb;
  --pill-warning-bg: #fdf1dc;
  --pill-warning-ink: #7a4a05;
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --device-scale: 1;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; }

.site {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 0 40px;
}

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}
.site-logo { display: block; width: 166px; color: var(--red); }
.site-logo svg { display: block; width: 100%; height: auto; }
.site-tag { font-size: 14px; color: var(--muted); }

/* Three columns on one 12-column idea: text | phone | controls. The phone is the page's one big thing. */
.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 56px;
  padding: 8px 0 24px;
}
.col { max-width: 360px; }
.col-left { justify-self: end; width: 100%; }
.col-right { justify-self: start; width: 100%; }

.col h1 {
  margin: 0 0 12px;
  font-size: 34px;
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 600;
  text-wrap: balance;
}
.lede { margin: 0 0 32px; color: var(--muted); max-width: 32ch; }

.col h2 { margin: 0 0 6px; font-size: 15px; font-weight: 500; color: var(--muted); }

/* the scenarios: a quiet list of full-width buttons, hairlines between them, an arrow that moves on hover;
   the running one turns red */
.scenarios { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--border); }
.scn {
  display: flex;
  align-items: center;
  gap: 24px;
  width: 100%;
  padding: 20px 2px;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  cursor: pointer;
}
.scn:focus-visible, .restart:focus-visible, .mobile-bar button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.scn-text { flex: 1; min-width: 0; }
.scn-title { display: block; font-size: 19px; font-weight: 600; line-height: 1.25; letter-spacing: -0.015em; transition: color .18s ease; }
.scn-sub { display: block; margin-top: 4px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.scn-arrow { flex: none; width: 22px; height: 22px; fill: none; stroke: #9a9da1; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .22s cubic-bezier(.2,.8,.25,1), stroke .18s ease; }
.scn:hover .scn-arrow { transform: translateX(5px); stroke: var(--ink); }
.scn[aria-pressed="true"] .scn-title { color: var(--red); }
.scn[aria-pressed="true"] .scn-arrow { stroke: var(--red); }

.restart {
  margin-top: 22px;
  padding: 0;
  background: none;
  border: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--control);
  cursor: pointer;
}
.restart:hover { color: var(--ink); text-decoration-color: var(--ink); }

.site-foot {
  padding: 16px 0 24px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* The phone. Its screen is always 390 x 844; the whole device is scaled to fit the window. */
.device-slot {
  width: calc(414px * var(--device-scale));
  height: calc(868px * var(--device-scale));
}
.device {
  width: 414px;
  height: 868px;
  padding: 12px;
  border-radius: 60px;
  background: #0d0d0e;
  transform: scale(var(--device-scale));
  transform-origin: top left;
}
.device-screen {
  position: relative;
  width: 390px;
  height: 844px;
  border-radius: 48px;
  overflow: hidden;
  /* the frame's own colour: a light ground here bleeds through the anti-aliased
     rounded edge as a thin white outline on every dark screen */
  background: #0d0d0e;
  isolation: isolate;
}
.device-screen > .app { background: transparent; }

/* Bar shown only on real phones, where the app takes the whole screen. */
.mobile-bar { display: none; }

@media (max-width: 1080px) {
  .site { padding: 0 24px; }
  .stage { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto 1fr; gap: 28px 32px; align-items: start; }
  .col-left { grid-column: 1; grid-row: 1; justify-self: start; padding-top: 16px; }
  .col-right { grid-column: 1; grid-row: 2; justify-self: start; }
  .device-slot { grid-column: 2; grid-row: 1 / span 2; }
  .col h1 { font-size: 28px; }
  .lede { margin-bottom: 0; }
}

/* A real phone: no frame, the prototype is the page. */
@media (max-width: 720px) {
  html, body { overflow: hidden; }
  .site { display: block; padding: 0; height: 100dvh; min-height: 0; }
  .site-head, .col-left, .col-right, .site-foot { display: none; }
  .stage { display: block; padding: 0; height: 100%; }
  .device-slot { width: 100%; height: calc(100% - 44px); }
  .device { width: 100%; height: 100%; padding: 0; border-radius: 0; transform: none; background: none; }
  .device-screen { width: 100%; height: 100%; border-radius: 0; background: var(--ground); }
  /* the three scenarios as a segmented bar above the app */
  .mobile-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    height: 44px;
    padding: 5px 8px;
    background: var(--ink);
  }
  .mobile-bar button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #c9cbce;
    font-size: 13px;
    font-weight: 600;
  }
  .mobile-bar button[aria-pressed="true"] { background: #fff; color: var(--ink); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ?solo=1 shows the phone alone, for recording a video or embedding the demo in a slide. */
html.solo .site-head, html.solo .col, html.solo .site-foot { display: none; }
html.solo .site { display: grid; grid-template-rows: 1fr; place-items: center; padding: 0; height: 100%; }
html.solo .stage { display: block; padding: 0; }
html.solo .device { animation: device-in .5s ease .15s both; }
@keyframes device-in { from { opacity: 0; } to { opacity: 1; } }

/* ?rec=1 marks every tap, so a recording shows where the finger went. */
.tap-mark {
  position: fixed;
  z-index: 100;
  width: 44px; height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .5);
  box-shadow: 0 0 0 2px rgba(23, 24, 26, .45);
  pointer-events: none;
  animation: tap-mark .5s ease-out forwards;
}
@keyframes tap-mark { from { opacity: 1; transform: scale(.55); } to { opacity: 0; transform: scale(1.15); } }
