/*
 * Header extras: four crooked service stamps and the tiny laundrette radio.
 * This is an additive layer for the semantic markup in index.html. The
 * silhouettes stay painted, but the control geometry keeps its hit areas
 * usable when the header wraps on a phone.
 */

.site-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  grid-template-areas: 'brand nav extras actions';
  align-items: center;
  gap: 22px;
  height: auto;
  min-height: 112px;
  padding-block: 20px;
  transform: none;
}

.site-header > .brand {
  grid-area: brand;
  justify-self: start;
  justify-content: center;
  width: clamp(224px, 20vw, 286px);
  max-width: 100%;
  min-width: 0;
  min-height: 44px;
  transform: none;
}

/* The generated letters fill a wide strip inside the transparent source.
   Clip only the empty vertical margins; keep the painted wordmark intact. */
.site-header .brand-logo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4.7 / 1;
  object-fit: cover;
  object-position: 50% 55%;
}
.site-header > .main-nav {
  grid-area: nav;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 1.5vw, 24px);
  margin: 0;
  min-width: 0;
}
.site-header .main-nav > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.2;
  padding-block: 12px;
}
.site-header .main-nav > .header-link {
  min-width: 132px;
  padding-inline: 20px;
  margin-left: 4px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .35px;
  line-height: 1;
  color: var(--paper);
  transform: none;
}
.site-header .header-link::before {
  filter: grayscale(1) brightness(.37) drop-shadow(1px 2px 0 #a54b25);
  transform: rotate(-1.5deg);
}
.site-header .header-link:hover::before {
  transform: rotate(-.5deg);
}
.site-header .header-link:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}
.site-header .header-link::after { display: none; }
.site-header > .header-actions {
  grid-area: actions;
  position: relative;
  gap: 0;
  margin: 0;
  padding-left: 16px;
  z-index: 46;
}
.site-header > .header-actions::before {
  content: '';
  position: absolute;
  width: 2px;
  height: 26px;
  left: 0;
  top: calc(50% - 13px);
  background: var(--ink);
  opacity: .25;
  clip-path: var(--rag);
  transform: rotate(7deg);
}

/* Keep the orange raster backing and let only its torn edge lean. */
.site-header .language-toggle {
  gap: 6px;
  min-width: 98px;
  padding: 8px 12px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 400;
  transform: none;
}
.site-header .language-toggle::before {
  filter: none;
  transform: rotate(2deg);
}
.site-header .language-toggle:hover::before,
.site-header .language-toggle[aria-expanded='true']::before {
  transform: rotate(-1deg);
}
.site-header .language-toggle .language-globe {
  width: 22px;
  height: 22px;
}

.header-extras {
  grid-area: extras;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin: 0;
  min-width: 0;
  position: relative;
  z-index: 45;
}

.service-links {
  display: flex;
  align-items: center;
  gap: 7px;
}

.service-button {
  --service-turn: 0deg;
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 7px;
  color: var(--paper);
  isolation: isolate;
  border-radius: 0;
  transform: rotate(var(--service-turn));
  transition: transform .16s ease, filter .16s ease;
}

.service-button:nth-child(2) { --service-turn: 0deg; }
.service-button:nth-child(3) { --service-turn: 0deg; }
.service-button:nth-child(4) { --service-turn: 0deg; }

.service-button::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url('/assets/icons/grunge-square.webp') center / 100% 100% no-repeat;
  filter: drop-shadow(2px 3px 0 var(--orange));
  transform: rotate(0deg);
}

.service-button::after {
  content: '';
  position: absolute;
  inset: 5px;
  z-index: -1;
  border: 1px dashed rgba(240, 235, 215, .18);
  pointer-events: none;
  transform: rotate(-1deg);
}

.service-button img {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: grayscale(.42) sepia(.42) saturate(.72) contrast(1.08) brightness(.9);
  transform: rotate(0deg);
}

.service-button[data-service='telegram'] img {
  filter: grayscale(.7) sepia(.52) saturate(.58) hue-rotate(20deg) brightness(.88) contrast(1.08);
}

.service-button[data-service='pump'] img {
  filter: grayscale(.3) sepia(.3) saturate(.78) hue-rotate(15deg) brightness(.9) contrast(1.08);
}

.service-button[data-service='fomo'] img,
.service-button[data-service='x'] img {
  filter: grayscale(.5) sepia(.38) saturate(.72) brightness(.88) contrast(1.08);
}

.service-button:hover,
.service-button:focus-visible {
  transform: rotate(0deg) translateY(-2px) scale(1.05);
  filter: saturate(1.2);
}

.service-button:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 5px;
}

.radio-control {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  z-index: 2;
}

.radio-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 6px;
  border: 0;
  background: transparent;
  border-radius: 0;
  transform: rotate(0deg);
}

.radio-toggle::before {
  content: '';
  position: absolute;
  inset: 1px;
  z-index: -1;
  background: url('/assets/icons/grunge-square.webp') center / 100% 100% no-repeat;
  filter: drop-shadow(2px 3px 0 var(--ink));
  transform: rotate(0deg);
}

.radio-toggle img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  transform: rotate(0deg);
  filter: sepia(.3) saturate(.68) brightness(.92) contrast(1.1);
}

.radio-toggle img[hidden] { display: none; }

.radio-toggle:hover,
.radio-toggle:focus-visible {
  transform: rotate(1deg) translateY(-2px);
}

.radio-toggle:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 5px;
}

.radio-volume-panel {
  position: absolute;
  right: -4px;
  top: calc(100% + 10px);
  display: flex;
  align-items: center;
  gap: 8px;
  width: 158px;
  min-height: 49px;
  padding: 10px 12px;
  background: #ded8ba;
  clip-path: var(--rag-tight);
  box-shadow: 4px 5px 0 var(--ink);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: rotate(-2deg) translateY(7px);
  transform-origin: top right;
  transition: opacity .14s ease, transform .14s ease, visibility 0s linear .14s;
}

.radio-control:hover .radio-volume-panel,
.radio-control:focus-within .radio-volume-panel,
.radio-control.is-open .radio-volume-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: rotate(-2deg) translateY(0);
  transition-delay: 0s;
}

.radio-control::after {
  content: '';
  position: absolute;
  top: 100%;
  right: -4px;
  width: 174px;
  height: 14px;
  pointer-events: none;
}

.radio-control:hover::after,
.radio-control:focus-within::after,
.radio-control.is-open::after { pointer-events: auto; }

.radio-volume-panel input[type='range'] {
  flex: 1 1 auto;
  width: 100%;
  accent-color: var(--orange);
  cursor: ew-resize;
}

.radio-volume-note {
  font: 8px/1.2 var(--scribble-font), cursive;
  color: var(--muted);
  white-space: nowrap;
  transform: rotate(-4deg);
}

@media (max-width: 1179px) {
  .site-header {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: 'brand extras actions' 'nav nav nav';
    column-gap: 20px;
    row-gap: 12px;
    min-height: 136px;
    padding-block: 16px 12px;
  }
  .site-header > .main-nav {
    justify-content: flex-start;
    gap: 30px;
    transform: none;
  }
  .site-header .main-nav > .header-link { margin-left: 4px; }
  .header-extras { gap: 10px; }
  .service-links { gap: 6px; }
}

@media (max-width: 899px) {
  .site-header .main-nav > .header-link { display: none; }
}

@media (max-width: 739px) {
  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: 'brand actions' 'nav nav' 'extras extras';
    gap: 12px 16px;
    min-height: 174px;
    padding-block: 16px 14px;
  }
  .site-header > .brand { width: 230px; }
  .site-header > .header-actions { padding-left: 0; justify-self: end; }
  .site-header > .header-actions::before { display: none; }
  .site-header > .main-nav {
    justify-content: space-between;
    gap: 12px;
    transform: none;
  }
  .site-header .main-nav > a {
    flex: 1 1 0;
    font-size: 11px;
    min-width: 0;
    transform: rotate(-1.5deg);
  }
  .site-header .main-nav > a:nth-child(2) { transform: rotate(1.5deg) translateY(1px); }
  .header-extras {
    justify-content: space-between;
    gap: 20px;
  }
  .service-links { gap: 6px; }
  .radio-volume-panel { right: 0; top: calc(100% + 8px); }
  .radio-volume-panel { width: 174px; }
  .radio-volume-note { display: none; }
}

@media (max-width: 360px) {
  .site-header { column-gap: 12px; }
  .site-header > .main-nav { gap: 6px; }
  .site-header .main-nav > a { font-size: 10px; }
  .service-links { gap: 3px; }
  .header-extras { gap: 12px; }
}

.music-credit a { text-decoration: underline; text-underline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .service-button,
  .radio-toggle,
  .radio-volume-panel { transition: none; }
}
