body:is(.homewood-case-page, .medica-case-page, .kempa-case-page) {
  color-scheme: dark;
  background: #03090e;
}

body.kwd-navigation.elite-detail-page:is(.homewood-case-page, .medica-case-page, .kempa-case-page) #tresc { padding-top: 0; }

.hw-case {
  --hw-accent: #ff9a65;
  --hw-ink: #edf6ff;
  --hw-muted: #b6c4d0;
  --hw-line: #bcd9ef34;
  --hw-radius: var(--visual-radius, 24px);
  color: var(--hw-ink);
}

.hw-case__container { width: min(1360px, calc(100% - 10vw)); margin-inline: auto; }
.hw-case__content { padding-bottom: clamp(60px, 8vw, 112px); }
.hw-case__opening {
  position: relative;
  isolation: isolate;
  display: flex;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  color-scheme: light;
  background: var(--kwd-light-base);
  color: var(--kwd-light-ink);
}

.hw-case__opening > .hw-case__container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding-top: clamp(105px, 9vw, 132px);
}

body:is(.homewood-case-page, .medica-case-page):not(.mobile-nav-open) #topbar:not(.is-condensed) .brand img {
  content: url("seo/kwd-logo-light.svg");
  mix-blend-mode: darken;
}

body:is(.homewood-case-page, .medica-case-page):not(.mobile-nav-open) #topbar:not(.is-condensed)
:is(.toplinks a, .toplinks button, .topbar__cta, .mobile-toggle) { color: var(--kwd-light-ink) !important; }

body:is(.homewood-case-page, .medica-case-page):not(.mobile-nav-open) #topbar:not(.is-condensed) .topbar__cta .circ {
  background: var(--kwd-light-ink);
  color: #fff;
}

body:is(.homewood-case-page, .medica-case-page):not(.mobile-nav-open) #topbar:not(.is-condensed) .nav-hover-dots i { background: currentColor; }

.hw-case :is(h1, h2, p, figure) { margin: 0; }

.hw-case__trail {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px 24px;
  margin-bottom: 18px;
  color: var(--hw-muted);
  font-size: 13px;
}

.hw-case__opening .hw-case__trail {
  justify-content: flex-start;
  color: var(--kwd-light-soft);
  margin-bottom: 0;
}

.hw-case__trail a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  text-underline-offset: 4px;
}

.hw-case__trail a:hover { text-decoration: underline; }
.hw-case__trail--end { margin: 0; padding-top: 16px; border-top: 1px solid var(--hw-line); }

.hw-case__hero {
  display: flex;
  flex: 1;
  align-items: center;
  padding-bottom: clamp(30px, 8vw, 140px);
}

.hw-case__intro {
  display: flex;
  width: min(37vw, 465px);
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  padding-block: 10px;
}

.hw-case__label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .1em;
  line-height: 1.5;
  text-transform: uppercase;
}

.hw-case__intro .hw-case__label { color: #a64421; }

:is(.homewood-case-page, .medica-case-page, .kempa-case-page) .hw-case__intro h1 {
  color: var(--kwd-light-ink);
  font-size: clamp(40px, 5.4vw, 76px);
  font-weight: 400;
  letter-spacing: -.067em;
  line-height: .98;
}

.hw-case__intro > p:last-child {
  max-width: 34ch;
  color: var(--kwd-light-soft);
  font-size: clamp(15px, 1.45vw, 19px);
  line-height: 1.6;
}

.hw-case__hero-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.hw-case__chapter { margin-block: clamp(54px, 8vw, 120px); }
.hw-case__book { margin-top: clamp(30px, 4vw, 54px); scroll-margin-top: 100px; }

.hw-case__chapter-head {
  display: grid;
  grid-template-columns: minmax(150px, .8fr) minmax(0, 1.2fr);
  gap: 12px clamp(24px, 5vw, 80px);
  align-items: start;
  margin-bottom: clamp(22px, 3vw, 44px);
  padding-top: 22px;
  border-top: 1px solid var(--hw-line);
}

.hw-case__book .hw-case__chapter-head { align-items: baseline; }
.hw-case__chapter-head > .hw-case__label { margin-top: 6px; color: var(--hw-muted); }
.hw-case__chapter-head h2 { font-size: clamp(32px, 4.2vw, 64px); font-weight: 400; letter-spacing: -.05em; line-height: 1.05; }
.hw-case__chapter-head div > p { max-width: 59ch; margin-top: 18px; color: var(--hw-muted); font-size: clamp(15px, 1.4vw, 18px); line-height: 1.68; }

.hw-case__grid, .hw-case__boards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2.2vw, 32px); }
.hw-case__wide { grid-column: 1 / -1; }

.hw-case__grid img, .hw-case__boards img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--hw-radius);
  background: #101922;
}

.hw-case__grid:not(.hw-case__grid--applications) img { aspect-ratio: 1; object-fit: cover; }
.hw-case__grid--applications figure:nth-last-child(-n+2) img { aspect-ratio: 3 / 2; object-fit: cover; }
.hw-case__square img { aspect-ratio: 1; object-fit: cover; }
.hw-case__grid--applications .hw-case__wide img { aspect-ratio: 16 / 9; object-fit: cover; }
.hw-case figcaption { padding: 11px 3px 0; color: var(--hw-muted); font-size: 13px; line-height: 1.5; }

.hw-case__chapter--system { padding: clamp(18px, 4vw, 55px); border: 1px solid var(--hw-line); border-radius: var(--hw-radius); background: #0b131b; }
.hw-case__chapter--system .hw-case__chapter-head { padding-top: 0; border: 0; }
.hw-case__palette { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.hw-case__palette li { display: grid; gap: 4px; font-size: 13px; line-height: 1.4; }
.hw-case__palette li > span:last-child { color: var(--hw-muted); font-variant-numeric: tabular-nums; }
.hw-case__swatch { display: block; min-height: 68px; margin-bottom: 4px; border: 1px solid var(--hw-line); border-radius: 0 36px 0 36px; background: var(--swatch); }

.hw-case__boards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hw-case__boards img { border: 1px solid var(--hw-line); }
.hw-case__boards a { display: block; border-radius: var(--hw-radius); }
.hw-case__boards a:hover, .hw-case a:focus-visible { outline: 2px solid var(--hw-accent); outline-offset: 4px; }
.hw-case [data-hw-gallery-item] { cursor: zoom-in; }

body:is(.homewood-case-page, .medica-case-page, .kempa-case-page):has(.hw-gallery[open]) { overflow: hidden; }

.hw-gallery {
  --gallery-edge: clamp(10px, 2vw, 22px);
  position: fixed;
  inset: 0;
  width: min(1180px, calc(100% - 24px));
  height: min(920px, calc(100dvh - 24px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--hw-line);
  border-radius: var(--hw-radius);
  background: #0b131b;
  color: var(--hw-ink);
  box-shadow: 0 24px 90px #0009;
}

.hw-gallery[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.hw-gallery::backdrop { background: #03090ee8; cursor: default; }

/* The native dialog sits above the site's custom cursor. */
body:is(.homewood-case-page, .medica-case-page, .kempa-case-page) .hw-gallery[open],
body:is(.homewood-case-page, .medica-case-page, .kempa-case-page) .hw-gallery[open] * { cursor: auto !important; }
body:is(.homewood-case-page, .medica-case-page, .kempa-case-page) .hw-gallery[open] button,
body:is(.homewood-case-page, .medica-case-page, .kempa-case-page) .hw-gallery[open] button * { cursor: pointer !important; }
body:is(.homewood-case-page, .medica-case-page, .kempa-case-page):has(.hw-gallery[open]) .kwd-cursor { visibility: hidden; }

.hw-gallery__header, .hw-gallery__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px var(--gallery-edge);
}

.hw-gallery__header h2 { font-size: clamp(15px, 2vw, 21px); font-weight: 500; }
.hw-gallery__controls { justify-content: center; min-height: 60px; }
.hw-gallery__stage { padding: 0 8px; }
.hw-gallery__stage img { display: block; width: 100%; height: 100%; object-fit: contain; }
.hw-gallery__label { display: grid; gap: 3px; text-align: center; font-size: 13px; line-height: 1.35; }
.hw-gallery__label small { color: var(--hw-muted); font-variant-numeric: tabular-nums; }

.hw-gallery button {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--hw-line);
  border-radius: 50%;
  background: #17232f;
  color: inherit;
  font: inherit;
  font-size: 21px;
}

.hw-gallery :is([data-gallery-prev], [data-gallery-next]) {
  position: absolute;
  z-index: 1;
  top: 50%;
  transform: translateY(-50%);
}
.hw-gallery [data-gallery-prev] { inset-inline-start: var(--gallery-edge); }
.hw-gallery [data-gallery-next] { inset-inline-end: var(--gallery-edge); }
.hw-gallery button:hover { background: #25384a; }
.hw-gallery button:focus-visible { outline: 2px solid var(--hw-accent); outline-offset: 2px; }
.hw-gallery button .icon { width: 18px; height: 18px; }

@media (min-width: 601px) {
  .hw-gallery__stage { padding-inline: calc(var(--gallery-edge) + 52px); }
}

@media (max-width: 870px) {
  body:is(.homewood-case-page, .medica-case-page):not(.mobile-nav-open) #topbar:not(.is-condensed) {
    background: var(--kwd-light-glass) !important;
    color: var(--kwd-light-ink);
  }
  body:is(.homewood-case-page, .medica-case-page):not(.mobile-nav-open) #topbar:not(.is-condensed) .v13-menu-dots i { background: var(--kwd-light-ink); }
}

@media (max-width: 820px) {
  .hw-case__container { width: calc(100% - 40px); }
  .hw-case__opening { min-height: 370px; }
  .hw-case__hero-image { object-position: right center; }
  .hw-case__chapter-head { grid-template-columns: 1fr; }
  .hw-case__boards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .hw-case__opening { aspect-ratio: auto; }
  .hw-case__opening > .hw-case__container {
    padding-top: calc(88px + env(safe-area-inset-top, 0px));
    padding-bottom: 101.25vw;
  }
  .hw-case__hero { padding-block: 12px 22px; }
  .hw-case__intro { width: 100%; gap: 12px; }
  /* Blend the top of the photo into the light surface above it. */
  .hw-case__hero-image {
    inset: auto 0 0 auto;
    width: 180%;
    max-width: none;
    height: auto;
    mask-image: linear-gradient(transparent, #000 7%);
  }
}

@media (max-width: 460px) {
  .hw-case__grid, .hw-case__boards { grid-template-columns: 1fr; }
  .hw-case__palette { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.hw-case__website { scroll-margin-top: 108px; }

.hw-case__site-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  margin-top: 12px;
  color: var(--hw-accent);
  text-underline-offset: 4px;
}

.hw-case__site-link:hover { text-decoration: underline; }

.hw-case__device-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  padding: clamp(24px, 7vw, 100px) clamp(16px, 6vw, 82px);
  overflow: hidden;
  border: 1px solid var(--hw-line);
  border-radius: var(--hw-radius);
  background: radial-gradient(ellipse at 48% 34%, #45404a, transparent 67%), #121920;
}

.hw-case__device-stage::before {
  position: absolute;
  z-index: -1;
  inset: 57% 0 0;
  background: linear-gradient(180deg, transparent, #0a0c10 86%);
  content: "";
}

.hw-case__laptop {
  position: relative;
  width: 88%;
  margin-right: 9%;
  padding: clamp(4px, .8vw, 12px);
  border: 1px solid #80838b;
  border-radius: clamp(7px, 1.4vw, 18px);
  background: linear-gradient(125deg, #353940, #0c0f12 60%, #21252b);
  box-shadow: 0 25px 55px #0009;
}

.hw-case__laptop::after {
  position: absolute;
  right: -5%;
  bottom: -3%;
  left: -5%;
  height: 3.5%;
  border-radius: 1px 1px 50% 50%;
  background: linear-gradient(#9c9fa7, #30343a 75%);
  content: "";
}

.hw-case__laptop a, .hw-case__phone a, .hw-case__browser a { display: block; }
.hw-case__laptop img, .hw-case__phone img, .hw-case__browser img { display: block; width: 100%; height: auto; }
.hw-case__laptop img { border-radius: clamp(2px, .55vw, 7px); }

.hw-case__phone {
  position: absolute;
  right: 7%;
  bottom: 9%;
  width: 17%;
  padding: clamp(3px, .6vw, 8px);
  border: 1px solid #8b8e94;
  border-radius: clamp(7px, 1.8vw, 26px);
  background: #151719;
  box-shadow: 12px 16px 30px #000b;
}

.hw-case__phone img { border-radius: clamp(4px, 1.3vw, 18px); }

.hw-case .hw-case__browser-figure { margin-top: clamp(25px, 5vw, 64px); }
.hw-case__browser { overflow: hidden; border: 1px solid var(--hw-line); border-radius: var(--hw-radius); background: #131b23; }
.hw-case__browser-bar { display: flex; align-items: center; gap: 13px; padding: 10px 16px; color: var(--hw-muted); font-size: 12px; line-height: 1.5; }
.hw-case__browser-bar > span:first-child { width: 6px; height: 6px; margin-right: 17px; border-radius: 50%; background: #ff8b58; box-shadow: 10px 0 #9ca4af, 20px 0 #66727e; }

@media (max-width: 460px) {
  .hw-case__device-stage { padding-block: 30px; }
  .hw-case__phone { right: 6%; bottom: 8%; width: 20%; }
}
