@font-face {
  font-family: "Norwester";
  src: url("./fonts/norwester.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --red: #ff1616;
  --red-deep: #7a0000;
  --white: #ffffff;
  --black: #000000;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #000;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--white);
  background:
    radial-gradient(ellipse at 12% 24%, rgba(255, 0, 0, 0.1), transparent 26rem),
    radial-gradient(ellipse at 88% 82%, rgba(255, 0, 0, 0.08), transparent 30rem),
    #000;
  font-family: "Norwester", Impact, "Arial Narrow", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

body::before,
body::after {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
}

body::before {
  background-image:
    radial-gradient(circle, rgba(255, 20, 20, 0.88) 0 1px, transparent 1.45px),
    radial-gradient(circle, rgba(255, 255, 255, 0.28) 0 1px, transparent 1.25px),
    radial-gradient(ellipse at 12% 35%, rgba(255, 0, 0, 0.17), transparent 20rem),
    radial-gradient(ellipse at 55% 58%, rgba(255, 0, 0, 0.13), transparent 24rem);
  background-position: 0 0, 70px 40px, 8% 40%, 54% 60%;
  background-size: 150px 150px, 230px 230px, 100% 100%, 100% 100%;
  opacity: 0.22;
  animation: pixel-cloud 42s ease-in-out infinite alternate;
}

body::after {
  background:
    repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.032) 0 1px, transparent 1px 6px);
  opacity: 0.18;
  animation: scan-drift 20s linear infinite;
}

@keyframes pixel-cloud {
  0% {
    background-position: 0 0, 70px 40px, -18% 28%, 38% 64%;
    transform: translate3d(-1rem, 0, 0);
  }

  50% {
    background-position: 90px 180px, -80px 180px, 44% 46%, 78% 44%;
    transform: translate3d(1.25rem, -0.75rem, 0);
  }

  100% {
    background-position: 180px 320px, -180px 300px, 112% 60%, 24% 72%;
    transform: translate3d(0.5rem, 1rem, 0);
  }
}

@keyframes scan-drift {
  from { background-position: 0 0; }
  to { background-position: 0 42px; }
}

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

a:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 4px;
}

.page {
  position: relative;
  z-index: 1;
  width: min(100%, 1180px);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(14px, 3vw, 34px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 56px;
  font-size: clamp(18px, 2.6vw, 30px);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: clamp(12px, 3vw, 42px);
}

.brand-small {
  font-size: clamp(34px, 5vw, 58px);
  text-shadow: 2px 0 var(--red), -2px 0 var(--red), 0 2px var(--red), 0 -2px var(--red);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 320px);
  align-items: center;
  gap: clamp(22px, 5vw, 68px);
  padding: clamp(18px, 3vw, 40px) 0 clamp(12px, 2vw, 24px);
}

.home .hero {
  min-height: auto;
  padding-bottom: 14px;
}

.wordmark {
  margin: 0;
  font-size: clamp(66px, 13vw, 170px);
  line-height: 0.86;
  color: #fff;
  text-shadow:
    6px 0 #b91616,
    -6px 0 #b91616,
    0 6px #b91616,
    0 -6px #b91616,
    0 0 30px rgba(255, 0, 0, 0.45);
}

.library .wordmark {
  font-size: clamp(64px, 12vw, 150px);
}

.faith .wordmark {
  font-size: clamp(46px, 8.8vw, 116px);
}

.tagline {
  margin: 18px 0 0;
  max-width: 900px;
  font-size: clamp(22px, 4vw, 52px);
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 0 16px rgba(255, 0, 0, 0.55);
  animation: slogan-flicker 6.5s steps(1, end) infinite;
}

@keyframes slogan-flicker {
  0%, 100% {
    opacity: 1;
    text-shadow: 0 0 16px rgba(255, 0, 0, 0.55), 0 0 1px #fff;
  }

  7% {
    opacity: 0.88;
    text-shadow: 0 0 8px rgba(255, 0, 0, 0.38);
  }

  8%, 12%, 57%, 61% { opacity: 1; }

  58% {
    opacity: 0.72;
    transform: translateX(1px);
  }

  59% {
    opacity: 1;
    transform: translateX(0);
  }

  91% { opacity: 0.82; }
  92% { opacity: 1; }
}

.arabic,
.intro {
  margin: 10px 0 0;
  max-width: 760px;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(18px, 2.6vw, 30px);
  line-height: 1.08;
  text-transform: uppercase;
  text-shadow: 0 0 14px rgba(255, 0, 0, 0.45);
}

.seal {
  width: min(100%, 300px);
  margin: 0 auto;
  filter: drop-shadow(0 0 24px rgba(255, 0, 0, 0.7));
  animation: float-seal 7s ease-in-out infinite;
}

@keyframes float-seal {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.cards,
.library-grid,
.faith-grid {
  display: grid;
  gap: clamp(10px, 1.8vw, 22px);
}

.cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: -10px;
}

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

.faith-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 900px;
  margin: 0 auto;
}

.card,
.library-card,
.faith-card {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 0, 0, 0.38), transparent 46%),
    linear-gradient(180deg, rgba(75, 0, 0, 0.72), rgba(0, 0, 0, 0.9));
  box-shadow:
    0 0 18px rgba(255, 255, 255, 0.72),
    0 0 34px rgba(255, 0, 0, 0.74),
    inset 0 0 30px rgba(255, 0, 0, 0.28);
}

.card {
  padding: clamp(16px, 1.7vw, 22px) clamp(12px, 1.5vw, 18px) clamp(18px, 2vw, 24px);
}

.library-card,
.faith-card {
  padding: clamp(16px, 2vw, 24px);
}

.library-card {
  grid-column: span 2;
  min-height: 95px;
}

.library-card.wide {
  grid-column: span 3;
}

.faith-card {
  min-height: 70px;
}

.card::before,
.library-card::before,
.faith-card::before {
  position: absolute;
  inset: -60% -20%;
  content: "";
  background: radial-gradient(circle, rgba(255, 0, 0, 0.34), transparent 58%);
  opacity: 0;
  transition: opacity 180ms ease;
}

.card:hover::before,
.card:focus-visible::before,
.library-card:hover::before,
.library-card:focus-visible::before,
.faith-card:hover::before,
.faith-card:focus-visible::before {
  opacity: 1;
}

.card h2,
.library-card h2,
.faith-card h2 {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 12px;
  padding-bottom: 6px;
  font-size: clamp(24px, 2.7vw, 35px);
  line-height: 0.95;
  text-align: center;
  text-transform: uppercase;
}

.card h2::after,
.library-card h2::after,
.faith-card h2::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  content: "";
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.65);
}

.card p,
.library-card p,
.faith-card p {
  position: relative;
  margin: 0;
  font-size: clamp(17px, 1.7vw, 23px);
  line-height: 1.08;
  text-align: center;
  text-transform: uppercase;
}

.submission {
  max-width: 1000px;
  margin: clamp(24px, 5vw, 46px) auto 0;
  color: var(--red);
  font-size: clamp(22px, 3.4vw, 42px);
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(255, 0, 0, 0.55);
}

.submission a {
  display: block;
  margin-top: 10px;
  color: var(--red);
  text-decoration: none;
  text-transform: uppercase;
}

.strip {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 112px;
  align-items: center;
  gap: clamp(14px, 3vw, 34px);
  margin: clamp(34px, 6vw, 72px) 0 0;
  text-align: center;
}

.strip.single {
  grid-template-columns: 1fr;
}

.strip img {
  width: 100%;
  filter: drop-shadow(0 0 18px rgba(255, 0, 0, 0.72));
}

.strip.single img {
  width: min(150px, 34vw);
  margin: 0 auto 14px;
}

.strip p {
  margin: 0;
  font-size: clamp(34px, 6.4vw, 82px);
  line-height: 0.95;
  text-transform: uppercase;
}

.strip a {
  display: block;
  border-radius: 10px;
  padding: 4px 14px;
  transition: box-shadow 180ms ease, text-shadow 180ms ease;
}

.strip a:hover,
.strip a:focus-visible {
  box-shadow:
    0 0 18px rgba(255, 255, 255, 0.72),
    0 0 34px rgba(255, 0, 0, 0.74);
}

.strip a:hover p,
.strip a:focus-visible p {
  text-shadow: 0 0 18px rgba(255, 0, 0, 0.85), 0 0 40px rgba(255, 0, 0, 0.6);
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 28px;
  padding: 34px 0 0;
  font-size: clamp(16px, 2.2vw, 24px);
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .seal {
    width: min(42vw, 230px);
    order: -1;
  }

  .intro {
    margin-right: auto;
    margin-left: auto;
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 10px;
  }

  .library-card,
  .library-card.wide {
    grid-column: span 3;
  }
}

@media (max-width: 620px) {
  .page {
    padding: 12px 8px 18px;
  }

  .nav {
    justify-content: center;
    min-height: auto;
  }

  .brand-small {
    display: none;
  }

  .nav-links {
    justify-content: center;
    gap: 12px;
    font-size: 18px;
  }

  .hero,
  .home .hero {
    gap: 12px;
    min-height: auto;
    padding: 22px 0 16px;
  }

  .wordmark,
  .library .wordmark,
  .faith .wordmark {
    font-size: clamp(48px, 14.4vw, 78px);
    text-shadow: 4px 0 #b91616, -4px 0 #b91616, 0 4px #b91616, 0 -4px #b91616;
  }

  .home .wordmark {
    font-size: clamp(62px, 19vw, 92px);
  }

  .tagline {
    margin-top: 12px;
    font-size: clamp(20px, 5.5vw, 32px);
  }

  .arabic,
  .intro {
    font-size: clamp(16px, 4vw, 21px);
  }

  .seal {
    width: 140px;
  }

  .cards {
    width: min(100%, 410px);
    margin-right: auto;
    margin-left: auto;
    gap: 8px;
  }

  .library-grid,
  .faith-grid {
    width: min(100%, 410px);
    margin-right: auto;
    margin-left: auto;
    gap: 9px;
  }

  .library-card,
  .library-card.wide,
  .faith-card {
    grid-column: span 6;
    min-height: 0;
    padding: 13px 10px 14px;
    border-width: 2px;
  }

  .faith-card {
    grid-column: auto;
  }

  .card {
    padding: 11px 8px 13px;
    border-width: 2px;
  }

  .card h2,
  .library-card h2,
  .faith-card h2 {
    margin-bottom: 8px;
    padding-bottom: 4px;
    font-size: clamp(19px, 5.5vw, 29px);
  }

  .card p,
  .library-card p,
  .faith-card p {
    font-size: clamp(12px, 3.4vw, 18px);
    line-height: 1.04;
  }

  .faith-grid {
    grid-template-columns: 1fr;
  }

  .submission {
    margin-top: 26px;
    font-size: clamp(20px, 5.2vw, 30px);
  }

  .strip {
    grid-template-columns: 1fr;
    margin-top: 30px;
  }

  .strip:not(.single) img {
    display: none;
  }
}
