/* ============================================================================
   style.css — Layout & visual design for the Project A frontpage
   Single page · top tabs & CTAs removed · hero + dynamic "Preview" slider.
============================================================================ */

/* ----------------------------- Design tokens ----------------------------- */
:root {
  /* Brand palette */
  --val-red:    #ff4655;   /* signature accent              */
  --val-red-dk: #bd3944;   /* pressed/hover red             */
  --val-cyan:   #18e3d8;   /* frame-corner accent           */
  --val-navy:   #0f1923;   /* near-black background         */
  --val-bg:     #1a242e;   /* secondary dark surface        */
  --val-cream:  #ece8e1;   /* off-white text                */
  --val-muted:  #768079;   /* muted grey-green              */

  /* Font stacks: genuine name first, free look-alike as fallback */
  --font-display: 'Tungsten-Bold', 'Anton', 'Oswald', 'Arial Narrow', sans-serif;
  --font-body:    'DINNextW1G', 'Barlow', 'DIN Next', 'Segoe UI', Arial, sans-serif;

  /* The iconic clipped corner */
  --clip-corner: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);

  --header-h: 68px;
}

/* ------------------------------- Reset ----------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--val-navy);
  color: var(--val-cream);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

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

/* ------------------------------ Wordmark --------------------------------- */
.wordmark {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--val-cream);
  font-size: 1.6rem;
  line-height: 1;
  transition: color 0.18s ease;
}
.wordmark:hover { color: var(--val-red); }
.wordmark--sm { font-size: 1.25rem; }

/* ------------------------------- Header ---------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 50;
  display: flex;
  align-items: center;
  transition: background-color 0.25s ease, box-shadow 0.25s ease;
}
/* Solid bar appears once the user scrolls past the hero top */
.site-header.is-scrolled {
  background: var(--val-navy);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

.site-header__inner {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* --------------------------------- Hero ---------------------------------- */
.hero {
  position: relative;
  min-height: clamp(560px, 88vh, 1000px);
  display: flex;
  align-items: center;
  overflow: hidden;
}

/* Static (no-video) gradient backdrop with a slow drift */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(120% 120% at 72% 18%, rgba(255, 70, 85, 0.30), transparent 55%),
    linear-gradient(125deg, #0f1923 0%, #1a242e 40%, #24323d 62%, #0f1923 100%);
  background-size: 100% 100%, 300% 300%;
  animation: heroPan 22s ease-in-out infinite alternate;
}
/* Bottom fade so the hero blends into the Preview section */
.hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--val-navy) 0%, rgba(15, 25, 35, 0) 38%);
}

@keyframes heroPan {
  from { background-position: 0% 0%, 0% 50%; }
  to   { background-position: 0% 0%, 100% 50%; }
}

.hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 28px;
}

.hero__kicker {
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 0.8rem;
  color: var(--val-red);
  margin: 0 0 0.6rem;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: clamp(4rem, 15vw, 11rem);
  line-height: 0.82;
  margin: 0;
  color: var(--val-cream);
}

/* ------------------- Action buttons (under the title) -------------------- */
.actions {
  margin-top: 2.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.85rem;
  line-height: 1;
  padding: 1.05em 2.4em;
  cursor: pointer;
  border: 0;
  clip-path: var(--clip-corner);
  transition: color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
  user-select: none;
}
.btn--primary {
  background: var(--val-red);
  color: var(--val-cream);
}
.btn--primary:hover {           /* VALORANT-style inversion on hover */
  background: var(--val-cream);
  color: var(--val-navy);
}
.btn--primary:active { transform: translateY(1px); }

/* ============================ PREVIEW slider ============================= */
.preview {
  max-width: 1320px;
  margin: 0 auto;
  padding: 84px 28px 110px;
}

.preview__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 30px;
}

.preview__title {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  line-height: 0.9;
  margin: 0;
  color: var(--val-cream);
}

.preview__link {
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.15s ease;
}
.preview__link:hover { color: var(--val-red); }
.preview__link-arrow { color: var(--val-red); font-size: 1.1em; }

/* Viewport + horizontal scroll track ------------------------------------- */
.preview__viewport { position: relative; }

.preview__track {
  list-style: none;
  margin: 0;
  padding: 0 0 6px;
  display: flex;
  gap: 22px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;            /* Firefox */
}
.preview__track::-webkit-scrollbar { display: none; }   /* WebKit */

/* 3 cards per view on desktop · 2 on tablet · ~1.1 on phone */
.preview__slide {
  flex: 0 0 calc((100% - 44px) / 3);
  scroll-snap-align: start;
}
@media (max-width: 900px) { .preview__slide { flex-basis: calc((100% - 22px) / 2); } }
@media (max-width: 600px) { .preview__slide { flex-basis: 86%; } }

/* Image card (styled after the VALORANT news cards) ---------------------- */
.card {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.card__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--val-bg);
  clip-path: var(--clip-corner);
}
.card__media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.card:hover .card__media { transform: scale(1.05); }

/* Cyan corner brackets (top-left & bottom-right) */
.card__frame::before,
.card__frame::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  pointer-events: none;
  z-index: 2;
}
.card__frame::before {
  top: 10px; left: 10px;
  border-top: 2px solid var(--val-cyan);
  border-left: 2px solid var(--val-cyan);
}
.card__frame::after {
  bottom: 10px; right: 10px;
  border-bottom: 2px solid var(--val-cyan);
  border-right: 2px solid var(--val-cyan);
}

/* Vertical wordmark on the frame, echoing the original cards */
.card__label {
  position: absolute;
  top: 14px;
  left: 14px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  color: rgba(236, 232, 225, 0.85);
  z-index: 3;
}

.card__tag {
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--val-red);
  margin: 0.95rem 0 0.3rem;
}
.card__title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
  margin: 0;
  color: var(--val-cream);
}

/* Arrows ------------------------------------------------------------------ */
.preview__arrow {
  position: absolute;
  top: calc(50% - 30px);
  transform: translateY(-50%);
  z-index: 4;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  font-family: var(--font-body);
  font-size: 1.7rem;
  line-height: 1;
  color: var(--val-cream);
  background: rgba(15, 25, 35, 0.7);
  border: 1px solid rgba(236, 232, 225, 0.3);
  cursor: pointer;
  clip-path: var(--clip-corner);
  transition: background-color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.preview__arrow:hover { background: var(--val-red); border-color: var(--val-red); }
.preview__arrow--prev { left: -10px; }
.preview__arrow--next { right: -10px; }
.preview__arrow[disabled] { opacity: 0; pointer-events: none; }

/* Dots -------------------------------------------------------------------- */
.preview__dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
}
.preview__dot {
  width: 30px;
  height: 3px;
  padding: 0;
  border: 0;
  background: rgba(236, 232, 225, 0.25);
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.preview__dot:hover { background: rgba(236, 232, 225, 0.5); }
.preview__dot.is-active { background: var(--val-red); }

.preview__empty {
  text-align: center;
  color: var(--val-muted);
  font-size: 0.9rem;
}
.preview__empty code {
  color: var(--val-cream);
  background: rgba(236, 232, 225, 0.08);
  padding: 2px 6px;
}

/* ============================ CONTRIBUTORS =============================== */
.contributors {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 28px 110px;
}

.contributors__head {
  margin-bottom: 30px;
}

.contributors__title {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  line-height: 0.9;
  margin: 0;
  color: var(--val-cream);
}

.contributors__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.contributor {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 16px 18px;
  background: rgba(15, 25, 35, 0.6);
  border-left: 3px solid var(--val-red);
  clip-path: var(--clip-corner);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.contributor:hover {
  background: var(--val-red);
  border-left-color: var(--val-cream);
}
.contributor:hover .contributor__github { color: rgba(236, 232, 225, 0.85); }

.contributor__name {
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
  color: var(--val-cream);
}

.contributor__github {
  font-size: 0.74rem;
  color: var(--val-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contributors__empty {
  text-align: center;
  color: var(--val-muted);
  font-size: 0.9rem;
  margin: 0;
}

/* ====================== Preview lightbox ================================= */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 24px;
}
.lightbox[hidden] { display: none; }

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 12, 17, 0.92);
  cursor: pointer;
}

.lightbox__panel {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: 90vh;
  animation: modalIn 0.18s ease-out;
}

.lightbox__close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 0;
  color: var(--val-cream);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease;
}
.lightbox__close:hover { color: var(--val-red); }

.lightbox__media-wrap {
  background: var(--val-bg);
  border: 1px solid rgba(236, 232, 225, 0.12);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
  overflow: hidden;
}

.lightbox__media {
  display: block;
  width: 100%;
  max-height: 85vh;
  object-fit: contain;
  background: #0a1018;
}

/* -------------------------------- Footer --------------------------------- */
.site-footer {
  background: var(--val-navy);
  border-top: 1px solid rgba(236, 232, 225, 0.08);
  padding: 38px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  text-align: center;
}
.site-footer__note {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--val-muted);
}

/* ====================== Download popup (modal) ========================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}
.modal[hidden] { display: none; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 12, 17, 0.82);
  cursor: pointer;
}

.modal__panel {
  position: relative;
  width: min(520px, 100%);
  max-height: 85vh;
  overflow-y: auto;
  background: var(--val-bg);
  border: 1px solid rgba(236, 232, 225, 0.12);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
  padding: 34px 34px 30px;
  animation: modalIn 0.18s ease-out;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 0;
  color: var(--val-cream);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease;
}
.modal__close:hover { color: var(--val-red); }

.modal__kicker {
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.72rem;
  color: var(--val-red);
  margin: 0 0 0.4rem;
}
.modal__title {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 0.9;
  margin: 0 0 1.5rem;
  color: var(--val-cream);
}

.modal__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.modal__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 14px 16px;
  background: rgba(15, 25, 35, 0.6);
  border-left: 3px solid var(--val-red);
  color: var(--val-cream);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.modal__link:hover { background: var(--val-red); border-left-color: var(--val-cream); }

.modal__link-text { min-width: 0; }   /* allow the URL line to ellipsize */
.modal__link-name {
  display: block;
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.92rem;
}
.modal__link-meta {
  display: block;
  margin-top: 2px;
  font-size: 0.74rem;
  color: var(--val-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.modal__link:hover .modal__link-meta { color: rgba(236, 232, 225, 0.85); }

.modal__link-arrow { flex: 0 0 auto; font-size: 1.3rem; line-height: 1; }

.modal__empty { color: var(--val-muted); margin: 0; }

.modal__footer {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(236, 232, 225, 0.1);
}
.modal__checksum {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.modal__checksum + .modal__checksum { margin-top: 0.65rem; }
.modal__checksum-label {
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  color: rgba(236, 232, 225, 0.55);
}
.modal__checksum-value {
  display: block;
  font-family: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', monospace;
  font-size: 0.7rem;
  line-height: 1.45;
  color: var(--val-cream);
  word-break: break-all;
  overflow-wrap: anywhere;
}

/* ------------------------------ Responsive ------------------------------- */
@media (max-width: 640px) {
  .site-header__inner,
  .hero__content,
  .preview,
  .contributors { padding-left: 18px; padding-right: 18px; }
  .preview__arrow { display: none; }   /* swipe on touch devices */
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__bg { animation: none; }
  .preview__track { scroll-behavior: auto; }
  .card__media { transition: none; }
}
