/* Shared fixed header — landing + converter app */

:root {
  --topbar-pad-y: 0.65rem;
  --topbar-item-h: 2.25rem;
  --topbar-height: calc(var(--topbar-pad-y) * 2 + var(--topbar-item-h));
}

html {
  scroll-padding-top: var(--topbar-height);
}

body:has(> .topbar) {
  padding-top: var(--topbar-height);
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(4, 5, 6, 0.82);
  backdrop-filter: blur(16px);
}

.topbar__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  max-width: min(92rem, calc(100vw - 3rem));
  margin: 0 auto;
  padding: var(--topbar-pad-y) clamp(1.25rem, 4vw, 2.5rem);
  box-sizing: border-box;
}

.topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--mono);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  flex-shrink: 0;
  color: inherit;
  text-decoration: none;
}

.topbar__nav {
  display: none;
  gap: 2rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
}

.topbar__nav a {
  color: inherit;
  text-decoration: none;
}

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

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

@media (min-width: 900px) {
  .topbar__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    column-gap: 1rem;
  }

  .topbar__brand {
    justify-self: start;
  }

  .topbar__nav {
    display: flex;
    justify-self: center;
    gap: clamp(1rem, 1.6vw, 2rem);
    font-size: clamp(0.82rem, 1.1vw, 0.92rem);
    white-space: nowrap;
  }

  .topbar__actions {
    justify-self: end;
    margin-left: 0;
    flex-shrink: 0;
  }
}

@media (min-width: 900px) and (max-width: 1040px) {
  .topbar__nav {
    gap: 0.85rem;
    font-size: 0.8rem;
  }

  .topbar .btn {
    padding: 0.55rem 0.9rem;
    font-size: 0.82rem;
  }

  .lang-switch__btn {
    min-width: 2.1rem;
    padding: 0 0.45rem;
    font-size: 0.8rem;
  }
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  box-sizing: border-box;
  height: var(--topbar-item-h);
  padding: 2px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.02);
}

.lang-switch__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  height: 100%;
  padding: 0 0.55rem;
  border: none;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.lang-switch__btn:hover:not(.lang-switch__btn--active) {
  color: var(--text);
}

.lang-switch__btn--active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px var(--border);
}

.topbar .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 1rem;
  border-radius: 10px;
  min-height: var(--topbar-item-h);
  box-sizing: border-box;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.2s, border-color 0.15s, background 0.15s;
}

.topbar .btn--primary {
  color: #040506;
  background: var(--brand-bright);
  box-shadow: 0 4px 24px var(--brand-glow);
}

.topbar .btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(61, 219, 132, 0.35);
}

.topbar .btn--ghost {
  color: var(--text);
  background: transparent;
  border: 1px solid var(--border-strong);
}

.topbar .btn--ghost:hover {
  border-color: rgba(61, 219, 132, 0.4);
  background: rgba(255, 255, 255, 0.03);
}

.topbar__actions .status-pill {
  height: var(--topbar-item-h);
  padding: 0 0.85rem;
  border-radius: 10px;
  font-size: 0.72rem;
  box-sizing: border-box;
}
