/* ================================
   OFFGRID — Foundation Festival 2026
   Visual identity: independent student magazine × campus noticeboard
   Colour system: Plum / Cobalt / Coral / Yellow / Green / Pink
   Mobile-first (375px base)
   ================================ */

:root {
  --plum: #54205F;
  --cobalt: #2454C6;
  --coral: #F05A47;
  --yellow: #F2B93F;
  --green: #4D8B55;
  --pink: #E84D8A;

  --ink: #171513;
  --white: #FFFFFF;

  /* Open-calls palette */
  --oc-cobalt: #3155A4;
  --oc-raspberry: #C94F6D;
  --oc-raspberry-dark: #B84460;
  --oc-mustard: #D5A63A;
  --oc-dark: #17151A;
  --oc-light: #F5EBDD;

  --line: rgba(23, 21, 19, 0.14);
  --line-strong: rgba(23, 21, 19, 0.35);

  --font-hero: "Anton", "Archivo Narrow", sans-serif;
  --font-display: "Archivo Narrow", "Anton", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "Space Mono", monospace;

  --gutter: 20px;
  --max-width: 1120px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background-color: var(--white);
  background-image: radial-gradient(rgba(23, 21, 19, 0.035) 1px, transparent 1px);
  background-size: 4px 4px;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
  overflow-x: hidden;
  min-height: 100vh;
}

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

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

ul {
  list-style: none;
}

::selection {
  background: var(--plum);
  color: var(--yellow);
}

:focus-visible {
  outline: 2px solid var(--cobalt);
  outline-offset: 2px;
}

/* Ensure nothing can force horizontal scroll */
html, body {
  max-width: 100%;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Tap targets ---------- */
a.btn,
button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 28px;
  cursor: pointer;
}

/* ================================
   Top eyebrow / presents line (hero, on plum)
   ================================ */
.eyebrow {
  display: block;
  text-align: center;
  font-family: var(--font-mono);
  font-size: clamp(10px, 3vw, 12px);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 500;
}

/* ================================
   HERO — the "cover page" — Plum + Cobalt + Yellow
   ================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px var(--gutter) 56px;
  gap: 26px;
  color: var(--white);
  background-color: var(--plum);
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 50% 0%, rgba(36, 84, 198, 0.35), transparent 62%);
  background-size: 4px 4px, 100% 100%;
  background-repeat: repeat, no-repeat;
  border-bottom: 4px solid var(--cobalt);
}

.hero::before,
.hero::after {
  content: "+";
  position: absolute;
  bottom: 14px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1;
  color: rgba(242, 185, 63, 0.5);
}

.hero::before { left: 16px; }
.hero::after { right: 16px; }

.hero__titles {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hero__title {
  line-height: 0;
}

.hero__logo {
  display: inline-block;
}

.hero__logo .logo-crop {
  width: min(520px, 84vw);
}

/* Soft light glow so the blue lettering reads on plum; follows the logo's shape.
   Kept small enough to fit in the crop's margin around the logo. */
:root {
  --logo-glow:
    drop-shadow(0 0 2px rgba(255, 255, 255, 0.3))
    drop-shadow(0 0 8px rgba(255, 255, 255, 0.15));
}

.hero__logo img {
  filter: var(--logo-glow);
}

/* Handoff from the loader: hero logo stays hidden until the loader logo lands on it */
.logo-pending #hero-logo img {
  opacity: 0;
}

.hero__subtitle {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: clamp(0.8rem, 3.2vw, 1rem);
  letter-spacing: 0.3em;
  color: var(--yellow);
  text-transform: uppercase;
}

.hero__dates {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: clamp(0.75rem, 3vw, 0.9rem);
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--ink);
  background: var(--yellow);
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: 8px 18px;
  transform: rotate(-2deg);
}

/* ---------- Countdown ---------- */
.countdown {
  width: 100%;
  max-width: 420px;
}

.countdown__label {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(10px, 3vw, 12px);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 14px;
}

.countdown__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
}

.countdown__unit {
  background: var(--yellow);
  border: 1px solid var(--ink);
  border-radius: 2px;
  padding: 8px 4px;
  min-width: 0;
}

.countdown__value {
  font-family: var(--font-hero);
  font-weight: 400;
  font-size: clamp(1.3rem, 6vw, 2.2rem);
  line-height: 1;
  color: var(--plum);
  font-variant-numeric: tabular-nums;
}

.countdown__unit-label {
  display: block;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: clamp(9px, 2.4vw, 10px);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}

.countdown__message {
  font-family: var(--font-hero);
  font-weight: 400;
  font-size: clamp(1.2rem, 4.5vw, 1.8rem);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 18px 12px;
  border: 1px solid var(--yellow);
  border-radius: 2px;
  color: var(--yellow);
}

/* ================================
   OPEN CALLS — Cobalt section, Raspberry / Plum cards, Mustard accent
   ================================ */
.section {
  padding: 64px var(--gutter);
  background: var(--oc-cobalt);
  color: var(--oc-light);
}

.section__heading {
  font-family: var(--font-hero);
  font-weight: 400;
  font-size: clamp(2rem, 8vw, 3.4rem);
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 40px;
  letter-spacing: 0.005em;
  color: var(--oc-light);
}

.section__heading::before {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  background: var(--oc-mustard);
  margin: 0 auto 18px;
}

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: var(--max-width);
  margin-inline: auto;
}

.card {
  position: relative;
  border-radius: 0;
  padding: 32px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Both cards — Raspberry with Mustard border, darker Raspberry on hover */
.cards .card {
  background: var(--oc-raspberry);
  color: var(--oc-dark);
  border: 1px solid var(--oc-mustard);
}

.cards .card:hover,
.cards .card:focus-within {
  background: var(--oc-raspberry-dark);
}

.cards .card .tag {
  border-color: var(--oc-dark);
  color: var(--oc-dark);
}

.cards .card .card__link {
  border-bottom-color: var(--oc-dark);
}

/* Card 2 — Trophy — slight grid-break rotation */
.cards .card:nth-child(2) {
  transform: rotate(0.5deg);
}

.card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 5vw, 1.9rem);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: inherit;
}

.card__teaser {
  color: inherit;
  opacity: 0.88;
  font-size: 0.98rem;
}

.card__specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  font-family: var(--font-mono);
  font-size: clamp(10px, 3vw, 11px);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  border-radius: 2px;
  padding: 5px 10px;
  white-space: nowrap;
}

.card__link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  min-height: 44px;
  align-self: flex-start;
  border-bottom: 2px solid currentColor;
  padding-block: 4px;
  color: inherit;
}

/* ================================
   FOOTER — Plum colophon strip
   ================================ */
.site-footer {
  padding: 28px var(--gutter) 36px;
  text-align: center;
  font-family: var(--font-mono);
  color: var(--yellow);
  background: var(--plum);
  font-size: 0.76rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.site-footer__social {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 8px;
  color: inherit;
  text-transform: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.site-footer__social:hover,
.site-footer__social:focus-visible {
  border-bottom-color: currentColor;
}

/* ================================
   DETAIL PAGES (tshirt / trophy)
   ================================ */
.page-header {
  padding: 18px var(--gutter);
  border-bottom: 2px solid var(--ink);
  position: sticky;
  top: 0;
  z-index: 10;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: inherit;
}

.detail-hero {
  position: relative;
  padding: 56px var(--gutter) 32px;
  max-width: var(--max-width);
  margin-inline: auto;
}

.detail-hero::before,
.detail-hero::after {
  content: "+";
  position: absolute;
  top: 16px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1;
  color: var(--line-strong);
}

.detail-hero::before { left: var(--gutter); }
.detail-hero::after { right: var(--gutter); }

.detail-hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: clamp(10px, 3vw, 12px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.detail-hero__eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  flex-shrink: 0;
}

.detail-hero__title {
  font-family: var(--font-hero);
  font-weight: 400;
  font-size: clamp(2.6rem, 11vw, 5.2rem);
  text-transform: uppercase;
  line-height: 0.92;
  letter-spacing: 0.005em;
  margin-bottom: 18px;
}

.detail-hero__intro {
  font-size: clamp(1rem, 4vw, 1.15rem);
  color: rgba(23, 21, 19, 0.75);
  max-width: 60ch;
}

.detail-body {
  max-width: var(--max-width);
  margin-inline: auto;
  padding: 0 var(--gutter) 40px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.detail-block {
  border-top: 1px solid var(--ink);
  padding-top: 28px;
}

.detail-block__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.1rem, 4.5vw, 1.4rem);
  text-transform: uppercase;
  margin-bottom: 14px;
  letter-spacing: 0.06em;
}

.detail-block p {
  color: rgba(23, 21, 19, 0.8);
  margin-bottom: 10px;
}

.detail-block ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-block ul + p {
  margin-top: 18px;
}

.detail-block li {
  color: rgba(23, 21, 19, 0.85);
  padding-left: 20px;
  position: relative;
}

.detail-block li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 7px;
  height: 7px;
}

.notice {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 2px;
  padding: 6px 12px;
  transform: rotate(-1.5deg);
}

.submit-cta {
  text-align: center;
  padding: 48px var(--gutter) 64px;
  border-top: 1px solid var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.submit-cta p {
  color: rgba(23, 21, 19, 0.7);
  font-size: 0.95rem;
}

.btn-primary {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 2px;
  border: 1px solid transparent;
  min-height: 52px;
  padding-inline: 40px;
  width: 100%;
  max-width: 320px;
}

/* ---------- T-Shirt page theme — Coral + Pink + Cobalt ---------- */
.page-tshirt .page-header {
  background: var(--coral);
  border-bottom-color: var(--ink);
}

.page-tshirt .back-link { color: var(--ink); }
.page-tshirt .back-link:hover { color: var(--plum); }

.page-tshirt .detail-hero__eyebrow { color: var(--pink); }
.page-tshirt .detail-hero__eyebrow::before { background: var(--cobalt); }

.page-tshirt .detail-hero__title {
  color: var(--plum);
  text-shadow: 3px 3px 0 var(--coral);
}

.page-tshirt .detail-block:nth-of-type(odd) .detail-block__title { color: var(--coral); }
.page-tshirt .detail-block:nth-of-type(even) .detail-block__title { color: var(--pink); }
.page-tshirt .detail-block li::before { background: var(--cobalt); }

.page-tshirt .notice {
  color: var(--white);
  background: var(--cobalt);
}

.page-tshirt .submit-cta { border-top-color: var(--coral); }

.page-tshirt .btn-primary {
  background: var(--plum);
  color: var(--white);
  border-color: var(--plum);
}

.page-tshirt .btn-primary:hover {
  background: var(--cobalt);
  border-color: var(--cobalt);
}

/* ---------- Trophy page theme — Green + Yellow + Plum ---------- */
.page-trophy .page-header {
  background: var(--green);
  border-bottom-color: var(--ink);
}

.page-trophy .back-link { color: var(--white); }
.page-trophy .back-link:hover { color: var(--yellow); }

.page-trophy .detail-hero__eyebrow { color: var(--plum); }
.page-trophy .detail-hero__eyebrow::before { background: var(--yellow); }

.page-trophy .detail-hero__title {
  color: var(--green);
  text-shadow: 3px 3px 0 var(--yellow);
}

.page-trophy .detail-block:nth-of-type(odd) .detail-block__title { color: var(--green); }
.page-trophy .detail-block:nth-of-type(even) .detail-block__title { color: var(--plum); }
.page-trophy .detail-block li::before { background: var(--plum); }

.page-trophy .notice {
  color: var(--ink);
  background: var(--yellow);
}

.page-trophy .submit-cta { border-top-color: var(--green); }

.page-trophy .btn-primary {
  background: var(--green);
  color: var(--white);
  border-color: var(--green);
}

.page-trophy .btn-primary:hover {
  background: var(--plum);
  border-color: var(--plum);
}

/* ================================
   TABLET / DESKTOP — min-width up-scaling
   ================================ */
@media (min-width: 640px) {
  .countdown {
    max-width: 480px;
  }
}

@media (min-width: 768px) {
  :root {
    --gutter: 40px;
  }

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

  .btn-primary {
    width: auto;
  }
}

@media (min-width: 1024px) {
  .hero {
    gap: 34px;
  }

  .section {
    padding: 88px var(--gutter);
  }

  .card {
    padding: 36px 32px 32px;
  }
}

/* ---------- Loader ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 0 16px;
  background: var(--white);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

html:not(.is-loading) .loader {
  display: none;
}

.loader.is-done {
  opacity: 0;
  visibility: hidden;
}

/* The logo file is a sheet of three variants; crop to the top colour one */
.logo-crop {
  position: relative;
  display: block;
  aspect-ratio: 890 / 420;
  overflow: hidden;
}

.logo-crop img {
  position: absolute;
  width: 127.08%;
  max-width: none;
  left: -12.36%;
  top: -4.76%;
}

.loader__logo {
  width: min(420px, 80vw);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Handoff: loader background clears while its logo glides onto the hero logo */
.loader.is-handoff {
  background-color: transparent;
  pointer-events: none;
  transition: background-color 0.8s ease;
}

/* Pick up the hero's glow on the way, so the landing is seamless */
.loader.is-handoff .loader__logo img {
  filter: var(--logo-glow);
  transition: filter 0.8s ease;
}

.loader.is-handoff .loader__progress {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.loader.is-done .loader__logo {
  opacity: 0;
  transform: scale(0.96);
}

.loader__progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(280px, 70vw);
}

.loader__bar {
  width: 100%;
  height: 18px;
  padding: 3px;
  border: 2px solid var(--ink);
}

.loader__fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--cobalt);
}

.loader__percent {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  font-variant-numeric: tabular-nums;
}

/* ---------- Scroll reveal: fade up and in, fade out when leaving ---------- */
.is-loading body > *:not(.loader) {
  visibility: hidden;
}

/* Uses `translate`, not `transform`, so rotated elements (date tag, trophy card) keep their tilt.
   Elements slide in from the side they enter on and leave the way they're going,
   so a fading element never drifts back into view and flickers. */
.reveal {
  opacity: 0;
  translate: 0 32px;
  transition:
    opacity 0.6s ease,
    translate 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.reveal.is-above {
  translate: 0 -32px;
}

.reveal.is-visible {
  opacity: 1;
  translate: 0 0;
  transition-delay: var(--reveal-delay, 0s);
}

/* ---------- Scroll cue ---------- */
.scroll-cue {
  position: fixed;
  z-index: 50;
  right: 24px;
  bottom: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--yellow);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.scroll-cue.is-shown {
  opacity: 1;
  pointer-events: auto;
}

.scroll-cue__label {
  padding: 8px 16px;
  white-space: nowrap;
  color: var(--ink);
  background: var(--yellow);
  border: 1px solid var(--ink);
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--coral);
  transition: background-color 0.2s ease;
}

.scroll-cue:hover .scroll-cue__label,
.scroll-cue:focus-visible .scroll-cue__label {
  background: var(--white);
}

.scroll-cue__track {
  position: relative;
  width: 3px;
  height: 72px;
  background: rgba(242, 185, 63, 0.35);
  overflow: hidden;
}

.scroll-cue__track::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 40%;
  background: var(--yellow);
  animation: scroll-cue 1.8s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.scroll-cue__arrow {
  width: 14px;
  height: 14px;
  margin-top: -14px;
  border-right: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: rotate(45deg);
  animation: scroll-cue-arrow 1.8s ease-in-out infinite;
}

@keyframes scroll-cue {
  0% { translate: 0 -100%; }
  100% { translate: 0 250%; }
}

@keyframes scroll-cue-arrow {
  0%, 100% { translate: 0 0; opacity: 0.6; }
  50% { translate: 0 5px; opacity: 1; }
}

/* On phones there's no side room, so sit it at the bottom centre */
@media (max-width: 640px) {
  .scroll-cue {
    right: 50%;
    bottom: 20px;
    translate: 50% 0;
    gap: 10px;
  }

  .scroll-cue__track {
    height: 36px;
  }
}

/* Reduced motion: no sliding or looping, but keep a soft fade so nothing pops in */
@media (prefers-reduced-motion: reduce) {
  .loader.is-done .loader__logo {
    transform: none;
  }

  .reveal,
  .reveal.is-above {
    translate: 0 0;
    transition: opacity 0.9s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  }

  .scroll-cue__track::after,
  .scroll-cue__arrow {
    animation: none;
  }

  .scroll-cue__track::after {
    height: 100%;
  }
}
