@font-face {
  font-family: "Qinghe Experience Serif";
  src: url("assets/source-han-serif-sc.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
}

:root {
  color-scheme: light;
  --heading: #303636;
  --text: #4a4a4a;
  --muted: #6e6e6e;
  --warm: #faf9f6;
  --pale: #f6fafa;
  --rule: #e3e8e8;
  --pale-rule: #dbf0f0;
  --accent: #2e6d67;
  --gutter: 36px;
  --content-width: 1200px;
  --serif: "Qinghe Experience Serif", "Source Han Serif SC VF", "Source Han Serif SC", "Songti SC", SimSun, serif;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--warm);
  color: var(--text);
  font: 400 16px/28px var(--sans);
}

h1, h2, h3, p, figure, dl, dd { margin: 0; }
img { display: block; max-width: 100%; }
button { font: inherit; }
a { color: var(--accent); text-underline-offset: .23em; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  z-index: 5;
  top: 12px;
  left: 12px;
  padding: 6px 12px;
  background: white;
  transform: translateY(-180%);
}
.skip-link:focus { transform: none; }

.shell {
  width: min(var(--content-width), calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

.site-header {
  position: relative;
  z-index: 2;
  background: #fcfdfc;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  min-height: 96px;
}

.brand { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.brand__symbol { width: 41px; height: auto; }
.brand__wordmark { width: 135px; height: auto; }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a, .site-nav summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  color: var(--heading);
  font: 400 15px/22px var(--serif);
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover, .site-nav summary:hover, .site-nav a[aria-current="page"] { color: var(--accent); }
.site-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 7px; }
.site-nav details { position: relative; }
.site-nav summary { gap: 6px; cursor: pointer; list-style: none; }
.site-nav summary::-webkit-details-marker { display: none; }
.site-nav summary::after {
  width: 5px;
  height: 5px;
  margin-top: -3px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  content: "";
  transform: rotate(45deg);
}

.site-nav .site-nav__submenu {
  position: absolute;
  top: 100%;
  left: -12px;
  display: grid;
  gap: 0;
  min-width: 192px;
  padding: 6px 12px;
  border: 1px solid var(--rule);
  background: #fcfdfc;
  box-shadow: 0 8px 20px rgb(38 75 75 / 8%);
}

.menu-toggle { display: none; }

.hero {
  position: relative;
  isolation: isolate;
  background: hsl(175 25% 94%);
}

.hero__art {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;
}

.hero::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(90deg, rgb(245 250 247 / 50%), transparent 68%);
  content: "";
}

.hero__inner {
  display: flex;
  align-items: center;
  min-height: clamp(330px, 27vw, 438px);
}

.hero__copy { max-width: 432px; padding-block: 36px; }

.eyebrow {
  position: relative;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
}

.eyebrow::after {
  position: absolute;
  inset: auto auto 0 0;
  width: 48px;
  height: 1px;
  background: var(--rule);
  content: "";
}

.hero .eyebrow::after { background: #bfd7d2; }
h1, h2 { color: var(--heading); font-family: var(--serif); }
h1 { margin-top: -4px; font-size: 42px; font-weight: 500; line-height: 60px; }
h2 { font-size: 32px; font-weight: 400; line-height: 44px; letter-spacing: 1px; }
h3 { color: var(--heading); font-size: 18px; font-weight: 500; line-height: 28px; }
.hero__intro { margin-top: 3px; text-wrap: pretty; }

.hero__link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
  padding: 6px 15px;
  border: 1px solid currentColor;
  font-size: 14px;
  line-height: 22px;
  text-decoration: none;
}

.hero__link:hover { background: var(--accent); color: white; }

.archive {
  --content-width: 798px;
  padding-bottom: 72px;
}
.archive__source {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.case-list { margin: 0; padding: 0; list-style: none; }
.case-list > li.case-lead { background: var(--pale); }
.case-list > li + li:not(.case-lead) > .case { border-top: 1px solid var(--rule); }
.case-list > li.case-lead + li > .case { border-top-color: transparent; }

.case {
  --case-copy-width: 390px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, min(54%, 564px));
  grid-template-areas: "head media" "details media";
  grid-template-rows: auto 1fr;
  align-items: start;
  gap: 25px 48px;
  padding-block: 42px;
}

.case__media { grid-area: media; min-width: 0; }
.case__head { grid-area: head; }
.case__details {
  grid-area: details;
  max-width: var(--case-copy-width);
  color: #505d58;
  font-size: 14px;
  font-weight: 400;
  line-height: 26px;
}
.case__chapter {
  display: inline-block;
  margin-bottom: 18px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--pale-rule);
  color: var(--accent);
  font-size: 14px;
  line-height: 22px;
}
.case__chapter span { margin-left: 6px; color: var(--muted); font-size: 12px; }

.case__photos {
  display: grid;
  grid-template-columns: minmax(0, var(--photo-a, 1fr)) minmax(0, var(--photo-b, 1fr));
  gap: 6px;
}

.case-photo {
  display: block;
  overflow: hidden;
  border-radius: 2px;
}

.case-photo img {
  width: 100%;
  height: auto;
}

.case__photo-caption {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}

.case__compare-control { display: none; }

.case__identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  font-size: 14px;
  line-height: 20px;
}
.case__identity h3 { color: #566560; font-size: 14px; font-weight: 400; line-height: 20px; }
.case__avatar {
  width: 11px;
  height: 11px;
  margin-top: 4.5px;
  width: 1cap;
  height: 1cap;
  margin-top: calc((20px - 1cap) / 2);
  border-radius: 50%;
  background: var(--pale);
  object-fit: cover;
}

.case__product, .case__notice { color: var(--muted); font-size: 12px; line-height: 18px; }
.case__product { overflow-wrap: anywhere; }
.case-lead .case__product { display: none; }
.case__notice { margin-top: 12px; padding-left: 9px; border-left: 1px solid #bfd7d2; }
.case__notice + .case__notice { margin-top: 6px; }

.case__tags {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: var(--case-copy-width);
  margin-top: 24px;
  text-align: center;
}

.case__tags > div { position: relative; }
.case__tags > div + div::before {
  content: "";
  position: absolute;
  inset-block: 3px;
  inset-inline-start: 0;
  border-inline-start: 1px solid var(--rule);
}
.case__tags dt { color: var(--muted); font-size: 12px; line-height: 18px; }
.case__tags dd { margin-top: 9px; color: #426d64; font-size: 16px; font-weight: 400; line-height: 24px; }
.case__profile { font-weight: 300; text-wrap: pretty; }
/* These margins account for the space inside the text line boxes. */
.case__improvement { margin-top: 26px; color: #808080; font-weight: 300; }
.case__improvement dt { color: var(--accent); font-size: 12px; font-weight: 400; line-height: 20px; letter-spacing: .03em; }
.case__improvement dd { font-size: 12px; line-height: 24px; text-wrap: pretty; }

@media (min-width: 901px) {
  .case__photos--compare {
    position: relative;
    isolation: isolate;
    width: min(100%, 360px);
    margin-inline: auto;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .case__photos--compare > figure { grid-area: 1 / 1; }
  .case__photos--compare > figure:first-child { z-index: 1; }
  .case__photos--compare .case-photo { aspect-ratio: 1; }
  .case__photos--compare > figure:first-child .case-photo {
    clip-path: inset(0 calc(100% - var(--split)) 0 0);
  }
  .case__photos--compare .case-photo img {
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transform: scale(1.04);
    transform-origin: center top;
  }
  .case__photos--compare > figure:first-child .case__photo-caption { text-align: start; }
  .case__photos--compare > figure:nth-child(2) .case__photo-caption { text-align: end; }
  .case__photos--compare > figure:first-child .case__photo-caption::before { content: "Before · "; color: var(--accent); }
  .case__photos--compare > figure:nth-child(2) .case__photo-caption::before { content: "After · "; color: var(--accent); }
  .case__compare-control {
    --thumb: 36px;
    display: block;
    position: absolute;
    inset: 0 0 auto;
    z-index: 2;
    aspect-ratio: 1;
    pointer-events: none;
  }
  .case__compare-control::before {
    content: "";
    position: absolute;
    inset-block: 0;
    left: var(--split);
    width: 2px;
    transform: translateX(-50%);
    background: white;
    box-shadow: 0 0 3px rgb(0 0 0 / 48%);
  }
  .case__compare-range {
    --handle: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232e6d67' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m8 8-4 4 4 4m8-8 4 4-4 4'/%3E%3C/svg%3E") center / 24px no-repeat;
    position: absolute;
    top: 50%;
    left: calc(var(--thumb) / -2);
    width: calc(100% + var(--thumb));
    height: 48px;
    transform: translateY(-50%);
    appearance: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: ew-resize;
    touch-action: pan-y;
    pointer-events: auto;
  }
  .case__compare-range::-webkit-slider-thumb {
    appearance: none;
    width: var(--thumb);
    height: var(--thumb);
    border: 1px solid rgb(0 0 0 / 18%);
    border-radius: 50%;
    background: var(--handle);
    box-shadow: 0 1px 6px rgb(0 0 0 / 30%);
  }
  .case__compare-range::-moz-range-thumb {
    width: calc(var(--thumb) - 2px);
    height: calc(var(--thumb) - 2px);
    border: 1px solid rgb(0 0 0 / 18%);
    border-radius: 50%;
    background: var(--handle);
    box-shadow: 0 1px 6px rgb(0 0 0 / 30%);
  }
  .case__compare-range:focus-visible { outline-offset: -2px; }

  :where(.case-list:not(.case-list--editorial)) .case__details:not(:has(> .case__notice)) {
    display: flex;
    flex-direction: column;
    align-self: stretch;
    /* Offset the photo caption, allowing for the leading below the last line of text. */
    padding-bottom: 18px;
  }
  :where(.case-list:not(.case-list--editorial)) .case__details:not(:has(> .case__notice))::before {
    content: "";
    order: 1;
    flex: 1 0 26px;
    max-height: 56px;
  }
  :where(.case-list:not(.case-list--editorial)) .case__details:not(:has(> .case__notice)) > .case__improvement {
    order: 2;
    margin-top: 0;
  }
}

.site-footer {
  padding-block: 36px 24px;
  background: linear-gradient(90deg, #28736f, #4a8482 52%, #2b7c79);
  color: #fff;
  font-size: 14px;
  line-height: 24px;
}

.site-footer__columns { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
.site-footer strong { display: block; margin-bottom: 6px; font-weight: 600; }
.site-footer a { color: inherit; overflow-wrap: anywhere; }
.site-footer a:focus-visible { outline-color: white; }
.site-footer__legal { margin-top: 24px; padding-top: 12px; border-top: 1px solid rgb(255 255 255 / 28%); }

@media (max-width: 900px) {
  :root { --gutter: 24px; }
  body { font-size: 15px; line-height: 26px; }
  h1 { margin-top: -2px; font-size: 30px; line-height: 42px; }
  h2 { font-size: 24px; font-weight: 500; line-height: 34px; }
  h3 { font-size: 16px; line-height: 24px; }

  .site-header__inner { flex-wrap: wrap; column-gap: 24px; row-gap: 0; min-height: 72px; }
  .brand { min-height: 72px; }
  .brand__symbol { width: 34px; }
  .brand__wordmark { width: 114px; }
  .menu-toggle {
    display: grid;
    place-items: center;
    width: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--heading);
    cursor: pointer;
  }
  .menu-toggle svg { width: 22px; height: 22px; }
  .site-nav { width: 100%; padding-block: 6px 12px; border-top: 1px solid var(--rule); background: #f6fbf9; }
  .site-nav > ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; align-items: start; }
  .site-nav .site-nav__submenu {
    position: static;
    min-width: 0;
    padding: 0 0 0 9px;
    border: 0;
    border-left: 1px solid var(--rule);
    box-shadow: none;
  }
  .site-nav__submenu a { white-space: normal; }

  .hero__art { object-position: 74% center; }
  .hero::after { background: linear-gradient(90deg, rgb(242 249 245 / 92%), rgb(242 249 245 / 68%) 48%, transparent 92%); }
  .hero__inner { min-height: 282px; }
  .hero__copy { max-width: 260px; }
  .hero__intro { max-width: 13em; margin-top: 1px; text-wrap: balance; }
  .hero__link { margin-top: 18px; }
  .archive { padding-bottom: 48px; }
  .case {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "head" "media" "details";
    grid-template-rows: auto;
    gap: 18px;
    padding-block: 30px;
  }
  .case__chapter { margin-bottom: 12px; }
  .case__tags { margin-top: 18px; }
  .case__details { margin-top: 1px; }
  .site-footer__columns { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}

@media (max-width: 380px) {
  :root { --gutter: 18px; }
}

.case-list--editorial {
  --case-chip-height: 24px;
}

.case-list--editorial .case__head {
  display: flex;
  max-width: var(--case-copy-width);
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.case-list--editorial .case__identity { align-items: center; }
.case-list--editorial .case__identity > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 6px;
}
.case-list--editorial .case__avatar {
  width: var(--case-chip-height);
  height: var(--case-chip-height);
  margin-top: 0;
}

.case-list--editorial .case__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}
.case-list--editorial .case__tags > div + div::before { content: none; }
.case-list--editorial .case__tags dd {
  min-height: var(--case-chip-height);
  margin: 0;
  padding: 3px 9px;
  border-radius: 999px;
  background: #e7efec;
  color: #355e56;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}

.case-list--editorial .case__profile {
  color: var(--heading);
  font: 400 22px/36px var(--serif);
}
.case-list--editorial .case__improvement { margin-top: 20px; }
@media (min-width: 901px) {
  .case-list--editorial .case {
    grid-template-columns: minmax(0, var(--case-copy-width)) 360px;
    row-gap: 18px;
  }
  .case-list--editorial .case__head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
  }
  .case-list--editorial .case__tags { flex-shrink: 0; }
}

@media (max-width: 900px) {
  .case-list--editorial .case__details {
    width: 87.5%;
    max-width: none;
  }
  .case-list--editorial .case__profile { font-size: 16px; line-height: 32px; }
  .case-list--editorial .case__profile,
  .case-list--editorial .case__improvement dd { text-wrap: wrap; }
}

.language-switch { position: relative; flex: 0 0 auto; align-self: center; }
.language-switch__toggle { display: grid; place-items: center; width: 44px; height: 44px; padding: 10px; border: 0; background: transparent; cursor: pointer; }
.language-switch img { width: 24px; height: auto; }
.language-switch__options { position: absolute; z-index: 5; top: 100%; right: 0; display: flex; gap: 4px; width: 104px; margin-top: 6px; padding: 6px; border: 1px solid rgb(64 94 128 / 15%); border-radius: 10px; background: #fff; box-shadow: 0 6px 20px rgb(54 71 90 / 18%); }
.language-switch__options::before { content: ""; position: absolute; right: 16px; top: -5px; width: 8px; height: 8px; background: #fff; transform: rotate(45deg); }
.language-switch__options::after { content: ""; position: absolute; inset: -8px 0 auto; height: 8px; }
.site-nav .language-switch__options a { display: grid; place-items: center; width: 44px; min-height: 44px; padding: 10px; border-radius: 6px; }
.language-switch__options a:hover, .language-switch__options a:focus-visible { background: #edf3f9; }
.site-nav .language-switch__options a[aria-current="page"] { background: #edf3f9; }
@media (max-width: 900px) {
  .language-switch { justify-self: start; }
  .language-switch__options { left: 0; right: auto; }
  .language-switch__options::before { left: 16px; right: auto; }
}

/* Desktop header logo dimensions shared across Qinghe pages. */
@media (width > 900px) {
  .site-header .brand .brand__symbol { width: 36px; height: 36px; object-fit: contain; }
  .site-header .brand .brand__wordmark { width: 122px; height: 30px; object-fit: contain; }
}
