/* Shared by every page: design tokens, reset, header, footer. */

:root {
  --orange: #ed713d;
  --navy: #302c45;
  --dark: #0c0d12;
  --dark-2: #14151d;
  --cream: #f4f1eb;
  --muted: #96939f;
  --line: rgba(244, 241, 235, 0.18);
  /* the fantasy opponent on the gameblitz page, clearly apart from orange */
  --opponent: #ff6369;
  --opponent-quiet: rgba(255, 99, 105, 0.7);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--dark);
  color: var(--cream);
  font-family: Inter, sans-serif;
}

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

.site-header {
  background: var(--dark-2);
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 76px;
  padding: 0 5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand img {
  width: 42px;
  height: 42px;
}

/* the right side of the header on the public pages: the links, the button of
   the Gameblitz page and the menu button */
.header-end {
  display: flex;
  align-items: center;
  gap: 28px;
}

/* Gameblitz is a page of its own, not a section like the other links: a
   square button with a lightning bolt, filled on its own page */
.header-bolt {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--orange);
  color: var(--orange);
}

.header-bolt .bolt-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.header-bolt:hover,
.header-bolt[aria-current="page"] {
  background: var(--orange);
  color: var(--dark);
}

/* a game is on (the schedule says so): a small dot and a ring that pulses */
.header-bolt {
  position: relative;
}

.header-bolt.is-live::after {
  content: "";
  position: absolute;
  top: -5px;
  right: -5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 2px var(--dark-2);
}

.header-bolt.is-live {
  animation: bolt-pulse 1.8s ease-out infinite;
}

@keyframes bolt-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(237, 113, 61, 0.55);
  }

  70%,
  100% {
    box-shadow: 0 0 0 10px rgba(237, 113, 61, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .header-bolt.is-live {
    animation: none;
  }
}

.header-bolt:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 3px;
}

.bolt-icon {
  flex: none;
  width: 1.15em;
  height: 1.15em;
  fill: var(--orange);
}

nav {
  display: flex;
  gap: 32px;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

nav a:hover {
  color: var(--orange);
}

/* the section that is in view, or the page that is open */
nav a[aria-current="true"],
nav a[aria-current="page"] {
  color: var(--orange);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
}

/* Menu button, only shown on small screens (see the media query below). */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--cream);
  cursor: pointer;
}

.nav-toggle:hover {
  color: var(--orange);
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  transition:
    top 0.2s ease,
    transform 0.2s ease,
    background-color 0.2s ease;
}

.nav-toggle-bar {
  position: relative;
}

.nav-toggle-bar::before,
.nav-toggle-bar::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-bar::before {
  top: -6px;
}

.nav-toggle-bar::after {
  top: 6px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after {
  top: 0;
  transform: rotate(-45deg);
}

@media (prefers-reduced-motion: reduce) {
  .nav-toggle-bar,
  .nav-toggle-bar::before,
  .nav-toggle-bar::after {
    transition: none;
  }
}

main {
  width: min(1180px, 90%);
  margin: auto;
}

.eyebrow,
.section-label {
  color: var(--orange);
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 1rem;
}

/* Section labels are headings now, keep the spacing they had as paragraphs. */
h2.section-label {
  margin: 1em 0;
}

.noscript-note {
  margin: 0;
  padding: 24px 5vw;
  text-align: center;
  color: var(--muted);
}

footer {
  border-top: 1px solid var(--line);
  padding: 30px 5vw;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.1em;
}

footer img {
  width: 36px;
  height: 36px;
}

/* the arrows to browse the weeks */
.week-switch {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.12em;
}

.week-switch[hidden] {
  display: none;
}

.week-switch button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--cream);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.week-switch button:hover:not(:disabled) {
  border-color: var(--orange);
  color: var(--orange);
}

.week-switch button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.week-switch span {
  min-width: 80px;
  text-align: center;
  color: var(--cream);
}

/* A slim button that folds an area open and shut, in the style of the week
   arrows (thin frame, cream text, orange on hover). A <button> with
   aria-expanded or the <summary> of a <details>. */
.fold-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 36px;
  margin: 14px 0 0;
  padding: 0;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--cream);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.12em;
  list-style: none;
  text-transform: uppercase;
  cursor: pointer;
}

.fold-toggle::-webkit-details-marker {
  display: none;
}

.fold-toggle::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.fold-toggle[aria-expanded="true"]::after,
details[open] > .fold-toggle::after {
  margin-top: 3px;
  transform: rotate(-135deg);
}

.fold-toggle span {
  color: var(--orange);
}

.fold-toggle:hover {
  border-color: var(--orange);
  color: var(--orange);
}

@media (max-width: 750px) {
  .site-header {
    height: auto;
    padding: 18px 5vw;
    gap: 20px;
  }

  .header-end {
    gap: 8px;
  }

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

  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px 5vw 16px;
    background: var(--dark-2);
    border-bottom: 1px solid var(--line);
  }

  .site-header.is-open nav {
    display: flex;
  }

  nav a {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }

  nav a:last-child {
    border-bottom: 0;
  }

  footer {
    font-size: 0.75rem;
  }
}
