:root {
  --banner-top: #65799b;
  --banner-bottom: #5e2663;
  --text: #ffffff;
  --text-muted: #ddd6e6;
  --blue: #2ea3e8;
  --gold: #f5b400;
  --silver: #c9c9cf;
  --ink: #2b2140;
  --gutter: clamp(1rem, 3vw, 2.5rem);
}

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

html {
  height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background-color: var(--banner-bottom);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

/* The banner's gradient (images/banner_bg.png is a 1px-wide slice of
   yt_banner.png) stretched over the viewport; it stays put while the page
   scrolls. The logo is a separate image so it can be sized independently. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--banner-bottom) url("../images/banner_bg.png") 0 0 / 100% 100% no-repeat;
}

.page {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--gutter);
}

/* Logo in the top left, content to its right */
.hero {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: var(--gutter);
}

.logo {
  display: block;
  width: clamp(110px, 24vw, 260px);
}

.logo img {
  display: block;
  width: 100%;
  height: auto;
}

.hero__text {
  min-width: 0;
}

h1 {
  margin: 0;
  font-size: clamp(1.6rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.tagline {
  margin: 0.4rem 0 0;
  color: var(--blue);
  font-size: clamp(0.7rem, 2vw, 1.4rem);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.intro {
  max-width: 34rem;
  margin: 1rem 0 0;
  color: var(--text-muted);
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
}

/* Content under the logo: three selectable cards and the panel they open */
.page {
  display: flex;
  flex-direction: column;
}

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-top: var(--gutter);
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.5rem, 2vw, 1.5rem);
}

.card {
  padding: clamp(0.75rem, 2vw, 1.25rem) clamp(0.5rem, 2vw, 1.5rem);
  border: 0;
  border-top: 4px solid var(--accent);
  border-radius: 12px 12px 0 0;
  background: rgba(0, 0, 0, 0.22);
  color: var(--accent);
  font: inherit;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s;
}

.card:hover {
  background: rgba(0, 0, 0, 0.36);
}

.card:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* The selected card takes its panel's colour so the two read as one piece */
.card[aria-selected="true"] {
  background: var(--light);
  color: var(--ink);
}

.card--life, .panel--life { --accent: var(--silver); --light: #b9b9c2; }
.card--music, .panel--music { --accent: var(--blue); --light: #dff1fc; }
.card--gaming, .panel--gaming { --accent: var(--gold); --light: #fff3cf; }

/* Fills the rest of the screen below the cards */
.panel {
  flex: 1;
  padding: clamp(1rem, 3vw, 2rem);
  border-radius: 0 0 12px 12px;
  background: var(--light);
  color: var(--ink);
}

.panel h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.footer {
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  text-align: center;
}

.footer p {
  margin: 0;
}

/* Phones: the intro drops under the logo so the title keeps its room */
@media (max-width: 600px) {
  .intro {
    grid-column: 1 / -1;
  }

  .hero__text {
    display: contents;
  }

  .hero__text h1,
  .hero__text .tagline {
    grid-column: 2;
  }

  .hero {
    grid-template-rows: 1fr auto auto 1fr auto;
    row-gap: 0;
  }

  .logo {
    grid-row: 1 / 5;
  }

  .hero__text h1 { grid-row: 2; }
  .hero__text .tagline { grid-row: 3; }
  .intro { grid-row: 5; }
}
