:root {
  color-scheme: dark;
  --background: #17191c;
  --foreground: #f6f2ec;
  --muted: #b9babd;
  --pill-stroke: #e8edf080;
  --focus: #ffcf91;
  --art-top-shade: #090c11a0;
  --wide-backdrop: url("assets/nine-colored-deer.webp");
  --reveal-ease: cubic-bezier(0, 0, .3, 1);
  --gutter: clamp(16px, 7.3vw, 240px);
  --header-height: clamp(48px, 7.2dvh, 106px);
  --body-type: clamp(.81rem, min(.74vw, 2.9dvh), 1.38rem);
  --control-type: clamp(.72rem, min(.65vw, 3dvh), 1.05rem);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--background);
  color: var(--foreground);
}

*, *::before, *::after { box-sizing: border-box; }
body {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  min-height: 100dvh;
  margin: 0;
}

.codex-page {
  --focus: #ffd49d;
}

.macos-page {
  --focus: #b9dfff;
  --art-top-shade: #0b1420df;
  --wide-backdrop: url("assets/macos-workbench-fhd.webp");
}

.openahoy-page {
  --focus: #aee0d3;
  --wide-backdrop: url("assets/openahoy-dispatch-fhd.webp");
}

p, h1, h2, h3, dl, dd { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 5px; }

.pill {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid var(--pill-stroke);
  border-radius: 999px;
  background: transparent;
  box-shadow: 0 6px 20px #02040850;
  color: var(--foreground);
  text-decoration: none;
}

.pill:is(:focus-visible, :active, [aria-current="page"]) {
  border-color: var(--focus);
  color: var(--focus);
}

.skip-link {
  position: fixed;
  z-index: 3;
  inset: 12px auto auto 12px;
  transform: translateY(-180%);
  padding: 10px 14px;
  font-size: .8rem;
}

.skip-link:focus { transform: none; }

.shell {
  width: min(100% - var(--gutter) * 2, 3360px);
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--header-height);
}

.brand { display: inline-flex; align-items: center; min-height: 44px; }
.brand svg { display: block; width: clamp(67px, 4.5vw, 155px); height: auto; }
.brand .brand-symbol { width: clamp(22px, 1.3vw, 42px); }

.site-header nav {
  display: flex;
  align-items: center;
  gap: clamp(5px, .55vw, 16px);
  white-space: nowrap;
}

.site-header nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding-inline: clamp(8px, .86vw, 20px);
  font-size: clamp(.69rem, min(.62vw, 3dvh), .98rem);
  font-weight: 520;
  line-height: 1;
  text-align: center;
  border-color: #e9f9f97a;
  background: linear-gradient(154deg, #f0ffff1c, #09181c13 55%, #92d3d320);
  -webkit-backdrop-filter: blur(7px) saturate(1.55) contrast(1.08);
  backdrop-filter: blur(7px) saturate(1.55) contrast(1.08);
  box-shadow: inset 0 1px #ffffff58, inset 0 -1px #97dfdf55,
    inset 3px 0 10px #c5f4ff21, inset -3px 0 8px #f8dcd717, 0 5px 17px #06101460;
}

.site-header nav a::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(ellipse at 17% 0%, #ffffff55, transparent 46%),
    radial-gradient(ellipse at 91% 104%, #bcecff47, transparent 55%);
}

.site-header nav a:is(:hover, :focus-visible, [aria-current="page"]) {
  border-color: var(--focus);
  box-shadow: inset 0 1px #ffffff7b, inset 0 -1px #b9ffeb66,
    inset 0 0 16px #a1e6ec2b, 0 4px 17px #050e1270;
}

.hero {
  display: grid;
  align-items: center;
}

.hero-art {
  position: absolute;
  z-index: -1;
  inset: 0;
  isolation: isolate;
  overflow: clip;
  pointer-events: none;
}

.hero-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 66% 38%;
}

.hero-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #0a0c10b5, #0a0c1066 38%, transparent 70%),
    linear-gradient(180deg, var(--art-top-shade), transparent 19%, transparent 76%, #090c1180);
}

.codex-page .hero-art img { object-position: right center; }

.codex-page .hero-art::after {
  background: linear-gradient(90deg, #0a0c10a3, #0a0c1033 30%, transparent 48%),
    linear-gradient(180deg, var(--art-top-shade), transparent 15%, transparent 77%, #090c1170);
}

.home-art::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background: radial-gradient(circle, #c8d1cc40 1px, transparent 1.2px) 0 0 / 18px 18px;
  mask-image: linear-gradient(to right, transparent 2%, #000 15%, #000c 25%, #0005 42%, transparent 59%),
    linear-gradient(to bottom, transparent 2%, #000 25%, #000 63%, transparent 97%);
  mask-composite: intersect;
}

.hero-copy {
  position: relative;
  padding-block: clamp(24px, 6dvh, 140px);
}

.hero h1 {
  font-size: clamp(1.5rem, min(2.28vw, 8.4dvh), 4.8rem);
  font-weight: 710;
  line-height: 1.12;
  letter-spacing: .015em;
  text-wrap: balance;
}

.hero-copy p {
  max-width: 28em;
  margin-top: clamp(8px, 1.4dvh, 23px);
  font-size: var(--body-type);
  line-height: 1.52;
}

.product-hero h1 {
  max-width: 14em;
  font-size: clamp(1.48rem, min(2.16vw, 8.4dvh), 4.65rem);
  letter-spacing: -.035em;
}

.product-hero .hero-copy > p:not(.product-status) { max-width: min(57%, 28em); }

@media (aspect-ratio > 1/1) {
  .codex-page .hero-copy {
    --codex-copy-width: min(44vw, calc(100vw - 90.5dvh - var(--gutter) - 8px));
  }
  .codex-page .hero-copy > p:not(.product-status) { max-width: min(28em, var(--codex-copy-width)); }
  .codex-page .hero-actions { max-width: var(--codex-copy-width); }
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  min-height: 44px;
  margin-top: clamp(11px, 2.3dvh, 44px);
  padding: .6em 1.17em;
  font-size: var(--control-type);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(7px, .65vw, 18px);
  margin-top: clamp(11px, 2.3dvh, 44px);
}

.hero-actions .button { margin-top: 0; }

.download-feedback {
  position: fixed;
  z-index: 2;
  inset-inline-start: var(--gutter);
  inset-block-end: max(38px, 5dvh);
  max-width: min(26rem, 100% - var(--gutter) * 2);
  padding: .65rem .85rem;
  border: 1px solid var(--pill-stroke);
  border-radius: 12px;
  background: #101316f5;
  font-size: .8rem;
  line-height: 1.5;
}

.download-feedback a { color: var(--focus); }
.download-feedback a:not([hidden]) { display: block; margin-top: .3em; }
.button[aria-disabled="true"] { cursor: progress; }

@media (max-height: 580px) {
  .download-feedback {
    inset-block-start: calc(var(--header-height) + 8px);
    inset-block-end: auto;
  }
}

.hero-copy .product-status {
  margin-top: clamp(13px, 2.7dvh, 48px);
  color: var(--muted);
  font-size: clamp(.72rem, min(.66vw, 2.8dvh), 1.19rem);
}

.editions {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(8px, 1.1vw, 30px);
  width: fit-content;
  margin-top: clamp(18px, 3.3dvh, 62px);
}

.edition {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  column-gap: clamp(10px, 1.45vw, 44px);
  min-height: clamp(50px, 5.3dvh, 88px);
  padding: clamp(8px, 1dvh, 20px) clamp(13px, 1.15vw, 35px);
}

.edition-name {
  font-size: clamp(.76rem, min(.74vw, 3.25dvh), 1.34rem);
  line-height: 1.2;
  font-weight: 610;
}

.edition-status {
  grid-column: 1;
  margin-top: .32em;
  color: var(--muted);
  font-size: clamp(.69rem, min(.57vw, 2.7dvh), 1.07rem);
  line-height: 1.35;
}

.edition-arrow {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--muted);
  font-size: clamp(.75rem, min(.72vw, 3.25dvh), 1.28rem);
}

.edition:is(:focus-visible, :active) .edition-arrow { color: var(--focus); }

.platform-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px clamp(13px, 1.3vw, 26px);
  margin: clamp(9px, 1.3dvh, 20px) 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: clamp(.72rem, min(.65vw, 2.8dvh), 1.16rem);
}

.platform-list li { display: inline-flex; align-items: center; gap: 7px; }
.platform-list img { display: block; border-radius: 5px; object-fit: contain; }
.platform-list .wechat-mark { padding: 4px; background: #07c160; }
.platform-list .x-mark { padding: 4px; }

.capabilities {
  display: grid;
  gap: .53em;
  max-width: 32em;
  margin-top: clamp(12px, 2dvh, 38px);
  font-size: clamp(.77rem, min(.74vw, 3.1dvh), 1.4rem);
  line-height: 1.47;
}

.capabilities > div {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: .9em;
}

.capabilities dt { font-weight: 680; }
.capabilities dd { color: var(--muted); }

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-block: clamp(3px, .8dvh, 16px);
  color: var(--muted);
  font-size: clamp(.65rem, min(.55vw, 2.6dvh), 1.03rem);
  line-height: 1.25;
}

.language-menu { position: relative; flex-shrink: 0; }

.language-trigger,
.language-options button {
  min-height: 32px;
  padding: 3px clamp(9px, .65vw, 15px);
  font: inherit;
  cursor: pointer;
}

.language-trigger { display: flex; align-items: center; gap: .65em; list-style: none; }
.language-trigger::-webkit-details-marker { display: none; }

.language-chevron {
  width: .42em;
  height: .42em;
  border-block-start: 1px solid;
  border-inline-end: 1px solid;
  rotate: -45deg;
  translate: 0 .1em;
}

.language-menu[open] .language-trigger { border-color: var(--focus); color: var(--focus); }
.language-menu[open] .language-chevron { rotate: 135deg; translate: 0 -.1em; }
.language-menu:not([open]) .language-options { display: none; }

.language-options {
  position: absolute;
  z-index: 2;
  inset-inline-end: 0;
  inset-block-end: calc(100% + 7px);
  display: grid;
  gap: 4px;
  min-width: 8.8rem;
  padding: 6px;
  border: 1px solid var(--pill-stroke);
  border-radius: 12px;
  background: #101316f5;
  box-shadow: 0 8px 22px #02040870;
}

.language-options button { text-align: start; white-space: nowrap; }
.language-options button[aria-pressed="true"] { border-color: var(--focus); color: var(--focus); }
.language-menu :focus-visible { outline-offset: 1px; }

@media (max-height: 580px) and (min-aspect-ratio: 1/1) {
  .hero-copy { padding-block: clamp(8px, 3.5dvh, 24px); }
  .openahoy-page .hero-copy { padding-block: 4px; }
  .openahoy-page .product-status, .openahoy-page .capabilities { margin-top: 8px; }
  .openahoy-page .platform-list { margin-top: 6px; }
}

@media (max-aspect-ratio: 4/5) {
  :root { --gutter: clamp(16px, 5.4vw, 98px); }

  .hero { align-items: end; }
  .hero-art img { object-position: 57% top; }

  .hero-art::after {
    background: linear-gradient(180deg, var(--art-top-shade), transparent 15%, #0b0e1420 37%, #0b0e14af 65%, #090c11db);
  }

  .home-art::before {
    mask-image: linear-gradient(to right, transparent 4%, #000 15%, #0008 24%, transparent 43%),
      linear-gradient(to bottom, transparent 64%, #000 81%, transparent 96%);
  }

  .hero-copy {
    padding-top: clamp(22px, 8dvh, 160px);
    padding-bottom: clamp(12px, 4.3dvh, 72px);
  }

  .hero h1 { font-size: clamp(1.43rem, min(6.1vw, 7dvh), 4.1rem); }
  .hero-copy p { max-width: 24em; }
  .product-hero .hero-copy > p:not(.product-status) { max-width: 28em; }
  .product-hero h1 { max-width: 100%; }
}

@media (max-aspect-ratio: 1/1) {
  .codex-page .hero { align-items: end; }
  .codex-page .hero-art img { object-position: center 45%; }

  .codex-page .hero-art::after {
    background: linear-gradient(180deg, var(--art-top-shade), transparent 17%, transparent 56%, #090c11c2 75%, #090c11e0);
  }
}

@media (max-width: 680px) {
  :root { --gutter: clamp(14px, 4.7vw, 30px); }
  .site-header { column-gap: 8px; }
  .editions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .edition { column-gap: 6px; padding-inline: 12px; }
}

@media (max-width: 420px) {
  .brand svg { width: 56px; }
  .brand .brand-symbol { width: 21px; }
  .site-header nav { gap: 4px; }
  .site-header nav a { padding-inline: 7px; }
}

@media (max-height: 520px) and (max-aspect-ratio: 4/5) {
  .openahoy-page .hero-copy { padding-block: 12px; }
  .codex-page .hero-art { background: #0c0b0a; }
  .codex-page .hero-art img {
    width: 90%;
    height: 85%;
    margin-inline: auto;
    object-position: center 71%;
    mask-image: linear-gradient(#000 87%, transparent),
      linear-gradient(to right, transparent, #000 2%, #000 98%, transparent);
    mask-composite: intersect;
  }
  .codex-page .hero-copy { padding-bottom: 8px; }
  .codex-page .hero-copy > p { font-size: .77rem; }
  .codex-page .hero-actions { margin-top: 8px; }
}

@media (max-height: 520px) {
  [lang="en"] .openahoy-page .hero-copy { padding-block: 3px; }
  [lang="en"] .openahoy-page .hero-copy > p:not(.product-status) {
    max-width: min(100%, 36em);
    font-size: .78rem;
    line-height: 1.35;
  }
  [lang="en"] .openahoy-page :is(.product-status, .platform-list, .capabilities, .hero-actions) { margin-top: 5px; }
  [lang="en"] .openahoy-page .platform-list { gap: 6px 9px; font-size: .72rem; }
  [lang="en"] .openahoy-page .capabilities { gap: .35em; font-size: .74rem; line-height: 1.33; }
  [lang="en"] .openahoy-page .button { padding-inline: .85em; }
}

@media (min-aspect-ratio: 21/9) {
  .hero-art {
    background: linear-gradient(90deg, #13171c22, #0b0e11cb 65%),
      var(--wide-backdrop) left 45% / cover;
  }

  .codex-page .hero-art { background: radial-gradient(ellipse at 78% 48%, #201812, #10100f 65%); }

  .hero-art img {
    width: min(100%, 210dvh);
    margin-left: auto;
    object-position: 64% 15%;
    mask-image: linear-gradient(90deg, transparent, #000 50%);
  }
}

@media (hover: hover) {
  .brand:hover svg { filter: drop-shadow(0 0 7px color-mix(in srgb, var(--focus) 45%, transparent)); }

  .pill:hover {
    border-color: var(--focus);
    color: var(--focus);
    box-shadow: 0 7px 24px color-mix(in srgb, var(--focus) 18%, transparent);
  }

  .edition:hover .edition-arrow { color: var(--focus); }
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes reveal-text {
    from { opacity: 0; translate: 0 9px; }
    to { opacity: 1; translate: 0 0; }
  }

  @keyframes sweep-control {
    from { background-position: 100% 50%; }
    to { background-position: 0 50%; }
  }

  @keyframes reveal-language-menu {
    from { opacity: 0; translate: 0 5px; }
    to { opacity: 1; translate: 0 0; }
  }

  .language-menu[open] .language-options { animation: reveal-language-menu .16s var(--reveal-ease); }

  .hero-copy h1, .hero-copy > p, .capabilities, .edition, .hero-actions, .hero-copy > .button {
    animation: reveal-text .62s var(--reveal-ease) backwards;
  }

  .hero-copy h1 { animation-delay: .07s; }
  .hero-copy > p { animation-delay: .15s; }
  .hero-copy > .product-status { animation-delay: .22s; }
  .capabilities, .edition, .hero-actions, .hero-copy > .button { animation-delay: .23s; }
  .edition + .edition { animation-delay: .29s; }
  .hero-actions:focus-within, .pill:focus-visible { animation: none; }

  .brand svg { transition: filter .25s var(--reveal-ease); }

  .pill {
    transition: color .24s var(--reveal-ease), border-color .26s var(--reveal-ease),
      box-shadow .26s var(--reveal-ease), scale .18s var(--reveal-ease);
  }

  :is(.edition, .button):active { scale: .975; }
  .edition-arrow, .button [aria-hidden="true"] { transition: translate .28s var(--reveal-ease), color .24s var(--reveal-ease); }

  /* Keep the moving highlight on the rim so the pill remains hollow. */
  :is(.edition, .button)::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 1px;
    border-radius: inherit;
    background: linear-gradient(105deg, transparent 38%, var(--focus) 50%, transparent 62%) 0 / 250% 100%;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    pointer-events: none;
  }

  :is(.edition, .button):focus-visible::before { animation: sweep-control .67s var(--reveal-ease); }
  .edition:focus-visible .edition-arrow, .button:focus-visible [aria-hidden="true"] { translate: 3px -2px; }

  @media (hover: hover) {
    :is(.edition, .button):hover::before { animation: sweep-control .67s var(--reveal-ease); }
    .edition:hover .edition-arrow, .button:hover [aria-hidden="true"] { translate: 3px -2px; }
  }
}

/* Host registration details for the Jiusera subpath. */
.site-identity {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .18em .85em;
  min-width: 0;
}
.site-identity a { color: inherit; text-decoration: underline; text-underline-offset: .15em; }
