/* Brokbase · brokbase.com
   One world: black ground, white type, condensed capitals, a bordered button.
   Chapters are full-height frames; the copy sits in one column, vertically
   centred, left or right; the media fills the frame or stands on black. */

/* D-DIN (Datto, SIL Open Font License 1.1; assets/fonts/OFL-1.1.txt): the
   reference's own face, self-hosted. Latin only: locales outside Latin fall
   back to Barlow (Cyrillic) and IBM Plex Sans Arabic. */
@font-face { font-family: "D-DIN"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/D-DIN.woff2") format("woff2"); }
@font-face { font-family: "D-DIN"; font-style: normal; font-weight: 700; font-display: swap; src: url("assets/fonts/D-DIN-Bold.woff2") format("woff2"); }

:root {
  --ink: rgb(240 240 250);
  --ink-soft: rgb(240 240 250 / 0.72);
  --ink-faint: rgb(240 240 250 / 0.62);
  --line: rgb(240 240 250 / 0.9);
  --hair: rgb(240 240 250 / 0.14);
  --ground: #000;
  --display: "D-DIN", "Barlow Semi Condensed", "Helvetica Neue", Arial, sans-serif;
  --text: "D-DIN", "Barlow", "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(20px, 6.9vw, 100px);
  --nav-h: clamp(72px, 10vh, 100px);
  --col: 40rem;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-h1: clamp(2.75rem, 1.6rem + 3.9vw, 5rem);
  --t-h2: clamp(2rem, 1.35rem + 2.1vw, 3rem);
  --t-body: 1rem;
  --track-display: 0.02em;
  --track-ui: 0.09em;
}
html[lang="ar"] {
  --display: "IBM Plex Sans Arabic", "Barlow", Arial, sans-serif;
  --text: "IBM Plex Sans Arabic", "Barlow", Arial, sans-serif;
  --track-display: 0; --track-ui: 0;
}
html[lang="zh"] {
  --display: "D-DIN", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --text: "D-DIN", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --track-display: 0.01em; --track-ui: 0.06em;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; background: var(--ground); }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: var(--text); font-size: var(--t-body); line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, video, svg { display: block; max-width: 100%; }
picture { display: contents; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
::selection { background: var(--ink); color: #000; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
@supports (scrollbar-color: auto) { html { scrollbar-color: rgb(240 240 250 / 0.28) transparent; scrollbar-width: thin; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--gutter); top: -3rem; z-index: 100; padding: 0.6rem 1rem; background: var(--ink); color: #000; font-weight: 600; text-decoration: none; }
.skip:focus { top: 1rem; }

/* ------------------------------------------------------------- type -- */
.u-display {
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track-display); line-height: 1; margin: 0;
  text-wrap: balance;
}
html[lang="ar"] .u-display, html[lang="zh"] .u-display { text-transform: none; line-height: 1.15; }
.u-ui {
  font-family: var(--text); font-weight: 600; font-size: 0.8125rem;
  letter-spacing: var(--track-ui); text-transform: uppercase; line-height: 1;
}
html[lang="ar"] .u-ui, html[lang="zh"] .u-ui { text-transform: none; font-size: 0.875rem; }

/* -------------------------------------------------------------- nav -- */
.nav {
  position: fixed; inset-inline: 0; top: 0; z-index: 50;
  height: var(--nav-h); padding: 0 clamp(20px, 2.8vw, 40px);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  background: linear-gradient(to bottom, rgb(0 0 0 / 0.55), rgb(0 0 0 / 0));
  pointer-events: none;
  /* the bar fades in place while the reader scrolls down and returns on the
     way up — spacex.com: .header-hide { opacity: 0 } with opacity .3s ease;
     nothing slides over the picture */
  transition: opacity 300ms ease;
}
.nav--hidden { opacity: 0; }
.nav--hidden > * { pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .nav { transition: none; } }
.nav > * { pointer-events: auto; }
.nav__brand { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--ink); }
.nav__brand svg { width: 22px; height: 22px; flex: none; }
.nav__name { font-family: var(--display); font-weight: 700; font-size: 1.125rem; letter-spacing: 0.14em; text-transform: uppercase; line-height: 1; }
.nav__links { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2.25rem); }
.nav__link { color: var(--ink); text-decoration: none; padding: 0.5rem 0; position: relative; }
.nav__link::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0.15rem; height: 1px; background: var(--ink); transform: scaleX(0); transform-origin: 0 50%; transition: transform 240ms var(--ease); }
.nav__link:hover::after { transform: scaleX(1); }
html[dir="rtl"] .nav__link::after { transform-origin: 100% 50%; }
.nav__lang {
  display: inline-flex; align-items: center; gap: 0.6rem;
  background: rgb(0 0 0 / 0.25); border: 1px solid rgb(240 240 250 / 0.55); color: var(--ink);
  padding: 0.6rem 0.8rem; cursor: pointer; transition: border-color 200ms var(--ease);
}
.nav__lang svg { width: 10px; height: 6px; transition: transform 240ms var(--ease); }
.nav__lang:hover { border-color: var(--ink); }
.nav__lang[aria-expanded="true"] svg { transform: rotate(180deg); }

/* the language drawer: a curtain from the end edge, items settling in behind it */
.drawer { position: fixed; inset: 0; z-index: 80; }
.drawer__backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / 0.6); opacity: 0; transition: opacity 320ms var(--ease); }
.drawer__panel:focus { outline: none; }
.drawer__item:focus:not(:focus-visible) { outline: none; }
.drawer__panel {
  position: absolute; top: 0; bottom: 0; right: 0; width: min(22rem, 100%);
  background: var(--ground); border-left: 1px solid var(--hair);
  padding: 1.5rem clamp(20px, 2.8vw, 40px) 2rem; overflow: auto;
  display: flex; flex-direction: column; gap: 1.25rem;
  transform: translateX(100%); transition: transform 380ms cubic-bezier(0.32, 0.72, 0, 1);
}
html[dir="rtl"] .drawer__panel { right: auto; left: 0; border-left: 0; border-right: 1px solid var(--hair); transform: translateX(-100%); }
.drawer.is-open .drawer__backdrop { opacity: 1; }
.drawer.is-open .drawer__panel { transform: none; }
.drawer__head { display: flex; justify-content: space-between; align-items: center; min-height: calc(var(--nav-h) - 3rem); color: var(--ink-soft); }
.drawer__close { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; background: none; border: 1px solid rgb(240 240 250 / 0.35); color: var(--ink); cursor: pointer; transition: background-color 200ms var(--ease), color 200ms var(--ease); }
.drawer__close svg { width: 14px; height: 14px; }
.drawer__close:hover { background: var(--ink); color: #000; }
.drawer__list { list-style: none; margin: 0; padding: 0; display: grid; }
.drawer__item {
  display: flex; align-items: baseline; gap: 1rem; padding: 1rem 0;
  border-top: 1px solid var(--hair); color: var(--ink); text-decoration: none; font-size: 1.25rem;
  opacity: 0; transform: translateX(18px);
  transition: opacity 420ms var(--ease), transform 420ms var(--ease);
}
html[dir="rtl"] .drawer__item { transform: translateX(-18px); }
.drawer__list li:last-child .drawer__item { border-bottom: 1px solid var(--hair); }
.drawer.is-open .drawer__item { opacity: 0.78; transform: none; }
.drawer.is-open .drawer__item:hover, .drawer.is-open .drawer__item[aria-current] { opacity: 1; }
.drawer__item[aria-current]::after { content: ""; margin-inline-start: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); align-self: center; }
.drawer__code { width: 3rem; flex: none; color: var(--ink-soft); }
.drawer__list li:nth-child(2) .drawer__item { transition-delay: 40ms; }
.drawer__list li:nth-child(3) .drawer__item { transition-delay: 80ms; }
.drawer__list li:nth-child(4) .drawer__item { transition-delay: 120ms; }
.drawer__list li:nth-child(5) .drawer__item { transition-delay: 160ms; }
.drawer__list li:nth-child(6) .drawer__item { transition-delay: 200ms; }
.drawer__list li:nth-child(7) .drawer__item { transition-delay: 240ms; }
.drawer__list li:nth-child(8) .drawer__item { transition-delay: 280ms; }
html.drawer-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  .drawer__backdrop, .drawer__panel, .drawer__item, .nav__lang svg { transition: none; }
}

/* ---------------------------------------------------------- buttons -- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.75rem;
  min-height: 3.125rem; padding: 0 1.25rem;
  border: 1px solid var(--line); color: var(--ink); background: rgb(0 0 0 / 0.25);
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 200ms var(--ease), color 200ms var(--ease), border-color 200ms var(--ease);
}
.btn svg { width: 14px; height: 14px; flex: none; }
html[dir="rtl"] .btn svg { transform: scaleX(-1); }
.btn:hover { background: var(--ink); color: #000; border-color: var(--ink); }
.btn:active { background: rgb(240 240 250 / 0.86); }
.btn[disabled] { opacity: 0.5; cursor: progress; }
.btn--solid { background: var(--ink); color: #000; }
.btn--solid:hover { background: rgb(240 240 250 / 0.86); }

/* --------------------------------------------------------- chapters -- */
.chapter { position: relative; min-height: 100vh; min-height: 100svh; overflow: clip; background: var(--ground); isolation: isolate; }
.chapter__media { position: absolute; inset: 0; z-index: 0; }
.chapter__img, .chapter__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.chapter__video { opacity: 0; transition: opacity 900ms var(--ease); }
.chapter__video.is-playing { opacity: 1; }
/* Only where the copy sits. A whole-frame darkening flattens the picture. */
.chapter__scrim { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.chapter--left .chapter__scrim { background: linear-gradient(to right, rgb(0 0 0 / 0.78) 0%, rgb(0 0 0 / 0.5) 34%, rgb(0 0 0 / 0) 62%); }
.chapter--right .chapter__scrim { background: linear-gradient(to left, rgb(0 0 0 / 0.78) 0%, rgb(0 0 0 / 0.5) 34%, rgb(0 0 0 / 0) 62%); }
#extract .chapter__img { object-position: 100% 50%; }
#extract .chapter__scrim { background: linear-gradient(to right, rgb(0 0 0 / 0.92) 0%, rgb(0 0 0 / 0.7) 36%, rgb(0 0 0 / 0) 60%); }

.chapter__copy {
  position: absolute; z-index: 2; top: 50%; translate: 0 -50%;
  width: min(var(--col), calc(100% - 2 * var(--gutter)));
  padding-top: var(--nav-h);
}
.chapter--left .chapter__copy { left: var(--gutter); }
.chapter--right .chapter__copy { right: var(--gutter); }
/* RTL keeps the LTR columns: the picture decides where the copy can sit; the
   text itself aligns right inside its column. */
.chapter__title { font-size: var(--t-h2); line-height: 1.1; }
.chapter__title--hero { font-size: var(--t-h1); line-height: 0.96; }
.chapter__text { margin: 1.5rem 0 0; max-width: var(--col); color: var(--ink); text-wrap: pretty; }
.chapter__text + .chapter__text { margin-top: 1rem; }
.chapter__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.5rem; }

/* product frames: the cabinet standing on black, cropped by the frame edge */
.chapter--product .chapter__media { background: var(--ground); }
.chapter__shot {
  position: absolute; top: 50%; translate: 0 -50%;
  width: min(62vw, 1120px); height: auto;
  border: 1px solid var(--hair); background: #0b0b0d;
  box-shadow: 0 30px 80px -30px rgb(0 0 0 / 0.9);
}
.chapter--left .chapter__shot { left: 46%; }
/* A frame on the left is anchored so the cabinet sidebar (20.7% of the shot)
   is wholly out of the frame and the "Sample data" ribbon is wholly in;
   narrower, so the copy column stays clear. */
.chapter--right .chapter__shot { width: min(58vw, 1040px); left: calc(-0.207 * min(58vw, 1040px)); }
/* On the product chapters the copy column may not run under the cabinet
   frame: a frame on the right starts at 46vw, a frame on the left ends at
   0.793 × its width (≈ 46vw). The column gives way before the frame does. */
@media (min-width: 861px) {
  .chapter--product.chapter--left .chapter__copy { width: min(var(--col), calc(46vw - var(--gutter) - 2.5rem)); }
  .chapter--product.chapter--right .chapter__copy { width: min(var(--col), calc(100vw - 0.793 * min(58vw, 1040px) - var(--gutter) - 2.5rem)); }
}

/* reveal: one entrance, from a state the reader already sees */
.reveal > * { opacity: 0; translate: 0 22px; transition: opacity 760ms var(--ease), translate 760ms var(--ease); }
.reveal > :nth-child(2) { transition-delay: 110ms; }
.reveal > :nth-child(3) { transition-delay: 210ms; }
.reveal.is-in > * { opacity: 1; translate: 0 0; }
@media (prefers-reduced-motion: reduce) {
  .reveal > * { translate: 0 0; transition: opacity 300ms linear; }
  .chapter__video { display: none; }
}

/* -------------------------------------------------------------- foot -- */
.foot {
  padding: 3rem var(--gutter) 3.5rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem 2rem;
  border-top: 1px solid var(--hair); color: var(--ink-soft);
}
.foot__links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 1.25rem 2rem; }
.foot__links a { color: var(--ink-soft); text-decoration: none; }
.foot__links a:hover, .foot__links a[aria-current="true"] { color: var(--ink); }
.foot__copy { margin: 0; }

/* ------------------------------------------------------------ mobile -- */
@media (max-width: 860px) {
  .nav { height: 64px; }
  .nav__name { display: none; }
  .nav__links { gap: 1rem; }
  .nav__link--cta { display: none; }
  .chapter { display: grid; grid-template-rows: 54svh auto; min-height: 100svh; }
  .chapter__media { position: relative; grid-row: 1; inset: auto; height: 54svh; }
  .chapter__scrim { display: none; }
  .chapter__media::after { content: ""; position: absolute; inset: auto 0 0 0; height: 40%; background: linear-gradient(to bottom, rgb(0 0 0 / 0), rgb(0 0 0 / 0.9)); }
  .chapter__copy { position: relative; grid-row: 2; top: auto; translate: none; width: auto; padding: 0.5rem var(--gutter) 3.5rem; margin-top: -3rem; }
  .chapter--left .chapter__copy, .chapter--right .chapter__copy { left: auto; right: auto; }
  .chapter--hero .chapter__media { height: 62svh; }
  .chapter--hero { grid-template-rows: 62svh auto; }
  .chapter__shot, .chapter--left .chapter__shot, .chapter--right .chapter__shot { position: absolute; top: 10%; translate: none; width: 170%; max-width: none; left: 5%; right: auto; }
  /* the assistant frame: sidebar out, conversation in */
  .chapter--right .chapter__shot { left: -35%; }
  .chapter__actions .btn { flex: 1 1 auto; }
  #extract .chapter__img { object-position: 70% 50%; }
  .foot { flex-direction: column; align-items: flex-start; }
}
