/* Only the page behind the opening film uses the following layout. */
html.opened #main:has(.editorial-service-index) {
  border-radius: 0;
  box-shadow: none;
}

.grid.hero:has(> .home-observation),
header.ds-hero:has(.home-observation) > .wrap {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: clamp(20px, 3.6vw, 56px);
  align-items: center;
  max-width: 1320px;
  margin-inline: auto;
  padding: clamp(30px, 4.2vw, 70px) clamp(20px, 4.4vw, 72px) 0;
  box-sizing: border-box;
}

header.ds-hero:has(.home-observation) {
  background: var(--ds-card);
  color: var(--ds-ink);
  padding: 0;
  border-bottom: 0;
}

.grid.hero:has(.home-observation) > .c1-8,
header.ds-hero:has(.home-observation) .en-heroL {
  grid-area: 1 / 1;
  min-width: 0;
}

:is(.grid.hero, header.ds-hero):has(.home-observation) h1 {
  max-width: 15ch;
  margin: .18em 0 .32em;
  font-size: clamp(40px, 4.8vw, 74px);
  font-weight: 750;
  line-height: 1.12;
  color: var(--ds-ink);
  text-wrap: balance;
}

html[lang|="ko"] .grid.hero:has(.home-observation) h1 {
  max-width: 9.2em;
  line-height: 1.18;
  word-break: keep-all;
}

:is(.grid.hero, header.ds-hero):has(.home-observation) :is(.eyebrow, .ds-hero-kicker) {
  margin: 0 0 10px;
  color: var(--ds-accent-dk);
  font-weight: 700;
}

:is(.grid.hero, header.ds-hero):has(.home-observation) :is(.lede, .ds-hero-lead) {
  max-width: var(--ds-measure);
  margin-block: 0 18px;
  color: var(--ds-sub);
  font-size: var(--ds-t5);
}

:is(.grid.hero, header.ds-hero):has(.home-observation) .answer-capsule {
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

#main .editorial-offer-note {
  max-width: var(--ds-measure);
  margin-block: 16px 26px;
}

#main .editorial-offer-note .sub,
#main .editorial-method-note .acs {
  margin: 8px 0;
  color: var(--ds-sub);
  font-size: var(--ds-t7);
  line-height: 1.6;
}

#main .editorial-offer-note .ctaproof {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.grid.hero:has(.home-observation) .ctarow,
header.ds-hero:has(.home-observation) .ds-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin: 16px 0;
}

.grid.hero:has(.home-observation) .ctaproof {
  flex-basis: 100%;
  order: 1;
}

.grid.hero:has(.home-observation) .sub {
  margin-block: 8px 0;
  color: var(--ds-sub);
}

.grid.hero:has(.home-observation) > .heroside,
header.ds-hero:has(.home-observation) > .wrap > .herofacts,
header.ds-hero:has(.home-observation) > .wrap > .us-proof,
header.ds-hero:has(.home-observation) > .wrap > .jahero-proof {
  grid-column: 1 / -1;
  grid-row: auto;
  max-width: none;
  width: auto;
  margin: 0;
  padding: 0;
}

header.ds-hero:has(.home-observation) > .wrap > .us-proof.herocard {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: start;
  gap: 8px 16px;
  padding-top: 12px;
  border: 0;
  border-top: 1px solid var(--ds-line);
  background: transparent;
  box-shadow: none;
}

header.ds-hero:has(.home-observation) .us-proof.herocard > span {
  flex: 0 1 auto;
}

:is(.grid.hero, header.ds-hero):has(.home-observation) .herofacts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--ds-line);
  border-bottom: 1px solid var(--ds-line);
}

:is(.grid.hero, header.ds-hero):has(.home-observation) .herofacts .ds-stat {
  display: block;
  margin: 0;
  padding: 15px clamp(10px, 1.7vw, 25px);
  border: 0;
  border-inline-start: 1px solid var(--ds-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

:is(.grid.hero, header.ds-hero):has(.home-observation) .herofacts .ds-stat:first-child {
  border-inline-start: 0;
  padding-inline-start: 0;
}

:is(.grid.hero, header.ds-hero):has(.home-observation) .herofacts .hf-v {
  display: block;
  min-width: 0;
  margin: 0 0 2px;
  color: var(--ds-accent-dk);
  font-size: clamp(25px, 2.4vw, 38px);
  font-variant-numeric: tabular-nums;
  line-height: 1.16;
}

:is(.grid.hero, header.ds-hero):has(.home-observation) .herofacts .hf-l {
  display: block;
  color: var(--ds-sub);
  font-size: var(--ds-t7);
  line-height: 1.45;
}

/* The Japanese hero keeps its source note and sample report in reading order. */
html[lang|="ja"] header.ds-hero:has(.home-observation) > .wrap {
  row-gap: 12px;
}

html[lang|="ja"] header.ds-hero:has(.home-observation) > .wrap > :is(.ja-herocol, h1, .editorial-ja-lead, .ds-hero-actions) {
  grid-column: 1;
  grid-row: auto;
  align-self: start;
}

html[lang|="ja"] header.ds-hero:has(.home-observation) > .wrap > .ja-herocol {
  align-self: end;
}

html[lang|="ja"] header.ds-hero:has(.home-observation) .jahero-proof {
  margin-top: 12px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

html[lang|="ja"] header.ds-hero:has(.home-observation) > .wrap > .herofoot {
  grid-column: 1 / -1;
}

#main .editorial-service-index {
  display: grid;
  grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr);
  align-items: start;
  gap: clamp(20px, 5vw, 80px);
  max-width: 1320px;
  margin: 0 auto;
  padding-block: clamp(34px, 5vw, 76px);
  border: 0;
}

#main > .editorial-service-index {
  padding-inline: clamp(20px, 4.4vw, 72px);
}

#main .editorial-service-index h2 {
  margin: 0;
  color: var(--ds-ink);
  font-size: clamp(26px, 3vw, 46px);
  font-weight: 700;
  line-height: 1.24;
  text-wrap: balance;
}

#main .editorial-service-index ul {
  display: grid;
  max-width: none;
  padding: 0;
  margin: 0;
  list-style: none;
  border-top: 2px solid var(--ds-accent);
}

#main .editorial-service-index li {
  padding: 0;
  margin: 0;
  border-bottom: 1px solid var(--ds-line);
}

#main .editorial-service-index a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 16px;
  padding: 17px 4px;
  color: var(--ds-ink);
  text-decoration: none;
}

#main .editorial-service-index a strong {
  font-weight: 700;
  font-size: clamp(20px, 1.8vw, 28px);
  line-height: 1.25;
}

#main .editorial-service-index a span {
  grid-column: 1;
  color: var(--ds-sub);
  font-size: var(--ds-t7);
  line-height: 1.5;
}

#main .editorial-service-index a i {
  grid-area: 1 / 2 / span 2;
  color: var(--ds-accent);
  font-size: 1.35em;
  font-style: normal;
}

#main .editorial-service-index a:is(:hover, :focus-visible) strong {
  color: var(--ds-accent-dk);
  text-decoration: underline;
  text-underline-offset: .14em;
}

#main .editorial-service-index a:focus-visible {
  outline: 2px solid var(--ds-accent);
  outline-offset: 2px;
}

#main:has(.editorial-service-index) :is(#problem, #fullstack, #analysis, #verify, #pricing, #faq, #close) {
  padding-block: clamp(36px, 5vw, 74px);
  border-top: 1px solid var(--ds-line);
}

#main:has(.editorial-service-index) header.act :is(.ach, h2) {
  color: var(--ds-ink);
  text-wrap: balance;
}

#main:has(.editorial-service-index) header.act .acl {
  display: block;
  color: var(--ds-accent-dk);
  font-size: var(--ds-t7);
  font-weight: 700;
  margin-bottom: 7px;
}

#main:has(.editorial-service-index) header.act > .acn,
#main:has(.editorial-service-index) .formsec .kick .kn {
  display: none;
}

#main:has(.editorial-service-index) :is(#problem, #verify) .ds-statgrid,
#main:has(.editorial-service-index) #fullstack .capbase {
  border-top: 1px solid var(--ds-line);
  border-bottom: 1px solid var(--ds-line);
  gap: 0;
}

#main:has(.editorial-service-index) :is(#problem .ds-stat, #fullstack .capbase .cd, #faq .cards .cd) {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: clamp(12px, 1.8vw, 25px);
}

#main:has(.editorial-service-index) :is(#problem .ds-stat, #fullstack .capbase .cd, #faq .cards .cd) + :is(.ds-stat, .cd) {
  border-inline-start: 1px solid var(--ds-line);
}

#main:has(.editorial-service-index) :is(#pricing .tablewrap, #verify .stats, #faq .fx-tab) {
  border-radius: 0;
  box-shadow: none;
}

#main .editorial-story-image {
  width: 100%;
  max-width: 1000px;
  margin: clamp(20px, 3vw, 42px) 0;
}

#main .editorial-story-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2.5 / 1;
  object-fit: cover;
}

#main .editorial-story-image figcaption {
  padding-block: 10px;
  color: var(--ds-sub);
  font-size: var(--ds-t7);
}

#main:has(.editorial-service-index) .ja-duo:not(:has(figure)) {
  display: block;
}

@media (max-width: 720px) {
  html:not(.curtain) #mast > .mwrap,
  html:not(.curtain):has(.home-observation) .topnav > .wrap {
    display: grid;
    align-items: center;
    grid-template-columns: minmax(0, 1fr) auto 44px;
    gap: 0 clamp(4px, 1.5vw, 10px);
    min-height: 58px;
    padding: 4px clamp(8px, 3vw, 20px);
    box-sizing: border-box;
  }

  html:not(.curtain):has(.home-observation) .topnav > .wrap {
    grid-template-columns: minmax(0, 1fr) auto 44px 44px;
  }

  #mast > .mwrap > .brand,
  html:has(.home-observation) .topnav > .wrap > .logo {
    grid-area: 1 / 1;
    min-width: 0;
    justify-self: start;
  }

  #mast > .mwrap > .brand svg {
    max-width: 100%;
  }

  #mast > .mwrap > .langswitch,
  html:has(.home-observation) .topnav > .wrap > .langswitch {
    display: inline-flex;
    grid-area: 1 / 2;
    gap: 0;
    margin: 0;
    padding: 1px;
  }

  #mast > .mwrap > .langswitch > a,
  html:has(.home-observation) .topnav > .wrap > .langswitch > a {
    min-width: 44px;
    min-height: 44px;
    padding-inline: 3px;
  }

  html:has(.home-observation) .topnav > .wrap > .navme {
    grid-area: 1 / 3;
  }

  #mast > .mwrap > .navburger,
  html:has(.home-observation) .topnav > .wrap > .navburger {
    grid-row: 1;
    grid-column: -2 / -1;
    margin: 0;
    border-color: var(--ds-line);
    color: var(--ds-ink);
  }

  #mast > .mwrap > .navburger i,
  html:has(.home-observation) .topnav > .wrap > .navburger i {
    background: currentColor;
  }

  #mast > .mwrap > .mnav,
  html:has(.home-observation) .topnav > .wrap > .navlinks {
    grid-row: 2;
    grid-column: 1 / -1;
  }
}

/* The same market links are in the menu sheet. Give the wordmark its full width. */
@media (max-width: 380px) {
  html:not(.curtain):has(.home-observation) .topnav > .wrap {
    grid-template-columns: minmax(0, 1fr) 44px 44px;
  }
  html:has(.home-observation) .topnav > .wrap > .langswitch { display: none; }
  html:has(.home-observation) .topnav > .wrap > .navme { grid-column: 2; }
}

@media (max-width: 780px) {
  .grid.hero:has(> .home-observation),
  header.ds-hero:has(.home-observation) > .wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    padding-top: 26px;
  }

  #main .editorial-story-image img {
    aspect-ratio: 3 / 2;
  }

  html[lang|="ja"] header.ds-hero:has(.home-observation) > .wrap > .ja-herocol {
    align-self: start;
  }

  :is(.grid.hero, header.ds-hero):has(.home-observation) .herofacts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  :is(.grid.hero, header.ds-hero):has(.home-observation) .herofacts .ds-stat:nth-child(odd) {
    border-inline-start: 0;
    padding-inline-start: 0;
  }

  :is(.grid.hero, header.ds-hero):has(.home-observation) .herofacts .ds-stat:nth-child(n+3) {
    border-block-start: 1px solid var(--ds-line);
  }

  #main .editorial-service-index {
    grid-template-columns: minmax(0, 1fr);
  }

  #main:has(.editorial-service-index) :is(#problem .ds-stat, #fullstack .capbase .cd, #faq .cards .cd) + :is(.ds-stat, .cd) {
    border-inline-start: 0;
    border-block-start: 1px solid var(--ds-line);
  }
}
