@font-face {
  font-family: Roobert;
  src: url('./fonts/Roobert-Regular-latin.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Roobert;
  src: url('./fonts/Roobert-Medium-latin.woff2') format('woff2');
  font-weight: 500 700;
  font-display: swap;
}

:root {
  --studio-control-ink: #101012;
  --romanjo-paper: var(--ps-color-foreground);
  --romanjo-muted: var(--ps-color-fg-70);
  --romanjo-line: var(--ps-color-hairline);
  --romanjo-accent: var(--ps-color-grey-light);
}

body {
  font-family: Roobert, system-ui, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

:root[data-theme='light'] {
  color-scheme: light;
  --ps-color-background: #f5f5f3;
  --ps-color-surface: #fff;
  --ps-color-foreground: #161619;
  --ps-color-fg-70: #4e4e53;
  --ps-color-fg-18: #19191b30;
  --ps-color-fg-12: #19191b22;
  --ps-color-grey-light: #232326;
  --studio-surface-raised: #eaeae8;
  --studio-control-ink: #fff;
}

[data-theme='light'] :is(.romanjo-hero, .studio-header) {
  color-scheme: dark;
  --ps-color-background: #101012;
  --ps-color-foreground: #fff;
  --romanjo-paper: #fff;
  --romanjo-muted: #ffffffb3;
  --romanjo-accent: #f5f5f5;
  color: #fff;
}

[data-theme='light'] .romanjo-hero :is(.romanjo-hero-title, .hero-fallback__headline, .romanjo-hero-copy .text-link) {
  text-shadow: 0 1px 16px #101012b8, 0 1px 3px #101012b8;
}

[data-theme='light'] .romanjo-hero .hero__wrapper[data-v-6a4e24e7] {
  background-color: #101012;
  isolation: isolate;
}

.romanjo-caption .caption-still {
  padding: .25rem .5rem;
  border-radius: var(--ps-radius-sm);
  background: #101012d9;
  color: #f5f5f5;
}

[data-theme='light'] :is(.homepage__content, .romanjo-footer) {
  background: var(--ps-color-background);
}

@media (min-width: 769px) {
  .studio-header:not(:has(.romanjo-menu[open])) .studio-header-logo.is-over-content:not(:focus-visible) {
    visibility: hidden;
  }
}

.studio-lights {
  position: fixed;
  z-index: 103;
  inset-block-start: 48px;
  inset-inline-end: calc(var(--navigation-inset) + 58px);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  isolation: isolate;
  color: #101012;
}

.studio-lights::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  background: #fff;
  transition: scale var(--ps-transition-base), background-color var(--ps-transition-base);
}

.studio-lights-icon {
  position: relative;
  width: 13px;
  height: 13px;
  margin-block-end: 3px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.studio-lights-icon::after {
  content: '';
  position: absolute;
  inset: 100% 2px auto;
  height: 5px;
  border-block-end: 2px solid currentColor;
}

#main .studio-motion-toggle {
  background: #fff;
  color: #101012;
  border-color: transparent;
}

@media (min-width: 769px) {
  .romanjo-hero .studio-motion-toggle {
    inset-block-start: 48px;
    inset-inline-end: calc(max(48px, 50vw - 912px) + 116px);
    width: 48px;
    height: 48px;
  }
}

.studio-lights[aria-pressed='true'] .studio-lights-icon { background: currentColor }
.studio-lights:is(:hover, :focus-visible)::before { scale: .85 }
.studio-header:has(.romanjo-menu[open]:not(.is-closing)) .studio-lights { color: #fff }
.studio-header:has(.romanjo-menu[open]:not(.is-closing)) .studio-lights::before { background: #101012 }

.studio-lights-hint {
  position: absolute;
  inset-block-start: calc(100% + 6px);
  inset-inline-end: 0;
  padding: 4px 10px;
  border-radius: var(--ps-radius-pill);
  background: #101012;
  color: #fff;
  white-space: nowrap;
  font-size: .78rem;
  visibility: hidden;
}

.studio-lights:is(:hover, :focus-visible) .studio-lights-hint { visibility: visible }

.studio-lights[aria-pressed='true'] [data-lights-on],
.studio-lights[aria-pressed='false'] [data-lights-off] {
  display: none;
}

[data-theme='light'] :focus-visible {
  outline-color: #135cbb;
}

/* Fit the original components to the case gallery and service content. */
#work .mist-card {
  --mc-radius: var(--ps-radius-md);
  height: auto;
}

#work .mist-card__body {
  height: auto;
}

#work .work-demo-slide figcaption {
  padding: var(--ps-space-2) var(--ps-space-3);
  background: var(--ps-color-surface);
}

#services .buyer-services {
  row-gap: var(--ps-space-3);
}

#services .buyer-offer {
  grid-column: auto;
  height: auto;
  gap: var(--ps-space-2);
  padding: var(--ps-space-3);
  border-color: transparent;
}

[data-theme='light'] #services .buyer-offer.promo {
  color: var(--ps-color-foreground);
  background: var(--ps-color-surface);
}

@media (hover: hover) {
  [data-theme='light'] #services .buyer-offer.promo:hover {
    background: var(--studio-surface-raised);
  }
}

[data-theme='light'] #services .promo__lede {
  color: var(--romanjo-muted);
}

#services .buyer-visual {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: var(--ps-radius-sm);
  background: var(--ps-color-background);
}

#services .buyer-preview-action {
  border-radius: var(--ps-radius-pill);
}

#main :is(.buyer-inquiry, button[data-work-launch], .button.primary) {
  color: var(--studio-control-ink);
  border-radius: var(--ps-radius-button);
  padding-inline: var(--ps-space-4);
}

#main button[data-work-launch][aria-expanded='true'] {
  color: var(--romanjo-accent);
}

[data-theme='light'] #work [data-work-frame][aria-current='true'] { color: #fff }
[data-theme='light'] :is(.homepage__content, .romanjo-footer) .text-link { text-decoration-color: #16161970 }
[data-theme='light'] :is(.homepage__content, .romanjo-footer) .text-link:hover { text-decoration-color: currentColor }
[data-theme='light'] #work .filter-buttons button:is(:hover, [aria-pressed='true']) { color: var(--romanjo-paper) }
[data-theme='light'] :is(#terms, #simulation, .extraction-results li, #work .work-ingest, #work .work-inspection-readings input, .studio-rfq),
[data-theme='light'] .sim-target input,
[data-theme='light'] .service-extraction-form textarea,
[data-theme='light'] .studio-rfq input,
[data-theme='light'] .studio-rfq textarea {
  background-color: var(--ps-color-surface);
  color: var(--romanjo-paper);
}

#data-factory {
  scroll-margin-block-start: 5.5rem;
  border-block: 1px solid var(--romanjo-line);
}

.studio-position {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: start;
  gap: clamp(2rem, 5vw, 6rem);
}

#studio .studio-position-copy h2 {
  font-size: clamp(2.15rem, 3.6vw, 3.85rem);
  text-wrap: balance;
}

.studio-position-copy h2 span { display: block }

.studio-position-copy p {
  max-width: 50ch;
  margin-block: 1rem;
  color: var(--romanjo-muted);
  font-size: 1rem;
}

.studio-position-copy a + a { margin-inline-start: var(--ps-space-4) }

#studio .studio-twin {
  grid-column: auto;
  min-width: 0;
  gap: 0;
  overflow: hidden;
  height: auto;
}

[data-theme='light'] #studio .studio-twin {
  background: var(--ps-color-surface);
  color: var(--romanjo-paper);
  box-shadow: 0 0 0 1px var(--romanjo-line);
}

.studio-twin > img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover }
.studio-twin-body { min-width: 0; padding: clamp(1rem, 2.2vw, 2.2rem) }
.studio-twin-body > p { color: var(--romanjo-muted); margin-block: .4rem .75rem }
.studio-twin-control { display: grid; gap: .25rem; margin-block: .8rem }
.studio-twin-control input { width: 100%; min-height: 36px; accent-color: var(--romanjo-accent) }
.studio-twin-readings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: .7rem 0 }
.studio-twin-readings > div { min-width: 0; border-block-start: 1px solid var(--romanjo-line); padding-block-start: .5rem }
.studio-twin-readings dt { color: var(--romanjo-muted); font-size: .78rem; line-height: 1.4 }
.studio-twin-readings dd { margin: .25rem 0 0; font-size: clamp(.8rem, 1.4vw, 1.13rem); font-variant-numeric: tabular-nums }
.studio-twin-note { font-size: .78rem }
.studio-twin-links { display: flex; flex-wrap: wrap; gap: 0 .9rem }

@media (max-width: 768px) {
  .studio-lights {
    inset-block-start: auto;
    inset-block-end: 18px;
    inset-inline-end: 7.2rem;
    height: 44px;
    width: 44px;
  }

  .studio-lights::before { background: #e1e1e2; inset: 4px }
  .studio-lights-hint { inset-block: auto calc(100% + 6px) }
  #data-factory { scroll-margin-block-start: 1rem }
  .studio-position { grid-template-columns: minmax(0, 1fr) }
  html { scroll-padding-block-end: 5rem }
}
