/* Scratch — parents' page (/scratch/parents).
 *
 * Inherits every token from /styles.css. Only what this page needs lives here.
 *
 * The look borrows from the Scratch editor itself: the signature orange, the
 * nine category colours, chunky rounded corners, and the notch-and-bump that
 * makes a Scratch block look like it clicks into the one below it. The notch
 * geometry is the real one from scratch-blocks (core/block_render_svg_vertical.js
 * — CORNER_RADIUS 4, NOTCH_PATH 'l 6,4 3,0 6,-4', scaled up here), the same
 * source the lesson pages quote.
 */

:root {
  --scr: #f4a21a; /* Scratch signature orange */
  --scr-deep: #d98407;
  --scr-soft: #fff6e8;
  --scr-line: #f6d9a8;

  /* Scratch 3 category palette — same values as scratch/lesson.css */
  --blk-motion: #4c97ff;
  --blk-looks: #9966ff;
  --blk-sound: #d65cd6;
  --blk-events: #ffd500;
  --blk-control: #ffab19;
  --blk-sensing: #5cb1d6;
  --blk-operators: #59c059;
  --blk-variables: #ff8c1a;
  --blk-myblocks: #ff6680;
}

.par {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--bg);
  /* Nothing on this page may widen the document. The wide things — the two
     tables — scroll inside their own .par-tablewrap instead. */
  overflow-x: hidden;
}

.par section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px 24px;
}

.par h2 {
  font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.3rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}

.par h3 {
  font-size: 1.15rem;
  margin: 0 0 6px;
}

.par p {
  color: var(--ink-soft);
  line-height: 1.65;
  margin: 0 0 12px;
}

.par .lede {
  font-size: 1.08rem;
  max-width: 68ch;
}

.par .eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--scr-deep);
  font-weight: 600;
  margin: 0 0 10px;
}

/* ---------- hero ---------- */

.par-hero {
  background:
    radial-gradient(1200px 400px at 80% -50%, rgba(244, 162, 26, 0.22), transparent 70%),
    linear-gradient(180deg, var(--scr-soft) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--scr-line);
}

.par-hero__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 72px 24px 56px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 48px;
  align-items: center;
}

.par-hero h1 {
  font-size: clamp(2.1rem, 1.3rem + 3.2vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}

.par-hero h1 em {
  font-style: normal;
  color: var(--scr-deep);
}

.par-hero .lede {
  font-size: 1.12rem;
}

.par-crumbs {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 18px;
}

.par-crumbs a {
  color: var(--scr-deep);
  text-decoration: none;
  font-weight: 600;
}

.par-crumbs a:hover {
  text-decoration: underline;
}

/* ---------- key numbers ---------- */

.par-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.par-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 14px;
  text-align: center;
  box-shadow: var(--shadow);
}

.par-stat b {
  display: block;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--scr-deep);
  letter-spacing: -0.02em;
}

.par-stat span {
  display: block;
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.3;
}

/* ---------- the block stack illustration ---------- */

.par-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
  filter: drop-shadow(0 12px 28px rgba(15, 23, 42, 0.14));
}

.par-stack figcaption {
  margin-top: 14px;
  font-size: 0.86rem;
  color: var(--muted);
  text-align: center;
}

/* One Scratch stack block. The clip-path draws the top notch and the bottom
   bump so the blocks read as clicking together, exactly as they do in the
   editor. Percentages keep the shape at any width; the 14px feet are the
   notch depth. */
.par-blk {
  position: relative;
  color: #fff;
  font-weight: 600;
  font-size: 0.98rem;
  padding: 16px 18px 22px;
  margin-bottom: -6px;
  border-radius: 6px;
  clip-path: polygon(
    0 0,
    16px 0,
    22px 8px,
    34px 8px,
    40px 0,
    100% 0,
    100% calc(100% - 8px),
    40px calc(100% - 8px),
    34px 100%,
    22px 100%,
    16px calc(100% - 8px),
    0 calc(100% - 8px)
  );
}

.par-blk--motion { background: var(--blk-motion); }
.par-blk--looks { background: var(--blk-looks); }
.par-blk--sound { background: var(--blk-sound); }
.par-blk--control { background: var(--blk-control); }
.par-blk--sensing { background: var(--blk-sensing); }
.par-blk--operators { background: var(--blk-operators); }
.par-blk--variables { background: var(--blk-variables); }

/* The hat block that starts every script. */
.par-blk--hat {
  background: var(--blk-events);
  color: #4a3a00;
  padding-top: 34px;
  border-radius: 22px 22px 6px 6px;
  clip-path: polygon(
    0 22px,
    100% 22px,
    100% calc(100% - 8px),
    40px calc(100% - 8px),
    34px 100%,
    22px 100%,
    16px calc(100% - 8px),
    0 calc(100% - 8px)
  );
  background-image: radial-gradient(120% 60px at 50% 0, var(--blk-events) 60%, transparent 61%);
}

.par-blk small {
  display: block;
  font-weight: 500;
  font-size: 0.82rem;
  opacity: 0.92;
  margin-top: 3px;
}

/* Inline category pill, for naming a block inside a sentence. */
.par-pill {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.85em;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- generic card grid ---------- */

.par-grid {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.par-grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.par-grid--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.par-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

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

.par-card__icon {
  font-size: 1.6rem;
  line-height: 1;
  display: block;
  margin-bottom: 10px;
}

/* ---------- the road map ---------- */

.par-road {
  display: grid;
  gap: 16px;
  margin-top: 32px;
}

.par-level {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 8px solid var(--lv, var(--scr));
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.par-level__rail {
  background: var(--lv-soft, var(--scr-soft));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 8px;
  text-align: center;
}

.par-level__n {
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1;
  color: var(--lv, var(--scr));
}

.par-level__n span {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 600;
}

.par-level__age {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.par-level__body { padding: 22px 24px; }

.par-level__body h3 {
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.par-level__theme {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lv, var(--scr));
  font-weight: 600;
  margin: 0 0 10px;
}

/* "By the end your child can…" list */
.par-can {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  gap: 7px;
}

.par-can li {
  position: relative;
  padding-left: 26px;
  color: var(--ink-soft);
  line-height: 1.5;
}

.par-can li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 700;
  color: var(--lv, var(--scr));
}

/* ---------- tables ---------- */

.par-tablewrap {
  overflow-x: auto;
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.par-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.par-table th,
.par-table td {
  padding: 13px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.par-table th {
  background: var(--scr-soft);
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.par-table tr:last-child td { border-bottom: none; }

.par-table td:first-child { font-weight: 600; color: var(--ink); }

.par-table tfoot td {
  background: var(--scr-soft);
  font-weight: 700;
}

/* ---------- grade bands ---------- */

.par-bands {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.par-band {
  border-radius: var(--radius);
  padding: 18px 20px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.par-band b {
  display: block;
  font-size: 1.6rem;
  line-height: 1;
  letter-spacing: -0.02em;
}

.par-band span {
  display: block;
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.par-band--d { border-color: #f2c56a; background: #fffaf0; }
.par-band--d b { color: #b8741a; }
.par-band--p { border-color: #9ee0c0; background: #f2fdf8; }
.par-band--p b { color: #059669; }
.par-band--n { border-color: #cbd5e1; background: #f8fafc; }
.par-band--n b { color: var(--muted); }

/* ---------- what's next ---------- */

.par-next {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.par-next a {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 5px solid var(--nx, var(--brand));
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.par-next a:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px -12px rgba(15, 23, 42, 0.28);
}

.par-next h3 { margin-bottom: 4px; }

.par-next .age {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
}

.par-next p {
  font-size: 0.92rem;
  margin: 0;
}

/* ---------- FAQ ---------- */

.par-faq {
  margin-top: 26px;
  display: grid;
  gap: 12px;
}

.par-faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.par-faq summary {
  cursor: pointer;
  padding: 18px 22px;
  font-weight: 600;
  font-size: 1.02rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.par-faq summary::-webkit-details-marker { display: none; }

.par-faq summary::after {
  content: "+";
  color: var(--scr-deep);
  font-size: 1.4rem;
  line-height: 1;
  flex: none;
}

.par-faq details[open] summary::after { content: "−"; }

.par-faq details[open] summary { border-bottom: 1px solid var(--border); }

.par-faq .par-faq__body { padding: 16px 22px 20px; }

.par-faq .par-faq__body p:last-child { margin-bottom: 0; }

/* ---------- callout + CTA ---------- */

.par-note {
  margin-top: 26px;
  background: var(--scr-soft);
  border: 1px solid var(--scr-line);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.par-note p:last-child { margin-bottom: 0; }

.par-cta {
  background: linear-gradient(135deg, var(--scr) 0%, var(--scr-deep) 100%);
  color: #fff;
  text-align: center;
}

.par-cta h2 { color: #fff; }

.par-cta p {
  color: rgba(255, 255, 255, 0.92);
  max-width: 60ch;
  margin-left: auto;
  margin-right: auto;
}

.par-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 26px;
}

.par-btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  font-size: 1rem;
  border: 2px solid transparent;
  transition: transform 0.15s ease;
}

.par-btn:hover { transform: translateY(-2px); }

.par-btn--solid { background: #fff; color: var(--scr-deep); }
.par-btn--ghost { border-color: rgba(255, 255, 255, 0.7); color: #fff; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .par-hero__inner {
    grid-template-columns: 1fr;
    gap: 36px;
    padding: 56px 20px 44px;
  }
  /* min(), not a bare 420px — on a 390px phone a fixed 420 widens the whole
     document and every section starts scrolling sideways. */
  .par-stack { max-width: min(420px, 100%); }
}

@media (max-width: 640px) {
  .par section { padding: 48px 18px; }
  .par-level { grid-template-columns: 1fr; }
  .par-level__rail {
    flex-direction: row;
    gap: 14px;
    justify-content: flex-start;
    padding: 12px 20px;
  }
  .par-level__n { font-size: 1.5rem; display: flex; align-items: baseline; gap: 8px; }
  .par-level__n span { margin-bottom: 0; }
  .par-level__age { margin-top: 0; }
  .par-level__body { padding: 18px 20px; }
}

@media print {
  .par-cta, .par-faq summary::after { background: none; }
  .par-faq details { break-inside: avoid; }
  .par-next a:hover { transform: none; }
}
