/* Coloring Fun Free. Owner's brand: violet + yellow, bright tool cards, illustrated covers.
   Display: Fredoka (rounded, playful). Body: Montserrat (the brand font). */

:root {
  --violet: #5b4bc4;
  --violet-2: #7c5ce6;
  --violet-dark: #3a2d7a;
  --night: #2e2557;
  --lav: #f4f2fd;
  --lav-2: #e7e3f7;
  --yellow: #ffd447;
  --green: #0f9d6e;
  --red: #e0533f;
  --text: #2e2557;
  --muted: #6e6885;
  --paper: #ffffff;
  --rule-mid: #cfc8ef;
  --r: 24px;
  --r-s: 14px;
  --wrap: 1240px;
  --shadow: 0 10px 30px rgba(91, 75, 196, .14);
  --display: "Fredoka", "Montserrat", system-ui, sans-serif;
  font-size: 17px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font-family: "Montserrat", system-ui, sans-serif; line-height: 1.6; }
img { max-width: 100%; display: block; }
a { color: var(--violet); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.12; color: var(--night); margin: 0 0 .45em; font-weight: 600; }
h1 { font-size: clamp(2.1rem, 4.8vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; max-width: 66ch; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 50; }

/* Header */
.site-head { background: #fff; position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 0 var(--lav-2); }
.site-head .wrap { display: flex; align-items: center; gap: 24px; min-height: 76px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; text-decoration: none; }
.logo img { height: 46px; width: auto; }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.nav a { text-decoration: none; padding: 9px 14px; border-radius: 999px; color: var(--text); font-weight: 600; font-size: .95rem; }
.nav a:hover { background: var(--lav); color: var(--violet); }
.nav a[aria-current="page"] { background: var(--violet); color: #fff; }
@media (max-width: 700px) {
  .site-head .wrap { min-height: 64px; gap: 6px; padding-top: 8px; padding-bottom: 8px; }
  .logo img { height: 38px; }
  .nav { margin-left: 0; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .nav a { white-space: nowrap; font-size: .88rem; padding: 7px 12px; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 24px; border-radius: 999px; border: 2px solid var(--violet); background: var(--violet); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(91, 75, 196, .3); }
.btn.yellow { background: var(--yellow); border-color: var(--yellow); color: var(--night); }
.btn.ghost { background: transparent; color: var(--violet); }
.btn.on-dark { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.btn.small { padding: 8px 16px; font-size: .9rem; }
.btn:disabled { opacity: .5; cursor: default; transform: none; box-shadow: none; }

/* Hero */
.hero { position: relative; overflow: hidden; margin: 18px 18px 0; border-radius: 32px; background: radial-gradient(120% 140% at 0% 0%, #8a6cf0 0%, var(--violet) 45%, #4a3aae 100%); color: #fff; }
.hero .wrap { position: relative; z-index: 2; display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; padding-top: 64px; padding-bottom: 84px; }
.hero h1 { color: #fff; }
.hero h1 .accent { display: block; color: var(--yellow); }
.hero .lead { font-size: 1.08rem; color: #e9e5ff; }
.pill { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25); color: #fff; padding: 6px 14px; border-radius: 999px; font-size: .85rem; font-weight: 600; margin-bottom: 18px; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 6px 0 28px; }
.hero-stats { display: flex; gap: 34px; flex-wrap: wrap; }
.hero-stats b { display: block; font-family: var(--display); font-size: 1.6rem; font-weight: 600; color: #fff; line-height: 1.1; }
.hero-stats span { font-size: .82rem; color: #d7d0ff; }
.hero-visual { position: relative; justify-self: center; }
.hero-card { display: block; text-decoration: none; position: relative; width: min(340px, 100%); background: #fff; border-radius: 20px; padding: 14px 14px 12px; transform: rotate(3deg); box-shadow: 0 24px 50px rgba(30, 20, 90, .35); }
.hero-card img { border-radius: 10px; aspect-ratio: 3 / 4; object-fit: contain; width: 100%; background: #fff; }
.hero-card .cap { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); padding: 8px 4px 0; font-weight: 600; }
.sticker { white-space: nowrap; position: absolute; top: -16px; right: -14px; background: var(--yellow); color: var(--night); font-family: var(--display); font-weight: 600; padding: 8px 14px; border-radius: 999px; transform: rotate(10deg); box-shadow: 0 6px 14px rgba(0,0,0,.15); font-size: .95rem; }
.hero-card2 { display: block; position: absolute; width: 150px; left: -80px; bottom: -30px; transform: rotate(-9deg); background: #fff; border-radius: 14px; padding: 8px; box-shadow: 0 16px 30px rgba(30,20,90,.3); }
.hero-card2 img { border-radius: 8px; aspect-ratio: 3/4; object-fit: contain; }
.doodles { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.doodles svg { position: absolute; }
.hero-wave { position: absolute; left: 0; right: 0; bottom: -1px; z-index: 1; width: 100%; height: 56px; display: block; }
@media (max-width: 900px) {
  .hero { margin: 10px; border-radius: 24px; }
  .hero .wrap { grid-template-columns: 1fr; padding-top: 40px; padding-bottom: 70px; }
  .hero-card { width: 240px; }
  .hero-card2 { display: none; }
  .doodles { display: none; }
}

/* Section scaffolding */
.section { padding: 56px 0; }
.section.tight { padding: 22px 0; }
.section.tint { background: var(--lav); }
.section-title { text-align: center; margin-bottom: 30px; }
.section-title h2 { display: inline-block; color: var(--violet); padding-bottom: 14px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 12'%3E%3Cpath d='M2 8 Q 15 2 30 7 T 60 7 T 90 7 T 118 6' fill='none' stroke='%23FFD447' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E") center bottom / 160px 12px no-repeat; }
.section-title p { margin: 4px auto 0; color: var(--muted); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.section-head h2 { color: var(--violet); }
.section-head p { margin: 0; color: var(--muted); }
.center { text-align: center; margin-top: 28px; }

/* Age picker */
.age-box { background: #fff; border: 2px solid var(--lav-2); border-radius: var(--r); padding: 24px; box-shadow: var(--shadow); }
.age-box h2 { font-size: 1.45rem; color: var(--night); margin-bottom: 2px; }
.age-box > p { color: var(--muted); font-size: .92rem; margin-bottom: 16px; }
.ages { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
@media (max-width: 760px) { .ages { grid-template-columns: repeat(2, 1fr); } }
.age { display: block; text-align: center; text-decoration: none; border-radius: 18px; padding: 16px 8px; border: 2px solid; transition: transform .15s; }
.age:hover { transform: translateY(-3px) rotate(-1deg); }
.age .n { display: block; font-family: var(--display); font-size: 1.6rem; font-weight: 600; line-height: 1.1; }
.age .t { display: block; font-size: .82rem; color: var(--muted); }
.age.c1 { background: #fff0f4; border-color: #ffc6d5; color: #d6336c; }
.age.c2 { background: #fff8e1; border-color: #ffe39a; color: #b7791f; }
.age.c3 { background: #e9f8f1; border-color: #a8e3c7; color: #0b7f58; }
.age.c4 { background: #e8f4fd; border-color: #a9d6f5; color: #1f6fb2; }
.age.c5 { background: #f1eefd; border-color: #cfc5f5; color: var(--violet); }

/* Tool cards */
.tools-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .tools-row { grid-template-columns: 1fr; } }
.tool-card { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px; padding: 24px; border-radius: var(--r); color: #fff; text-decoration: none; transition: transform .2s; }
.tool-card:hover { transform: translateY(-4px); }
.tool-card::before, .tool-card::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.tool-card::before { width: 150px; height: 150px; top: -50px; right: -40px; background: rgba(255,255,255,.15); }
.tool-card::after { width: 70px; height: 70px; bottom: -18px; left: 20px; background: rgba(255,255,255,.1); }
.tool-card .ic { width: 56px; height: 56px; border-radius: 16px; background: rgba(255,255,255,.22); display: grid; place-items: center; }
.tool-card .ic svg { width: 30px; height: 30px; }
.tool-card h3 { color: #fff; font-size: 1.4rem; margin: 0; }
.tool-card p { margin: 0; color: rgba(255,255,255,.92); font-size: .92rem; flex: 1; }
.tool-card .go { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(255,255,255,.25); padding-top: 12px; font-weight: 700; }
.tool-card .go i { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.25); display: grid; place-items: center; font-style: normal; transition: transform .15s; }
.tool-card:hover .go i { transform: translateX(4px); }
.tool-card.violet { background: linear-gradient(135deg, #7c5ce6, #6d3ee0); box-shadow: 0 8px 22px rgba(109,62,224,.28); }
.tool-card.green { background: linear-gradient(135deg, #12b07c, #0b7f58); box-shadow: 0 8px 22px rgba(11,127,88,.28); }
.tool-card.red { background: linear-gradient(135deg, #ec6a55, #c63b2c); box-shadow: 0 8px 22px rgba(198,59,44,.28); }

/* Seasonal banner */
.season { display: flex; align-items: center; gap: 16px; justify-content: space-between; flex-wrap: wrap; background: var(--yellow); border-radius: 20px; padding: 16px 20px; }
.season .em { width: 48px; height: 48px; border-radius: 14px; background: rgba(255,255,255,.5); display: grid; place-items: center; font-size: 1.5rem; flex: none; }
.season .txt { flex: 1; min-width: 200px; }
.season b { display: block; font-family: var(--display); font-size: 1.15rem; font-weight: 600; color: #3a2b00; }
.season span { font-size: .88rem; color: #7a5a00; }

/* Illustrated covers (skills, coloring categories) */
.covers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 960px) { .covers { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .covers { grid-template-columns: repeat(2, 1fr); gap: 12px; } }
.cover { display: block; text-decoration: none; color: var(--text); background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 4px 0 var(--lav-2), var(--shadow); transition: transform .2s; }
.cover:nth-child(odd):hover { transform: translateY(-4px) rotate(-1.2deg); }
.cover:nth-child(even):hover { transform: translateY(-4px) rotate(1.2deg); }
.cover .pic { display: block; aspect-ratio: 1; background: var(--lav); overflow: hidden; }
.cover .pic img { width: 100%; height: 100%; object-fit: cover; }
.cover .name { display: block; text-align: center; padding: 10px 10px 2px; font-weight: 700; color: var(--violet); }
.cover .meta { display: block; text-align: center; padding: 0 10px 12px; font-size: .8rem; color: var(--muted); }

/* Skill cards on inner pages */
.skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.skill { display: block; text-decoration: none; color: var(--text); background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 4px 0 var(--lav-2), var(--shadow); transition: transform .2s; }
.skill:hover { transform: translateY(-4px); }
.skill .pic { display: block; aspect-ratio: 1; background: var(--lav); }
.skill .pic img { width: 100%; height: 100%; object-fit: cover; }
.skill .body { display: block; padding: 12px 16px 16px; }
.skill h3 { color: var(--violet); margin-bottom: 2px; }
.skill p { margin: 0; color: var(--muted); font-size: .88rem; }
.skill .count { display: inline-block; margin-top: 6px; font-size: .8rem; font-weight: 700; color: var(--night); background: var(--yellow); padding: 2px 10px; border-radius: 999px; }

/* Games */
.games { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .games { grid-template-columns: 1fr; } }
.game-card { display: block; text-decoration: none; color: var(--text); background: #fff; border-radius: var(--r); padding: 20px; box-shadow: 0 4px 0 var(--lav-2), var(--shadow); transition: transform .2s; }
.game-card:hover { transform: translateY(-4px); }
.game-card svg { width: 100%; height: 130px; margin-bottom: 12px; background: var(--lav); border-radius: 16px; padding: 10px; }
.game-card h3 { color: var(--violet); }
.game-card p { margin: 0; color: var(--muted); font-size: .92rem; }

/* Grids of printables */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 20px; }
.card { display: block; text-decoration: none; color: var(--text); }
.card .pic { display: block; aspect-ratio: 3 / 4; background: #fff; border: 2px solid var(--lav-2); border-radius: 16px; overflow: hidden; transition: transform .2s, border-color .2s, box-shadow .2s; }
.card .pic img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.card:hover .pic { border-color: var(--violet-2); transform: translateY(-3px); box-shadow: var(--shadow); }
.card .name { display: block; margin-top: 8px; font-weight: 700; line-height: 1.3; font-size: .95rem; }
.card .meta { display: block; color: var(--muted); font-size: .8rem; }
.card[hidden], [data-group][hidden] { display: none; }
@media (max-width: 600px) { .grid, .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .skill .body p { display: none; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.chip { padding: 8px 16px; border-radius: 999px; border: 2px solid var(--lav-2); background: #fff; color: var(--violet); font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; text-decoration: none; }
.chip:hover { border-color: var(--violet-2); }
.chip[aria-pressed="true"] { background: var(--violet); border-color: var(--violet); color: #fff; }

/* Inner page header */
.band { background: linear-gradient(180deg, var(--lav) 0%, #fff 100%); }
.page-head { position: relative; padding: 34px 0 26px; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--muted); }
.page-head .intro { font-size: 1.05rem; }
.facts { display: inline-block; background: var(--yellow); color: var(--night); font-weight: 700; font-size: .85rem; padding: 4px 12px; border-radius: 999px; margin: 0 0 12px; }

/* Single printable */
.printable { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 44px; align-items: start; padding-bottom: 30px; }
@media (max-width: 860px) { .printable { grid-template-columns: 1fr; gap: 24px; } }
.printable > .pic { background: #fff; border-radius: 22px; padding: 14px; box-shadow: 0 6px 0 var(--lav-2), var(--shadow); transform: rotate(-1deg); }
.printable .actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.tip { background: #fff8e1; border: 2px dashed var(--yellow); padding: 12px 16px; border-radius: 16px; margin: 18px 0; }
.tip p { margin: 0; }

.prose { max-width: 72ch; }
.prose h2 { font-size: 1.6rem; color: var(--violet); margin-top: 1.4em; }
.prose h3 { margin-top: 1.2em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .3em; }
.prose img { height: auto; border-radius: 12px; }

/* Tracing pad + games */
.tracer, .board { background: #fff; border-radius: var(--r); padding: 16px; box-shadow: 0 6px 0 var(--lav-2), var(--shadow); }
.tracer canvas { width: 100%; height: auto; aspect-ratio: 4 / 3; touch-action: none; cursor: crosshair; display: block; border-radius: 14px; }
.tracer-bar, .board-bar { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.board-bar { margin: 0 0 12px; }
.tracer-bar .msg { flex: 1 1 220px; margin: 0 0 0 4px; color: var(--muted); font-size: .92rem; }
.board-bar .msg { margin: 0 0 0 auto; color: var(--muted); }
.msg.win { color: var(--green) !important; font-weight: 700; }
.letters { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; }
.letters button { width: 40px; height: 40px; border-radius: 12px; border: 2px solid var(--lav-2); background: #fff; font: inherit; font-family: var(--display); font-weight: 600; font-size: 1.05rem; color: var(--violet); cursor: pointer; }
.letters button[aria-pressed="true"] { background: var(--violet); color: #fff; border-color: var(--violet); }
.letters button.done { border-color: var(--green); background: #e9f8f1; }
.letters button.done[aria-pressed="true"] { background: var(--green); color: #fff; }
#maze { width: 100%; max-width: 620px; height: auto; aspect-ratio: 1; touch-action: none; display: block; margin: 0 auto; }
.pad { display: grid; grid-template-columns: repeat(3, 56px); gap: 6px; justify-content: center; margin-top: 12px; }
.pad button { height: 56px; border-radius: 14px; border: 2px solid var(--lav-2); background: #fff; font-size: 1.4rem; cursor: pointer; color: var(--violet); }
.pad .up { grid-column: 2; } .pad .left { grid-column: 1; grid-row: 2; } .pad .down { grid-column: 2; grid-row: 2; } .pad .right { grid-column: 3; grid-row: 2; }
@media (pointer: fine) { .pad { display: none; } }
.pattern { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; min-height: 92px; padding: 10px 0; }
.pattern svg { width: 64px; height: 64px; }
.slot { width: 72px; height: 72px; border: 3px dashed var(--rule-mid); border-radius: 16px; display: grid; place-items: center; font-size: 2rem; color: var(--rule-mid); font-weight: 700; }
.slot.filled { border-style: solid; border-color: var(--green); }
.options { display: flex; gap: 14px; justify-content: center; margin: 18px 0 6px; flex-wrap: wrap; }
.options button { width: 92px; height: 92px; border-radius: 20px; border: 2px solid var(--lav-2); background: #fff; cursor: pointer; display: grid; place-items: center; }
.options button:hover { border-color: var(--violet-2); }
.options button.wrong { border-color: var(--red); animation: shake .3s; }
.options svg { width: 60px; height: 60px; }
.stars { text-align: center; color: var(--muted); }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* Forms */
.form { display: grid; gap: 14px; max-width: 520px; }
.form label { display: grid; gap: 4px; font-weight: 700; }
.form input, .form textarea { font: inherit; padding: 11px 14px; border: 2px solid var(--lav-2); border-radius: var(--r-s); background: #fff; }
.form .status { min-height: 1.5em; margin: 0; }

/* Footer with a wave on top */
.site-foot { position: relative; margin-top: 80px; background: var(--violet-dark); color: #d9d3f5; padding: 60px 0 28px; }
.site-foot::before { content: ""; position: absolute; left: 0; right: 0; top: -39px; height: 40px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 40' preserveAspectRatio='none'%3E%3Cpath d='M0 40 C 150 0 300 0 450 20 S 750 40 900 18 S 1100 0 1200 22 V40 Z' fill='%233A2D7A'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.site-foot a { color: #fff; text-decoration: none; }
.site-foot a:hover { text-decoration: underline; }
.site-foot .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; }
@media (max-width: 760px) { .site-foot .cols { grid-template-columns: 1fr 1fr; } }
.site-foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: .92rem; }
.site-foot h2 { color: var(--yellow); font-size: 1.1rem; }
.foot-logo { display: inline-block; background: #fff; border-radius: 16px; padding: 8px 12px; }
.foot-logo img { height: 40px; width: auto; }
.site-foot small { display: block; margin-top: 30px; color: #b3a9e3; }

/* Color online */
.colorer { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .colorer { grid-template-columns: 1fr; } .colorer .tools { order: 2; position: sticky; bottom: 0; z-index: 5; } }
.colorer .tools { background: #fff; border-radius: var(--r); padding: 16px; display: grid; gap: 12px; box-shadow: var(--shadow); border: 2px solid var(--lav-2); }
.colorer .row { display: flex; gap: 6px; flex-wrap: wrap; }
.colorer .tool { flex: 1; }
.swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
@media (min-width: 861px) { .swatches { grid-template-columns: repeat(5, 1fr); } }
.swatch { aspect-ratio: 1; border-radius: 10px; border: 2px solid rgba(0,0,0,.1); cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { outline: 3px solid var(--violet); outline-offset: 2px; }
.swatches input[type=color] { width: 100%; height: 100%; aspect-ratio: 1; border: 2px dashed var(--rule-mid); border-radius: 10px; padding: 0; background: #fff; cursor: pointer; }
.colorer .paper { background: #fff; border-radius: var(--r); padding: 10px; min-height: 300px; display: grid; place-items: center; box-shadow: var(--shadow); }
.colorer canvas { width: 100%; height: auto; touch-action: none; cursor: crosshair; display: block; }
.colorer label { display: flex; gap: 10px; align-items: center; font-size: .9rem; }
.colorer label input { flex: 1; accent-color: var(--violet); }
.chip.tool[aria-pressed="true"] { background: var(--violet); color: #fff; border-color: var(--violet); }

/* AR overlay */
.ar { position: fixed; inset: 0; z-index: 100; background: #15102e; color: #fff; display: grid; }
.ar canvas { width: 100%; height: 100%; object-fit: cover; display: none; }
.ar.live canvas { display: block; grid-area: 1 / 1; }
.ar-panel { grid-area: 1 / 1; align-self: center; justify-self: center; max-width: 360px; margin: 16px; padding: 24px; background: #241c52; border-radius: var(--r); display: grid; gap: 12px; text-align: center; }
.ar.live .ar-panel { align-self: end; max-width: 520px; width: calc(100% - 32px); background: rgba(21,16,46,.82); text-align: left; }
.ar-panel p { margin: 0; color: #d8d3f2; }
.ar-panel .ar-title { color: #fff; font-family: var(--display); font-weight: 600; font-size: 1.2rem; }
.ar-range { display: none; gap: 10px; align-items: center; font-size: .9rem; }
.ar.live .ar-range { display: flex; }
.ar-range input { flex: 1; accent-color: var(--yellow); }
.ar-actions { display: flex; gap: 8px; justify-content: center; }
.ar .btn.ghost { color: #fff; border-color: #fff; }

/* Pack generator */
.pack { background: #fff; border-radius: var(--r); padding: 26px; max-width: 860px; box-shadow: 0 6px 0 var(--lav-2), var(--shadow); }
.pack h2 { font-size: 1.45rem; color: var(--violet); }
.pack .picks { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 18px; }
.pack .nav-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.pack ol { padding-left: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.pack li { display: flex; gap: 10px; align-items: center; font-size: .92rem; }
.pack li img { width: 40px; height: 54px; object-fit: contain; border: 1px solid var(--lav-2); background: #fff; border-radius: 6px; }
.pack input[type=text] { font: inherit; padding: 11px 14px; border: 2px solid var(--lav-2); border-radius: var(--r-s); width: 100%; max-width: 360px; }
.steps-label { color: var(--muted); font-size: .9rem; margin-bottom: 4px; font-weight: 600; }

/* How-it-works steps and FAQ on tool pages */
.how { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: how; padding: 0; margin: 0; }
@media (max-width: 860px) { .how { grid-template-columns: 1fr 1fr; } }
.how li { list-style: none; background: #fff; border-radius: 20px; padding: 18px; box-shadow: var(--shadow); }
.how li::before { counter-increment: how; content: counter(how); display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--yellow); font-family: var(--display); font-weight: 600; margin-bottom: 8px; }
.how b { display: block; color: var(--violet); }
.how span { font-size: .9rem; color: var(--muted); }
.faq { max-width: 820px; }
.faq details { background: #fff; border-radius: 16px; padding: 14px 18px; margin-bottom: 10px; box-shadow: 0 2px 0 var(--lav-2); }
.faq summary { font-weight: 700; cursor: pointer; color: var(--night); }
.faq details p { margin: 8px 0 0; }

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

/* Soft lavender band behind inner page headers */
body { overflow-x: clip; }
.page-head { isolation: isolate; }
.page-head::before { content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; left: -50vw; right: -50vw; background: linear-gradient(180deg, var(--lav) 0%, rgba(244,242,253,0) 100%); }
.page-head::after { content: ""; position: absolute; z-index: -1; right: 0; top: 24px; width: 120px; height: 60px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 60'%3E%3Cpath d='M60 6l3.6 8.2 8.9.8-6.7 5.9 2 8.7-7.8-4.6-7.8 4.6 2-8.7-6.7-5.9 8.9-.8z' fill='%23FFD447'/%3E%3Ccircle cx='100' cy='38' r='8' fill='none' stroke='%23CFC8EF' stroke-width='3'/%3E%3Ccircle cx='20' cy='44' r='5' fill='%23FF8FB1'/%3E%3C/svg%3E") no-repeat; }
@media (max-width: 700px) { .page-head::after { display: none; } }

/* Header dropdowns (desktop): open on hover or keyboard focus */
.dd { position: relative; }
.dd-menu { display: none; position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 30; background: #eef1f6; border-radius: 20px; padding: 14px; gap: 12px; grid-auto-flow: column; grid-auto-columns: 200px; box-shadow: 0 18px 40px rgba(46,37,87,.18); }
.dd-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.dd:hover .dd-menu, .dd:focus-within .dd-menu { display: grid; }
.dd-group { background: #fff; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 2px 6px rgba(46,37,87,.06); }
.dd-group b { display: block; text-align: center; background: #c3eafb; color: var(--night); padding: 10px; font-size: .95rem; }
.dd-group a { display: block; text-align: center; padding: 9px 12px; color: var(--text); text-decoration: none; font-weight: 500; font-size: .92rem; border-radius: 0; }
.dd-group a:hover { background: var(--lav); color: var(--violet); }
.dd:last-child .dd-menu { left: auto; right: 0; transform: none; }
@media (max-width: 900px) { .dd-menu { display: none !important; } }
/* centred buttons under sections */
.center { max-width: none; }

/* Images keep their proportions (width/height attributes are only hints) */
img { height: auto; }
.cover .pic img, .skill .pic img, .card .pic img { height: 100%; }
.hero .wrap > *, .printable > * { min-width: 0; }
h1, h2 { overflow-wrap: break-word; }

/* Pagination */
.card.off { display: none; }
.pager { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 28px 0 8px; }
.pager a, .pager span { min-width: 42px; height: 42px; padding: 0 12px; display: inline-grid; place-items: center; border-radius: 999px; text-decoration: none; font-weight: 700; }
.pager a { background: #fff; border: 2px solid var(--lav-2); color: var(--violet); }
.pager a:hover { border-color: var(--violet-2); }
.pager a[aria-current="page"] { background: var(--violet); border-color: var(--violet); color: #fff; }
.pager span { color: var(--muted); }

/* Mobile menu: burger button + full-width panel */
.nav-toggle { display: none; }
@media (max-width: 900px) {
  .site-head .wrap { flex-wrap: nowrap; min-height: 64px; padding-top: 8px; padding-bottom: 8px; }
  .logo img { height: 40px; }
  .nav-toggle { display: grid; gap: 5px; margin-left: auto; width: 46px; height: 46px; place-content: center; border: 0; border-radius: 14px; background: var(--lav); cursor: pointer; }
  .nav-toggle span { display: block; width: 22px; height: 3px; border-radius: 3px; background: var(--violet); transition: transform .2s, opacity .2s; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; margin: 0; width: auto; overflow: auto; max-height: calc(100vh - 64px); flex-direction: column; align-items: stretch; gap: 0; background: #fff; padding: 10px 16px 20px; box-shadow: 0 16px 30px rgba(46,37,87,.15); }
  .nav.open { display: flex; }
  .nav > a, .dd > a { display: block; font-size: 1.05rem; padding: 12px 14px; border-radius: 14px; white-space: normal; }
  .dd-menu { display: grid !important; position: static; transform: none; background: none; box-shadow: none; padding: 0 0 8px 14px; grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: 1fr 1fr; gap: 0 12px; }
  .dd-menu::before { display: none; }
  .dd-group { background: none; box-shadow: none; border-radius: 0; }
  .dd-group b { background: none; text-align: left; padding: 8px 0 2px; font-size: .78rem; color: var(--muted); }
  .dd-group a { text-align: left; padding: 6px 0; }
  .site-head .wrap { position: relative; }
  body.menu-open { overflow: hidden; }
}

/* Phones: a compact hero that fits on one screen */
@media (max-width: 600px) {
  .hero .wrap { padding-top: 26px; padding-bottom: 54px; gap: 0; }
  .hero h1 { font-size: 1.85rem; margin-bottom: .35em; }
  .hero .lead { font-size: .92rem; line-height: 1.5; margin-bottom: .8em; }
  .pill { margin-bottom: 12px; font-size: .78rem; }
  .hero-actions { flex-direction: column; gap: 8px; margin: 4px 0 18px; }
  .hero-actions .btn { width: 100%; padding: 10px 16px; font-size: .92rem; }
  .hero-stats { display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 10px; }
  .hero-stats b { font-size: 1.2rem; white-space: nowrap; }
  .hero-stats span { display: block; font-size: .7rem; line-height: 1.3; }
  .hero-visual { display: none; }
}

/* Long texts: a white "reading card" with friendly headings and list cards */
.story { position: relative; max-width: 1120px; margin: 48px auto; background: #fff; border-radius: 28px; padding: 50px 64px; box-shadow: 0 6px 0 var(--lav-2), var(--shadow); line-height: 1.75; }
.section.tint .story { margin: 0 auto; }
.story::before { content: ""; position: absolute; top: -18px; right: 36px; width: 44px; height: 44px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l2.9 6.6 7.1.6-5.4 4.7 1.6 7-6.2-3.7-6.2 3.7 1.6-7L2 9.2l7.1-.6z' fill='%23FFD447' stroke='%23F2B705' stroke-width='.8'/%3E%3C/svg%3E") no-repeat center / contain; }
.story p { max-width: none; }
.story h2 { display: flex; align-items: center; gap: 12px; font-size: 1.55rem; color: var(--violet); margin: 1.7em 0 .55em; }
.story h2:first-child { margin-top: 0; }
.story h2::before { content: ""; flex: none; width: 12px; height: 12px; border-radius: 4px; background: var(--yellow); transform: rotate(45deg); }
.story h3 { color: var(--night); }
.story ul { list-style: none; padding: 0; margin: 0 0 1.3em; display: grid; gap: 10px; }
.story li { position: relative; margin: 0; padding: 12px 16px 12px 48px; background: var(--lav); border-radius: 16px; line-height: 1.6; }
.story li::before { content: "✓"; position: absolute; left: 14px; top: 13px; width: 22px; height: 22px; border-radius: 50%; background: var(--violet); color: #fff; font-size: .75rem; font-weight: 700; display: grid; place-items: center; }
.story ol { padding-left: 1.3em; }
.story a { font-weight: 600; text-decoration-color: rgba(91,75,196,.35); text-decoration-thickness: 2px; }
.story a:hover { text-decoration-color: var(--violet); }
.story > p:first-of-type { font-size: 1.06rem; }
.story p:last-child { margin-bottom: 0; }
@media (max-width: 700px) { .story { padding: 30px 20px; border-radius: 22px; margin: 32px auto; } .story h2 { font-size: 1.3rem; } .story li { padding-left: 44px; } }
