@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../assets/fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

@font-face {
  font-family: "Figtree";
  src: url("../assets/fonts/figtree-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

.dsi-visual-switch {
  color: var(--ink-muted);
  font: 500 13px/1.25 system-ui, sans-serif;
  text-underline-offset: 3px;
}

:root[data-visual="studio"]:not([data-mode="menu"]) {
  --bg-canvas: #e9ebe5;
  --surface-tray: #f5f5ef;
  --surface-dock: #e1e4dc;
  --surface-tile: #eaede5;
  --surface-tile-inner: #f1f3ec;
  --surface-pill: #f5f5ef;
  --surface-pill-hover: #e0e4da;
  --border-panel: #c6cbc1;
  --border-tile: #cbd1c5;
  --border-tile-hover: #9ca697;
  --border-tile-inner: #d6dcd1;
  --hairline: #d4d9ce;
  --hairline-strong: #a8b2a2;
  --ink-primary: #212823;
  --ink-muted: #525e53;
  --studio-led: #b83e25;
  --studio-button: #a53621;
  --studio-button-hover: #872916;
  --studio-control: 8px;
  --studio-radius: 16px;
  --tile-ledge: #c7cdc1;
  --tray-shadow: 0 8px 24px rgb(31 44 33 / 6%);
  --signal-orange: #b83e25;
  --signal-orange-text: #9b2e1d;
  --wii-sky: var(--studio-led);
  --wii-sky-text: var(--signal-orange-text);
  --font-sans: "Figtree", "Trebuchet MS", sans-serif;
  --font-display: "Bricolage Grotesque", "Bahnschrift", sans-serif;
  --font-mono: var(--font-sans);


  body {
    background-image: none;
  }

  :focus-visible {
    outline-color: var(--studio-led);
  }

  .hud-pill,
  .ds-pill,
  .ds-keycap,
  .nf-btn {
    border-radius: var(--studio-control);
    backdrop-filter: none;
    font: 600 13px/1.25 var(--font-sans);
    letter-spacing: 0;
    text-transform: none;
    box-shadow: none;
  }

  .hud-pill:hover,
  :is(a, button).ds-pill:hover,
  .ds-keycap:hover:not(:disabled) {
    transform: none;
    box-shadow: none;
  }

  :is(.ds-keycap--orange, .ds-keycap.is-active, .nf-btn--primary),
  :is(.ds-keycap--orange, .ds-keycap.is-active, .nf-btn--primary):is(:hover, :focus-visible, :active) {
    background: var(--studio-button);
    border: 1px solid transparent;
    color: #fff;
    box-shadow: none;
  }

  :is(.ds-keycap--orange, .ds-keycap.is-active, .nf-btn--primary):hover:not(:disabled) {
    background: var(--studio-button-hover);
  }

  .stage-hint,
  .tap-cue-badge {
    border-radius: var(--studio-control);
    box-shadow: none;
    letter-spacing: 0;
    backdrop-filter: none;
  }

  :is(.tap-cue-ripple, .tl-hero__grille) {
    display: none;
  }

  .tap-cue-hand,
  .loading-dot {
    animation: none;
  }

  /* Shared chrome and the scrollable galleries, profile and case studies. */
  .ds-topbar::before {
    background: var(--bg-canvas);
    backdrop-filter: none;
  }

  .ds-topbar .ds-topbar__brand {
    padding-inline-start: 0;
    border: 0;
    background: none;
    color: var(--ink-primary);
    font: 600 17px/1 var(--font-display);
  }

  :is(.ds-topbar__variant, .ds-topbar__section-title, .pj-kicker, .pj-spec__label,
    .tl-eyebrow, .tl-hero__status, .tl-hero__tools-label, .tl-rail-tag, .tl-entity__eyebrow,
    .sm-work-client, .sm-v3-stage-client, .sm-v3-rail-hint, .sm-v3-rail-counter) {
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
  }

  :is(.ds-topbar__section-title, .pj-title, .pj-h2, .pj-nav-card__title,
    .tl-hero__title, .tl-section-title, .tl-chapter-title, .tl-card__title,
    .sm-v3-stage-title, .sm-work-title, .sm-v3-thumb .sm-work-title) {
    font-weight: 600;
  }

  .ds-pill--aqua,
  .ds-pill--orange {
    background: var(--surface-tile);
    border-color: var(--border-tile);
    color: var(--ink-primary);
  }

  :is(.ds-tray, .sm-v3-stage, .pj-stage, .tl-portrait-frame, .tl-hero, .tl-chapter) {
    border-width: 1px;
    border-radius: var(--studio-radius);
    box-shadow: var(--tray-shadow);
  }

  .tl-portrait-frame {
    padding: 8px;
    background: var(--surface-tray);
  }

  .tl-portrait-mat {
    border-radius: 8px;
  }

  .tl-live-dot {
    box-shadow: none;
  }

  .tl-hero__status strong {
    font-weight: 600;
  }

  .tl-hero__title {
    text-wrap: balance;
  }

  .tl-stat {
    border-radius: 12px;
    box-shadow: none;
  }

  .sm-v3-stage-bar {
    padding: 12px 16px;
  }

  :is(.sm-v3-stage-bg, .pj-stage__bg) {
    visibility: hidden;
  }

  :is(.sm-v3-thumb, .sm-v3-thumb.is-hover-zone, .sm-v3-thumb.is-active,
    .sm-v3-thumb.is-active.is-hover-zone) {
    transform: none;
    box-shadow: none;
    border-radius: 12px;
  }

  .sm-v3-thumb.is-active {
    border-color: var(--studio-led);
  }

  :is(.sm-v3-thumb.is-hover-zone, .sm-v3-thumb:focus-visible) .sm-media-img,
  .sm-v3-stage:not(.is-vertical) .sm-v3-stage-media:hover .sm-v3-stage-fg,
  .pj-shell--revista .pj-gallery .pj-media-trigger:hover img {
    transform: none;
  }

  :is(.sm-v3-rail-arrow, .pj-nav-card, .pj-footer-cta) {
    background: var(--surface-tray);
    color: var(--ink-primary);
    border-color: var(--border-tile);
    box-shadow: none;
  }

  :is(.pj-header, .pj-block) {
    padding-block-start: 24px;
  }

  .pj-specs {
    gap: 12px;
  }

  .pj-spec {
    border-radius: var(--studio-control);
    box-shadow: none;
  }

  .nf-card {
    border-radius: var(--studio-radius);
    box-shadow: var(--tray-shadow);
  }

  @media (prefers-reduced-motion: reduce) {
    .module-host {
      transition: none;
    }
  }
}

:root[data-visual="studio"][data-theme="dark"] {
  --bg-canvas: #181e1a;
  --surface-tray: #242d27;
  --surface-dock: #1c241f;
  --surface-tile: #2b362e;
  --surface-tile-inner: #323e35;
  --surface-pill: #242d27;
  --surface-pill-hover: #35443a;
  --border-panel: #3f4c42;
  --border-tile: #48564a;
  --border-tile-hover: #788a78;
  --border-tile-inner: #435346;
  --hairline: #3d4a40;
  --hairline-strong: #657869;
  --ink-primary: #f0f2ea;
  --ink-muted: #b6c2b5;
  --studio-led: #ff977c;
  --tile-ledge: #111914;
  --tray-shadow: none;
  --signal-orange: #ff977c;
  --signal-orange-text: #ffad95;
}

:root[data-visual="studio"][data-theme="dark"][data-mode="menu"] {
  --signal-orange: #f17f4d;
  --signal-orange-ledge: #a8492b;
  --signal-orange-border: #bd5e3e;
  --on-orange-ink: #2c170e;
  --surface-tile-empty: var(--surface-dock);
  --surface-tile-empty-inner: var(--surface-tray);
  --border-tile-empty: var(--border-panel);
  --tile-ledge-empty: var(--tile-ledge);
  --seg-idle: var(--border-tile);
  --seg-hover: var(--border-tile-hover);
  --wii-sky: var(--signal-orange);
  --aqua-pill-bg: var(--surface-pill);
  --aqua-pill-border: var(--border-panel);
  --aqua-pill-ink: var(--ink-primary);
  --aqua-pill-shadow: transparent;
  --vignette: rgb(120 155 127 / 4%);

  .dsi-tile.is-active {
    background: var(--signal-orange);
    border-color: var(--signal-orange-border);
    box-shadow: inset 0 1px 0 var(--tile-hi), 0 6px 0 var(--signal-orange-ledge);
  }

  .dsi-tile.is-empty.is-active {
    background: var(--surface-tile);
    border-color: var(--border-tile-hover);
    box-shadow: inset 0 1px 0 var(--tile-hi), 0 6px 0 var(--tile-ledge);
  }

  .dsi-tile.is-empty.is-active .dsi-tile-start {
    color: var(--ink-muted);
  }

  .dsi-arrow-btn {
    border-color: var(--signal-orange-border);
    box-shadow: inset 0 1px 0 var(--tile-hi), 0 2px 0 var(--signal-orange-ledge);
  }

  .dsi-arrow-btn:hover:not(:disabled) {
    background: var(--signal-orange-text);
  }

  .dsi-arrow-btn:active:not(:disabled),
  .dsi-seg-btn.is-active {
    box-shadow: none;
  }
}

:root[data-visual="studio"][data-mode="menu"] {
  --studio-control: 8px;
  --font-sans: "Figtree", "Trebuchet MS", sans-serif;
  --font-display: "Bricolage Grotesque", "Bahnschrift", sans-serif;
  --font-mono: var(--font-sans);

  .hud-controls {
    display: none !important;
  }

  .dsi-menu-topbar-host {
    position: sticky;
    top: 0;
    z-index: 40;
    width: 100%;
    flex: none;
  }

  .dsi-studio-topbar {
    position: relative;
    min-height: 44px;
    padding: 0;
    --topbar-chrome: 0;
    --topbar-inner-w: min(920px, calc(100% - 40px));
    transition: padding 220ms var(--ease-out);
  }

  .dsi-studio-topbar::before {
    background: var(--bg-canvas);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: opacity 220ms var(--ease-out);
  }

  .dsi-studio-topbar .ds-topbar__inner {
    transition: max-width 220ms var(--ease-out);
  }

  .dsi-studio-topbar.is-scrolled {
    --topbar-chrome: 1;
    padding: 7px 20px;
    --topbar-inner-w: none;
  }

  .dsi-studio-topbar .ds-topbar__brand {
    padding-inline-start: 0;
    border: 0;
    background: none;
    color: var(--ink-primary);
    font: 600 17px/1 var(--font-display);
    box-shadow: none;
  }

  .dsi-studio-topbar :where(.ds-pill) {
    border-radius: var(--studio-control);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    font: 600 13px/1.25 var(--font-sans);
    letter-spacing: 0;
    text-transform: none;
    box-shadow: none;
  }

  .dsi-studio-topbar .ds-pill:hover {
    transform: none;
    box-shadow: none;
  }

  .dsi-studio-topbar .ds-topbar__variant {
    background: var(--surface-tile);
    border-color: var(--border-tile);
    color: var(--ink-muted);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
  }

  .dsi-studio-topbar .dsi-menu-mute {
    width: 44px;
    min-width: 44px;
    padding: 0;
    justify-content: center;
  }

  .dsi-studio-topbar .dsi-power-pill:hover .dsi-power-icon,
  .dsi-studio-topbar .dsi-power-pill:focus-visible .dsi-power-icon {
    color: var(--signal-orange);
  }
}

@media (max-width: 640px) {
  :root[data-visual="studio"][data-mode="menu"] .dsi-studio-topbar {
    &,
    &.is-scrolled {
      padding: 0 12px;
      --topbar-inner-w: none;
    }

    .ds-topbar__inner,
    .ds-topbar__left,
    .ds-topbar__right {
      gap: clamp(4px, 1.5vw, 6px);
    }

    .ds-topbar__brand {
      padding: 0;
      font-size: clamp(12px, 4vw, 17px);
      letter-spacing: 0;
    }

    .ds-topbar__variant {
      display: inline-flex;
      height: 32px;
      min-height: 32px;
      padding: 0 6px;
      font-size: 12px;
    }

    .dsi-power-pill {
      width: 44px;
      padding: 0;
      justify-content: center;

      span {
        display: none;
      }
    }
  }
}

/* The original console shell hosts a single editorial preview in place of its speech bubble. */
.dsi-bubble-wrap.has-studio-preview {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  align-items: stretch;
  justify-items: stretch;
  width: min(920px, calc(100% - 40px));
  min-height: clamp(216px, 33dvh, 304px);
  overflow: hidden;
  border: 1px solid #29352c;
  border-radius: 16px;
  background: #141b15;
  color: #f6f4e9;
  font-family: "Figtree", "Trebuchet MS", sans-serif;

  &.is-empty {
    grid-template-columns: 1fr;
  }

  .dsi-bubble-tail,
  [hidden] {
    display: none;
  }

  .dsi-speech-bubble {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 12px;
    min-width: 0;
    padding: clamp(20px, 3vw, 36px);
    background: none;
    border: 0;
    box-shadow: none;
    text-align: left;
  }

  .dsi-bubble-kicker,
  .dsi-bubble-sub {
    margin: 0;
    color: #ccd4c9;
    letter-spacing: 0;
  }

  .dsi-bubble-kicker {
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
  }

  .dsi-bubble-title {
    color: inherit;
    font-family: "Bricolage Grotesque", "Bahnschrift", sans-serif;
    font-size: clamp(34px, 4.2vw, 56px);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.035em;
  }

  .dsi-bubble-sub {
    max-width: 32ch;
    font-size: 16px;
    line-height: 1.45;
  }

  .dsi-studio-open {
    min-height: 44px;
    margin-top: 4px;
    padding: 0 16px;
    border-radius: 8px;
    background: #a53621;
    color: #fff;
    font-weight: 600;
  }

  .dsi-studio-open::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
  }

  .dsi-studio-open:hover {
    background: #872916;
  }

  :is(.dsi-studio-open, .dsi-studio-credit a):focus-visible {
    outline-color: #ffad95;
  }

  .dsi-studio-preview {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    overflow: hidden;
    background: #101712;
  }

  .dsi-studio-preview[hidden] {
    display: none;
  }

  .dsi-studio-preview.has-brand-logo {
    background: #fff;
  }

  .dsi-studio-preview img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .dsi-studio-preview img.is-portrait {
    object-position: center 35%;
  }

  .dsi-studio-preview img.is-brand-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    width: min(42%, 150px);
    height: min(64%, 96px);
    margin: 0;
    object-fit: contain;
  }

  .dsi-studio-credit {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 2;
    margin: 0;
    padding: 4px 8px;
    border-radius: 4px;
    background: #161c18;
    color: #f4f5ee;
    font-size: 13px;
    pointer-events: none;
  }

  .dsi-studio-credit a {
    text-underline-offset: 3px;
    pointer-events: auto;
  }
}

@media (max-width: 700px) {
  [data-visual="studio"][data-mode="menu"] .portfolio-reveal {
    display: block;
    overflow-y: auto;
    padding: 8px 0 20px;
  }

  [data-visual="studio"] .dsi-menu-shell {
    height: auto;
    max-height: none;
    gap: 12px;
    margin: 0 auto;
  }

  [data-visual="studio"] .dsi-menu-topbar {
    padding-top: 0;
  }

  .dsi-bubble-wrap.has-studio-preview {
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
    width: calc(100% - 24px);
    margin-top: 0;

    .dsi-speech-bubble {
      min-height: 178px;
      padding: 16px;
      gap: 8px;
    }

    .dsi-bubble-title {
      font-size: clamp(28px, 8vw, 40px);
    }

    .dsi-bubble-sub {
      font-size: 14px;
    }

    .dsi-studio-preview {
      width: 100%;
      height: 176px;
      min-height: 176px;
      aspect-ratio: auto;
    }
  }
}

@media (max-width: 640px) {
  [data-visual="studio"][data-mode="menu"] {
    .portfolio-reveal {
      padding-bottom: 12px;
    }

    .dsi-menu-footer {
      display: none;
    }
  }
}

@media (max-width: 700px) and (max-height: 640px) {
  [data-visual="studio"][data-mode="menu"] {
    .portfolio-reveal {
      padding: 0 0 8px;
    }

    .dsi-menu-shell {
      gap: 8px;
    }

    .dsi-bubble-wrap.has-studio-preview {
      min-height: 0;

      .dsi-speech-bubble {
        min-height: 0;
        padding: 12px;
        gap: 6px;
      }

      .dsi-bubble-title {
        font-size: clamp(24px, 7vw, 30px);
      }

      .dsi-bubble-sub {
        line-height: 1.3;
      }

      .dsi-studio-open {
        margin-top: 0;
      }

      .dsi-studio-preview {
        height: clamp(72px, calc(100dvh - 432px), 140px);
        min-height: 0;
      }

      .dsi-studio-preview img.is-portrait {
        object-position: center 45%;
      }
    }

    .dsi-carousel-viewport {
      padding: 7px 0 10px;
    }

    .dsi-carousel-track {
      gap: 10px;
    }

    .dsi-tile {
      width: 98px;
      height: 82px;
      padding-inline: 6px;
    }

    .dsi-tile.is-active {
      width: 112px;
      height: 96px;
    }

    .dsi-tile-inner {
      gap: 4px;
      padding: 5px 2px;
    }

    .dsi-tile-icon {
      width: 28px;
      height: 28px;
    }

    .dsi-tile-caption {
      white-space: nowrap;
    }

    .dsi-menu-footer {
      display: none;
    }
  }
}

@media (max-height: 640px) and (min-width: 701px) {
  [data-visual="studio"][data-mode="menu"] .portfolio-reveal {
    display: block;
    overflow-y: auto;
    padding: 12px 0 20px;
  }

  [data-visual="studio"] .dsi-menu-shell {
    height: auto;
    max-height: none;
    gap: 12px;
  }
}
