/* korakoala.app, shared styles: fonts, colour tokens (light and dark), type, header, footer, buttons.
   Mobile first. Pages carry no inline styles or scripts: the CSP only allows files from this site. */

/* The app's own fonts, subset to Latin (SIL OFL; licences in /assets/fonts). */
@font-face {
  font-family: "Fredoka";
  src: url("/assets/fonts/fredoka-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("/assets/fonts/nunito-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

/* Warm paper, mint and the four tab colours, taken from the app's palette. */
:root {
  color-scheme: light dark;

  --font-display: "Fredoka", ui-rounded, "Arial Rounded MT Bold", "Segoe UI", system-ui, sans-serif;
  --font-body: "Nunito", ui-rounded, "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;

  --page: #fcf8f0;
  --page-alt: #f1f7ef;
  --card: #ffffff;
  --ink: #1b1d1c;
  --ink-soft: #4b5550;
  --line: #e4ddcd;
  --mint-soft: #dcf5e9;
  --mint-ink: #066b4d;
  --button: #087a58;
  --button-edge: #045640;
  --button-ink: #ffffff;
  --leaf-light: #6be38d;
  --leaf: #1f9a55;
  --focus: #1b1d1c;
  --sky: #d3f1ea;
  --sun: #fff0c7;
  --hill-far: #d2f0d6;
  --hill-near: #a6e2b5;
  --phone-rim: transparent;
  --shadow: 0 1px 2px rgb(30 52 42 / 0.06), 0 14px 34px -12px rgb(30 52 42 / 0.2);

  --lift-soft: #eeebff;
  --lift-ink: #4a3db0;
  --fuel-soft: #e0f5e5;
  --fuel-ink: #17643a;
  --spend-soft: #fff1c9;
  --spend-ink: #6f4b00;
  --habits-soft: #ffe4ef;
  --habits-ink: #9c2157;

  --gutter: clamp(16px, 5vw, 40px);
  --max: 1120px;
  --radius-xl: 32px;
  --radius-l: 24px;
  --radius-m: 18px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0e1411;
    --page-alt: #121b16;
    --card: #18221d;
    --ink: #edf3ef;
    --ink-soft: #b3c1b9;
    --line: #2b3a31;
    --mint-soft: #133528;
    --mint-ink: #5ee9b6;
    --button: #3ddfa8;
    --button-edge: #1c8a63;
    --button-ink: #04241a;
    --leaf-light: #8aeea9;
    --leaf: #34b56b;
    --focus: #edf3ef;
    --sky: #0f2420;
    --sun: #1c2416;
    --hill-far: #142b1d;
    --hill-near: #1b3c27;
    --phone-rim: rgb(255 255 255 / 0.16);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.45), 0 14px 34px -12px rgb(0 0 0 / 0.65);

    --lift-soft: #24223f;
    --lift-ink: #cdc6ff;
    --fuel-soft: #15301f;
    --fuel-ink: #9fe8b4;
    --spend-soft: #2e2612;
    --spend-ink: #ffd877;
    --habits-soft: #35192a;
    --habits-ink: #ffb3d4;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 16px;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.6;
}

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

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p {
  margin: 0;
}

a {
  color: var(--mint-ink);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 3px;
}

strong {
  font-weight: 800;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: 12px;
  left: var(--gutter);
  z-index: 10;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-weight: 800;
  box-shadow: var(--shadow);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* ---------- Header ---------- */

.site-header {
  padding-block: 14px;
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 600;
  text-decoration: none;
}

.brand img {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  box-shadow: var(--shadow);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.site-nav a:hover {
  background: var(--mint-soft);
}

.site-nav .nav-wide {
  display: none;
}

.site-nav .lang-link {
  margin-left: 4px;
  border: 2px solid var(--line);
  background: var(--card);
}

@media (min-width: 880px) {
  .site-nav .nav-wide {
    display: inline-flex;
  }
}

/* ---------- Buttons and pills ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 24px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* A soft lip under each button, like the pressable buttons in the app. */
.btn--primary {
  background: var(--button);
  color: var(--button-ink);
  box-shadow: 0 4px 0 var(--button-edge);
}

.btn--soft {
  background: var(--card);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--line), 0 4px 0 var(--line);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(3px);
}

.btn--primary:active {
  box-shadow: 0 1px 0 var(--button-edge);
}

.btn--soft:active {
  box-shadow: inset 0 0 0 2px var(--line), 0 1px 0 var(--line);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--mint-soft);
  color: var(--mint-ink);
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* ---------- Leaves: the app's reward, drawn in CSS and used as list bullets ---------- */

.leaf-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.leaf-list li {
  position: relative;
  padding-left: 32px;
}

.leaf-list li::before,
.leaf {
  content: "";
  width: 17px;
  height: 17px;
  border-radius: 0 100% 0 100%;
  background: linear-gradient(135deg, var(--leaf-light), var(--leaf));
}

.leaf-list li::before {
  position: absolute;
  top: 0.32em;
  left: 2px;
}

.leaf {
  display: inline-block;
  flex: none;
}

/* ---------- Footer ---------- */

.site-footer {
  padding-block: 44px calc(40px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--page-alt);
  font-size: 0.9375rem;
}

.site-footer__inner {
  display: grid;
  gap: 22px;
}

.site-footer .brand {
  font-size: 1.375rem;
}

.site-footer .brand img {
  width: 36px;
  height: 36px;
  border-radius: 11px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-weight: 800;
}

.footer-links a {
  display: inline-block;
  padding-block: 6px;
}

.footer-fine {
  color: var(--ink-soft);
}

.footer-fine + .footer-fine {
  margin-top: 6px;
}

@media (min-width: 880px) {
  .site-footer__inner {
    grid-template-columns: 1.2fr 1fr;
    align-items: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
