/* Taartverdeler: the JustBee look (paper, ink, yellow; Fredoka and Nunito Sans, as on justbee.nl)
   with a strawberry cake. The print rules at the bottom show only the template at real size. */
:root {
  --paper: #faf7ee;
  --panel: #fffdf6;
  --ink: #1f1f1f;
  --muted: #6a665d;
  --line: #e8dfc9;
  --yellow: #ffc629;
  --yellow-soft: #fff0b7;
  --gold: #b38b10;
  --icing: #f6a5c0;
  --icing-light: #fbc8da;
  --icing-dark: #e27fa3;
  --berry: #c2185b;
  --sponge: #f2cd93;
  --cream: #fff6e8;
  --choc: #4a2a1a;
  --plate: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Nunito Sans', sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

h1,
h2,
h3 {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.08;
  margin: 0;
}

a {
  color: inherit;
  text-decoration-thickness: 2px;
  text-decoration-color: #d5a400;
  text-underline-offset: 4px;
}

button,
select,
input {
  font: inherit;
  color: inherit;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: .17em;
  font-weight: 800;
  text-transform: uppercase;
  color: #73654c;
}

[hidden] {
  display: none !important;
}

/* ---------- JustBee return bar (as on the other subdomains) */

.justbee-return {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 8px max(24px, calc((100vw - 1180px) / 2));
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  font: 800 14px 'Nunito Sans', sans-serif;
}

.justbee-return a {
  color: var(--ink);
  text-decoration: none;
}

.justbee-return .brand {
  display: block;
  width: 156px;
  line-height: 0;
}

.justbee-return .brand img {
  display: block;
  width: 100%;
  height: auto;
}

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

.hero {
  background:
    radial-gradient(circle at 82% 30%, rgba(246, 165, 192, .38), transparent 44%),
    radial-gradient(circle at 10% 110%, rgba(255, 198, 41, .28), transparent 40%),
    var(--paper);
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 24px 36px;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(40px, 6.4vw, 78px);
}

.subline {
  margin: 14px 0 0;
  font-size: 20px;
  color: var(--muted);
  max-width: 36ch;
}

.quip {
  margin: 12px 0 0;
  min-height: 1.5em;
  font-weight: 800;
  color: var(--berry);
}

.hero-art {
  margin: 0;
  justify-self: center;
  width: min(100%, 380px);
}

.hero-cake {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.hero-cake .plate {
  fill: #fff;
  stroke: var(--line);
  stroke-width: 2;
}

.hero-cake .plate-rim {
  fill: none;
  stroke: #efe6d2;
  stroke-width: 1.5;
}

.hero-cake .sponge {
  fill: var(--sponge);
}

.hero-cake .filling {
  fill: var(--berry);
  opacity: .78;
}

.hero-cake .icing {
  fill: var(--icing);
}

.hero-cake .icing-top {
  fill: var(--icing-light);
}

.hero-cake .cut {
  stroke: var(--choc);
  stroke-width: 1.6;
  stroke-dasharray: 5 4;
  stroke-linecap: round;
  opacity: .7;
}

.hero-cake .candle {
  fill: #fff;
  stroke: #e9d9e0;
}

.hero-cake .candle-stripe {
  fill: #7fb3e8;
}

.hero-cake .wick {
  stroke: var(--choc);
  stroke-width: 2;
  stroke-linecap: round;
}

.hero-cake .flame-glow {
  fill: var(--yellow);
  opacity: .35;
}

.hero-cake .flame {
  fill: #ff9d1c;
}

.hero-cake .flame-wrap {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: flicker 1.8s ease-in-out infinite alternate;
}

@keyframes flicker {
  0% { transform: rotate(-3deg) scaleY(1); }
  50% { transform: rotate(2deg) scaleY(1.06); }
  100% { transform: rotate(-1deg) scaleY(.96); }
}

/* sprinkles, shared by the hero and the cake drawing */
.sprinkle.s1,
.sprinkle.sp1 { fill: #ffc629; }
.sprinkle.s2,
.sprinkle.sp2 { fill: #4fb3a9; }
.sprinkle.s3,
.sprinkle.sp3 { fill: #ffffff; }
.sprinkle.s4,
.sprinkle.sp4 { fill: #6c8ee0; }
.sprinkle.s5,
.sprinkle.sp5 { fill: #9b5de5; }

/* ---------- page */

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: grid;
  gap: 24px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 30px;
  min-width: 0;
}

.card h2 {
  font-size: clamp(26px, 3vw, 34px);
}

.section-head {
  margin-bottom: 16px;
}

.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 70ch;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

/* ---------- controls */

.controls-card {
  display: grid;
  gap: 20px;
}

.shape-picker {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.shape-picker legend,
.field-label {
  display: block;
  padding: 0;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #73654c;
}

.shape-option {
  position: relative;
  cursor: pointer;
}

.shape-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.shape-option span {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 12px 6px 10px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fff;
  font-weight: 800;
  font-size: 15px;
  transition: border-color .15s, background .15s;
}

.shape-option svg {
  width: 30px;
  height: 30px;
  fill: var(--icing-light);
  stroke: var(--icing-dark);
  stroke-width: 1.6;
}

.shape-option input:checked + span {
  border-color: var(--ink);
  background: var(--yellow-soft);
}

.shape-option input:focus-visible + span {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

.size-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: block;
  min-width: 0;
}

.unit-input {
  display: flex;
  align-items: center;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.unit-input:focus-within {
  border-color: var(--ink);
}

.unit-input input {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 10px 12px;
  font-size: 20px;
  font-weight: 800;
  background: transparent;
  outline: none;
}

.unit {
  padding-right: 14px;
  color: var(--muted);
  font-weight: 700;
}

input[aria-invalid="true"],
select[aria-invalid="true"] {
  color: var(--berry);
}

.unit-input:has(input[aria-invalid="true"]) {
  border-color: var(--berry);
}

.stepper {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.stepper button {
  flex: 0 0 52px;
  min-height: 52px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.stepper button:hover,
.stepper button:focus-visible {
  border-color: var(--ink);
  background: var(--yellow-soft);
}

.stepper input {
  flex: 1;
  min-width: 0;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
  text-align: center;
  font: 600 28px 'Fredoka', sans-serif;
}

.stepper input:focus {
  outline: none;
  border-color: var(--ink);
}

.people {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 0 14px;
}

.people summary {
  cursor: pointer;
  padding: 14px 0;
  font-weight: 800;
}

.people[open] summary {
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}

.optional {
  margin-left: 6px;
  font-weight: 600;
  color: var(--muted);
  font-size: 14px;
}

.hint {
  margin: 0 0 10px;
  font-size: 15px;
  color: var(--muted);
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.chip {
  border: 1.5px solid #d9cfb6;
  border-radius: 999px;
  background: var(--panel);
  padding: 5px 12px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.chip:hover,
.chip:focus-visible {
  border-color: var(--ink);
  background: var(--yellow-soft);
}

.people-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  gap: 6px;
  max-height: 420px;
  overflow-y: auto;
}

.person {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) minmax(0, 118px);
  gap: 6px;
  align-items: center;
}

.person-no {
  font-weight: 800;
  color: var(--muted);
  text-align: right;
  font-size: 14px;
}

.person-name,
.person-share {
  width: 100%;
  min-width: 0;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 7px 9px;
  background: #fff;
  font-size: 15px;
}

.person-name:focus,
.person-share:focus {
  outline: none;
  border-color: var(--ink);
}

.errors:empty {
  display: none;
}

.errors {
  border-radius: 14px;
  background: #fde7ef;
  color: #8a1342;
  padding: 10px 14px;
  font-weight: 700;
}

.errors p {
  margin: 0;
}

/* ---------- result */

.result-card {
  display: grid;
  gap: 18px;
}

.result-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.result-card.is-stale .cake-figure,
.result-card.is-stale .numbers {
  opacity: .35;
}

.cake-figure {
  margin: 0;
  justify-self: center;
  width: min(100%, 500px);
}

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

.cake .plate {
  fill: #efe6d2;
}

.cake .plate-rim {
  fill: var(--plate);
  stroke: var(--line);
  stroke-width: 1.5px;
  vector-effect: non-scaling-stroke;
}

.cake .cake-side {
  fill: var(--icing-dark);
}

.cake .cake-top {
  fill: var(--icing);
}

.cake .slice-a {
  fill: var(--icing);
}

.cake .slice-b {
  fill: var(--icing-light);
}

.cake .slice-c {
  fill: #f8b6cd;
}

.cake .piping {
  fill: var(--cream);
  stroke: #f3d9c6;
  stroke-width: 1px;
  vector-effect: non-scaling-stroke;
}

.cake .cut-under {
  stroke: rgba(255, 255, 255, .85);
  stroke-width: 6px;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.cake .cut {
  stroke: var(--choc);
  stroke-width: 2.5px;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.cake .centre-dot {
  fill: var(--choc);
}

.cake .candle-glow {
  fill: var(--yellow);
  opacity: .35;
}

.cake .candle-wax {
  fill: #fff;
  stroke: #7fb3e8;
  stroke-width: 2px;
  vector-effect: non-scaling-stroke;
}

.cake .candle-ring {
  fill: #7fb3e8;
}

.cake .candle-flame {
  fill: #ff9d1c;
  stroke: var(--yellow);
  stroke-width: 1px;
  vector-effect: non-scaling-stroke;
}

.cake .label {
  font-family: 'Nunito Sans', sans-serif;
  font-weight: 800;
  fill: var(--choc);
  stroke: #fff;
  paint-order: stroke;
  stroke-linejoin: round;
}

.numbers {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.numbers > div {
  background: var(--yellow-soft);
  border-radius: 16px;
  padding: 12px 14px;
}

.numbers dt {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #73654c;
}

.numbers dd {
  margin: 2px 0 0;
  font: 600 26px 'Fredoka', sans-serif;
  line-height: 1.15;
}

.numbers .note {
  display: block;
  font: 600 13px 'Nunito Sans', sans-serif;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary,
.ghost {
  min-height: 48px;
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  border: 2px solid transparent;
}

.primary {
  background: var(--yellow);
  border-color: var(--yellow);
}

.primary:hover,
.primary:focus-visible {
  background: #f0b400;
  border-color: var(--ink);
}

.ghost {
  background: transparent;
  border-color: #d9cfb6;
}

.ghost:hover,
.ghost:focus-visible {
  border-color: var(--ink);
}

.print-note,
.share-status {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
}

.share-status:empty {
  display: none;
}

.share-status {
  color: var(--ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* ---------- steps */

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 10px;
  max-width: 80ch;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 46px;
  min-height: 34px;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--icing-light);
  color: var(--choc);
  font: 600 17px 'Fredoka', sans-serif;
}

.piece-table:empty {
  display: none;
}

.piece-table {
  margin-top: 20px;
  overflow-x: auto;
}

.piece-table table {
  border-collapse: collapse;
  min-width: 100%;
  font-size: 15px;
}

.piece-table th,
.piece-table td {
  text-align: left;
  padding: 7px 12px 7px 0;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.piece-table th {
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #73654c;
}

/* ---------- fun */

.fun-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.fun-grid .card p {
  margin: 12px 0 0;
}

.fun-grid .card h2 {
  font-size: clamp(24px, 2.4vw, 30px);
}

.fair-card {
  background: var(--yellow-soft);
  border-color: #f2d77c;
}

.aside {
  font-size: 15px;
  color: var(--muted);
}

.seven {
  display: block;
  width: min(100%, 190px);
  height: auto;
  margin: 14px auto 6px;
}

.seven-cake {
  fill: var(--icing-light);
  stroke: var(--icing-dark);
  stroke-width: 3;
}

.seven-cut {
  stroke: var(--choc);
  stroke-width: 2;
  stroke-linecap: round;
}

.seven-string {
  stroke: var(--gold);
  stroke-width: 3;
  stroke-dasharray: 6 5;
  stroke-linecap: round;
}

.seven-hex {
  fill: #fff;
  stroke: var(--gold);
  stroke-width: 2.5;
}

.seven-mark {
  fill: var(--choc);
}

.seven-steps {
  margin: 10px 0 0;
  padding-left: 22px;
  display: grid;
  gap: 6px;
}

.facts {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.facts li {
  position: relative;
  padding-left: 22px;
}

.facts li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: .55em;
  width: 11px;
  height: 4px;
  border-radius: 2px;
  background: var(--icing-dark);
  transform: rotate(-35deg);
}

.facts li:nth-child(2n)::before {
  background: #4fb3a9;
}

.facts li:nth-child(3n)::before {
  background: var(--yellow);
}

.small-print {
  font-size: 15px;
  color: var(--muted);
}

.small-print p {
  max-width: 80ch;
}

.small-print p:first-child {
  margin-top: 0;
}

.small-print p:last-child {
  margin-bottom: 0;
}

/* ---------- the template: only on paper */

.print-area {
  display: none;
}

/* ---------- small screens */

@media (max-width: 1020px) {
  .fun-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .facts-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .hero-inner,
  .workbench,
  .fun-grid {
    grid-template-columns: 1fr;
  }

  .hero-inner {
    gap: 18px;
    padding-top: 28px;
  }

  .hero-art {
    width: min(100%, 300px);
  }
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .justbee-return {
    padding-inline: 16px;
  }

  .justbee-return .brand {
    width: 126px;
  }

  .justbee-return > a:last-child {
    font-size: 12px;
  }

  .hero-inner,
  .page {
    padding-inline: 16px;
  }

  .page {
    gap: 16px;
  }

  .card {
    padding: 22px 18px;
  }

  .subline {
    font-size: 18px;
  }

  .hero-art {
    width: min(100%, 240px);
  }

  .numbers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .numbers dd {
    font-size: 22px;
  }

  .person {
    grid-template-columns: 22px minmax(0, 1fr) minmax(0, 104px);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- print: the template at real size, nothing else */

@page {
  size: A4 portrait;
  margin: 8mm;
}

@media print {
  body {
    background: #fff;
    font-size: 10pt;
  }

  body > *:not(.print-area) {
    display: none !important;
  }

  .print-area {
    display: block;
  }

  .print-page {
    break-after: page;
    page-break-after: always;
    break-inside: avoid;
  }

  .print-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .print-title {
    margin: 0 0 2mm;
    font: 700 10pt 'Nunito Sans', sans-serif;
    color: #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .print-tile {
    display: block;
    overflow: hidden;
  }

  .print-foot {
    display: flex;
    align-items: flex-start;
    gap: 5mm;
    margin-top: 3mm;
    height: 11mm;
    overflow: hidden;
  }

  .control-line {
    flex: 0 0 auto;
    display: block;
  }

  .print-notes p {
    margin: 0;
    font-size: 7.5pt;
    line-height: 1.25;
    color: #222;
  }

  .tpl-cake {
    fill: #fff5f8;
    stroke: #000;
  }

  .tpl-cut,
  .tpl-mark,
  .tpl-control {
    stroke: #000;
    stroke-linecap: butt;
  }

  .tpl-frame {
    fill: none;
    stroke: #999;
  }

  .tpl-join {
    stroke: #555;
    stroke-dasharray: .3 .2;
  }

  .tpl-label,
  .tpl-small {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 800;
    fill: #000;
  }

  .tpl-label {
    stroke: #fff;
    paint-order: stroke;
  }

  .tpl-small {
    font-weight: 700;
  }
}
