/* Mokulua Math website. One stylesheet for every page.
   Colors come from the game: sky #87ceeb, sand #f4d9a0, sign ink #2b1a0e.
   Type sizes reuse the game's scale (--t-caption, --t-body, --t-label, --t-title)
   and the system UI font; the title logo SVG carries its own display face. */

:root {
  color-scheme: light;
  --sky: #87ceeb;
  --sand: #f4d9a0;
  --sand-dark: #e8c890;
  --foam: #ffffff;
  --paper: #fffaf0;
  --ink: #142c42;
  --link: #185487;
  --sign-ink: #2b1a0e;
  --shadow: rgba(43, 26, 14, .22);

  --t-caption: 17px;
  --t-body: 19px;
  --t-label: 22px;
  --t-title: 26px;

  --gutter: 16px;
  --max: 640px;
  --pad: 20px;
  --radius: 12px;
  --border: 3px;
  --tap: 48px;
}

@media (min-width: 600px) {
  :root { --pad: 32px; }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--sky);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: var(--t-body);
  line-height: 1.55;
  overflow-wrap: break-word;
  padding-top: env(safe-area-inset-top);
}

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

a { color: var(--link); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:focus-visible { outline: 3px solid var(--sign-ink); outline-offset: 3px; border-radius: 4px; }

.email { overflow-wrap: anywhere; font-weight: 700; }

/* Page frame: sky on top, the beach at the bottom */
.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
}

main.wrap { flex: 1; padding-bottom: 40px; }

.top { padding-top: 24px; padding-bottom: 20px; }
.top a { display: inline-block; border-radius: var(--radius); }
.top img { width: 220px; }

/* The card: a cream sign with a dark edge and a hard pixel shadow, like the logo */
.card {
  background: var(--paper);
  border: var(--border) solid var(--sign-ink);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--shadow);
  padding: var(--pad);
}

h1, h2, p, ul { margin: 0; }
h1 { font-size: var(--t-title); line-height: 1.25; }
h2 { font-size: var(--t-label); line-height: 1.3; margin-top: 32px; }
p, ul { margin-top: 12px; }
h1 + p { margin-top: 8px; }
ul { padding-left: 1.2em; }
li + li { margin-top: 6px; }
strong { font-weight: 700; }

.small { font-size: var(--t-caption); }

/* Home page */
.home { text-align: center; }
.home .logo { margin: 24px auto 0; max-width: 560px; }
.home .logo img { width: 100%; }
.lead { font-size: var(--t-label); font-weight: 700; line-height: 1.3; margin: 12px 0 24px; }
.home .card p:first-of-type { margin-top: 16px; }
.app-icon {
  width: 96px;
  margin: 0 auto;
  border-radius: 22px;
  border: var(--border) solid var(--sign-ink);
  image-rendering: pixelated;
}
.soon { font-size: var(--t-label); font-weight: 700; line-height: 1.3; }

.buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}
.button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 8px 16px;
  background: var(--paper);
  border: var(--border) solid var(--sign-ink);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--shadow);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.button:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--shadow); }

/* Footer: foam line, then sand */
.beach {
  background: var(--sand);
  border-top: 6px solid var(--foam);
  box-shadow: inset 0 6px 0 var(--sand-dark);
  padding: 16px 0 max(24px, env(safe-area-inset-bottom));
  font-size: var(--t-caption);
}
.beach nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 24px;
}
.beach a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--ink);
  font-weight: 700;
}
.beach a[aria-current="page"] { text-decoration: none; }
