@import url('./ares-tokens.css');

:root {
  --ares-v4-header-height: 64px;
  --ares-v4-ticker-height: 34px;
  --ares-v4-footer-max: 90rem;
}

html.ares-shell-v4-open,
html.ares-shell-v4-open body {
  overflow: hidden;
}

.ares-v4-shell-header {
  position: sticky;
  top: 0;
  z-index: 500;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(14rem, 20rem) auto auto;
  align-items: center;
  gap: 1rem;
  min-height: var(--ares-v4-header-height);
  padding: 0.55rem 1.35rem;
  color: var(--ares-color-text);
  background: rgba(7, 16, 31, 0.97);
  border-bottom: 0.5px solid var(--ares-color-gold-border);
  box-shadow: none;
  backdrop-filter: blur(16px);
}

.ares-v4-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-width: max-content;
}

.ares-v4-brand img {
  width: 2.35rem;
  height: 2.35rem;
  object-fit: contain;
}

.ares-v4-brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ares-v4-brand-name {
  color: var(--ares-color-gold-bright);
  font-family: var(--ares-font-display);
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1;
}

.ares-v4-brand-subtitle {
  margin-top: 0.18rem;
  color: var(--ares-color-text-muted);
  font-family: var(--ares-font-mono);
  font-size: 0.5rem;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}

.ares-v4-primary-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  min-width: 0;
}

.ares-v4-nav-link,
.ares-v4-menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.34rem;
  min-height: 2.2rem;
  padding: 0.42rem 0.57rem;
  color: var(--ares-color-text-muted);
  background: transparent;
  border: 0;
  border-radius: var(--ares-radius-button);
  font-family: var(--ares-font-mono);
  font-size: 0.56rem;
  font-weight: 500;
  letter-spacing: 0.065em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}

.ares-v4-nav-link:hover,
.ares-v4-nav-link:focus-visible,
.ares-v4-nav-link[aria-current='page'],
.ares-v4-nav-menu.is-active > .ares-v4-menu-button,
.ares-v4-nav-menu.is-open > .ares-v4-menu-button,
.ares-v4-menu-button:hover,
.ares-v4-menu-button:focus-visible {
  color: var(--ares-color-gold-bright);
  background: var(--ares-color-gold-soft);
}

.ares-v4-nav-menu {
  position: relative;
}

.ares-v4-menu-caret {
  color: var(--ares-color-text-dim);
  font-size: 0.58rem;
  transform: translateY(-0.04rem);
}

.ares-v4-nav-menu.is-open .ares-v4-menu-caret {
  color: var(--ares-color-gold-bright);
  transform: rotate(180deg);
}

.ares-v4-menu-panel {
  position: fixed;
  top: calc(var(--ares-v4-header-height) - 1px);
  right: 1.25rem;
  left: 1.25rem;
  z-index: 520;
  display: none;
  grid-template-columns: minmax(14rem, 0.28fr) minmax(0, 1fr);
  gap: 1rem;
  max-width: calc(var(--ares-shell-max) - 2.5rem);
  max-height: min(74vh, 42rem);
  margin-inline: auto;
  padding: 1rem;
  overflow: auto;
  color: var(--ares-color-text);
  background: var(--ares-color-surface-2);
  border: 0.5px solid var(--ares-color-gold-border);
  border-top: 0;
  border-radius: 0 0 var(--ares-radius-card) var(--ares-radius-card);
  box-shadow: var(--ares-shadow-card);
}

.ares-v4-nav-menu.is-open .ares-v4-menu-panel {
  display: grid;
}

.ares-v4-menu-summary {
  display: grid;
  align-content: start;
  gap: 0.72rem;
  min-width: 0;
  padding: 0.95rem;
  background: var(--ares-color-surface-1);
  border: 0.5px solid var(--ares-border-subtle);
  border-radius: var(--ares-radius-panel);
}

.ares-v4-menu-summary strong {
  color: var(--ares-color-text);
  font-family: var(--ares-font-display);
  font-size: 1rem;
}

.ares-v4-menu-summary p {
  margin: 0;
  color: var(--ares-color-text-muted);
  font-size: 0.73rem;
  line-height: 1.55;
}

.ares-v4-menu-shortcuts,
.ares-v4-menu-group-links {
  display: grid;
  gap: 0.18rem;
}

.ares-v4-menu-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  min-width: 0;
}

.ares-v4-menu-group {
  min-width: 0;
}

.ares-v4-menu-group h3 {
  margin: 0 0 0.48rem;
  color: var(--ares-color-text-muted);
  font-family: var(--ares-font-mono);
  font-size: 0.56rem;
  font-weight: 500;
  letter-spacing: 0.085em;
  text-transform: uppercase;
}

.ares-v4-menu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  min-height: 2.25rem;
  padding: 0.42rem 0.5rem;
  color: var(--ares-color-text);
  background: transparent;
  border-radius: var(--ares-radius-button);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.25;
}

.ares-v4-menu-link::after {
  flex: 0 0 auto;
  color: var(--ares-color-text-dim);
  content: '→';
  font-family: var(--ares-font-mono);
  font-size: 0.65rem;
}

.ares-v4-menu-link:hover,
.ares-v4-menu-link:focus-visible,
.ares-v4-menu-link[aria-current='page'] {
  color: var(--ares-color-gold-bright);
  background: var(--ares-color-gold-soft);
}

.ares-v4-menu-link:hover::after,
.ares-v4-menu-link:focus-visible::after,
.ares-v4-menu-link[aria-current='page']::after {
  color: var(--ares-color-gold-bright);
}

.ares-v4-menu-footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.1rem;
  margin: 0 -1rem -1rem;
  padding: 0.82rem 1rem;
  color: var(--ares-color-gold-bright);
  background: var(--ares-color-surface-1);
  border-top: 0.5px solid var(--ares-color-gold-border);
  font-family: var(--ares-font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
}

.ares-v4-menu-footer::after {
  content: '→';
}

.ares-v4-search {
  position: relative;
  min-width: 0;
}

.ares-v4-search label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.ares-v4-search input {
  width: 100%;
  min-height: 2.38rem;
  padding: 0.52rem 2.45rem 0.52rem 0.78rem;
  color: var(--ares-color-text);
  background: var(--ares-color-surface-2);
  border: 0.5px solid var(--ares-color-gold-border);
  border-radius: 0.44rem;
  outline: 0;
  font-family: var(--ares-font-mono);
  font-size: 0.62rem;
}

.ares-v4-search input::placeholder {
  color: var(--ares-color-text-muted);
}

.ares-v4-search-submit {
  position: absolute;
  top: 50%;
  right: 0.36rem;
  display: inline-grid;
  place-items: center;
  width: 1.82rem;
  height: 1.82rem;
  padding: 0;
  color: var(--ares-color-gold-bright);
  background: var(--ares-color-gold-soft);
  border: 0.5px solid var(--ares-color-gold-border);
  border-radius: 0.32rem;
  transform: translateY(-50%);
  cursor: pointer;
}

.ares-v4-search-results {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  left: 0;
  z-index: 550;
  display: none;
  max-height: 23rem;
  overflow: auto;
  color: var(--ares-color-text);
  background: var(--ares-color-surface-2);
  border: 0.5px solid var(--ares-color-gold-border);
  border-radius: var(--ares-radius-panel);
  box-shadow: var(--ares-shadow-card);
}

.ares-v4-search-results:not(:empty) {
  display: block;
}

.ares-v4-header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  padding: 0.52rem 0.78rem;
  color: var(--ares-color-gold-bright);
  background: var(--ares-color-gold-soft);
  border: 0.5px solid var(--ares-color-gold-border);
  border-radius: var(--ares-radius-button);
  font-family: var(--ares-font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ares-v4-menu-toggle {
  display: none;
  width: 2.38rem;
  height: 2.38rem;
  padding: 0;
  color: var(--ares-color-gold-bright);
  background: var(--ares-color-surface-2);
  border: 0.5px solid var(--ares-border-strong);
  border-radius: var(--ares-radius-button);
  font-family: var(--ares-font-mono);
  font-size: 0.56rem;
  cursor: pointer;
}

.ares-v4-ticker {
  position: relative;
  z-index: 300;
  display: flex;
  align-items: stretch;
  min-height: var(--ares-v4-ticker-height);
  overflow-x: auto;
  color: var(--ares-color-text-muted);
  background: var(--ares-color-surface-1);
  border-bottom: 0.5px solid var(--ares-border-subtle);
  scrollbar-width: none;
}

.ares-v4-ticker::-webkit-scrollbar {
  display: none;
}

.ares-v4-ticker-link,
.ares-v4-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
  min-height: var(--ares-v4-ticker-height);
  padding: 0.45rem 0.92rem;
  border-right: 0.5px solid var(--ares-border-subtle);
  font-family: var(--ares-font-mono);
  font-size: 0.56rem;
  white-space: nowrap;
}

.ares-v4-ticker-label {
  color: var(--ares-color-text);
}

.ares-v4-tone-gold .ares-v4-ticker-value {
  color: var(--ares-color-gold-bright);
}

.ares-v4-tone-positive .ares-v4-ticker-value {
  color: var(--ares-color-positive);
}

.ares-v4-tone-negative .ares-v4-ticker-value {
  color: var(--ares-color-negative);
}

.ares-v4-tone-confidence .ares-v4-ticker-value {
  color: var(--ares-color-confidence);
}

.ares-v4-tone-neutral .ares-v4-ticker-value {
  color: var(--ares-color-text-muted);
}

.ares-v4-footer {
  color: var(--ares-color-text);
  background: var(--ares-color-bg);
  border-top: 0.5px solid var(--ares-color-gold-border);
}

.ares-v4-footer-inner {
  display: grid;
  grid-template-columns: minmax(16rem, 1.35fr) repeat(3, minmax(9rem, 0.65fr));
  gap: 2rem;
  width: min(100%, var(--ares-v4-footer-max));
  margin-inline: auto;
  padding: 2rem 1.4rem 1.35rem;
}

.ares-v4-footer-brand {
  min-width: 0;
}

.ares-v4-footer-wordmark {
  color: var(--ares-color-gold-bright);
  font-family: var(--ares-font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.ares-v4-footer-statement {
  max-width: 40rem;
  margin: 0.72rem 0 0;
  color: var(--ares-color-text-muted);
  font-size: 0.7rem;
  line-height: 1.65;
}

.ares-v4-dataset-state {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  margin-top: 0.9rem;
  padding: 0.34rem 0.52rem;
  color: var(--ares-color-confidence);
  background: var(--ares-color-confidence-soft);
  border: 0.5px solid rgba(90, 167, 223, 0.28);
  border-radius: var(--ares-radius-tag);
  font-family: var(--ares-font-mono);
  font-size: 0.56rem;
}

.ares-v4-dataset-state::before {
  width: 0.38rem;
  height: 0.38rem;
  background: currentColor;
  border-radius: 50%;
  content: '';
}

.ares-v4-footer-group h2 {
  margin: 0 0 0.62rem;
  color: var(--ares-color-text-muted);
  font-family: var(--ares-font-mono);
  font-size: 0.56rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.ares-v4-footer-links {
  display: grid;
  gap: 0.2rem;
}

.ares-v4-footer-link {
  display: inline-flex;
  width: fit-content;
  padding: 0.2rem 0;
  color: var(--ares-color-text-muted);
  font-size: 0.67rem;
}

.ares-v4-footer-link:hover,
.ares-v4-footer-link:focus-visible,
.ares-v4-footer-link[aria-current='page'] {
  color: var(--ares-color-gold-bright);
}

.ares-v4-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100%, var(--ares-v4-footer-max));
  margin-inline: auto;
  padding: 0.9rem 1.4rem 1.2rem;
  color: var(--ares-color-text-dim);
  border-top: 0.5px solid var(--ares-border-subtle);
  font-family: var(--ares-font-mono);
  font-size: 0.54rem;
}

.ares-v4-footer-bottom a {
  color: var(--ares-color-text-muted);
}

.ares-v4-footer-bottom a:hover,
.ares-v4-footer-bottom a:focus-visible {
  color: var(--ares-color-gold-bright);
}

.ares-v4-backdrop {
  position: fixed;
  inset: 0;
  z-index: 490;
  display: none;
  background: rgba(1, 6, 15, 0.68);
  backdrop-filter: blur(2px);
}

.ares-v4-backdrop.is-visible {
  display: block;
}

@media (max-width: 82rem) {
  .ares-v4-shell-header {
    grid-template-columns: auto minmax(0, 1fr) minmax(12rem, 16rem) auto;
  }

  .ares-v4-header-cta {
    display: none;
  }

  .ares-v4-nav-link,
  .ares-v4-menu-button {
    padding-inline: 0.46rem;
    font-size: 0.53rem;
  }
}

@media (max-width: 68rem) {
  .ares-v4-shell-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding-inline: 1rem;
  }

  .ares-v4-primary-nav,
  .ares-v4-search {
    display: none;
  }

  .ares-v4-menu-toggle {
    display: inline-grid;
    place-items: center;
  }

  .ares-v4-shell-header.is-mobile-open {
    align-items: start;
  }

  .ares-v4-shell-header.is-mobile-open .ares-v4-primary-nav {
    position: fixed;
    top: var(--ares-v4-header-height);
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 510;
    display: block;
    padding: 0.75rem 1rem 5rem;
    overflow: auto;
    background: rgba(7, 16, 31, 0.99);
    border-top: 0.5px solid var(--ares-color-gold-border);
  }

  .ares-v4-shell-header.is-mobile-open .ares-v4-nav-link,
  .ares-v4-shell-header.is-mobile-open .ares-v4-menu-button {
    width: 100%;
    min-height: 2.8rem;
    justify-content: space-between;
    padding: 0.7rem 0.75rem;
    font-size: 0.65rem;
  }

  .ares-v4-shell-header.is-mobile-open .ares-v4-nav-menu {
    width: 100%;
  }

  .ares-v4-menu-panel {
    position: static;
    grid-template-columns: 1fr;
    max-height: none;
    margin: 0.25rem 0 0.65rem;
    padding: 0.7rem;
    border: 0.5px solid var(--ares-border-subtle);
    border-radius: var(--ares-radius-panel);
    box-shadow: none;
  }

  .ares-v4-menu-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ares-v4-menu-footer {
    margin: 0.2rem -0.7rem -0.7rem;
  }

  .ares-v4-footer-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ares-v4-footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 42rem) {
  .ares-v4-shell-header {
    padding: 0.5rem 0.75rem;
  }

  .ares-v4-brand img {
    width: 2.1rem;
    height: 2.1rem;
  }

  .ares-v4-brand-name {
    font-size: 0.86rem;
  }

  .ares-v4-menu-groups,
  .ares-v4-footer-inner {
    grid-template-columns: 1fr;
  }

  .ares-v4-footer-brand {
    grid-column: auto;
  }

  .ares-v4-footer-bottom {
    align-items: flex-start;
    flex-direction: column;
  }
}
