/* =====================================================================
   Ellie Is Cool 3000 — all the colors and styles live in this one file.

   Want to change the colors? Change them right here at the top.
   Everything on every page will change with them.
   ===================================================================== */

:root {
  --ink:       #3B1D33;   /* main text color   */
  --ink-soft:  #7A4E6D;   /* quieter text      */
  --paper:     #FFF0F7;   /* page background   */
  --card:      #FFFFFF;   /* card background   */

  --punch:      #FF2E8B;  /* hot pink — home and art */
  --watermelon: #F2385A;  /* stories */
  --orchid:     #B23BE8;  /* poems   */
  --candy:      #FF9AD0;
  --sun:        #FFC93C;

  --accent: var(--punch);
  --accent-deep: #C4145F;   /* darker version, for white text on top */

  --radius: 14px;
  --shadow: 0 2px 0 rgba(59, 29, 51, .16), 0 12px 28px -18px rgba(59, 29, 51, .5);
}

/* Each page sets its own accent color with a class on <body> */
body.page-stories { --accent: var(--watermelon); --accent-deep: #B81E3C; }
body.page-poems   { --accent: var(--orchid);     --accent-deep: #8A26B8; }
body.page-art     { --accent: var(--punch);      --accent-deep: #C4145F; }

/* ---------- basics ---------- */

* { box-sizing: border-box; }

body {
  margin: 0;
  background-color: var(--paper);
  /* faint notebook ruling */
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0 31px,
    rgba(255, 46, 139, .09) 31px 32px
  );
  color: var(--ink);
  font-family: "Lexend", system-ui, sans-serif;
  font-size: 1.05rem;
  line-height: 1.75;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 5rem;
}

a { color: var(--accent); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- top navigation ---------- */

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: 1.25rem 0 2rem;
}

.nav a {
  font-family: "Fredoka", system-ui, sans-serif;
  font-weight: 600;
  font-size: .95rem;
  text-decoration: none;
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: .3rem 1rem;
  box-shadow: 0 2px 0 var(--ink);
}

.nav a:hover { transform: translateY(-2px); }

.nav a[aria-current="page"] {
  background: var(--accent-deep);
  border-color: var(--ink);
  color: #fff;
}

/* ---------- headings ---------- */

.eyebrow {
  font-family: "Caveat", cursive;
  font-size: 1.5rem;
  color: var(--ink-soft);
  margin: 0;
}

h1 {
  font-family: "Fredoka", system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(2.4rem, 9vw, 4rem);
  line-height: 1.05;
  margin: .2rem 0 0;
  letter-spacing: -.01em;
}

.scribble {
  display: block;
  width: min(100%, 22rem);
  height: 14px;
  color: var(--accent);
  margin-top: .25rem;
}

.hand {
  font-family: "Caveat", cursive;
  font-size: 1.6rem;
  line-height: 1.35;
  color: var(--ink-soft);
  margin: .75rem 0 0;
}

/* ---------- the big tiles on the home page ---------- */

.tiles {
  display: grid;
  gap: 1rem;
  margin-top: 2.75rem;
}

.tile {
  display: block;
  text-decoration: none;
  color: var(--ink);
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 4px 0 var(--ink);
  padding: 1.25rem 1.4rem;
  transition: transform .12s ease;
}

.tile:hover { transform: translateY(-3px); }

.tile h2 {
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.7rem;
  margin: 0;
  color: var(--tile-color, var(--accent));
}

.tile p {
  font-family: "Caveat", cursive;
  font-size: 1.35rem;
  color: var(--ink-soft);
  margin: 0;
}

.tile-stories { --tile-color: var(--watermelon); }
.tile-poems   { --tile-color: var(--orchid); }
.tile-art     { --tile-color: var(--punch); }

/* ---------- cards: one story or one poem ---------- */

.card {
  position: relative;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.25rem 1.6rem 1.6rem;
  margin: 3rem 0;
}

/* the piece of tape at the top of every card */
.card::before {
  content: "";
  position: absolute;
  top: -13px;
  left: 50%;
  width: 104px;
  height: 26px;
  transform: translateX(-50%) rotate(-2deg);
  background: var(--accent);
  opacity: .35;
  border-left: 2px dashed rgba(255, 255, 255, .6);
  border-right: 2px dashed rgba(255, 255, 255, .6);
}

.card:nth-of-type(even) { rotate: .5deg; }
.card:nth-of-type(odd)  { rotate: -.5deg; }

.card h2 {
  font-family: "Fredoka", system-ui, sans-serif;
  font-size: 1.9rem;
  line-height: 1.15;
  margin: 0;
}

.byline {
  font-family: "Caveat", cursive;
  font-size: 1.3rem;
  color: var(--ink-soft);
  margin: 0 0 1.25rem;
}

.card p { margin: 0 0 1rem; }
.card p:last-child { margin-bottom: 0; }

/* Poems keep the line breaks exactly as they are typed */
.poem-text {
  white-space: pre-line;
  font-size: 1.15rem;
  line-height: 1.9;
}

/* ---------- art gallery ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.75rem;
  margin-top: 2.5rem;
}

.art {
  margin: 0;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .75rem .75rem 0;
  rotate: -.75deg;
}

.gallery .art:nth-child(even) { rotate: .75deg; }

.art img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: var(--paper);
}

.art figcaption {
  font-family: "Fredoka", system-ui, sans-serif;
  font-weight: 600;
  padding: .7rem .25rem 1rem;
  line-height: 1.3;
}

.art figcaption span {
  display: block;
  font-family: "Caveat", cursive;
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--ink-soft);
}

/* ---------- footer ---------- */

.footer {
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 2px dashed rgba(255, 46, 139, .35);
  font-family: "Caveat", cursive;
  font-size: 1.3rem;
  color: var(--ink-soft);
}

/* ---------- be kind to people who get motion sick ---------- */

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .tile:hover, .nav a:hover { transform: none; }
}
