/* ===== IC — Infinite Challenge ===== */

:root {
  --bg: #0A0A0A;
  --surface: #141414;
  --deepest: #050505;
  --text: #FFFFFF;
  --muted: rgba(255,255,255,0.6);
  --faint: rgba(255,255,255,0.18);
  --hairline: rgba(255,255,255,0.08);
  --ic-blue: #378ADD;
  --ic-blue-hover: #85B7EB;
  --live: #E5484D;

  --f-display: "Space Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --f-body: "Space Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --f-serif: "Cormorant Garamond", "Times New Roman", serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body {
  position: relative;
  /* film-grain noise overlay */
  background-image:
    radial-gradient(rgba(255,255,255,0.012) 1px, transparent 1px);
  background-size: 3px 3px;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, svg { display: block; }

::selection { background: var(--ic-blue); color: #fff; }

/* ===== Layout primitives ===== */
.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 48px;
}
@media (max-width: 760px) {
  .container { padding: 0 24px; }
}

.section { position: relative; padding: 120px 0; }
.section--tight { padding: 80px 0; }
.section--motto { padding: 160px 0; background: var(--deepest); }

.eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.mono {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.h-display {
  font-family: var(--f-display);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.92;
}

/* ===== Watermark / logo image utilities ===== */
.hero__watermark img,
.motto__wm img,
.card__wm img,
.mag-tile__wm img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand { color: #fff; }
.brand__word {
  font-family: var(--f-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
}

/* ===== Top Nav ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 48px;
  transition: background 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(10,10,10,0.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--hairline);
}
.nav__brand { display: flex; align-items: center; gap: 12px; }
.nav__wordmark {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
}
.nav__links {
  display: flex; gap: 36px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.nav__links a {
  color: var(--muted);
  transition: color 0.2s ease;
  position: relative;
}
.nav__links a:hover { color: #fff; }
.nav__links a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -6px;
  height: 1px; background: var(--ic-blue);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.3s ease;
}
.nav__links a:hover::after { transform: scaleX(1); }

@media (max-width: 900px) {
  .nav__links { display: none; }
  .nav { padding: 18px 24px; }
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 26px;
  border-radius: 999px;
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.02em;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn--blue {
  background: var(--ic-blue);
  color: #fff;
}
.btn--blue:hover {
  background: var(--ic-blue-hover);
  transform: translateY(-1px);
}
.btn--ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.4);
}
.btn--ghost:hover {
  background: #fff;
  color: #0A0A0A;
  border-color: #fff;
}
.btn--sm { padding: 11px 18px; font-size: 12px; }

.btn .arr {
  display: inline-block;
  transition: transform 0.2s ease;
}
.btn:hover .arr { transform: translateX(4px); }

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 140px 0 60px;
  overflow: hidden;
}
.hero__meta {
  position: absolute; top: 110px; left: 48px;
  color: var(--muted);
}
.hero__watermark {
  position: absolute;
  right: -160px; top: 50%;
  transform: translateY(-50%);
  width: 1180px; height: 800px;
  opacity: 0.05;
  pointer-events: none;
}
.hero__inner {
  position: relative;
  z-index: 2;
}
.hero__title {
  font-size: clamp(56px, 11vw, 168px);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1.0;
  text-wrap: balance;
}
.hero__title .blue { color: var(--ic-blue); }
.hero__sub {
  margin-top: 36px;
  max-width: 560px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}
.hero__ctas {
  margin-top: 44px;
  display: flex; gap: 14px; flex-wrap: wrap;
}
.hero__scroll {
  position: absolute; bottom: 36px; right: 48px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  color: var(--muted);
  z-index: 2;
}
.hero__scroll-line {
  width: 1px; height: 48px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.6), rgba(255,255,255,0));
  animation: scroll-pulse 2s ease-in-out infinite;
}
@keyframes scroll-pulse {
  0%, 100% { transform: scaleY(1); transform-origin: top; }
  50% { transform: scaleY(0.4); }
}

@media (max-width: 760px) {
  .hero__meta { left: 24px; }
  .hero__scroll { right: 24px; }
}

/* ===== Stats bar ===== */
.stats {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 80px;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 96px 0;
}
.stats__title {
  font-size: clamp(36px, 4.4vw, 68px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.95;
}
.stats__label { margin-bottom: 18px; }
.stats__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-content: end;
}
.stat__num {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(56px, 7vw, 104px);
  letter-spacing: -0.05em;
  line-height: 0.9;
  color: var(--ic-blue);
}
.stat__label {
  margin-top: 14px;
  color: var(--muted);
}
@media (max-width: 900px) {
  .stats { grid-template-columns: 1fr; gap: 48px; }
  .stats__grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

/* ===== Section header (Challenges / Projects / Magazine) ===== */
.s-header {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 60px;
  align-items: end;
  margin-bottom: 56px;
}
.s-header__title {
  font-size: clamp(40px, 5.6vw, 84px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.95;
  margin-top: 18px;
}
.s-header__right {
  display: flex; align-items: end; justify-content: space-between; gap: 24px;
}
.s-header__sub {
  color: var(--muted);
  font-size: 15px;
  max-width: 360px;
  line-height: 1.6;
}
.arrows { display: flex; gap: 10px; }
.arrow-btn {
  width: 56px; height: 56px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  display: inline-flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.3);
  cursor: not-allowed;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, filter 0.2s ease;
}
.arrow-btn--blue {
  background: var(--ic-blue);
  border-color: var(--ic-blue);
  color: #fff;
  cursor: pointer;
}
.arrow-btn--blue:hover {
  background: var(--ic-blue-hover);
  border-color: var(--ic-blue-hover);
  filter: brightness(1.05);
}

@media (max-width: 900px) {
  .s-header { grid-template-columns: 1fr; gap: 32px; align-items: start; }
}

/* ===== Card rail ===== */
.rail {
  position: relative;
  margin: 0 -48px;
  padding: 0 48px;
}
.rail__track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.rail__track::-webkit-scrollbar { display: none; }

.card {
  flex: 0 0 calc((100% - 72px) / 4);
  min-width: 0;
  scroll-snap-align: start;
  position: relative;
}
@media (max-width: 1200px) {
  .card { flex-basis: calc((100% - 48px) / 3); }
}
@media (max-width: 900px) {
  .card { flex-basis: calc((100% - 24px) / 2); }
}
@media (max-width: 620px) {
  .card { flex-basis: 78%; }
}

.card__media {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--surface);
  overflow: hidden;
  border: 1px solid var(--hairline);
}
.card__media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}
.card__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.08);
  transition: transform 0.7s cubic-bezier(.2,.7,.2,1), filter 0.5s ease;
}
.card:hover .card__img { transform: scale(1.05); filter: grayscale(0.85) contrast(1.1); }

.card__num {
  position: absolute; top: 14px; left: 14px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: #fff;
  mix-blend-mode: difference;
  z-index: 2;
}
.tag {
  position: absolute; top: 14px; right: 14px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.18);
  z-index: 2;
}
.tag--live {
  background: var(--live);
  border-color: var(--live);
  color: #fff;
  display: inline-flex; align-items: center; gap: 6px;
}
.tag--live .dot {
  width: 6px; height: 6px; background: #fff; border-radius: 999px;
  animation: live-pulse 1.4s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.card__wm {
  position: absolute; bottom: 14px; right: 14px;
  width: 44px; height: 30px;
  opacity: 0.4;
  z-index: 2;
}

.card__body { padding: 18px 4px 0; }
.card__cat {
  color: var(--ic-blue);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.card__title {
  margin-top: 8px;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.02em;
  position: relative;
  display: inline-block;
}
.card__title::after {
  content: "";
  position: absolute; left: 0; right: 100%; bottom: -3px;
  height: 1px; background: var(--ic-blue);
  transition: right 0.35s cubic-bezier(.2,.7,.2,1);
}
.card:hover .card__title::after { right: 0; }
.card__meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.01em;
}

/* ===== Progress bar ===== */
.progress {
  margin-top: 56px;
  display: flex; align-items: center; gap: 24px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--muted);
}
.progress__track {
  flex: 1;
  display: flex; gap: 6px;
}
.progress__seg {
  flex: 1; height: 2px;
  background: var(--hairline);
  transition: background 0.4s ease;
}
.progress__seg.is-on { background: var(--ic-blue); }
.progress__count { color: #fff; }
.progress__total { color: var(--muted); }

/* ===== Magazine grid ===== */
.mag-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 220px;
  gap: 12px;
}
.mag-tile {
  position: relative;
  background: var(--surface);
  overflow: hidden;
  border: 1px solid var(--hairline);
}
.mag-tile--tall { grid-row: span 2; }
.mag-tile--wide { grid-column: span 2; }
.mag-tile--big { grid-row: span 2; grid-column: span 2; }

.mag-tile__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  transition: filter 0.5s ease, transform 0.7s cubic-bezier(.2,.7,.2,1);
}
.mag-tile:hover .mag-tile__img {
  filter: grayscale(0) contrast(1.05);
  transform: scale(1.03);
}
.mag-tile__code {
  position: absolute; bottom: 12px; left: 12px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: #fff;
  mix-blend-mode: difference;
  z-index: 2;
}
.mag-tile__wm {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 24px;
  opacity: 0.45;
}

@media (max-width: 900px) {
  .mag-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 200px; }
  .mag-tile--big { grid-column: span 2; }
  .mag-tile--wide { grid-column: span 2; }
}

/* ===== Motto ===== */
.motto {
  position: relative;
  text-align: center;
}
.motto__wm {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 1000px; height: 680px;
  opacity: 0.045;
  pointer-events: none;
}
.motto__inner { position: relative; z-index: 2; }
.motto__quote {
  font-family: "Anton", "Impact", "Haettenschweiler", "Arial Narrow Bold", sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: clamp(56px, 10vw, 168px);
  line-height: 0.95;
  letter-spacing: 0.005em;
  color: #fff;
  text-transform: uppercase;
  margin: 32px auto 0;
  max-width: 1400px;
  text-wrap: balance;
  display: flex;
  flex-direction: column;
  gap: 0.04em;
}
.motto__line { display: block; }

.motto__sub {
  font-family: var(--f-serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(15px, 2.1vw, 32px);
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: rgba(255,255,255,0.72);
  margin-top: 44px;
  display: flex;
  flex-direction: column;
  gap: 0.15em;
}
.motto__sub-line { display: block; }

.motto__caption {
  margin-top: 56px;
  color: var(--muted);
}

/* ===== Footer ===== */
.footer {
  background: var(--deepest);
  padding: 100px 0 36px;
  border-top: 1px solid var(--hairline);
}
.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 60px;
  margin-bottom: 80px;
}
.footer__brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.footer__brand-word {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 18px;
}
.footer__tag {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.02em;
  max-width: 320px;
  line-height: 1.2;
}
.footer__tag .blue { color: var(--ic-blue); }
.footer h4 {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
  font-weight: 400;
}
.footer__list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer__list a {
  color: #fff;
  font-size: 15px;
  transition: color 0.2s ease;
}
.footer__list a:hover { color: var(--ic-blue); }
.footer__handle {
  display: inline-block;
  margin-left: 8px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  vertical-align: middle;
}
.footer__bottom {
  border-top: 1px solid var(--hairline);
  padding-top: 24px;
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  color: var(--muted);
}

@media (max-width: 900px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 40px; }
}
@media (max-width: 560px) {
  .footer__grid { grid-template-columns: 1fr; gap: 40px; }
}

/* ===== Reveal on scroll (uses CSS animation, not transition — more reliable under iframe throttling) ===== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
}
.reveal.is-in {
  animation: reveal-fade 0.9s cubic-bezier(.2,.7,.2,1) forwards;
}
@keyframes reveal-fade {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== App icon card (clean editorial treatment) ===== */
.card__media--app {
  background: #0f0f0f;
}
.card__media--app::after {
  background: linear-gradient(180deg, rgba(0,0,0,0) 65%, rgba(0,0,0,0.55) 100%);
}
.card__app-wrap {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 14%;
  gap: 22px;
  z-index: 1;
}
.card__app-icon {
  width: 52%;
  height: auto;
  display: block;
  border-radius: 20%;
  box-shadow:
    0 20px 40px rgba(0,0,0,0.55),
    0 0 0 1px rgba(255,255,255,0.06);
  transition: transform 0.6s cubic-bezier(.2,.7,.2,1);
}
.card__app-caption {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
}
.card:hover .card__app-icon { transform: scale(1.03); }

/* ===== Cover image card (pre-composed editorial image, fit to frame) ===== */
.card__media--cover {
  background: #000;
}
.card__media--cover::after {
  background: linear-gradient(180deg, rgba(0,0,0,0) 70%, rgba(0,0,0,0.5) 100%);
}
.card__cover-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  transition: transform 0.7s cubic-bezier(.2,.7,.2,1);
}
.card:hover .card__cover-img { transform: scale(1.03); }

/* ===== Photo (real image fills card / tile) ===== */
.photo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  filter: grayscale(100%) contrast(1.06);
  transition: transform 0.7s cubic-bezier(.2,.7,.2,1), filter 0.5s ease;
  z-index: 0;
}
.photo__veil {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.4);
  pointer-events: none;
  z-index: 1;
  transition: background 0.4s ease;
}
.card:hover .photo { transform: scale(1.04); filter: grayscale(85%) contrast(1.08); }
.card:hover .photo__veil { background: rgba(0,0,0,0.25); }
.mag-tile:hover .photo { filter: grayscale(0) contrast(1.05); transform: scale(1.03); }
.mag-tile:hover .photo__veil { background: rgba(0,0,0,0.15); }

/* Make sure card/tile content sits above the photo + veil */
.card__num, .card__wm, .tag, .mag-tile__code, .mag-tile__wm { z-index: 2; }

/* ===== Placeholder image (SVG-style) ===== */
.ph {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(135deg,
      rgba(255,255,255,0.035) 0 1px,
      transparent 1px 14px),
    linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.35);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-align: center;
  padding: 24px;
  filter: grayscale(1);
}
.ph span { line-height: 1.5; }
