/* FocusEdge — the school exercise notebook.
   Ruled paper, a red margin line, royal-blue ink, red-ink ticks, and one
   marigold switch. Every colour below comes from these five tokens. */

:root {
  --paper:    #F6F8FB;   /* notebook paper, faintly blue */
  --rule:     #CFDBEE;   /* ruled line */
  --ink:      #1C2B5A;   /* royal-blue ink: text, primary */
  --margin:   #D9483B;   /* red margin line, teacher's ticks, "blocked" */
  --marigold: #F4B02A;   /* the switch, and only the switch-like things */

  --ink-soft: color-mix(in srgb, var(--ink) 72%, var(--paper));
  --ink-faint: color-mix(in srgb, var(--ink) 12%, var(--paper));
  --white: #FFFFFF;

  --display: 'Anek Latin', 'Hind', system-ui, sans-serif;
  --body: 'Hind', system-ui, sans-serif;
  --hand: 'Kalam', 'Comic Sans MS', cursive;

  --line: 32px;          /* one ruled line; vertical rhythm is built on it */
  --gutter: 16px;
  --margin-x: 20px;      /* where the red margin line sits */
  --max: 1120px;
}

@media (min-width: 720px) {
  :root { --gutter: 32px; --margin-x: 56px; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.6;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--marigold); outline-offset: 3px; border-radius: 4px; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

h1, h2, h3 {
  font-family: var(--display);
  font-variation-settings: 'wdth' 88;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}
h2 { font-size: clamp(32px, 5vw, 48px); margin-bottom: 16px; }
h3 { font-size: 22px; line-height: 1.2; font-variation-settings: 'wdth' 100; }
p { margin: 0 0 16px; }
.lede { font-size: 20px; color: var(--ink-soft); max-width: 34em; }
.hero .lede { color: var(--ink); font-size: 21px; }

/* The handwritten voice: a teacher's red-ink notes. Used sparingly. */
.note {
  font-family: var(--hand);
  color: var(--margin);
  font-size: 19px;
  line-height: 1.25;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
  font-variation-settings: 'wdth' 100;
  letter-spacing: -0.01em;
}
.brand img { width: 34px; height: 34px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--display);
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
  transition: transform .15s ease;
}
.button:hover { transform: translateY(-1px); }

/* ---------- Ruled paper ---------- */

.ruled {
  position: relative;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--line) - 1px),
    var(--rule) calc(var(--line) - 1px),
    var(--rule) var(--line)
  );
}
.ruled::before {                 /* the red margin line */
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: var(--margin-x);
  width: 2px;
  background: color-mix(in srgb, var(--margin) 55%, transparent);
  pointer-events: none;
}
.ruled > .wrap { padding-left: max(var(--gutter), calc(var(--margin-x) + 20px)); }

/* ---------- Hero ---------- */

.hero { padding: 48px 0 64px; }
.hero .wrap {
  display: grid;
  gap: 48px;
  align-items: center;
}
@media (min-width: 900px) {
  .hero { padding: 80px 0 96px; }
  .hero .wrap { grid-template-columns: 1.1fr 1fr; gap: 64px; }
}
.hero h1 {
  font-size: clamp(44px, 8vw, 84px);
  margin-bottom: 24px;
}
.hero h1 .underlined {
  position: relative;
  white-space: nowrap;
}
.hero h1 .underlined::after {       /* red-ink underline, the way a teacher marks it */
  content: '';
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: 0.04em;
  height: 0.09em;
  background: var(--margin);
  border-radius: 99px;
  transform: rotate(-1.2deg);
}

/* The switch */
.switch-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.switch {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 8px 20px 8px 8px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-family: var(--display);
  font-weight: 600;
  font-size: 19px;
  cursor: pointer;
}
.switch .track {
  position: relative;
  width: 64px;
  height: 36px;
  border-radius: 999px;
  background: var(--ink-faint);
  transition: background .25s ease;
}
.switch .knob {
  position: absolute;
  top: 4px; left: 4px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 3px rgb(28 43 90 / .35);
  transition: transform .25s cubic-bezier(.3,1.4,.5,1), background .25s ease;
}
.switch[aria-checked="true"] .track { background: var(--ink); }
.switch[aria-checked="true"] .knob { transform: translateX(28px); background: var(--marigold); }
.switch .state { min-width: 2.2em; text-align: left; color: var(--ink-soft); font-weight: 500; }
.switch-row .note { transform: rotate(-2deg); }

/* ---------- Phone ---------- */

.stage {
  position: relative;
  display: grid;
  justify-items: center;
}
.phone {
  position: relative;
  width: min(300px, 100%);
  padding: 14px;
  border-radius: 44px;
  background: var(--ink);
  box-shadow: 0 30px 60px -30px rgb(28 43 90 / .55);
}
.screen {
  position: relative;
  min-height: 560px;           /* phone-shaped, but grows rather than clipping */
  border-radius: 32px;
  background: var(--white);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 16px 14px 14px;
}
.statusbar {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 0 6px;
}
.clock {
  font-family: var(--display);
  font-size: 44px;
  font-weight: 600;
  line-height: 1;
  margin: 18px 6px 2px;
  font-variation-settings: 'wdth' 90;
}
.date { font-size: 13px; color: var(--ink-soft); margin: 0 6px 12px; }

.banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 2px 12px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--marigold);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .25s ease, transform .25s ease;
}
.phone.study .banner { opacity: 1; transform: none; }

.apps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.app {
  display: grid;
  justify-items: center;
  gap: 4px;
  font-size: 10.5px;
  line-height: 1.15;
  text-align: center;
  color: var(--ink);
  transition: color .3s ease;
}
.app .tile {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--t, var(--ink));
  color: var(--white);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
  transition: background .3s ease, color .3s ease, box-shadow .3s ease;
  transition-delay: calc(var(--i, 0) * 18ms);
}
.app .lock {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--margin);
  border: 2px solid var(--white);
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(.4);
  transition: opacity .2s ease, transform .25s cubic-bezier(.3,1.5,.5,1);
  transition-delay: calc(var(--i, 0) * 18ms);
}
.app .lock svg { width: 10px; height: 10px; }
.phone.study .app:not(.study-app) { color: color-mix(in srgb, var(--ink) 40%, var(--white)); }
.phone.study .app:not(.study-app) .tile { background: var(--ink-faint); color: color-mix(in srgb, var(--ink) 30%, var(--white)); }
.phone.study .app:not(.study-app) .lock { opacity: 1; transform: none; }
.phone.study .app.study-app .tile { box-shadow: 0 0 0 3px var(--marigold); }

.swap { display: grid; margin: 14px 0 12px; }
.swap > * { grid-area: 1 / 1; }
.search {
  align-self: start;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--ink-faint);
  color: var(--ink-soft);
  font-size: 13px;
  transition: opacity .2s ease;
}
.phone.study .search { opacity: 0; }

/* Study websites: appears with Study Mode, showing the sites the parent chose */
.sites {
  padding: 8px 8px 6px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--marigold) 16%, var(--white));
  box-shadow: inset 0 0 0 2px var(--marigold);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .3s ease .15s, transform .3s ease .15s;
}
.phone.study .sites { opacity: 1; transform: none; }
.sites-head {
  display: block;
  margin: 0 2px 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--ink-soft);
}
.sites ul {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.sites li {
  display: grid;
  justify-items: center;
  gap: 3px;
  font-size: 10px;
  line-height: 1.1;
  font-weight: 500;
}
.sites .fav {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--t);
  color: var(--white);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
}

.shield-chip {
  margin-top: auto;
  transform: translateY(0);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--ink-faint);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
}
.shield-chip svg { flex: none; width: 18px; height: 18px; }

/* Margin notes around the phone. Beside it on wide screens, under it on phones. */
.phone-notes { display: grid; gap: 8px; margin-top: 20px; max-width: 300px; }
.phone-notes .note { transition: opacity .25s ease; }
.phone-notes .when-study { opacity: .0; }
.stage.study .when-study { opacity: 1; }
@media (min-width: 1100px) {
  .phone-notes { position: absolute; inset: 0; margin: 0; max-width: none; pointer-events: none; }
  .phone-notes .note { position: absolute; width: 150px; }
  .phone-notes .n-study { top: 34%; left: calc(50% + 170px); transform: rotate(3deg); }
  .phone-notes .n-shield { bottom: 5%; right: calc(50% + 168px); text-align: right; transform: rotate(-3deg); }
}

/* ---------- Sections ---------- */

.section { padding: 80px 0; }
.section + .section { border-top: 1px solid var(--rule); }
@media (min-width: 900px) { .section { padding: 96px 0; } }

.split { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; gap: 80px; }
}

/* Picked up without asking: a browser that meets the block screen */
.browser {
  border: 2px solid var(--ink);
  border-radius: 20px;
  background: var(--white);
  overflow: hidden;
  width: 100%;
  margin-top: 24px;
}
.browser .bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  font-size: 14px;
  color: var(--ink-soft);
}
.browser .url {
  flex: 1;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--rule);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.browser .body {
  padding: 40px 24px 36px;
  text-align: center;
}
.browser .stop {
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--margin);
  display: grid;
  place-items: center;
}
.browser .stop svg { width: 30px; height: 30px; }
.browser h3 { margin-bottom: 8px; }
.browser p { color: var(--ink-soft); font-size: 16px; margin: 0; }

.always {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 4px 12px 4px 6px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
}
.always .dot {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--marigold);
}

/* The website list, marked like an exercise book */
.sitelist {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  width: 100%;
  margin-top: 24px;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: 0 16px 40px -28px rgb(28 43 90 / .5);
}
.sitelist.ruled::before { left: 52px; }
.sitelist li {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--line);
  margin: 0;
  padding: 0 20px 0 20px;
  font-size: 17px;
  line-height: var(--line);
}
.sitelist .mark {
  width: 22px;
  font-family: var(--hand);
  font-weight: 700;
  font-size: 22px;
  color: var(--margin);
  text-align: center;
}
.sitelist .site { padding-left: 14px; font-weight: 500; }
.sitelist .no .site { text-decoration: line-through; text-decoration-color: var(--margin); color: var(--ink-soft); }
.sitelist .head { font-family: var(--hand); color: var(--ink-soft); font-size: 17px; }

/* A notebook page: white, ruled, red margin, entries written on the lines
   with the teacher's red-ink mark in the margin. */
.page {
  list-style: none;
  margin: 0;
  padding: var(--line) 0;
  background-color: var(--white);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: 0 16px 40px -28px rgb(28 43 90 / .5);
}
.page.ruled::before { left: 52px; }
.marked li {
  display: grid;
  grid-template-columns: 52px 1fr;
  padding-right: 20px;
  font-size: 17px;
  line-height: var(--line);
}
.marked .mark {
  font-family: var(--hand);
  font-weight: 700;
  font-size: 22px;
  color: var(--margin);
  text-align: center;
}
.marked p { margin: 0; padding-left: 14px; color: var(--ink-soft); }
.marked strong { color: var(--ink); font-weight: 600; }
.spaced li + li { margin-top: var(--line); }   /* a blank ruled line between entries */
.marked .title {
  display: block;
  padding-left: 66px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  color: var(--ink);
}

/* The two things a built-in kids mode can't do */
.pair { display: grid; gap: 56px; margin-top: 48px; }
@media (min-width: 900px) {
  /* Subgrid lines up label, heading, text and panel across both columns, so
     the two panels start and end at the same height. */
  .pair { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto auto 1fr; gap: 0 64px; }
  .pair article { display: grid; grid-row: span 4; grid-template-rows: subgrid; }
  .pair .always { justify-self: start; }
}
.pair .browser { display: flex; flex-direction: column; }
.pair .browser .body { flex: 1; display: grid; align-content: center; }
.pair article > h3 { font-size: 26px; margin-bottom: 10px; }
.pair article > p { color: var(--ink-soft); margin: 0; }

/* Setup steps: a real sequence, so they are numbered */
.steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 32px;
  margin: 48px 0 0;
  padding: 0;
}
@media (min-width: 800px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
}
.steps li:nth-child(2)::before { background: var(--marigold); border-color: var(--marigold); }
.steps h3 { margin-bottom: 8px; }
.steps p { color: var(--ink-soft); margin: 0; }

/* Privacy */
.ledger {
  display: grid;
  gap: 24px;
  margin-top: 40px;
}
@media (min-width: 800px) { .ledger { grid-template-columns: 1fr 1fr; } }
.ledger { align-items: stretch; }   /* both pages the same height */

/* FAQ */
.faq { max-width: 760px; margin-top: 32px; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 20px 40px 20px 0;
  position: relative;
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.3;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  position: absolute;
  right: 4px;
  top: 16px;
  font-size: 28px;
  font-weight: 400;
  color: var(--margin);
}
.faq details[open] summary::after { content: '–'; }
.faq details p { color: var(--ink-soft); padding-bottom: 8px; }

/* Get the app */
.get { text-align: center; }
.get .wrap { display: grid; justify-items: center; }
.get.ruled > .wrap { padding-left: var(--gutter); }   /* centred, so no margin offset */
.get h2 { max-width: 16em; }
.get .lede { margin: 0 auto 32px; }
.get .soon { margin-top: 16px; color: var(--ink-soft); font-size: 16px; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 32px 0;
  font-size: 15px;
  color: var(--ink-soft);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
}
.site-footer nav { display: flex; gap: 20px; }

/* ---------- Legal pages ---------- */

.legal { max-width: 760px; padding-top: 56px; padding-bottom: 80px; }
.legal h1 { font-size: clamp(36px, 6vw, 56px); margin-bottom: 8px; }
.legal h2 { font-size: 26px; margin: 40px 0 12px; }
.legal .updated { color: var(--ink-soft); font-size: 15px; margin-bottom: 32px; }
.legal li { margin-bottom: 6px; }
.legal li::marker { color: var(--margin); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media (max-width: 479px) { .switch-row .note { display: none; } }

/* Mobile hero: the switch sits directly above the phone, and both fit on one
   screen, so flipping it and seeing the apps lock happen in the same view. */
@media (max-width: 899px) {
  .hero .wrap { gap: 20px; }
  .switch-row { justify-content: center; margin-top: 24px; }
  .phone { width: min(264px, 100%); padding: 12px; border-radius: 40px; }
  .screen { padding: 12px 10px 10px; border-radius: 29px; min-height: 500px; }
  .clock { font-size: 36px; margin-top: 12px; }
  .apps { gap: 10px 4px; }
  .app .tile { width: 40px; height: 40px; border-radius: 12px; font-size: 17px; }
}
