/* ════════════════════════════════════════════
   FONTS
════════════════════════════════════════════ */
@font-face {
  font-family: 'NaNTresorM';
  src: url('NaNTresorM-Bold.ttf') format('truetype');
  font-weight: 700;
}
@font-face {
  font-family: 'NaNTresorM';
  src: url('NaNTresorM-Regular.ttf') format('truetype');
  font-weight: 400;
}
@font-face {
  font-family: 'Celescript';
  src: url('Celescript.ttf') format('truetype');
}

/* ════════════════════════════════════════════
   RESET
════════════════════════════════════════════ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  height: 100%;
}

/* ════════════════════════════════════════════
   BODY — flex column, full height, bg fallback
   for content that scrolls beyond the viewport
════════════════════════════════════════════ */
body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  /* Fallback bg for overflowed/scrolled area */
  background-image: url('shell.png');
  background-size: cover;
  background-position: center top;
  background-repeat: repeat-y;
}

/* ════════════════════════════════════════════
   FIXED BG — what mix-blend-mode: screen blends against
════════════════════════════════════════════ */
.bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background-image: url('shell.png');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  z-index: 0;
}

/* ════════════════════════════════════════════
   PAGE — flex column, fills viewport, stacks
   top-bar / middle / bottom vertically
════════════════════════════════════════════ */
.page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
}

/* ════════════════════════════════════════════
   TOP BAR — flex row, header left / nav right
════════════════════════════════════════════ */
.top-bar {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 36px 30px 0 48px;
  width: 100%;
  /* does not grow — takes only what it needs */
  flex-shrink: 0;
}

/* ── Header (title + subtitle stacked) ── */
.header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  /* allow it to shrink if viewport is narrow */
  min-width: 0;
}

.title {
  font-family: 'NaNTresorM', serif;
  font-weight: 400;
  /* fluid: scales between 32pt and 62pt */
  font-size: clamp(32pt, 6vw, 62pt);
  color: #6e00b0;
  line-height: 1;
  letter-spacing: -0.01em;
  /* allow long words to wrap rather than overflow */
  overflow-wrap: break-word;
}

.subtitle {
  font-family: 'Celescript', cursive;
  font-size: clamp(12pt, 1.4vw, 16pt);
  color: #6e00b0;
  margin-top: 8px;
  padding-bottom: 6px;
  border-bottom: 3px solid #6e00b0;
  /* inline-flex keeps the underline tight to the text width */
  display: inline-flex;
  align-self: flex-start;
}

/* ── Nav (stream / memories / info) ── */
.nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;           /* wraps if viewport is too narrow */
  gap: 16px;
  padding-top: 10px;
  /* don't shrink smaller than its content */
  flex-shrink: 0;
}

/* ── Shared button base ── */
.btn {
  font-family: 'Celescript', cursive;
  font-size: clamp(10pt, 1.1vw, 12pt);
  line-height: 1;
  padding: 8px 18px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  /* inline-flex centres text vertically in the pill */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.btn-stream {
  background-color: #ffffff;
  color: #6e00b0;
}

/* tell us your memories! — canvas-inverted pill */
.btn-memories {
  position: relative;
  color: #ffffff;
  background: transparent;
  overflow: hidden;
}

.btn-memories canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  display: block;
  z-index: 0;
}

.btn-memories span {
  position: relative;
  z-index: 1;
}

.btn-info {
  background-color: #ffffff;
  color: #6e00b0;
}

/* ════════════════════════════════════════════
   MIDDLE — flex: 1 so it expands to push
   bottom down; holds the info panel
════════════════════════════════════════════ */
.middle {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  /* small breathing room below top-bar */
  padding-top: 16px;
}

/* ── Info panel — block in normal flow ── */
.info-panel {
  display: none;
  position: relative;
  margin: 0 48px;
  /* auto bottom margin so it doesn't hug the bottom section */
  margin-bottom: 24px;
}

.info-panel.active {
  display: block;
}

#overlayCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 24px;
  display: block;
  z-index: 0;
}

.info-content {
  position: relative;
  z-index: 1;
  padding: 48px 56px;
}

.info-content p {
  font-family: 'NaNTresorM', serif;
  font-weight: 400;
  font-size: clamp(11pt, 1.2vw, 15pt);
  color: #ffffff;
  line-height: 0.9;
}

.info-content strong { font-weight: 700; }
.info-content em     { font-style: italic; }

.info-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  font-family: 'NaNTresorM', serif;
  z-index: 2;
}

/* ════════════════════════════════════════════
   BOTTOM — flex column: toolkit then image
   always last, never grows
════════════════════════════════════════════ */
.bottom {
  display: flex;
  flex-direction: column;
  width: 100%;
  flex-shrink: 0;
}

.toolkit {
  padding: 0 48px 20px 48px;
}

.toolkit p {
  font-family: 'Celescript', cursive;
  font-size: clamp(12pt, 1.4vw, 16pt);
  color: #6e00b0;
  line-height: 1.5;
  white-space: pre-line;
}

/* she-tells image: always full-width, blends over bg */
.text-wrap {
  width: 100%;
  line-height: 0;
  flex-shrink: 0;
}

.text-wrap img {
  width: 100%;
  display: block;
  mix-blend-mode: screen;
}

/* ════════════════════════════════════════════
   TABLET (≤ 900px) — nav wraps below header
════════════════════════════════════════════ */
@media (max-width: 900px) {
  .top-bar {
    padding: 28px 24px 0 32px;
    gap: 16px;
  }

  .nav {
    gap: 12px;
  }

  .info-panel {
    margin: 0 32px 24px 32px;
  }

  .toolkit {
    padding: 0 32px 16px 32px;
  }
}

/* ════════════════════════════════════════════
   MOBILE (≤ 600px) — everything stacks
════════════════════════════════════════════ */
@media (max-width: 600px) {
  .top-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 20px 0 24px;
    gap: 20px;
  }

  /* Nav stacks vertically on mobile:
     stream + memories left, info right */
  .nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding-top: 0;
    width: 100%;
  }

  .btn-stream  { align-self: flex-start; }
  .btn-memories { align-self: flex-start; }
  .btn-info    { align-self: flex-end; }

  .info-panel {
    margin: 0 20px 16px 20px;
  }

  .info-content {
    padding: 36px 24px;
  }

  .toolkit {
    padding: 0 20px 16px 20px;
  }
}
