/* Mathlight's site in the app's own look: ground, white cards, accent blue, chunky
   bottom edges, Bricolage Grotesque headings and Inter body. Fonts are served from
   this site (nothing loaded from other servers). Light only, like the app. */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/BricolageGrotesque.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/Inter.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ground: #F3F4F8;
  --surface: #FFFFFF;
  --ink: #12162B;
  --muted: #5A6078;
  --line: #E3E5EE;
  --accent: #3D5AFE;
  --accent-edge: #2A3FC0;
  --accent-soft: #EEF1FF;
  --cube: #FFB020;
  --cube-edge: #C98300;
  --success: #1E8E5A;
  --display: "Bricolage Grotesque", system-ui, -apple-system, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 40px 64px;
}
body { position: relative; min-height: 100vh; }
main { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }

/* A few cubes and x boxes behind the page, down both sides. Wide screens: in the
   empty margins. Phones: they peek in from the screen edges, behind the cards. */
.tiles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; opacity: 0.5; }
.tiles i {
  position: absolute; width: var(--s); height: var(--s); border-radius: calc(var(--s) * 0.28);
  transform: rotate(var(--r));
  display: grid; place-items: center;
}
/* --o: 0 = next to the content, 1 = at the window edge. */
.tiles .l { left: calc((50% - 340px - var(--s)) * (1 - var(--o))); }
.tiles .r { right: calc((50% - 340px - var(--s)) * (1 - var(--o))); }
.tiles .cube { background: var(--cube); box-shadow: 0 3px 0 var(--cube-edge); }
.tiles .x { background: var(--accent); box-shadow: 0 3px 0 var(--accent-edge); }
.tiles .x::after { content: "x"; color: #FFFFFF; font: italic 600 calc(var(--s) * 0.55)/1 var(--body); margin-top: -0.1em; }
@media (max-width: 900px) {
  .tiles .l { left: calc(var(--s) * (-0.25 - 0.4 * var(--o))); }
  .tiles .r { right: calc(var(--s) * (-0.25 - 0.4 * var(--o))); }
}

/* Header: the app icon, the title and a row of tiles like the app's balance pans. */
header { display: flex; align-items: center; gap: 16px; margin-bottom: 4px; }
.icon {
  flex: none; width: 64px; height: 64px; border-radius: 16px;
  box-shadow: 0 4px 0 var(--line);
}
h1 {
  font-family: var(--display); font-weight: 800; font-size: clamp(30px, 6vw, 40px);
  line-height: 1.1; margin: 0; letter-spacing: -0.01em; text-wrap: balance;
}
.lead { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.cubes { display: flex; gap: 6px; margin-top: 10px; }
.cubes i {
  width: 14px; height: 14px; border-radius: 4px;
  background: var(--cube); box-shadow: 0 2px 0 var(--cube-edge);
}
.cubes i.x { background: var(--accent); box-shadow: 0 2px 0 var(--accent-edge); }

/* Page menu: pills with the app's chunky bottom edge. */
nav { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
nav a {
  font-weight: 700; font-size: 15px; text-decoration: none;
  padding: 8px 16px; border-radius: 999px;
  background: var(--surface); color: var(--ink);
  box-shadow: 0 4px 0 var(--line);
  transition: transform 80ms ease-out, box-shadow 80ms ease-out;
}
nav a:active { transform: translateY(4px); box-shadow: 0 0 0 var(--line); }
nav a[aria-current="page"] { background: var(--accent); color: #FFFFFF; box-shadow: 0 4px 0 var(--accent-edge); }

/* Cards: white on the ground, like the app's Home cards. The first one stands out in accent soft. */
.card, section {
  background: var(--surface); border-radius: 20px;
  padding: 22px 24px; display: flex; flex-direction: column; gap: 12px;
}
.card { background: var(--accent-soft); border-radius: 24px; }
.card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.card li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; }
.card li span { min-width: 0; }
.tick {
  width: 22px; height: 22px; margin-top: 3px; border-radius: 50%;
  background: var(--success);
  display: grid; place-items: center;
}
.tick svg { width: 12px; height: 12px; }
.tick path { fill: none; stroke: #FFFFFF; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

h2 {
  font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1.25;
  margin: 0; text-wrap: balance;
}
p { margin: 0; }
section ul, section ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
section li::marker { color: var(--accent); }

.path {
  font-weight: 600; color: var(--accent-edge);
  background: var(--accent-soft);
  border-radius: 6px; padding: 1px 4px;
}
.email { font-weight: 700; color: var(--accent); user-select: all; -webkit-user-select: all; overflow-wrap: anywhere; }
a { color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

footer { padding-top: 12px; color: var(--muted); font-size: 15px; text-align: center; }
footer a { font-weight: 600; }
