/* InstaScrollBlock: the page is one sheet of squared school paper (Seyès ruling). */

@font-face {
  font-family: "Shantell Sans";
  src: url("fonts/shantell-sans.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/atkinson-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("fonts/atkinson-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --line: 32px;                 /* one Seyès square */
  --paper: #fffdf8;
  --desk: #d9dbe3;
  --rule: #e3e6f7;              /* thin writing lines */
  --rule-strong: #b8c1ec;       /* square lines */
  --margin-ink: #c13584;        /* the margin line and the "teacher's pen" */
  --magenta: #c13584;
  --magenta-deep: #9c2468;
  --ink: #18215a;               /* blue ballpoint */
  --ink-soft: #3a4478;
  --marker: #14122b;            /* black felt marker for headings */
  --ok: #1f6b45;
  --warn: #8a5300;
  --margin: 72px;               /* distance from sheet edge to margin line */
  --hand: "Shantell Sans", "Comic Sans MS", cursive;
  --body: "Atkinson Hyperlegible", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font: 400 17px/var(--line) var(--body);
}

::selection { background: #f6c6e0; color: var(--marker); }
:focus-visible { outline: 3px solid var(--magenta); outline-offset: 3px; border-radius: 4px; }
a { color: var(--magenta-deep); text-decoration-thickness: 2px; text-underline-offset: 4px; }
a:hover { color: var(--magenta); }
strong { color: var(--marker); }
em { font-style: normal; font-weight: 700; color: var(--marker); }
code { font: 600 14px/1.6 ui-monospace, "Cascadia Mono", Consolas, monospace; word-break: break-all; color: var(--ink-soft); }
.nowrap { white-space: nowrap; }

/* ---------------------------------------------------------------- the sheet */

.desk { padding: 40px 24px 64px; }

.sheet {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--line) 56px calc(var(--line) * 2) calc(var(--margin) + 40px);
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, var(--rule-strong) 1px, transparent 1px),
    linear-gradient(to bottom, var(--rule-strong) 1px, transparent 1px),
    linear-gradient(to bottom, var(--rule) 1px, transparent 1px);
  background-size: var(--line) 100%, 100% var(--line), 100% calc(var(--line) / 4);
  background-position: var(--margin) 0, 0 0, 0 0;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(40, 30, 20, .12), 0 18px 40px -12px rgba(40, 30, 20, .28);
}
/* Margin line: the paper's red line, in the app's magenta */
.sheet::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: var(--margin);
  width: 2px;
  background: var(--margin-ink);
  opacity: .8;
}
/* No grid inside the margin, like a real copybook page */
.sheet::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: var(--margin);
  background:
    radial-gradient(circle at 50% 50%, var(--desk) 0 9px, #c3c6d2 9.5px, transparent 10.5px) 0 calc(var(--line) * 3) / 100% calc(var(--line) * 8) repeat-y,
    var(--paper);
  border-radius: 3px 0 0 3px;
}
.sheet > * { position: relative; z-index: 1; }

/* ---------------------------------------------------------------- header */

.sheet-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 32px;
  min-height: calc(var(--line) * 2);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font: 700 22px/var(--line) var(--hand);
  color: var(--marker);
  text-decoration: none;
}
.brand-icon { width: 36px; height: 36px; flex: none; }
.sheet-head ul { display: flex; flex-wrap: wrap; gap: 4px 24px; margin: 0; padding: 0; list-style: none; }
.sheet-head li a {
  font: 600 17px/var(--line) var(--hand);
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(var(--magenta), var(--magenta));
  background-size: 0 2px;
  background-repeat: no-repeat;
  background-position: 0 85%;
  transition: background-size .25s cubic-bezier(.2, .7, .2, 1);
}
.sheet-head li a:hover { background-size: 100% 2px; color: var(--marker); }

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: var(--line) 48px;
  align-items: start;
  padding-top: calc(var(--line) * 2);
  padding-bottom: calc(var(--line) * 2);
}

h1, h2, h3 { font-family: var(--hand); color: var(--marker); text-wrap: balance; }
h1 {
  margin: 0 0 var(--line);
  font-size: clamp(38px, 4.3vw, 58px);
  line-height: calc(var(--line) * 2);
  font-weight: 800;
  letter-spacing: -0.02em;
}
/* The second sentence is written in the teacher's magenta and underlined twice with a ruler */
.ink-pen {
  color: var(--magenta);
  background-image:
    linear-gradient(var(--magenta), var(--magenta)),
    linear-gradient(var(--magenta), var(--magenta));
  background-size: 100% 3px, 100% 3px;
  background-position: 0 92%, 0 100%;
  background-repeat: no-repeat;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding-bottom: 6px;
}

.lede { max-width: 34em; margin: 0 0 var(--line); font-size: 19px; }

.cta { margin: 0 0 var(--line); }
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 0 28px 0 22px;
  border-radius: 14px;
  background: var(--magenta);
  color: #fff;
  font: 700 21px/1 var(--hand);
  text-decoration: none;
  box-shadow: 0 2px 0 var(--magenta-deep), 0 10px 22px -8px rgba(156, 36, 104, .55);
  transform: rotate(-1deg);
  transition: transform .2s cubic-bezier(.2, .7, .2, 1), box-shadow .2s, background-color .2s;
}
.btn-download svg { width: 26px; height: 26px; }
.btn-download:hover { color: #fff; background: #b02c78; transform: rotate(0deg) translateY(-2px); box-shadow: 0 4px 0 var(--magenta-deep), 0 16px 28px -10px rgba(156, 36, 104, .6); }
.btn-download:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--magenta-deep), 0 6px 14px -8px rgba(156, 36, 104, .5); }
.btn-download.small { min-height: 52px; font-size: 18px; transform: none; }

.cta-meta { margin: 16px 0 0; color: var(--ink-soft); font-size: 15px; }
.link-check { font: 600 18px/var(--line) var(--hand); }

.nevers {
  display: flex;
  flex-wrap: wrap;
  gap: 0 28px;
  margin: 0;
  padding: 0;
  list-style: none;
  font: 600 16px/var(--line) var(--hand);
  color: var(--ink);
}
.nevers li { display: inline-flex; align-items: center; gap: 8px; }
.nevers li::before {
  content: "";
  width: 18px; height: 18px;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M3 10.5l4.5 4.5L17 4.5' fill='none' stroke='%23c13584' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------------- demo phone */

.demo {
  margin: 0;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 0 20px;
  align-items: start;
}
.phone {
  width: 236px;
  height: 448px;
  border: 3px solid var(--marker);
  border-radius: 34px;
  background: #fff;
  padding: 14px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 14px 30px -14px rgba(20, 18, 43, .45);
  transform: rotate(1.5deg);
  user-select: none;
  -webkit-user-select: none;
}
.phone-top { display: flex; justify-content: space-between; align-items: center; padding: 0 6px; height: 24px; }
.phone-title { font: 700 16px/1 var(--hand); color: var(--marker); }
.ico, .tabs svg { width: 20px; height: 20px; color: var(--marker); }

.stories {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 4px;
  flex: none;
  touch-action: pan-x;
  cursor: grab;
}
.stories::-webkit-scrollbar { display: none; }
.stories span {
  flex: none;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 2.5px solid var(--magenta);
  background: radial-gradient(circle at 50% 38%, #c9cde6 0 7px, transparent 7.5px), radial-gradient(circle at 50% 110%, #c9cde6 0 15px, #eef0fa 15.5px);
}

.feed {
  position: relative;
  flex: 1;
  overflow: hidden;
  border-radius: 10px;
  touch-action: none;
  cursor: ns-resize;
}
.feed-track { will-change: transform; }
.post header { display: flex; align-items: center; gap: 6px; font: 600 12px/28px var(--body); color: var(--ink); padding: 0 4px; }
.post header i { width: 18px; height: 18px; border-radius: 50%; background: #c9cde6; }
.pic { height: 150px; border-radius: 6px; margin-bottom: 10px; }
.p1 { background: linear-gradient(160deg, #f3b9d6, #c9cdf2); }
.p2 { background: linear-gradient(200deg, #ffe2a8, #f4a7b9); }
.p3 { background: linear-gradient(170deg, #bfe3d4, #b9c7f2); }
.no-scroll {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 96px; height: 96px;
  margin: -48px 0 0 -48px;
  color: var(--magenta);
  opacity: 0;
  transform: scale(.85);
  transition: opacity .25s, transform .35s cubic-bezier(.2, .7, .2, 1);
  pointer-events: none;
  filter: drop-shadow(0 4px 10px rgba(255, 255, 255, .9));
}
.feed.is-blocked .no-scroll { opacity: .95; transform: scale(1); }

.tabs { display: flex; justify-content: space-around; align-items: center; height: 36px; border-top: 1.5px solid #e4e6f2; flex: none; }

figcaption { display: flex; flex-direction: column; padding-top: 52px; }
.note {
  position: relative;
  margin: 0;
  font: 600 17px/26px var(--hand);
  color: var(--magenta-deep);
  max-width: 15em;
}
.note-feed { margin-top: 92px; }
.note-tabs { margin-top: 150px; }
.arrow {
  position: absolute;
  left: -84px;
  top: 2px;
  width: 80px;
  height: 36px;
  overflow: visible;
}
.arrow path { fill: none; stroke: var(--magenta); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* Arrows draw themselves once, when the page opens */
.draw { stroke-dasharray: 160; stroke-dashoffset: 0; }
@media (prefers-reduced-motion: no-preference) {
  .js .draw { stroke-dashoffset: 160; animation: draw 1s cubic-bezier(.3, .6, .2, 1) forwards; }
  .js .note-stories .draw { animation-delay: .5s; }
  .js .note-feed .draw { animation-delay: .9s; }
  .js .note-tabs .draw { animation-delay: 1.3s; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.feed-note-ok { color: var(--magenta); }

/* ---------------------------------------------------------------- sections */

.block {
  padding-top: calc(var(--line) * 2);
  padding-bottom: var(--line);
}
.margin-label {
  position: absolute;
  left: calc(-1 * (var(--margin) + 40px));
  width: var(--margin);
  top: calc(var(--line) * 2);
  margin: 0;
  text-align: center;
  font: 700 17px/calc(var(--line) * 2) var(--hand);
  color: var(--magenta);
  transform: rotate(-4deg);
}
h2 {
  margin: 0 0 var(--line);
  font-size: clamp(30px, 3.6vw, 42px);
  line-height: calc(var(--line) * 2);
  font-weight: 750;
  letter-spacing: -0.015em;
}
h3 { margin: var(--line) 0 0; font-size: 21px; line-height: var(--line); font-weight: 700; }
.block p { max-width: 40em; margin: 0 0 var(--line); }
.intro { font-size: 18px; }

/* ---------------------------------------------------------------- checker */

.detected {
  display: inline-block;
  padding: 0 14px;
  margin-bottom: var(--line) !important;
  background: #fff6c2;
  font: 600 16px/var(--line) var(--hand);
  color: var(--marker);
  transform: rotate(-.6deg);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
}

.quiz {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--line) 48px;
  max-width: 880px;
}
.q { margin: 0; padding: 0; border: 0; min-width: 0; }
.q-title { display: block; padding: 0; margin-bottom: 4px; font: 700 18px/var(--line) var(--hand); color: var(--marker); }
.q-help { margin: 6px 0 0 !important; font-size: 14px; color: var(--ink-soft); line-height: 24px; }

select {
  width: 100%;
  min-height: 48px;
  padding: 0 44px 0 14px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 8l5 5 5-5' fill='none' stroke='%2318215a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center / 18px;
  color: var(--marker);
  font: 600 17px/1.2 var(--body);
  appearance: none;
  cursor: pointer;
}
select:hover { border-color: var(--magenta); }

.box {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--line);
  padding: 4px 0;
  cursor: pointer;
  line-height: 24px;
}
.box input {
  appearance: none;
  flex: none;
  width: 24px; height: 24px;
  margin: 0;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: #fff;
  display: grid;
  place-content: center;
  cursor: pointer;
}
.box input::after {
  content: "";
  width: 18px; height: 18px;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M3 10.5l4.5 4.5L17 4.5' fill='none' stroke='%23c13584' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  transform: scale(0);
  transition: transform .18s cubic-bezier(.16, 1, .3, 1);
}
.box input:checked { border-color: var(--magenta); }
.box input:checked::after { transform: scale(1.15); }
.box:hover input { border-color: var(--magenta); }

/* The result is "graded" in magenta pen */
.grade { margin: calc(var(--line) * 1.5) 0 var(--line); max-width: 880px; }
.verdict {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0 24px;
  align-items: start;
}
.verdict-mark {
  position: relative;
  width: 112px; height: 112px;
  display: grid;
  place-items: center;
  font: 800 19px/1.05 var(--hand);
  color: var(--magenta);
  text-align: center;
  transform: rotate(-8deg);
}
.verdict-mark svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.verdict-mark path { fill: none; stroke: var(--magenta); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 400; stroke-dashoffset: 0; }
@media (prefers-reduced-motion: no-preference) {
  .verdict.fresh .verdict-mark path { animation: circle .7s cubic-bezier(.3, .6, .2, 1) both; }
}
@keyframes circle { from { stroke-dashoffset: 400; } to { stroke-dashoffset: 0; } }
.verdict.no .verdict-mark, .verdict.no .verdict-mark path { color: var(--marker); stroke: var(--marker); }
.verdict h3 { margin-top: 8px; font-size: 24px; }
.verdict.yes h3 { color: var(--ok); }
.verdict.no h3 { color: var(--marker); }
.verdict ul { margin: 0 0 var(--line); padding-left: 20px; }
.verdict li { margin: 0; }
.verdict li::marker { color: var(--magenta); }
.verdict .tip { font-family: var(--hand); font-weight: 600; color: var(--magenta-deep); }

.aside { font-size: 16px; color: var(--ink-soft); }

/* ---------------------------------------------------------------- install */

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; max-width: 46em; }
.steps > li { position: relative; counter-increment: step; padding-left: 64px; margin-bottom: var(--line); }
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border: 2.5px solid var(--marker);
  border-radius: 50% 46% 52% 48%;
  font: 800 22px/1 var(--hand);
  color: var(--marker);
}
.steps h3 { margin: 6px 0 4px; }
.steps p { margin: 0 0 8px !important; }
.pen-note {
  font-family: var(--hand);
  font-weight: 600;
  font-size: 16px;
  color: var(--magenta-deep);
  line-height: 28px;
}

/* A sticky note stuck onto step 2: the Play Protect block */
.blocked-box {
  margin: 16px 0 8px;
  padding: 18px 22px 10px;
  background: #fff6c2;
  border-radius: 4px;
  transform: rotate(-.4deg);
  box-shadow: 0 1px 1px rgba(60, 50, 0, .08), 0 10px 18px -12px rgba(60, 50, 0, .35);
}
.blocked-box h4 { margin: 0 0 6px; font: 700 19px/28px var(--hand); color: var(--marker); }
.blocked-box p { margin: 0 0 10px !important; line-height: 28px; }
.sub-steps { margin: 0 0 12px; padding-left: 26px; list-style: lower-alpha; }
.sub-steps li { line-height: 28px; margin: 2px 0; }
.sub-steps li::marker { color: var(--magenta); font-family: var(--hand); font-weight: 700; }
.blocked-box code { font-size: 13px; background: rgba(255, 255, 255, .7); padding: 1px 5px; border-radius: 4px; word-break: break-word; }

/* ---------------------------------------------------------------- notes */

.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 40px;
}
.notes-grid h3:first-child { margin-top: 0; }
.notes-grid p { font-size: 16px; }
.ticks, .crosses { list-style: none; margin: 0 0 var(--line); padding: 0; font-size: 16px; }
.ticks li, .crosses li { position: relative; padding-left: 30px; line-height: 26px; margin: 3px 0; }
.ticks li::before, .crosses li::before {
  content: "";
  position: absolute;
  left: 0; top: 4px;
  width: 18px; height: 18px;
  background: no-repeat center / contain;
}
.ticks li::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M3 10.5l4.5 4.5L17 4.5' fill='none' stroke='%231f6b45' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.crosses li::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 3v9' stroke='%23c13584' stroke-width='3' stroke-linecap='round'/%3E%3Ccircle cx='10' cy='16.5' r='1.8' fill='%23c13584'/%3E%3C/svg%3E"); }
.hash { line-height: 24px !important; font-size: 14px !important; color: var(--ink-soft); }

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

.sheet-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
  padding-top: var(--line);
  margin-top: var(--line);
  border-top: 2px solid var(--magenta);
}
.sheet-foot p { margin: 0; font-size: 15px; color: var(--ink-soft); line-height: 24px; }

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

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .demo { justify-self: start; }
  .notes-grid { grid-template-columns: 1fr 1fr; }
  .notes-grid > div:last-child { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  :root { --margin: 30px; }
  body { font-size: 16px; }
  .desk { padding: 0; }
  .sheet { padding: 16px 18px calc(var(--line) * 2) calc(var(--margin) + 16px); border-radius: 0; }
  .sheet::after { background: var(--paper); }
  .sheet-head ul { gap: 0 18px; }
  .sheet-head li a { font-size: 16px; }
  .hero { padding-top: var(--line); }
  h1 { font-size: clamp(32px, 9.4vw, 44px); line-height: 48px; }
  .lede { font-size: 17px; }
  .btn-download { width: 100%; justify-content: center; }
  .demo { grid-template-columns: 1fr; justify-items: center; justify-self: stretch; }
  .phone { transform: none; }
  figcaption { padding-top: var(--line); width: 100%; }
  .note { max-width: none; padding-left: 0; }
  .note .arrow { display: none; }
  .note-feed, .note-tabs { margin-top: 0; }
  .note { margin-bottom: 8px; }
  .margin-label { display: none; }
  h2 { line-height: 44px; }
  .quiz { grid-template-columns: 1fr; }
  .verdict { grid-template-columns: 1fr; }
  .verdict-mark { width: 92px; height: 92px; font-size: 16px; }
  .steps > li { padding-left: 54px; }
  .steps > li::before { width: 38px; height: 38px; font-size: 19px; }
  .blocked-box { margin-left: -54px; padding: 16px 16px 8px; transform: none; }
  .notes-grid { grid-template-columns: 1fr; }
}
