/* Shared language control for the static public pages. */
.wyt-language {
  position: relative;
  flex: 0 0 auto;
  margin: 0;
  color: var(--white, #f5f8fb);
  font: inherit;
  z-index: 2;
}

.wyt-language > summary {
  box-sizing: border-box;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  min-width: 0;
  min-height: 38px;
  padding: .38rem .65rem;
  border-radius: .5rem;
  border: 1px solid var(--border, #405062);
  background: var(--bg2, #131c27);
  color: inherit;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}

.wyt-language > summary::-webkit-details-marker {
  display: none;
}

.wyt-language > summary::after {
  content: "";
  display: inline-block;
  width: .39rem;
  height: .39rem;
  flex: 0 0 .39rem;
  margin-top: -.2rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.wyt-language[open] > summary::after {
  margin-top: .2rem;
  transform: rotate(225deg);
}

.wyt-language-options {
  position: absolute;
  inset: calc(100% + .3rem) 0 auto auto;
  min-width: 10.2rem;
  max-width: calc(100vw - 24px);
  padding: .25rem;
  background: var(--bg2, #131c27);
  border: 1px solid var(--border, #405062);
  border-radius: .6rem;
  box-shadow: 0 12px 22px #0005;
}

.wyt-language:not([open]) > .wyt-language-options {
  display: none;
}

.wyt-language[open] .wyt-language-options a {
  box-sizing: border-box;
  display: block;
  min-height: 36px;
  padding: .56rem .65rem;
  border-radius: .4rem;
  color: inherit;
  font-size: .83rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
}

.wyt-language-options a:hover,
.wyt-language-options a[aria-current="page"] {
  background: var(--line, #80dda2);
  color: #10221b;
}

.wyt-language summary:focus-visible,
.wyt-language-options a:focus-visible {
  outline: 2px solid var(--line, #80dda2);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .wyt-language > summary {
    min-height: 34px;
    padding-inline: .45rem;
  }
  .wyt-language > summary[data-compact] {
    gap: .35rem;
  }
  .wyt-language > summary[data-compact] > span {
    display: none;
  }
  .wyt-language > summary[data-compact]::before {
    content: attr(data-compact);
  }
}


[data-wyt-legacy-language][hidden] { display: none !important; }

.wyt-language-options {
  transform: translateX(var(--wyt-menu-shift, 0px));
}

.wyt-language .wyt-language-options a[aria-current="page"],
.wyt-language .wyt-language-options a:hover {
  color: #10221b;
}

.card-site-header {
  position: relative;
  z-index: 20;
}

html[data-wyt-static-locale]:not([data-wyt-static-locale="zh"]) #hero h1 {
  font-size: clamp(2.05rem, 4.4vw, 4.15rem);
  line-height: 1.13;
  word-break: normal;
  overflow-wrap: anywhere;
}

@media (min-width: 1281px) {
  html[data-wyt-static-locale]:not([data-wyt-static-locale="zh"]) nav .nav-links {
    gap: clamp(.4rem, .68vw, .75rem) !important;
  }
}

@media (max-width: 600px) {
  html[data-wyt-static-locale]:not([data-wyt-static-locale="zh"]) #hero h1 {
    font-size: clamp(1.85rem, 7.3vw, 2.6rem);
  }
}


html[data-wyt-static-locale]:not([data-wyt-static-locale="zh"]) #hero .hero-desc {
  color: var(--white, #eef4fb);
  opacity: .77;
}

/* The existing theme control remains functional until the pull-cord menu mounts. */
[data-wyt-theme-legacy][hidden] {
  display: none !important;
}

.wyt-theme {
  position: relative;
  flex: 0 0 auto;
  margin: 0;
  z-index: 3;
  color: #f3f7f5;
}

.wyt-theme > summary {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  list-style: none;
  inline-size: 38px;
  block-size: 38px;
  border: 1px solid #5e746b;
  border-radius: .5rem;
  background: #18241f;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}

.wyt-theme > summary::-webkit-details-marker {
  display: none;
}

.wyt-theme-cord {
  position: relative;
  display: block;
  inline-size: 2px;
  block-size: 15px;
  margin-block-start: -6px;
  border-radius: 1px;
  background: #a1bcaf;
  transition: transform .16s ease;
  pointer-events: none;
}

.wyt-theme-cord::after {
  content: "";
  position: absolute;
  inset: auto auto -5px 50%;
  transform: translateX(-50%);
  inline-size: 10px;
  block-size: 10px;
  border-radius: 50%;
  border: 1px solid #b7d7c7;
  background: #a1bcaf;
}

.wyt-theme > summary:active .wyt-theme-cord,
.wyt-theme[open] .wyt-theme-cord {
  transform: translateY(3px);
}

.wyt-theme-options {
  position: absolute;
  inset: calc(100% + .35rem) 0 auto auto;
  min-inline-size: 10.4rem;
  max-inline-size: calc(100vw - 16px);
  padding: .25rem;
  border: 1px solid #5e746b;
  border-radius: .6rem;
  background: #18241f;
  box-shadow: 0 .6rem 1.35rem #0005;
  transform: translateX(var(--wyt-menu-shift, 0px));
}

.wyt-theme:not([open]) > .wyt-theme-options {
  display: none;
}

.wyt-theme .wyt-theme-options button {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  width: 100%;
  min-height: 38px;
  padding: .52rem .6rem;
  border: 0;
  border-radius: .36rem;
  background: transparent;
  color: inherit;
  font: 600 .83rem/1.3 system-ui, sans-serif;
  text-align: start;
  cursor: pointer;
}

.wyt-theme .wyt-theme-options button[aria-pressed="true"] {
  background: #295740;
  color: #fff;
}

.wyt-theme-options button[aria-pressed="true"]::after {
  content: "";
  inline-size: .36rem;
  block-size: .66rem;
  margin-inline-end: .18rem;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  flex: 0 0 auto;
}

.wyt-theme summary:focus-visible,
.wyt-theme-options button:focus-visible {
  outline: 2px solid #43b979;
  outline-offset: 2px;
}

html.light .wyt-theme {
  color: #1a3228;
}

html.light .wyt-theme > summary,
html.light .wyt-theme-options {
  background: #f8fbf8;
  border-color: #8fac9b;
}

html.light .wyt-theme-cord {
  background: #8b6030;
}

html.light .wyt-theme-cord::after {
  background: #e6ab48;
  border-color: #986b2a;
  box-shadow: 0 0 0 3px #e6ab4833;
}

html.light .wyt-theme .wyt-theme-options button[aria-pressed="true"] {
  background: #ccecd7;
  color: #123621;
}

@media (max-width: 600px) {
  .wyt-theme > summary {
    inline-size: 34px;
    block-size: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wyt-theme-cord {
    transition: none;
  }
}
