/* ============================================================
   Marketing Madness — Portfolio
   Dark editorial theme. Brand green #8FE000, MADNESS gradient.
   ============================================================ */

:root {
  --bg: #080808;
  --bg-elevated: #111111;
  --fg: #f4f4f4;
  --fg-muted: rgba(244, 244, 244, 0.55);
  --fg-faint: rgba(244, 244, 244, 0.35);
  --brand-green: #8fe000;
  --border: rgba(255, 255, 255, 0.08);
  --madness-gradient: linear-gradient(
    100deg,
    #ff2d8a,
    #ff5d3a,
    #f5a623,
    #d4e000,
    #8fe000,
    #00c8a0,
    #00a8ff
  );
  --accent: var(--brand-green); /* overridden per-card */
  --max-width: 1200px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

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

/* ---------- Wordmark ---------- */
.wordmark {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  user-select: none;
}

.wordmark__marketing {
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  font-weight: 600;
}

.wordmark__madness {
  font-weight: 900;
  letter-spacing: -0.02em;
  background: var(--madness-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.wordmark--lg .wordmark__marketing {
  font-size: 9px;
  letter-spacing: 0.55em;
  /* offset half a letter so tracking stays optically centred */
  margin-left: 0.55em;
  margin-bottom: 0.6em;
}

.wordmark--lg .wordmark__madness {
  font-size: clamp(3.5rem, 13vw, 9rem);
}

.wordmark--sm .wordmark__marketing {
  font-size: 7px;
  letter-spacing: 0.45em;
  margin-left: 0.45em;
  margin-bottom: 0.35em;
}

.wordmark--sm .wordmark__madness {
  font-size: 1.35rem;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem clamp(1.25rem, 5vw, 3rem);
  background: rgba(8, 8, 8, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

/* header logo doubles as a home link */
.logo-link {
  display: inline-flex;
  border-radius: 8px;
  transition: opacity 0.2s var(--ease);
}

.logo-link:hover {
  opacity: 0.75;
}

.logo-link:focus-visible {
  outline: 2px solid var(--brand-green);
  outline-offset: 4px;
}

.byline {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--fg-muted);
  letter-spacing: 0.02em;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px);
  padding: 4rem clamp(1.25rem, 5vw, 3rem) 6rem;
  text-align: center;
  overflow: hidden;
}

/* glow wash behind the wordmark */
.hero::before {
  content: "";
  position: absolute;
  width: 80vw;
  max-width: 900px;
  aspect-ratio: 1;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    circle,
    rgba(143, 224, 0, 0.14),
    rgba(255, 45, 138, 0.08) 45%,
    transparent 70%
  );
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.hero__subtitle {
  margin-top: 1.5rem;
  font-size: clamp(0.9rem, 2.5vw, 1.15rem);
  font-weight: 500;
  color: var(--fg);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero__tagline {
  margin: 1.75rem auto 0;
  max-width: 540px;
  font-size: 1.05rem;
  color: var(--fg-muted);
}

.hero__cta {
  display: inline-block;
  margin-top: 2.5rem;
  padding: 0.8rem 1.6rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--bg);
  background: var(--brand-green);
  border-radius: 999px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.hero__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(143, 224, 0, 0.3);
}

/* ---------- Episodes ---------- */
.episodes {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem clamp(1.25rem, 5vw, 3rem) 6rem;
}

.episodes__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.episodes__title {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.episodes__count {
  font-size: 0.85rem;
  color: var(--fg-faint);
  letter-spacing: 0.04em;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.5rem;
}

/* ---------- Episode card ---------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  aspect-ratio: 3 / 4;
  padding: 1.4rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease),
    border-color 0.35s var(--ease);
  opacity: 0;
  transform: translateY(16px);
}

.card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* cover image fills the card */
.card__cover {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.5s var(--ease);
}

.card:hover .card__cover {
  transform: scale(1.05);
}

/* scrim: darkens the lower half so text/badge stay legible over any cover */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
      to top,
      rgba(8, 8, 8, 0.92) 0%,
      rgba(8, 8, 8, 0.55) 35%,
      rgba(8, 8, 8, 0) 65%
    ),
    radial-gradient(
      120% 80% at 50% 0%,
      color-mix(in srgb, var(--accent) 28%, transparent),
      transparent 60%
    );
  opacity: 0.85;
  transition: opacity 0.35s var(--ease);
}

.card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 18px 50px color-mix(in srgb, var(--accent) 28%, transparent);
}

.card:hover::before {
  opacity: 1;
}

.card__badge {
  flex: none;
  position: relative;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  background: rgba(8, 8, 8, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* bottom row: EP badge on the left, "Read episode" on the right */
.card__body {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.card__open {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  transition: gap 0.25s var(--ease);
}

.card:hover .card__open {
  gap: 0.7rem;
}

/* accent bar pinned to the card foot */
.card__rule {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  width: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

.card:hover .card__rule {
  transform: scaleX(1);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 3rem clamp(1.25rem, 5vw, 3rem);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.site-footer__meta {
  font-size: 0.85rem;
  color: var(--fg-muted);
}

.site-footer__copy {
  font-size: 0.78rem;
  color: var(--fg-faint);
}

/* ---------- Motion / responsive ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .card {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media (max-width: 540px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }
  .byline {
    display: none;
  }
  /* narrow cards: stack the EP badge just above "Read episode" */
  .card__body {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
  }
}
