/* ==========================================================================
   Educoon — shared design system
   One family (Bricolage Grotesque), warm paper ground, near-black ink,
   Educoon blue for actions. Colour fields are taken from the app's own cards.
   ========================================================================== */

/* Self-hosted fonts. General Sans (ITF Free Font License, see fonts/GeneralSans-LICENSE.txt)
   sets titles and the wordmark; Bricolage Grotesque (SIL OFL) sets running text. */
@font-face {
  font-family: 'General Sans';
  src: url('fonts/GeneralSans-Variable.woff2') format('woff2');
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('fonts/bricolage-grotesque-latin-ext.woff2') format('woff2');
  font-weight: 400 800;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('fonts/bricolage-grotesque-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-stretch: 75% 100%;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Ground and ink */
  --paper: #ecebe6;
  --paper-deep: #e0ddd5;
  --card: #f7f6f3;
  --white: #ffffff;
  --ink: #171614;
  --ink-soft: #59554e;
  --ink-mute: #8b867d;

  /* Fields, taken from the app's home screen */
  --night: #171614;
  --night-raised: #24221f;
  --blue: #0a6cf5;
  --blue-press: #0757c9;
  --blue-wash: #dfeaff;
  --orange: #ff7a45;
  --orange-wash: #ffe3d6;
  --lilac: #e8e3fb;
  --lilac-ink: #4b3fa0;
  --green: #2f7a50;
  --red: #b8434f;

  /* Type */
  --font: 'Bricolage Grotesque', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'General Sans', 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --fs-display: clamp(3rem, 7.2vw, 7.25rem);
  --fs-h2: clamp(2.25rem, 4.6vw, 4.4rem);
  --fs-h3: clamp(1.35rem, 1.9vw, 1.75rem);
  --fs-lead: clamp(1.125rem, 1.35vw, 1.3rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.9375rem;

  /* Space */
  --gutter: clamp(1rem, 2.6vw, 2rem);
  --max: 1320px;
  --section: clamp(6rem, 11vw, 10.5rem);
  --stage-pad: clamp(1.5rem, 5vw, 4.5rem);

  /* Shape */
  --r-stage: clamp(26px, 3vw, 40px);
  --r-tile: clamp(22px, 2.2vw, 30px);
  --r-inner: 16px;

  /* Motion */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --press: 110ms;
  --hover: 220ms;

  /* Floating things only */
  --float-shadow: 0 30px 60px -24px rgba(23, 22, 20, .38), 0 10px 24px -12px rgba(23, 22, 20, .18);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 88px;
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: 400;
  font-optical-sizing: auto;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
  color: inherit;
  text-wrap: balance;
}
h1 { font-size: var(--fs-display); line-height: .92; letter-spacing: -0.04em; }
h2 { font-size: var(--fs-h2); line-height: .96; letter-spacing: -0.035em; }
h3 { font-size: var(--fs-h3); line-height: 1.1; letter-spacing: -0.02em; font-weight: 600; }
h4 { font-size: 1.125rem; line-height: 1.2; letter-spacing: -0.01em; font-weight: 600; }
p { text-wrap: pretty; }

::selection { background: var(--blue); color: var(--white); }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 200;
  padding: .75rem 1.1rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-weight: 700;
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.wrap {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* --------------------------------------------------------------------------
   Buttons — fully round, flat, one fill. Feedback on press, not release.
   -------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--white);
  --btn-bg-hover: #000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 52px;
  padding: 0 1.45rem;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: background-color var(--hover) var(--ease-out), transform var(--press) ease-out;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:hover { background: var(--btn-bg-hover); }
.btn:active { transform: scale(.965); }
.btn svg {
  width: 18px; height: 18px;
  flex: none;
  transition: transform var(--hover) var(--ease-out);
}
.btn:hover svg { transform: translateX(3px); }

.btn-blue { --btn-bg: var(--blue); --btn-fg: var(--white); --btn-bg-hover: var(--blue-press); }
.btn-light { --btn-bg: var(--white); --btn-fg: var(--ink); --btn-bg-hover: var(--card); }
.btn-paper { --btn-bg: var(--paper-deep); --btn-fg: var(--ink); --btn-bg-hover: #d9d2c6; }
.btn-ghost-dark { --btn-bg: rgba(255,255,255,.12); --btn-fg: var(--white); --btn-bg-hover: rgba(255,255,255,.2); }
.btn-small { min-height: 42px; padding: 0 1.1rem; font-size: .9375rem; }

/* Text link with arrow */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-weight: 700;
  color: var(--ink);
}
.link-arrow svg { width: 17px; height: 17px; transition: transform var(--hover) var(--ease-out); }
.link-arrow:hover svg { transform: translateX(4px); }

/* --------------------------------------------------------------------------
   Brand mark (round mascot + typed wordmark)
   -------------------------------------------------------------------------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1;
}
.brand img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  flex: none;
}

/* --------------------------------------------------------------------------
   Sub-page top bar (forms, legal, updates, android beta)
   -------------------------------------------------------------------------- */
.subbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
}
.subbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 76px;
}
.subbar-back {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  padding: 0 1.1rem;
  border-radius: 999px;
  background: var(--paper-deep);
  font-size: .9375rem;
  font-weight: 700;
  transition: background-color var(--hover) var(--ease-out), transform var(--press) ease-out;
}
.subbar-back:hover { background: #d9d2c6; }
.subbar-back:active { transform: scale(.965); }
.subbar-back svg { width: 17px; height: 17px; }

/* --------------------------------------------------------------------------
   Sub-page footer
   -------------------------------------------------------------------------- */
.subfoot {
  margin-top: var(--section);
  padding-block: 2.5rem 3rem;
  background: var(--paper-deep);
  color: var(--ink-soft);
  font-size: var(--fs-small);
}
.subfoot .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.subfoot nav { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; }
.subfoot a { font-weight: 600; color: var(--ink); }
.subfoot a:hover { color: var(--blue); }

/* --------------------------------------------------------------------------
   Reveal — content is visible unless the script has run and opted in.
   -------------------------------------------------------------------------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 75ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
  .js [data-reveal] { transform: none; transition: opacity 300ms linear; }
}
