/* Technologies MapleDev site. Tokens follow the Munchmath design system (PLAN.md section 9 in the app repo). */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/assets/PlusJakartaSans.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --page: #F7F7F9;
  --track: #EFEFF2;
  --ink: #1E1E24;
  --ink2: #6B6B75;
  --ink2Tint: #5F5F69;
  --accent: #1E1E1E;
  --onAccent: #FFFFFF;
  --accentSoft: #F0F0F2;
  --hero: #CFC3F3;
  --onHero: #1E1E24;
  --ring: #6E5BC0;
  --tile1: #F7D9D9;
  --tile2: #DFEBCB;
  --tile3: #F6E3CC;
  --tile4: #E6DEF9;
  --radius-l: 28px;
  --radius-m: 20px;
  --radius-s: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141418;
    --surface: #1F1F25;
    --page: #141418;
    --track: #2E2E36;
    --ink: #F4F4F6;
    --ink2: #A8A8B3;
    --ink2Tint: #A8A8B3;
    --accent: #F4F4F6;
    --onAccent: #141418;
    --accentSoft: #2C2C34;
    --hero: #3B3260;
    --onHero: #F4F4F6;
    --ring: #B9AAF0;
    --tile1: #3B2B31;
    --tile2: #2D3826;
    --tile3: #3A3025;
    --tile4: #302A46;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--page);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  font-weight: 500;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 0;
}

img, svg { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { text-decoration-color: currentColor; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; border-radius: 6px; }

.skip {
  position: absolute;
  left: 16px;
  top: -48px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--onAccent);
  text-decoration: none;
  z-index: 10;
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 20px; }

/* Header */

.site-header { padding: 20px 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -0.01em; text-decoration: none; }
.brand img { width: 30px; height: 30px; }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 14px; }
.nav a { padding: 7px 12px; border-radius: 999px; text-decoration: none; color: var(--ink2); font-weight: 600; }
.nav a:hover { color: var(--ink); background: var(--accentSoft); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--accentSoft); }
.nav .lang { margin-left: 6px; border: 1.5px solid var(--track); color: var(--ink); }

main { flex: 1; }

/* Type */

h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.15; }
h1 { font-size: clamp(34px, 6vw, 54px); font-weight: 800; }
h2 { font-size: clamp(24px, 3.4vw, 30px); font-weight: 800; }
h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
.lede { font-size: clamp(17px, 2vw, 19px); color: var(--ink2); max-width: 36em; text-wrap: pretty; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink2); }

/* Buttons and badges */

.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  background: var(--accent);
  color: var(--onAccent);
}
.button.soft { background: var(--accentSoft); color: var(--ink); }
.button[aria-disabled="true"] { background: var(--accentSoft); color: var(--ink2); cursor: default; }
.button svg { width: 18px; height: 18px; fill: currentColor; }

/* Landing hero */

.hero { padding: 40px 0 56px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 48px; align-items: center; }
/* A hero with copy only (the studio home) uses one wide column. */
.hero.solo .wrap { grid-template-columns: minmax(0, 820px); }
.hero-copy { display: grid; gap: 20px; justify-items: start; }
.hero h1 { font-size: clamp(34px, 5.2vw, 50px); text-wrap: balance; }
/* French runs about a third longer, so its hero heading is a step smaller to keep two lines per sentence on wide screens. */
.hero h1:lang(fr) { font-size: clamp(32px, 4.2vw, 42px); }
.hero-art {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-l);
  background: var(--hero);
  display: grid;
  place-items: center;
}
.hero-art img { width: 52%; filter: drop-shadow(0 18px 30px rgb(30 30 36 / 0.18)); }

/* Sections and tiles */

.section { padding: 32px 0 56px; }
.section + .section { padding-top: 0; }
.section-head { display: grid; gap: 8px; margin-bottom: 24px; max-width: 40em; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.tile { border-radius: var(--radius-m); padding: 22px; display: grid; gap: 6px; align-content: start; color: var(--ink2Tint); font-size: 15px; }
.tile h3 { color: var(--ink); }
.tile.t1 { background: var(--tile1); }
.tile.t2 { background: var(--tile2); }
.tile.t3 { background: var(--tile3); }
.tile.t4 { background: var(--tile4); }

.card {
  background: var(--surface);
  border: 1px solid var(--track);
  border-radius: var(--radius-m);
  padding: 22px;
  display: grid;
  gap: 8px;
  align-content: start;
}
.card p { color: var(--ink2); }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.card.wide { grid-column: 1 / -1; padding: 28px; gap: 10px; }
.card.wide p { max-width: 40em; }
.card.wide .actions { margin-top: 8px; }

.app-card { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 18px; align-items: center; text-decoration: none; }
.app-card .icon { width: 72px; height: 72px; border-radius: 18px; background: var(--bg); border: 1px solid var(--track); display: grid; place-items: center; }
.app-card .icon img { width: 52px; height: 52px; }
.app-card:hover { border-color: var(--ink2); }

/* Long-form text: privacy, terms, support, deletion */

.doc { padding: 24px 0 64px; }
.doc .wrap { max-width: 760px; }
.doc header { display: grid; gap: 12px; margin-bottom: 32px; }
.doc h1 { font-size: clamp(32px, 5vw, 44px); }
.doc .meta { font-size: 14px; color: var(--ink2); }
.summary { background: var(--hero); color: var(--onHero); border-radius: var(--radius-m); padding: 22px 24px; display: grid; gap: 10px; margin-bottom: 36px; }
.summary ul { margin: 0; padding-left: 20px; }
.summary li { margin: 4px 0; }
.summary .fine { margin-top: 4px; font-size: 13px; color: color-mix(in srgb, var(--onHero) 72%, transparent); }
.toc { border: 1px solid var(--track); background: var(--surface); border-radius: var(--radius-m); padding: 18px 22px; margin-bottom: 40px; font-size: 15px; }
.toc ol { margin: 8px 0 0; padding-left: 20px; columns: 2; column-gap: 32px; }
.toc li { margin: 3px 0; break-inside: avoid; }
.prose h2 { font-size: 24px; margin: 44px 0 12px; scroll-margin-top: 16px; }
.prose h3 { margin: 28px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 14px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose strong { font-weight: 700; }
.prose .table { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--track); border-radius: var(--radius-s); background: var(--surface); }
.prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--track); }
.prose th { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink2); }
.prose tr:last-child td { border-bottom: 0; }
.prose .callout { background: var(--accentSoft); border-radius: var(--radius-s); padding: 16px 18px; margin: 0 0 18px; }
.prose .callout p:last-child { margin-bottom: 0; }

.steps { counter-reset: step; list-style: none; padding: 0 !important; display: grid; gap: 12px; }
/* The number sits in the left gutter, so bold words inside a step stay inline with the text. */
.steps li { counter-increment: step; position: relative; min-height: 32px; padding: 3px 0 0 44px; margin: 0 !important; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--accentSoft); display: grid; place-items: center; font-weight: 800; font-size: 14px; line-height: 1; }

/* Footer */

.site-footer { border-top: 1px solid var(--track); padding: 28px 0 36px; font-size: 14px; color: var(--ink2); }
.site-footer .wrap { display: grid; gap: 12px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer a { text-decoration: none; font-weight: 600; }
.site-footer a:hover { color: var(--ink); }
.site-footer small { font-size: 13px; }

/* Not found */

.notfound { padding: 72px 0 96px; }
.notfound .wrap { display: grid; gap: 18px; justify-items: start; max-width: 640px; }
/* Both languages get the same weight, as Quebec's Charter of the French Language expects. */
.notfound h1, .notfound h2 { font-size: clamp(32px, 5vw, 44px); }
.notfound [lang="fr"] { display: grid; gap: 18px; justify-items: start; width: 100%; margin-top: 22px; padding-top: 40px; border-top: 1px solid var(--track); }

@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .site-header { padding: 14px 0; }
  .section { padding-bottom: 40px; }
  .hero { padding: 16px 0 40px; }
  .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .hero-art { aspect-ratio: 16 / 10; }
  .hero-art img { width: 34%; }
  .tiles, .cards { grid-template-columns: minmax(0, 1fr); }
  .toc ol { columns: 1; }
  .prose h2 { margin-top: 36px; }
  .summary { padding: 18px 20px; }

  /* Tables become one card per row, each value labelled with its column (data-label on every td). */
  .prose .table { overflow: visible; }
  .prose table, .prose tbody, .prose tr, .prose td { display: block; }
  .prose thead { display: none; }
  .prose tr { padding: 14px 16px; border-bottom: 1px solid var(--track); }
  .prose tr:last-child { border-bottom: 0; }
  .prose td { padding: 0; border: 0; }
  .prose td + td { margin-top: 8px; }
  .prose td:first-child { font-weight: 700; color: var(--ink); }
  .prose td[data-label]:not(:first-child)::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink2); }
}

/* When the nav no longer fits beside the brand, give it its own row and line the pill text up with the brand. */
/* The language switch moves to the brand row, so the remaining links fit on one line even in French. */
@media (max-width: 560px) {
  .site-header .wrap { position: relative; flex-direction: column; align-items: flex-start; gap: 8px; }
  .nav { margin-left: -12px; }
  .nav .lang { position: absolute; top: -2px; right: 16px; margin-left: 0; }
  .site-header .brand { max-width: calc(100% - 104px); line-height: 1.2; }
}

@media (prefers-reduced-motion: no-preference) {
  .nav a, .app-card { transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease; }
}

@media print {
  .site-header nav, .site-footer nav, .skip { display: none; }
  body, html { background: #fff; color: #000; }
}
