:root {
  --ag-ink: #11131a;
  --ag-muted: #656b78;
  --ag-line: #e7e9ef;
  --ag-paper: #ffffff;
  --ag-soft: #f4f6f9;
  --ag-blue: #116fb7;
  --ag-berry: #c01868;
  --ag-lime: #d5ff38;
  --ag-radius: 8px;
  --ag-max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  color: var(--ag-ink);
  background: var(--ag-paper);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(231, 233, 239, 0.86);
  backdrop-filter: blur(16px);
}

.site-header__inner {
  width: min(var(--ag-max), calc(100% - 40px));
  min-height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--ag-ink);
  text-decoration: none;
}

.site-logo img {
  width: 48px;
  height: auto;
}

.site-logo span {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.nav-toggle {
  position: relative;
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--ag-line);
  border-radius: 999px;
  background: #fff;
  color: var(--ag-ink);
}

.nav-toggle span:not(.nav-toggle__label) {
  position: absolute;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 180ms ease, opacity 180ms ease;
}

.nav-toggle span:nth-child(1) {
  transform: translateY(-6px);
}

.nav-toggle span:nth-child(3) {
  transform: translateY(6px);
}

.nav-toggle__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.nav-open .nav-toggle span:nth-child(1) {
  transform: rotate(45deg);
}

.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.nav-open .nav-toggle span:nth-child(3) {
  transform: rotate(-45deg);
}

.primary-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}

.primary-nav a {
  padding: 10px 13px;
  border-radius: 999px;
  color: #2f3440;
  text-decoration: none;
  white-space: nowrap;
}

.primary-nav a:hover {
  background: #edf6fc;
  color: var(--ag-blue);
}

.hero {
  min-height: calc(100vh - 78px);
  display: flex;
  align-items: flex-end;
  color: #ffffff;
  background:
    linear-gradient(90deg, rgba(4, 8, 14, 0.82) 0%, rgba(4, 8, 14, 0.58) 48%, rgba(4, 8, 14, 0.18) 100%),
    url("../img/hero-handball.jpg") center / cover no-repeat;
}

.hero__content,
.history-section > .section-kicker,
.history-hero,
.timeline,
.section-heading,
.team-grid,
.news-grid,
.contact-section {
  width: min(var(--ag-max), calc(100% - 40px));
  margin-right: auto;
  margin-left: auto;
}

.hero__content {
  padding: 98px 0 76px;
}

.hero__eyebrow,
.section-kicker {
  margin: 0 0 16px;
  color: var(--ag-lime);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(44px, 7vw, 92px);
  line-height: 0.98;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.hero__tagline {
  max-width: 590px;
  margin: 26px 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 20px;
  font-weight: 700;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
}

.button--primary {
  background: var(--ag-lime);
  color: var(--ag-ink);
}

.button--ghost {
  border-color: rgba(255, 255, 255, 0.45);
  color: #ffffff;
}

.hero__marks {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 52px;
}

.hero__marks img {
  width: 78px;
  height: auto;
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.34));
}

.hero__marks span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  min-height: 48px;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
}

.history-section {
  padding: 84px 0 88px;
  background: var(--ag-paper);
}

.history-section > .section-kicker,
.section-heading .section-kicker {
  color: var(--ag-berry);
}

.history-hero {
  margin-bottom: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(340px, 0.72fr);
  gap: 34px;
  align-items: stretch;
}

.history-hero__image {
  min-height: 460px;
  overflow: hidden;
  border-radius: var(--ag-radius);
  background: #d9dee7;
}

.history-hero__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-hero__copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 44px;
  border: 1px solid var(--ag-line);
  border-radius: var(--ag-radius);
  background: linear-gradient(135deg, #ffffff 0%, #f4fbff 100%);
}

.history-hero__copy h2,
.section-heading h2,
.contact-section h2 {
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.history-hero__copy p {
  margin: 22px 0 0;
  color: #333946;
  font-size: 18px;
  font-weight: 700;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.timeline-item {
  min-height: 150px;
  padding: 22px;
  border: 1px solid var(--ag-line);
  border-radius: var(--ag-radius);
  background: var(--ag-paper);
}

.timeline-item:nth-child(4n + 2) {
  background: #f7fbff;
}

.timeline-item:nth-child(4n + 3) {
  background: #fff7fb;
}

.timeline-item__year {
  margin-bottom: 10px;
  color: var(--ag-blue);
  font-size: 24px;
  font-weight: 900;
}

.timeline-item p {
  margin: 0;
  color: #3d4350;
  font-size: 15px;
}

.team-section {
  padding: 84px 0 92px;
  background: linear-gradient(180deg, #11131a 0%, #171b23 100%);
  color: #ffffff;
}

.section-heading {
  margin-bottom: 38px;
}

.section-heading h2 {
  max-width: 760px;
}

.section-heading p {
  max-width: 620px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 18px;
  font-weight: 700;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px;
}

.player-card {
  position: relative;
  min-width: 0;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: var(--ag-radius);
  background: #242a34;
}

.player-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  transition: transform 240ms ease;
}

.player-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 46%;
  background: linear-gradient(180deg, rgba(17, 19, 26, 0) 0%, rgba(17, 19, 26, 0.86) 100%);
}

.player-card:hover img {
  transform: scale(1.035);
}

.player-card__name {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 1;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ag-ink);
  text-align: center;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.15;
}

.news-section {
  padding: 84px 0 88px;
  background: var(--ag-soft);
}

.news-section .section-heading .section-kicker {
  color: var(--ag-blue);
}

.news-section .section-heading p {
  color: var(--ag-muted);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.news-card {
  overflow: hidden;
  border: 1px solid var(--ag-line);
  border-radius: var(--ag-radius);
  background: var(--ag-paper);
}

.news-card__image {
  width: 100%;
  height: 230px;
  object-fit: cover;
  object-position: center;
}

.news-card__body {
  padding: 24px;
}

.news-card h3 {
  margin: 0 0 14px;
  font-size: 23px;
  line-height: 1.2;
  font-weight: 900;
}

.news-card p {
  margin: 0;
  color: #3e4552;
  font-size: 16px;
}

.contact-section {
  padding: 72px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.contact-section .section-kicker {
  color: var(--ag-berry);
}

.contact-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 14px 22px;
  border-radius: 999px;
  background: var(--ag-ink);
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
}

.site-footer {
  padding: 26px 20px 34px;
  border-top: 1px solid var(--ag-line);
  text-align: center;
  background: var(--ag-paper);
}

.site-footer p {
  margin: 0;
  color: var(--ag-muted);
  font-size: 14px;
}

.not-found {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  padding: 32px;
  text-align: center;
  background: var(--ag-soft);
}

.not-found img {
  width: 92px;
  height: auto;
}

.not-found h1 {
  margin: 0;
  font-size: clamp(34px, 7vw, 58px);
  line-height: 1;
  font-weight: 900;
  text-transform: uppercase;
}

.not-found p {
  margin: 0;
  color: var(--ag-muted);
  font-weight: 700;
}

@media (max-width: 1120px) {
  .history-hero {
    grid-template-columns: 1fr;
  }

  .history-hero__image {
    min-height: 380px;
  }

  .timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .team-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  html {
    scroll-padding-top: 80px;
  }

  .site-header__inner {
    min-height: 72px;
    gap: 14px;
  }

  .site-logo span {
    max-width: 188px;
    white-space: normal;
    font-size: 12px;
    line-height: 1.15;
  }

  .nav-toggle {
    display: inline-flex;
    flex: 0 0 auto;
  }

  .primary-nav {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 10px 20px 16px;
    border-bottom: 1px solid var(--ag-line);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 20px 30px rgba(17, 19, 26, 0.08);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease;
  }

  .nav-open .primary-nav {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .primary-nav a {
    padding: 12px 4px;
    border-radius: 0;
  }

  .hero {
    min-height: 620px;
    background-position: 58% center;
  }

  .hero__content {
    padding: 72px 0 54px;
  }

  .hero h1 {
    max-width: 620px;
    font-size: clamp(34px, 11vw, 58px);
    line-height: 1.02;
  }

  .hero__tagline {
    max-width: 520px;
    font-size: 18px;
  }

  .history-section,
  .team-section,
  .news-section {
    padding: 62px 0 68px;
  }

  .history-hero__copy {
    padding: 28px;
  }

  .history-hero__copy h2,
  .section-heading h2,
  .contact-section h2 {
    font-size: clamp(30px, 9vw, 44px);
    line-height: 1.05;
  }

  .history-hero__copy p,
  .section-heading p {
    font-size: 16px;
  }

  .timeline,
  .news-grid {
    grid-template-columns: 1fr;
  }

  .team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .player-card__name {
    left: 10px;
    right: 10px;
    bottom: 10px;
    min-height: 36px;
    font-size: 14px;
  }

  .contact-section {
    align-items: flex-start;
    flex-direction: column;
    padding: 58px 0;
  }

  .contact-link {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 480px) {
  .site-header__inner,
  .hero__content,
  .history-section > .section-kicker,
  .history-hero,
  .timeline,
  .section-heading,
  .team-grid,
  .news-grid,
  .contact-section {
    width: min(100% - 28px, var(--ag-max));
  }

  .hero {
    min-height: 570px;
    background-position: 63% center;
  }

  .hero__content {
    padding: 54px 0 42px;
  }

  .hero__eyebrow,
  .section-kicker {
    margin-bottom: 12px;
    font-size: 12px;
  }

  .hero h1 {
    font-size: clamp(30px, 12vw, 44px);
  }

  .hero__tagline {
    margin-top: 18px;
    font-size: 16px;
  }

  .hero__actions,
  .hero__marks {
    align-items: stretch;
    flex-direction: column;
  }

  .hero__actions {
    gap: 10px;
    margin-top: 24px;
  }

  .hero__marks {
    gap: 12px;
    margin-top: 32px;
  }

  .hero__marks img {
    width: 64px;
  }

  .hero__marks span {
    min-width: 0;
    min-height: 42px;
    font-size: 16px;
  }

  .button,
  .contact-link {
    width: 100%;
  }

  .history-hero__image {
    min-height: 260px;
  }

  .history-hero__copy {
    padding: 22px;
  }

  .history-hero__copy h2,
  .section-heading h2,
  .contact-section h2 {
    font-size: clamp(28px, 10vw, 36px);
  }

  .timeline-item {
    min-height: 0;
    padding: 18px;
  }

  .timeline-item__year {
    font-size: 21px;
  }

  .news-card__image {
    height: 190px;
  }

  .news-card__body {
    padding: 20px;
  }

  .news-card h3 {
    font-size: 20px;
  }

  .team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .player-card {
    width: 100%;
    aspect-ratio: 4 / 5.6;
    margin: 0 auto;
  }

  .player-card__name {
    left: 8px;
    right: 8px;
    bottom: 8px;
    min-height: 34px;
    padding: 7px 8px;
    font-size: 13px;
  }
}

@media (max-width: 360px) {
  .team-grid {
    grid-template-columns: 1fr;
  }

  .player-card {
    width: min(280px, 100%);
    aspect-ratio: 3 / 4;
  }
}
