:root {
  --color-red: #e50914;
  --color-red-dark: #a8050d;
  --color-black: #050505;
  --color-white: #ffffff;
  --color-paper: #f5f0e6;
  --color-cream: #fff8e8;

  --font-display: "Cooper Black", "Ultra", "Alfa Slab One", Georgia, serif;
  --font-action: "Arial Black", Impact, system-ui, sans-serif;
  --font-body: "Montserrat", Inter, Arial, sans-serif;

  --content-max: 1220px;
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--color-black);
  color: var(--color-white);
  font-family: var(--font-body);
  overflow: hidden;
}

a {
  color: inherit;
}

.home-shell {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.08), transparent 42%),
    var(--color-black);
}

.home-bg {
  position: absolute;
  inset: 0;
  z-index: -3;
  overflow: hidden;
  pointer-events: none;
}

.bg-texture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.95;
  filter: contrast(1.08) brightness(0.76);
}

.bg-halftone,
.bg-brush {
  position: absolute;
  user-select: none;
  pointer-events: none;
}

.bg-halftone {
  width: 820px;
  opacity: 0.45;
  mix-blend-mode: screen;
}

.bg-halftone--tl {
  top: -80px;
  left: -100px;
  transform: rotate(180deg);
}

.bg-halftone--br {
  right: -80px;
  bottom: -100px;
}

.bg-brush {
  width: 1800px;
  opacity: 0.65;
  mix-blend-mode: screen;
  filter: saturate(1.18) contrast(1.12);
}

.bg-brush--tr {
  top: -320px;
  right: -600px;
  transform: rotate(-8deg);
  clip-path: inset(5% 2% 55% 52%);
}

.bg-brush--bl {
  bottom: -320px;
  left: -600px;
  transform: rotate(172deg);
  clip-path: inset(55% 52% 5% 2%);
}

.home-stage {
  position: relative;
  width: min(var(--content-max), calc(100vw - 80px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto auto auto auto;
  align-content: center;
  gap: 20px;
}

.nav-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(185px, 1fr));
  gap: 34px;
  align-items: center;
  justify-items: center;
  width: min(880px, 100%);
  margin: 0 auto;
}

.nav-row--top {
  padding-bottom: 8px;
  padding-top: 30px;
}

.nav-row--bottom {
  padding-top: 10px;
}

.poster-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  min-height: 58px;
  padding: 12px 20px;
  color: var(--color-black);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.62), rgba(255,255,255,0) 46%),
    var(--color-paper);
  border: 3px solid var(--color-black);
  border-radius: 4px;
  box-shadow: 6px 7px 0 rgba(0, 0, 0, 0.92);
  font-family: var(--font-action);
  font-size: clamp(18px, 1.4vw, 24px);
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.02em;
  text-decoration: none;
  text-transform: uppercase;
  transform: rotate(var(--tilt, -1deg));
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.poster-link:nth-child(2) {
  --tilt: 1deg;
}

.poster-link:nth-child(3) {
  --tilt: -0.5deg;
}

.poster-link::before,
.poster-link::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 2px solid rgba(255,255,255,0.68);
  clip-path: polygon(2% 18%, 100% 4%, 98% 82%, 0 96%);
  pointer-events: none;
}

.poster-link::after {
  inset: 5px -10px -8px 8px;
  border-color: rgba(0,0,0,0.45);
  transform: rotate(-1deg);
}

.poster-link strong {
  color: var(--color-red);
  font-size: 0.96em;
  line-height: 1;
  -webkit-text-stroke: 1px var(--color-red-dark);
  order: 1;
}

.poster-link:hover,
.poster-link:focus-visible {
  background: var(--color-white);
  transform: translate(3px, 3px) rotate(var(--tilt, -1deg));
  box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.95);
  outline: none;
}

.poster-link:focus-visible {
  outline: 3px solid var(--color-red);
  outline-offset: 6px;
}

.poster-link--cta {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.62), rgba(255,255,255,0) 46%),
    var(--color-paper);
  color: var(--color-black);
  text-shadow: none;
}

.poster-link--cta strong {
  color: var(--color-red);
  -webkit-text-stroke: 1px var(--color-red-dark);
}

.logo-stage {
  position: relative;
  display: grid;
  place-items: center;
  align-self: center;
  transform: translateY(4px);
}

.logo-splatter {
  position: absolute;
  width: min(1400px, 110vw);
  max-height: 750px;
  object-fit: contain;
  opacity: 0.92;
  transform: rotate(-2deg) scale(1.15);
  z-index: 0;
}

.bg-splatter {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-2deg) scale(1.15);
  width: min(1400px, 110vw);
  max-height: 750px;
  object-fit: contain;
  opacity: 0.95;
  filter: contrast(1.3) brightness(1.3);
}

.main-logo {
  position: relative;
  z-index: 1;
  width: min(1100px, 88vw);
  max-height: 620px;
  object-fit: contain;
  filter:
    drop-shadow(10px 11px 0 rgba(0,0,0,0.94))
    drop-shadow(0 0 24px rgba(0,0,0,0.92));
  transform: rotate(-1.5deg);
}

.tagline {
  margin: 0;
  align-self: start;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  color: var(--color-white);
  font-family: var(--font-action);
  font-size: clamp(25px, 2.4vw, 39px);
  font-style: italic;
  font-weight: 900;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  text-shadow: 4px 4px 0 var(--color-black);
}

.tagline strong {
  color: var(--color-red);
  -webkit-text-stroke: 1px var(--color-black);
}

@media (max-height: 780px) {
  .home-stage {
    grid-template-rows: 85px 1fr 80px 50px;
  }

  .logo-stage {
    min-height: 390px;
  }

  .main-logo {
    width: min(900px, 80vw);
  }

  .logo-splatter {
    width: min(1000px, 88vw);
  }

  .poster-link {
    min-height: 50px;
    font-size: clamp(16px, 1.25vw, 20px);
  }

  .tagline {
    font-size: clamp(21px, 2vw, 32px);
  }
}

/* ─── Corner energy overlays ─── */
.corner {
  position: fixed;
  pointer-events: none;
  z-index: 1;
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.85;
}

.corner--top-left {
  top: 0;
  left: 0;
  width: 360px;
  height: 360px;
  background-image: url("/public/assets/textures/school-of-knock-corner-top-left.png");
  background-image: image-set(
    url("/public/assets/textures/school-of-knock-corner-top-left.webp") type("image/webp"),
    url("/public/assets/textures/school-of-knock-corner-top-left.png") type("image/png")
  );
  background-position: top left;
}

.corner--top-right {
  top: 0;
  right: 0;
  width: 480px;
  height: 420px;
  background-image: url("/public/assets/textures/school-of-knock-corner-top-right.png");
  background-image: image-set(
    url("/public/assets/textures/school-of-knock-corner-top-right.webp") type("image/webp"),
    url("/public/assets/textures/school-of-knock-corner-top-right.png") type("image/png")
  );
  background-position: top right;
}

.corner--bottom-left {
  bottom: 0;
  left: 0;
  width: 460px;
  height: 480px;
  background-image: url("/public/assets/textures/school-of-knock-corner-bottom-left.png");
  background-image: image-set(
    url("/public/assets/textures/school-of-knock-corner-bottom-left.webp") type("image/webp"),
    url("/public/assets/textures/school-of-knock-corner-bottom-left.png") type("image/png")
  );
  background-position: bottom left;
}

.corner--bottom-right {
  bottom: 0;
  right: 0;
  width: 420px;
  height: 360px;
  background-image: url("/public/assets/textures/school-of-knock-corner-bottom-right.png");
  background-image: image-set(
    url("/public/assets/textures/school-of-knock-corner-bottom-right.webp") type("image/webp"),
    url("/public/assets/textures/school-of-knock-corner-bottom-right.png") type("image/png")
  );
  background-position: bottom right;
}

/* ─── Sign In pill (fixed top-left) ─── */
.signin-pill {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 10;
  background: var(--color-red);
  color: var(--color-white);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.8rem;
  text-decoration: none;
  padding: 8px 18px;
  border-radius: 20px;
  letter-spacing: 0.02em;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}
.signin-pill:hover {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.4);
}

/* ─── Mobile header (hidden on desktop) ─── */
.mobile-header {
  display: none;
}

.nav-grid-mobile {
  display: none;
}

/* ─── Mobile layout ─── */
@media (max-width: 768px) {
  html,
  body {
    overflow-y: scroll;
    height: auto;
  }

  .home-shell {
    min-height: auto;
  }

  .signin-pill {
    display: none;
  }

  .mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    position: relative;
    z-index: 10;
  }

  .hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
  }

  .hamburger span {
    display: block;
    width: 28px;
    height: 3px;
    background: var(--color-white);
    border-radius: 2px;
  }

  .mobile-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--color-red);
    color: var(--color-white);
    font-family: var(--font-action);
    font-size: 16px;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    text-decoration: none;
    border: none;
    z-index: 2;
  }

  .mobile-cta strong {
    color: var(--color-white);
  }

  .home-stage {
    grid-template-rows: auto auto auto auto auto;
    align-content: start;
    min-height: auto;
    gap: 0;
    padding: 0 16px 40px;
  }

  .mobile-header { order: 1; }
  .logo-stage { order: 2; }
  .nav-row--top { display: none; }
  .nav-row--bottom { display: none; }
  .nav-grid-mobile {
    order: 3;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    width: 100%;
    padding: 20px 16px 20px 0;
  }
  .tagline { order: 5; }

  .poster-link {
    flex-direction: column;
    gap: 6px;
    min-height: 70px;
    font-size: clamp(14px, 4vw, 18px);
  }

  .poster-link strong {
    order: 0;
  }

  .tagline {
    flex-direction: column;
    gap: 4px;
    font-size: clamp(20px, 5vw, 30px);
    text-align: center;
    padding-top: 20px;
  }

  .corner--top-left {
    display: none;
  }

  .corner--top-right,
  .corner--bottom-left,
  .corner--bottom-right {
    width: 200px;
    height: 200px;
  }
}

/* ─── Mobile dropdown menu ─── */
.mobile-menu {
  display: none;
}

@media (max-width: 768px) {
  .mobile-menu:not([hidden]) {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    z-index: 10;
    background: var(--color-black);
    border-bottom: 3px solid var(--color-red);
    padding: 16px 24px;
    gap: 8px;
  }

  .mobile-menu__link {
    color: var(--color-white);
    font-family: var(--font-action);
    font-size: 18px;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    text-decoration: none;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.15);
  }

  .mobile-menu__link:last-child {
    border-bottom: none;
  }
}
