/* The studio site loads this stylesheet directly. Apps load it inside the shared header's shadow root. */

:host {
  display: block;
  position: sticky;
  top: 0;
  z-index: 30;
  color: #eef3f7;
  color-scheme: dark;
  font: 16px/1.6 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg-soft: #0d1826;
  --surface: #111f30;
  --surface-2: #17283b;
  --line: #26384a;
  --text: #eef3f7;
  --muted: #9eafbd;
  --accent: #f2a65a;
  --accent-soft: #ffd2a3;
}

.site-header, .site-header * {
  box-sizing: border-box;
}

.site-header a {
  color: inherit;
}

.site-header .header-inner {
  width: min(calc(100% - 40px), 1160px);
  margin-inline: auto;
}

@media (max-width: 600px) {
  .site-header .header-inner {
    width: min(calc(100% - 28px), 1160px);
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: rgba(8,17,29,.88);
  backdrop-filter: blur(18px);
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-weight: 850;
  letter-spacing: -.02em;
  white-space: nowrap;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: block;
  object-fit: contain;
}

.nav-cluster {
  display: flex;
  align-items: center;
  gap: 20px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.main-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: .92rem;
  font-weight: 650;
}

.main-nav a:hover {
  color: var(--text);
}

@media (max-width:860px) {
  .header-inner {
    align-items: flex-start;
    padding-block: 15px;
  }
  .nav-cluster {
    align-items: flex-end;
    flex-direction: column-reverse;
    gap: 8px;
  }
  .main-nav {
    gap: 13px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

@media (max-width:600px) {
  .brand span:last-child {
    display: none;
  }
  .main-nav a {
    font-size: .84rem;
  }
}

.site-header {
  max-width: 100%;
}

.header-inner, .nav-cluster, .main-nav {
  min-width: 0;
}

@media (max-width:600px) {
  .header-inner {
    gap: 12px;
  }
  .brand {
    flex: 0 0 auto;
  }
  .nav-cluster {
    flex: 1 1 auto;
    max-width: 100%;
    min-width: 0;
  }
  .main-nav {
    max-width: 100%;
    min-width: 0;
    gap: 10px;
  }
  .main-nav a {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}

.language-picker {
  position: relative;
  margin-left: 16px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}

.language-picker summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 58px;
  min-height: 44px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 800;
  letter-spacing: .04em;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: color .16s ease,background-color .16s ease,border-color .16s ease;
}

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

.language-picker summary:hover, .language-picker[open] summary {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface);
}

.language-picker summary:focus-visible, .language-menu a:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: 3px;
}

.language-picker-chevron {
  display: inline-block;
  font-size: .72rem;
  line-height: 1;
  transition: transform .16s ease;
}

.language-picker[open] .language-picker-chevron {
  transform: rotate(180deg);
}

.language-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 9px);
  right: 0;
  display: grid;
  min-width: 176px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 18px 45px rgba(0,0,0,.32);
}

.language-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 42px;
  padding: 0 11px;
  border-radius: 8px;
  color: var(--muted);
  font-size: .92rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.language-menu a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.language-menu a[aria-current=page] {
  color: var(--accent-soft);
  background: rgba(242,166,90,.08);
}

.language-menu-check {
  color: var(--accent);
  font-weight: 900;
}

@media (max-width:860px) {
  .language-picker {
    align-self: flex-end;
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }
  .language-menu {
    top: calc(100% + 7px);
  }
}

@media (prefers-reduced-motion:reduce) {
  .language-picker summary, .language-picker-chevron {
    transition: none;
  }
}

@media (max-width:600px) {
  .header-inner {
    align-items: center;
    padding-block: 10px;
    gap: 10px;
  }
  .brand {
    flex: 0 0 auto;
  }
  .brand-mark {
    width: 32px;
    height: 32px;
  }
  .nav-cluster {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
  }
  .main-nav {
    min-width: 0;
    max-width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: clamp(6px,2.2vw,10px);
  }
  .main-nav a {
    min-width: 0;
    white-space: nowrap;
    overflow-wrap: normal;
    font-size: clamp(.69rem,2.8vw,.8rem);
  }
  .language-picker {
    align-self: center;
    flex: 0 0 auto;
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }
  .language-picker summary {
    min-width: 50px;
    min-height: 40px;
    padding: 0 8px;
    gap: 5px;
    font-size: .8rem;
  }
}

@media (max-width:360px) {
  .header-inner {
    gap: 7px;
  }
  .nav-cluster {
    gap: 5px;
  }
  .main-nav {
    gap: 5px;
  }
  .main-nav a {
    font-size: .66rem;
  }
  .language-picker summary {
    min-width: 46px;
    padding-inline: 6px;
    font-size: .76rem;
  }
  .brand-mark {
    width: 30px;
    height: 30px;
  }
}

.work-menu {
  position: relative;
  color: var(--muted);
  font-size: .92rem;
  font-weight: 650;
}

.work-menu summary {
  cursor: pointer;
  white-space: nowrap;
}

.work-menu summary:hover, .work-menu[open] summary {
  color: var(--text);
}

.work-menu ul {
  position: absolute;
  right: 0;
  top: calc(100% + .5rem);
  z-index: 2;
  width: min(18rem, calc(100vw - 2rem));
  max-height: min(55vh, 24rem);
  overflow: auto;
  list-style: none;
  margin: 0;
  padding: .4rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
  box-shadow: 0 12px 30px #0006;
}

.main-nav .work-menu li a {
  display: block;
  padding: .45rem .65rem;
  border-radius: 7px;
  white-space: normal;
}

.main-nav .work-menu a:is(:hover, :focus-visible, [aria-current]) {
  background: var(--surface-2);
  color: var(--text);
}

.work-menu-group {
  border-top: 1px solid var(--line);
  margin-top: .25rem;
  padding-top: .25rem;
}

.work-menu-app {
  margin-inline-start: .65rem;
}

@media (max-width: 600px) {
  .work-menu {
    font-size: clamp(.69rem, 2.8vw, .8rem);
  }
  .work-menu ul {
    right: auto;
    left: max(-1rem, -4vw);
    width: min(15rem, 52vw);
  }
}

@media (max-width: 350px) {
  .work-menu {
    font-size: .66rem;
  }
}
