/* LinePlay's website. Plain CSS, no build step: Cloudflare Pages serves this folder as it is. */

/*
 * The app's palette (apps/mobile/src/theme/colours.ts), Green room, so the site looks like
 * the app.
 * The pages follow the device's light or dark setting, unless theme.js has set
 * `data-theme`: from the link, as the app does to match its own Appearance
 * setting, or from the light and dark button at the top of the page.
 */
:root {
  color-scheme: light;
  --background: #f1f2f4;
  --surface: #e2e5e9;
  --text: #1c1e22;
  --text-secondary: #525861;
  --accent: #0a6b4a;
  --separator: #c2c7cd;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --background: #191b1f;
    --surface: #272a30;
    --text: #e3e6ea;
    --text-secondary: #a0a6ae;
    --accent: #5fd6a4;
    --separator: #434850;
  }
}

/* The same dark palette, chosen whatever the device's setting. */
:root[data-theme='dark'] {
  color-scheme: dark;
  --background: #191b1f;
  --surface: #272a30;
  --text: #e3e6ea;
  --text-secondary: #a0a6ae;
  --accent: #5fd6a4;
  --separator: #434850;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
}

main {
  max-width: 40rem;
  margin: 0 auto;
  /* At least 20px at the sides, and clear of the notch in landscape. */
  padding: 3rem max(1.25rem, env(safe-area-inset-right)) 3rem
    max(1.25rem, env(safe-area-inset-left));
}

h1,
h2 {
  line-height: 1.2;
  text-wrap: balance;
}

h1 {
  margin: 0 0 0.5rem;
  font-size: 2rem;
}

h2 {
  margin: 2.25rem 0 0.5rem;
  font-size: 1.25rem;
}

p,
ul {
  margin: 0 0 1rem;
}

ul {
  padding-left: 1.25rem;
}

li + li {
  margin-top: 0.35rem;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

.secondary {
  color: var(--text-secondary);
}

.summary {
  margin: 1.5rem 0 0;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  background: var(--surface);
}

.summary ul {
  margin: 0;
}

footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--separator);
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

footer p {
  margin: 0;
}

/*
 * The LinePlay mark (the app icon, from brand/) before the name, with the
 * corners iOS gives the icon. Decoration: the name beside it says it.
 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}

.mark {
  width: 1.4em;
  height: 1.4em;
  border-radius: 22.5%;
}

/*
 * The name beside the mark is in the text colour, not the link green: the
 * icon carries the brand's green, and green text can't match it in dark
 * mode and still be easy to read.
 */
a.brand {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

/* The home page: one short block, a little way down the screen. */
.home main {
  padding-top: max(6rem, 18vh);
}

.home h1 {
  font-size: 2.5rem;
}

.tagline {
  font-size: 1.25rem;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-top: 2rem;
  padding: 0;
  list-style: none;
}

.links li + li {
  margin-top: 0;
}

/*
 * The light and dark button, in the top corner of every page. It shows what a
 * tap switches to: a moon on a light page, a sun on a dark one.
 */
.theme-toggle {
  position: absolute;
  top: max(0.75rem, env(safe-area-inset-top));
  right: max(0.75rem, env(safe-area-inset-right));
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.theme-toggle[hidden] {
  display: none;
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle[data-next='light'] .moon,
.theme-toggle[data-next='dark'] .sun {
  display: none;
}
