@import url('https://fonts.googleapis.com/css2?family=Arimo:wght@400;700&display=swap');

:root {
    --mint: #b6f5dc;
    --ink: #14141a;
    --purple: #5048f6;
    --line: #0000001a;
     --frame: #ebff88;
    --accent: #e6ff69;

}

* {
    box-sizing: border-box;
}

body { 
    margin: 0;
    background: var(--mint);
    color: var(--ink);
    font-family: 'Arimo', -apple-system, BlinkMacSystemFont, sans-serif;
}
nav {
  background: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  height: 64px;
  box-sizing: border-box;
}

nav .logo {
 position: relative;
  top: 30px;
  background: #23232b;
  color: #fff;
  font-size: 60px;
  letter-spacing: 1px;
  font-family: "Permanent Marker", cursive; 
  padding: 10px 29px;
  z-index: 2;
}

nav .links {
  display: flex;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12.5px;
}

nav .links a {
  color: #cfcfd6;
  text-decoration: none;
  font-family: "Space Mono", monospace;
}

nav .links a:hover {
  color: #fff;
}
.hero {
  position: relative;
}

.hero img {
  display: block;
  width: 100%;
  height: auto;
}


.hero {
  position: relative;
  z-index: 1;
}

.why-badge {
  position: absolute;
  right: 18px;
  bottom: -65px;
  z-index: 2;
  background: var(--ink);
  color: #fff;
  padding: 20px 36px;
  font-family: "Permanent Marker", cursive;
  font-size: 54px;
}

.discourse p {
  margin-top: 40px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.line {
  background: var(--ink);
  color: #fff;
  font-family: "Permanent Marker", cursive;
  padding: 10px 24px;
  font-size: 54px;
  line-height: 1.1;
}

.line2 { margin-left: 80px;  font-size: 84px; }
.line3 { margin-left: 30px; }
.line4 { margin-left: 160px; font-size: 80px; }

.articles {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}
.top-group { height: 480px; }
.bottom-group { height: 350px; }

.a1 { top: 0;     left: 30%; width: 40%; }
.a2 { top: 8px;   left: 49%; width: 50%; }
.a3 { top: 78px;  left: 4%;  width: 44%; }
.a4 { top: 222px; left: 38%; width: 54%; }
.a5 { top: 275px; left: 1%;  width: 38%; }

.a6 { top: 70px;  left: 7%;  width: 25%; }
.a7 { top: 117px; left: 35%; width: 31%; }
.a8 { top: 0;     left: 58%; width: 40%; }

.collage {
  position: relative;
}

.doodle {
  position: absolute;
  z-index: 2;
  margin: 0;
  background: var(--ink);
  color: #fff;
  padding: 20px 36px;
  font-family: "Permanent Marker", cursive;
  font-size: 54px;
  line-height: 1.1;
}

.collage {
  position: relative;
}

.doodle:first-child { left: 24px; top: 6px; }
.doodle:last-child  { right: 24px; bottom: -550px; }

.toolkit-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  padding: 24px;
}

.toolkit-text {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.deck-notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.toolkit-pic {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 700px) {
  .toolkit-layout,
  .deck-notes {
    grid-template-columns: 1fr;
  }
  .toolkit-pic {
    height: auto;
  }
}
.text-block {
  background: var(--ink);
  color: #fff;
  font-family: "Permanent Marker", cursive;
  font-size: clamp(18px, 2.6vw, 28px);
  line-height: 1.3;
  padding: clamp(12px, 2vw, 24px) clamp(16px, 3vw, 36px);
  margin: 0;
}

.section-break {
  background: #000;
  padding: 18px 16px;
  display: flex;
  justify-content: center;
}

.deck-label {
  margin: 0;
  background: var(--ink2);
  color: #fff;
  font-family: "Space Mono", monospace;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 12px 36px;
  border: 1px solid #fff4;
  border-radius: 999px;
}

.deck-label-red {
  border-color: #c4161c;
}

.deck-label-purple {
  border-color: var(--purple);
}


.deck {
  background-image: url("images/toolkit4.webp");
  background-size: cover;
  background-position: center;
  padding: 48px 24px 90px;
}

.carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 12px;
}

.card {
  flex: 0 0 calc((100% - 64px) / 5);
  min-width: 150px;
  aspect-ratio: 2 / 3;
  scroll-snap-align: start;
  background: #c4161c;
  color: #fff;
  padding: 16px;
  border-radius: 12px;
  font-family: "Space Mono", monospace;
}

.carousel {
  scrollbar-width: none;
}
.carousel::-webkit-scrollbar {
  display: none;
}

.deck-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
}

.arrow {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #000;
  border: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.dots {
  display: flex;
  gap: 12px;
}

.dot {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #000;
  box-shadow: 0 0 0 1px #fff5;
  cursor: pointer;
}

.dot.active {
  background: radial-gradient(circle, #fff 35%, #000 40%);
}

.arrow:focus-visible,
.dot:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.deck-purple .card {
  background: var(--purple);
}

.section-break-end {
  padding: 28px 16px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.meme-section {
  background: var(--mint);
  padding: clamp(24px, 6vw, 80px) 24px;
}

.meme-panel {
  --thumb-h: 86px;
  --gap: 14px;
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 220px;
  gap: 24px;
  align-items: start;
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px;
  background: #e0fff6;
  border: 2px solid #5a6b66;
}

/* Let the columns shrink instead of stretching the page */
.meme-panel > * {
  min-width: 0;
}

/* ---- Left: templates ---- */
.meme-templates {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.meme-pill {
  margin: 0;
  background: #d9d9d9;
  color: var(--ink);
  font-family: "Space Mono", monospace;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 28px;
  border-radius: 999px;
}

.template-list {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  width: 100%;
}

.template-thumb {
  flex: 0 0 var(--thumb-h);
  padding: 0;
  background: #d9d9d9;
  border: 2px solid var(--ink);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  scroll-snap-align: start;
}
.template-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Selected template: thicker purple outline (not only a colour change) */
.template-thumb[aria-pressed="true"] {
  outline: 4px solid var(--purple);
  outline-offset: 2px;
}

.template-more {
  background: none;
  border: 0;
  padding: 4px 12px;
  color: var(--ink);
  cursor: pointer;
}
.template-more svg {
  display: block;
  transition: transform 0.2s;
}
.template-more.at-end svg {
  transform: rotate(180deg);
}

/* ---- Middle: the meme (takes the picture's own proportions) ---- */
.meme-stage {
  display: flex;
  justify-content: center;
}
.meme-stage canvas {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 80vh;
  display: block;
  background: var(--mint);
  border: 3px solid var(--ink);
}

/* ---- Right: text boxes ---- */
.meme-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.meme-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.meme-text {
  width: 100%;
  box-sizing: border-box;
  background: #d9d9d9;
  color: var(--ink);
  font-family: "Space Mono", monospace;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  padding: 16px 12px;
  border: 1px solid #5a6b66;
  border-radius: 6px;
}
.meme-text::placeholder {
  color: var(--ink);
  opacity: 1;
}

.meme-buttons {
  display: flex;
  gap: 8px;
}

.meme-add,
.meme-generate {
  font-family: "Space Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
}
.meme-add {
  background: #d9d9d9;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.meme-generate {
  flex: 1;
  background: #8a0b10;
  color: #fff;
  border: 0;
}
.meme-add:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.meme-add:hover:not(:disabled),
.meme-generate:hover {
  outline: 3px solid var(--purple);
}

/* ---- Phones: templates become a sideways row, controls go below ---- */
@media (max-width: 700px) {
  .meme-panel {
    grid-template-columns: 1fr;
  }
  .meme-templates {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .template-thumb {
    flex: 0 0 120px;
    height: var(--thumb-h);
  }

}

/* STAT BAR */
.stat-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px 16px;
  background: #000;
  color: #fff;
  font-family: "Space Mono", monospace;
  text-align: center;
  padding: 32px 24px;
}

.stat-bar .stat b {
  display: block;
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 700;
  line-height: 1.1;
}

.stat-bar .stat span {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.stat-bar #statLine {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  font-size: 12px;
  color: #fff;
}

/* Phones: 2 x 2 instead of 4 across */
@media (max-width: 700px) {
  .stat-bar {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* COLLAGE: one box, everything positioned as a percentage of it */
.stage {
  position: relative;
  width: min(100% - 32px, 900px);
  margin: 24px auto;
  aspect-ratio: 526 / 610;
  container-type: inline-size;
}
.piece { position: absolute; height: auto; display: block; }
.p1 { left: 31%;   top: 0;     width: 33%; }
.p2 { left: 50.5%; top: 0.5%;  width: 42.5%; }
.p3 { left: 9.5%;  top: 6.5%;  width: 40%; }
.p4 { left: 40%;   top: 18.5%; width: 49%; }
.p5 { left: 7%;    top: 23.5%; width: 18%; }
.p6 { left: 12.5%; top: 75%;   width: 23.5%; }
.p7 { left: 37.5%; top: 79%;   width: 29%; }
.p8 { left: 59%;   top: 69%;   width: 35.5%; }

/* Black text cards (same look as the why? badge) */
.tag, .shout {
  position: absolute;
  z-index: 2;
  margin: 0;
  background: var(--ink);
  color: #fff;
  font-family: "Permanent Marker", cursive;
  line-height: 1.1;
  white-space: nowrap;
}
.tag { font-size: 4.2cqw; padding: 0.3em 0.6em; }
.t1 { left: 7%;  top: 2%; }
.t2 { left: 26%; top: 29%; }
.t3 { left: 75%; top: 31%; }

.statement { display: contents; }
.shout { font-size: 4.9cqw; padding: 0.15em 0.5em; }
.s1 { left: 9.5%;  top: 41.5%; }
.s2 { left: 19%;   top: 46%;   font-size: 7.4cqw; }
.s3 { left: 10.5%; top: 53%; }
.s4 { left: 22.5%; top: 59.5%; font-size: 6.2cqw; }
.s5 { left: 9.5%;  top: 65.5%; }

.meme-stage canvas:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; }

/* ---- Save status under the meme buttons ---- */
.meme-status {
  margin: 8px 0 0;
  font-family: "Space Mono", monospace;
  font-size: 12px;
  min-height: 1.4em;
}

/* ---- Library ---- */
.library {
  background: var(--mint);
  padding: clamp(24px, 6vw, 80px) 24px;
  min-height: 60vh;
}
.library h1,
.library-intro,
.library-empty {
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}
.library-intro {
  font-family: "Space Mono", monospace;
  margin-bottom: 24px;
}
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  align-items: start;
  max-width: 1000px;
  margin: 0 auto;
}
.library-card {
  margin: 0;
  background: #e0fff6;
  border: 2px solid var(--ink);
  padding: 10px;
}
.library-card canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #d9d9d9;
}
.library-admin {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-family: "Space Mono", monospace;
  font-size: 12px;
  font-weight: 700;
}
.library-admin span { flex: 1 1 100%; }

.admin-panel {
  max-width: 1000px;
  margin: 48px auto 0;
  padding: 24px;
  border: 2px solid var(--ink);
  background: #e0fff6;
  font-family: "Space Mono", monospace;
}
.admin-panel h2 { margin-top: 0; }
.admin-panel form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.admin-panel form[hidden] { display: none; }
.admin-panel input {
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--ink);
}
.admin-message { min-height: 1.4em; }

/* ---- Image frame: add class="framed" to any image that needs one ---- */
.framed {
  border: 4px solid var(--frame);
  box-sizing: border-box;
}
/* Inside the collage the pictures scale with the stage, so the frame scales with it too */
.stage .framed {
  border-width: 0.8cqw;
}

/* ===== theme (keep at the very end of style.css) ===== */
:root {
  --page: #f5f7e6;
  --text: #111111;
  --frame: #ebff88;
  --accent: #e6ff69;
  --violet: #5843ec;
}

body {
  background: var(--page);
  color: var(--text);
  font-family: 'Arimo', Arial, sans-serif;
  line-height: 1.5;
}

h1, h2, h3 {
  font-family: 'Arimo', Arial, sans-serif;
  font-weight: 700;
  color: var(--text);
}

a { color: var(--violet); text-decoration: underline; }
a:hover, a:focus-visible { background: var(--accent); color: #111111; }

button {
  background: var(--violet);
  color: #ffffff;
  border: 2px solid var(--violet);
}
button:hover, button:focus-visible {
  background: #111111;
  color: var(--accent);
  border-color: #111111;
}

:focus-visible { outline: 3px solid #111111; outline-offset: 2px; }

.label-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.label {
  display: inline;
  margin: 0;
  padding: 0.15em 0.5em;
  background: #e6ff69;
  color: #5843ec;
  font-family: 'Arimo', Arial, sans-serif;
  line-height: 1.7;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.label--title { font-weight: 700; font-size: 1.25rem; }

/* alternative colours, dark text because the light tints are too pale for violet text */
.label--violet { background: #9e94ff; color: #111111; }
.label--pink   { background: #ffbaba; color: #111111; }
.label--green  { background: #74ffc3; color: #111111; }

.tag,
.shout {
  background: #e6ff69;
  color: #5843ec;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.logo,
.why-badge {
  background: #e6ff69;
  color: #5843ec;
}


nav .logo,
.logo {
  background: none !important;
  box-shadow: none !important;
  border: 0 !important;
  padding: 0 !important;
  width: auto !important;
  height: auto !important;
  display: inline-block !important;
  margin-top: -30px !important;
}

nav .logo img,
.logo img {
  display: block !important;
  height: 100px !important;
  width: auto !important;
}

.hero img,
img[src="images/front-page.webp"] {
  width: 100% !important;
  height: 60vh !important;
  object-fit: cover !important;
  object-position: center !important;
}

/* ===== collage layout, from the sketch ===== */
.stage {
  position: relative !important;
  display: block !important;
  container-type: inline-size;
  width: min(100%, 1100px) !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 478 / 684 !important;
  margin: 0 auto !important;
  padding: 0 !important;
  overflow: visible !important;
}

.stage .piece,
.stage .tag,
.stage .statement {
  position: absolute !important;
  inset: auto !important;
  transform: none !important;
  margin: 0 !important;
}

.stage .piece { height: auto !important; max-width: none !important; }

/* articles: left, top and width are % of the collage */
.stage .p1 { left: 33.8% !important; top: 3.5% !important; width: 39% !important;   z-index: 1; }
.stage .p2 { left: 50.7% !important; top: 9% !important;   width: 44% !important;   z-index: 2; }
.stage .p3 { left: 10.9% !important; top: 17.6% !important; width: 41.8% !important; z-index: 3; }
.stage .p4 { left: 40.6% !important; top: 30% !important;   width: 52% !important;   z-index: 4; }
.stage .p5 { left: 2.5% !important;  top: 32.9% !important; width: 23.4% !important; z-index: 5; }
.stage .p6 { left: 60.5% !important;  top: 80% !important; width: 24.5% !important; z-index: 1; }
.stage .p7 { left: 74% !important;   top: 68% !important;   width: 29% !important;   z-index: 2; }
.stage .p8 { left: 55.9% !important; top: 49.5% !important; width: 44% !important;   z-index: 3; }

/* small texts */
.stage .tag { font-size: 4.6cqw !important; width: fit-content !important; line-height: 1.2 !important; z-index: 10; }
.stage .t1 { left: 1.5% !important; top: 7.8% !important; }
.stage .t2 { left: 24% !important;  top: 40% !important; }
.stage .t3 { left: 82% !important;  top: 41.5% !important; font-size: 5.2cqw !important; }

/* big statement */
.stage .statement {
  left: 4.6% !important;
  top: 49.5% !important;
  width: 62% !important;
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5cqw;
  z-index: 10;
}
.stage .shout {
  position: static !important;
  transform: none !important;
  margin: 0 !important;
  display: block !important;
  width: fit-content;
  line-height: 1.15 !important;
}
.stage .s1 { font-size: 7.5cqw !important; }
.stage .s2 { font-size: 10cqw !important;  margin-left: 12% !important; }
.stage .s3 { font-size: 7.5cqw !important; margin-left: 2% !important; }
.stage .s4 { font-size: 9cqw !important;   margin-left: 24% !important; }
.stage .s5 { font-size: 7.5cqw !important; }

nav {
  background: #5843ec !important;
}

nav .links a {
  color: #ffffff !important;
}

nav .links a:hover,
nav .links a:focus-visible {
  background: #e6ff69 !important;
  color: #5843ec !important;
}

* {
  font-family: 'Arimo', Arial, sans-serif !important;
}

.text-block {
  background: #5843ec !important;
  color: #e6ff69 !important;
}

