/* Jpfin's download page. Tokens: jp_jpfin_ui/src/theme/palette.rs (dark and light ramps).
   Fonts: IBM Plex Sans and Mono from IBM Plex, subset for the page:
   pyftsubset <ttf> --unicodes="U+0020-007E,U+00A0-00FF,U+2013-2014,U+2018-201D,U+2026,U+2192,U+2265" --flavor=woff2
   (Mono only carries the install command: --unicodes="U+0020-007E" --layout-features=''). */
@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/IBMPlexSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/IBMPlexSans-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/IBMPlexSans-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #121519;
  --chrome: #181c21;
  --element: #1e2228;
  --element-hover: #25292f;
  --border: #31363c;
  --border-strong: #3f444b;
  --text: #ebedf0;
  --text-2: #b8bcc2;
  --text-3: #8f949b;
  --solid: #2371d1;
  --solid-hover: #337fe0;
  --solid-active: #1664bf;
  --accent-text: #93c1fe;
  --ok: #6fd189;
  --focus: #498de5;
  --glass: rgb(24 28 33 / 0.66);
  --shadow: 0 2px 6px rgb(0 0 0 / 0.35), 0 30px 80px rgb(0 0 0 / 0.55);
  --dim-back: brightness(0.6) saturate(0.85);
  --dim-far: brightness(0.42) saturate(0.7);
  /* the silk background (site.js reads these): gray and accent ramps */
  --silk-bg0: #0d1015;
  --silk-bg1: #151a23;
  --silk-fold: #1a212b;
  --silk-glow: #1e3d66;
  --silk-sheen: #4d8fe8;
  --font: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 4px;
  --radius-lg: 6px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --spring: linear(0, 0.21 6%, 0.62 15%, 0.91 25%, 1.03 34%, 1.05 42%, 1.02 56%, 0.995 72%, 1);
  --w: min(1060px, 57vw);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #fcfdff;
    --chrome: #f1f3f5;
    --element: #eceef1;
    --element-hover: #e5e8ec;
    --border: #d8dbdf;
    --border-strong: #c7cbd0;
    --text: #1a1e24;
    --text-2: #51565c;
    --text-3: #62676d;
    --solid: #126cd1;
    --solid-hover: #0160c1;
    --solid-active: #0055ae;
    --accent-text: #145cb0;
    --ok: #137738;
    --focus: #126cd1;
    --glass: rgb(252 253 255 / 0.7);
    --shadow: 0 2px 6px rgb(16 24 40 / 0.08), 0 30px 80px rgb(16 24 40 / 0.18);
    --dim-back: brightness(0.92) saturate(0.85);
    --dim-far: brightness(0.84) saturate(0.7);
    --silk-bg0: #f2f6fb;
    --silk-bg1: #fcfdff;
    --silk-fold: #e4ecf6;
    --silk-glow: #c7e0ff;
    --silk-sheen: #5b9aed;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

/* Without WebGL2 (or before the first frame) this gradient is the background. */
body {
  min-height: 100dvh;
  background:
    radial-gradient(90% 70% at 85% 10%, var(--silk-glow), transparent 60%),
    linear-gradient(to top, var(--silk-bg0), var(--silk-bg1));
  background-attachment: fixed;
  color: var(--text);
  font: 400 14px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
}
.backdrop.live {
  opacity: 1;
}

a {
  color: var(--accent-text);
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
button {
  font: inherit;
  cursor: pointer;
}

.page {
  max-width: 1480px;
  margin: 0 auto;
  padding: 64px 48px 40px;
}

/* hero */
.head {
  display: flex;
  align-items: center;
  gap: 22px;
}
.logo {
  width: 88px;
  height: 88px;
  filter: drop-shadow(0 10px 24px rgb(0 0 0 / 0.35));
}
h1 {
  margin: 0;
  font: 600 48px/52px var(--font);
}
.what {
  margin: 6px 0 0;
  font-size: 18px;
  line-height: 24px;
  color: var(--text-2);
}

.get {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 32px;
}
.download {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 20px;
  border-radius: var(--radius-lg);
  background: var(--solid);
  color: #fff;
  font: 500 15px/1 var(--font);
  text-decoration: none;
  box-shadow:
    0 1px 0 rgb(255 255 255 / 0.12) inset,
    0 8px 24px rgb(35 113 209 / 0.35);
  transition:
    background 150ms var(--ease-out),
    transform 100ms var(--ease-out);
}
.download:hover {
  background: var(--solid-hover);
}
.download:active {
  background: var(--solid-active);
  transform: scale(0.98);
}
.download[aria-disabled="true"] {
  background: var(--element);
  color: var(--text-3);
  box-shadow: none;
  cursor: default;
  transform: none;
}
.version {
  font-weight: 400;
  opacity: 0.78;
}
.command {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 46px;
  padding: 0 7px 0 16px;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.command code {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font: 400 13.5px/20px var(--mono);
  color: var(--text);
}
.copy {
  flex: none;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--element);
  color: var(--text-2);
  font: 500 13px/1 var(--font);
}
.copy:hover {
  background: var(--element-hover);
  color: var(--text);
}

.summary {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: var(--text-3);
}
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 28px;
  margin: 10px 0 0;
  font-size: 12.5px;
}
.facts > div {
  display: flex;
  gap: 8px;
}
.facts > div[hidden] {
  display: none;
}
.facts dt {
  color: var(--text-3);
}
.facts dd {
  margin: 0;
  color: var(--text-2);
}
.dim {
  color: var(--text-3);
}
.sha {
  display: inline-flex;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-2);
  font-size: 12.5px;
  text-align: left;
}
.sha-full {
  display: none;
}
.sha:hover .sha-short,
.sha:focus-visible .sha-short {
  display: none;
}
.sha:hover .sha-full,
.sha:focus-visible .sha-full {
  display: inline;
  color: var(--text);
}
.sha-state {
  color: var(--accent-text);
}

/* the window stack: one in front, two behind, two further back */
.shots {
  margin-top: 40px;
}
.stack {
  position: relative;
  height: calc(var(--w) * 0.625 + 36px);
  perspective: 2600px;
  perspective-origin: 50% 25%;
}
.window {
  position: absolute;
  top: 28px;
  left: 50%;
  width: var(--w);
  margin-left: calc(var(--w) / -2);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--chrome);
  box-shadow: var(--shadow);
  transition:
    transform 700ms var(--spring),
    filter 400ms var(--ease-out);
}
.window img {
  display: block;
  width: 100%;
  height: auto;
}
.window[data-slot="0"] {
  z-index: 5;
  cursor: default;
}
.window[data-slot="1"] {
  z-index: 4;
  transform: translate3d(-27%, -14px, -300px) rotateY(13deg);
  filter: var(--dim-back);
}
.window[data-slot="2"] {
  z-index: 4;
  transform: translate3d(27%, -14px, -300px) rotateY(-13deg);
  filter: var(--dim-back);
}
.window[data-slot="3"] {
  z-index: 3;
  transform: translate3d(-47%, -26px, -640px) rotateY(19deg);
  filter: var(--dim-far);
}
.window[data-slot="4"] {
  z-index: 3;
  transform: translate3d(47%, -26px, -640px) rotateY(-19deg);
  filter: var(--dim-far);
}
.window[data-slot="1"]:hover {
  transform: translate3d(-29%, -24px, -250px) rotateY(12deg);
  filter: none;
}
.window[data-slot="2"]:hover {
  transform: translate3d(29%, -24px, -250px) rotateY(-12deg);
  filter: none;
}
.window[data-slot="3"]:hover {
  transform: translate3d(-50%, -36px, -580px) rotateY(18deg);
  filter: var(--dim-back);
}
.window[data-slot="4"]:hover {
  transform: translate3d(50%, -36px, -580px) rotateY(-18deg);
  filter: var(--dim-back);
}
.tag {
  position: absolute;
  top: 44px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--glass);
  color: var(--text);
  font: 500 13px/18px var(--font);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms var(--ease-out);
}
.window[data-slot="1"] .tag,
.window[data-slot="3"] .tag {
  left: 16px;
  opacity: 1;
}
.window[data-slot="2"] .tag,
.window[data-slot="4"] .tag {
  right: 16px;
  opacity: 1;
}

.labels {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin-top: 30px;
}
.label {
  position: relative;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--text-3);
  font: 500 15px/20px var(--font);
}
.label:hover {
  color: var(--text-2);
}
.label[aria-current] {
  color: var(--text);
}
.label::after,
.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
}
.label[aria-current]::after {
  content: "";
  background: var(--border-strong);
}
.progress {
  z-index: 1;
  background: var(--accent-text);
  transform: scaleX(0);
  transform-origin: left;
}

.foot {
  margin-top: 64px;
  font-size: 12px;
  color: var(--text-3);
}
.foot a {
  color: inherit;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}

@media (prefers-color-scheme: light) {
  .logo {
    filter: drop-shadow(0 10px 24px rgb(16 24 40 / 0.18));
  }
}

/* phones: the stack becomes a strip that swipes */
@media (max-width: 760px) {
  .page {
    padding: 40px 16px 32px;
  }
  .head {
    gap: 16px;
  }
  .logo {
    width: 64px;
    height: 64px;
  }
  h1 {
    font-size: 36px;
    line-height: 40px;
  }
  .what {
    font-size: 16px;
  }
  .get {
    flex-direction: column;
    align-items: stretch;
    margin-top: 24px;
  }
  .download {
    justify-content: center;
  }
  .facts {
    flex-direction: column;
  }
  .sha-full {
    overflow-wrap: anywhere;
  }
  .stack {
    height: auto;
    perspective: none;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin: 0 -16px;
    padding: 4px 16px 20px;
    scrollbar-width: none;
  }
  .window,
  .window[data-slot] {
    position: relative;
    top: 0;
    left: 0;
    margin: 0;
    flex: none;
    width: 86vw;
    transform: none;
    filter: none;
    scroll-snap-align: center;
    border-radius: 8px;
  }
  .window[data-slot]:hover {
    transform: none;
    filter: none;
  }
  .tag {
    display: none;
  }
  .labels {
    margin-top: 8px;
    gap: 8px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .window,
  .download {
    transition: none;
  }
}
