/* Fair Copy Classes: a ruled notebook page.
   Blue ink is the centre's voice. Red pen only ever marks results. */

/* Anek Latin (Ek Type, Mumbai), cut to the characters and three styles the site uses. */
@font-face {
  font-family: "Anek Latin";
  src: url("../fonts/anek-reg400.woff2") format("woff2");
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
}
@font-face {
  font-family: "Anek Latin";
  src: url("../fonts/anek-reg600.woff2") format("woff2");
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
}
@font-face {
  font-family: "Anek Latin";
  src: url("../fonts/anek-cond700.woff2") format("woff2");
  font-weight: 700;
  font-stretch: 75%;
  font-display: swap;
}
@font-face {
  font-family: "Kalam";
  src: url("../fonts/kalam-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --paper: #ffffff;
  --leaf: #f2f5fa;
  --rule: #c9d6ea;
  --rule-strong: #7f95bc;
  --ink: #1e3a94;
  --ink-deep: #14275f;
  --graphite: #2a2e35;
  --muted: #55606e;
  --red: #c8232c;
  --wa: #127a46;

  --line: 28px; /* the notebook's line height; the hero sits on it */
  --gutter: 16px;
  --margin-x: 12px; /* where the red margin runs */
  --indent: 34px; /* content starts after the margin */

  --sans: "Anek Latin", "Segoe UI", system-ui, sans-serif;
  --hand: "Kalam", "Segoe Print", cursive;
  --radius: 6px;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 16px;
}
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--graphite);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-stretch: 100%;
  font-weight: 400;
  padding-bottom: 76px; /* room for the phone action bar */
  overflow-x: hidden;
}

/* The red double margin of an exercise book, on the ruled pages only (hero, page heads). */
.hero::before,
.page-head::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--margin-x);
  width: 5px;
  border-left: 1.5px solid var(--red);
  border-right: 1.5px solid var(--red);
  opacity: 0.5;
  pointer-events: none;
}
[id] {
  scroll-margin-top: 72px;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure,
blockquote {
  margin: 0;
}
ul,
ol {
  padding: 0;
  list-style: none;
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: var(--ink);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
a:hover {
  text-decoration-thickness: 2.5px;
}
:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
  border-radius: 2px;
}
strong {
  font-weight: 600;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: absolute;
  left: var(--indent);
  top: -100px;
  z-index: 20;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  border-radius: var(--radius);
}
.skip:focus {
  top: 8px;
}

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: var(--indent);
  padding-right: var(--gutter);
}
.narrow {
  max-width: 820px;
}
.muted {
  color: var(--muted);
}

/* ---------- type ---------- */

h1,
h2,
.h-small,
.logo-name,
.contents-group-name,
.year-label,
.step-title,
.btn,
.action-bar a {
  font-stretch: 75%;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0;
}
h1 {
  font-size: 2.875rem; /* 46px on two notebook lines */
  line-height: calc(var(--line) * 2);
  text-wrap: balance;
}
h2 {
  font-size: 2.25rem;
  line-height: 1.05;
  text-wrap: balance;
}
.h-small {
  font-size: 1.625rem;
  line-height: 1.1;
  margin-bottom: 18px;
}
h3 {
  font-size: 1.1875rem;
  line-height: 1.3;
  font-weight: 600;
  color: var(--graphite);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 22px;
  border-radius: var(--radius);
  font-size: 1.1875rem;
  line-height: 1;
  text-decoration: none;
  border: 2px solid transparent;
}
.btn-ink {
  background: var(--ink);
  color: #fff;
}
.btn-ink:hover {
  background: var(--ink-deep);
}
.btn-wa {
  background: var(--wa);
  color: #fff;
}
.btn-wa:hover {
  background: #0d6338;
}
.btn-line {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--paper);
}
.btn-line:hover {
  background: var(--leaf);
}
.btn svg {
  flex: none;
}
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--wa);
  font-weight: 600;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 1px 0 rgba(20, 39, 95, 0.04), 0 6px 14px -10px rgba(20, 39, 95, 0.25);
}
.header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-right: auto;
}
.mark {
  flex: none;
  width: 34px;
  height: 34px;
}
.mark .m-paper {
  fill: #fff;
}
.mark .m-rule {
  stroke: var(--rule);
}
.mark .m-margin {
  stroke: var(--red);
}
.mark .m-edge {
  stroke: var(--ink);
}
.mark-letters {
  font-family: var(--sans);
  font-stretch: 75%;
  font-weight: 700;
  font-size: 21px;
  fill: var(--ink);
}
.logo-words {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.logo-name {
  font-size: 1.375rem;
  line-height: 1;
  white-space: nowrap;
}
.logo-place {
  display: none;
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 3px;
}
.nav-wide,
.header-demo {
  display: none;
}
.nav-small {
  position: static;
}
.nav-small summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 1.5px solid var(--rule-strong);
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}
.nav-small summary::-webkit-details-marker {
  display: none;
}
.burger,
.burger::before,
.burger::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}
.burger {
  position: relative;
}
.burger::before,
.burger::after {
  content: "";
  position: absolute;
  left: 0;
}
.burger::before {
  top: -6px;
}
.burger::after {
  top: 6px;
}
.nav-small[open] .burger {
  background: transparent;
}
.nav-small[open] .burger::before {
  top: 0;
  transform: rotate(45deg);
}
.nav-small[open] .burger::after {
  top: 0;
  transform: rotate(-45deg);
}
.nav-small nav {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
  box-shadow: 0 12px 24px rgba(20, 39, 95, 0.12);
  padding: 8px var(--gutter) 16px var(--indent);
}
.nav-small nav a {
  display: block;
  padding: 12px 0;
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
.nav-small nav li:last-child a {
  border-bottom: 0;
}
[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 2.5px;
  text-underline-offset: 6px;
}

/* ---------- hero: text sitting on the ruled lines ---------- */

.hero {
  position: relative;
  padding: calc(var(--line) * 1) 0 calc(var(--line) * 2);
  background-image: linear-gradient(to bottom, transparent calc(var(--line) - 1px), var(--rule) calc(var(--line) - 1px));
  background-size: 100% var(--line);
  background-position: 0 21px;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "classes" "title" "body" "slip";
}
.hero-classes {
  grid-area: classes;
  font-size: 1rem;
  line-height: 1.4;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 14px;
}
.hero h1 {
  grid-area: title;
  font-size: 12.2vw;
  line-height: 1.02;
  margin-bottom: 20px;
}
.hero h1 span {
  display: block;
  text-wrap: balance;
}
.hero-body {
  grid-area: body;
}
.hero-lede,
.page-lede {
  font-size: 1.1875rem;
  line-height: var(--line);
  max-width: 40ch;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}
.hero-actions .btn {
  min-height: 56px;
}
.hero-note {
  margin-top: 10px;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--muted);
}
@media (max-width: 599px) {
  .hero-actions .btn {
    flex: 1 1 100%;
  }
  .slip-table tr {
    display: grid;
    grid-template-columns: auto auto 1fr;
    column-gap: 14px;
    padding: 8px 0;
  }
  .slip-table th {
    grid-column: 1 / -1;
    padding: 0 0 2px;
  }
  .slip-table td {
    padding: 0;
  }
}

/* The result slip: a marked paper pinned on the ruled page. */
.hero-slip {
  grid-area: slip;
  position: relative;
  margin-top: 28px;
  padding: 18px 18px 16px;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-top: 4px solid var(--red);
  border-radius: 4px;
  box-shadow: 0 14px 28px -18px rgba(20, 39, 95, 0.45);
}
.slip-head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
}
.slip-head .circled {
  font-size: 2.375rem;
  line-height: 1;
}
.proof-text {
  font-family: var(--hand);
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.35;
  color: var(--red);
}
.slip-table {
  width: 100%;
  margin-top: 14px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.slip-table tr {
  border-top: 1px dashed var(--rule-strong);
}
.slip-table th,
.slip-table td {
  padding: 8px 8px 8px 0;
  text-align: left;
  font-size: 0.9375rem;
  line-height: 1.3;
  vertical-align: baseline;
}
.slip-table th {
  font-weight: 600;
  color: var(--graphite);
}
.slip-table td {
  color: var(--muted);
  white-space: nowrap;
}
.slip-table td strong {
  color: var(--graphite);
}
.slip-link {
  margin-top: 10px;
  font-weight: 600;
}

/* A red-pen ring drawn by hand around a mark. */
.circled {
  display: inline-block;
  position: relative;
  padding: 0.18em 0.55em 0.22em;
  color: var(--red);
  font-stretch: 75%;
  font-weight: 700;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 100' preserveAspectRatio='none'%3E%3Cpath d='M112 7C61 3 12 17 8 47c-4 33 47 46 98 45 51-1 88-14 86-44C190 19 150 6 96 9 72 10 50 16 40 22' fill='none' stroke='%23c8232c' stroke-width='3.2' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E")
    center / 100% 100% no-repeat;
}
.circled-big {
  padding: 0.22em 0.5em 0.28em;
}

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

.section {
  position: relative;
  padding: 56px 0;
}
.section-timetable,
.section-demo {
  background: var(--leaf);
}
.section-head {
  margin-bottom: 28px;
  max-width: 44rem;
}
.section-head p {
  margin-top: 12px;
  font-size: 1.125rem;
  max-width: 52ch;
}
.more {
  margin-top: 24px;
  font-weight: 600;
}
.split {
  display: grid;
  gap: 48px;
}

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

.page-head {
  position: relative;
  padding: var(--line) 0 calc(var(--line) * 1.5);
  border-bottom: 1px solid var(--rule);
  background-image: linear-gradient(to bottom, transparent calc(var(--line) - 1px), var(--rule) calc(var(--line) - 1px));
  background-size: 100% var(--line);
  background-position: 0 21px;
}
.page-head h1 {
  max-width: 20ch;
  line-height: 1.08;
  padding: 4px 0 10px;
}
.crumb {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: var(--line);
}
