/* flere.app, in the flere house style copied from apps/family-intranet/frontend/app.css (copy, do
   not import: apps/README.md): light only, warm paper, white cards edged by a 1px border, pill
   buttons. Hanken Grotesk carries labels and headings; IBM Plex Mono carries badges and small
   print. Both are self-hosted under ./fonts with their OFL licence texts. 16 px base, 48 px
   targets, honours prefers-reduced-motion. No inline styles: the CSP allows only this file. */

@font-face {
  font-family: "Hanken Grotesk";
  src: url("./fonts/HankenGrotesk-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("./fonts/IBMPlexMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #faf8f5;
  --surface: #ffffff;
  --ink: #221f29;
  --muted: #7a7468;
  --border: #e2ddd4;
  --accent: #3f5d33;
  --accent-hover: #2f4726;
  --font: "Hanken Grotesk", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --ring: rgba(63, 93, 51, 0.45);
  --radius: 16px;
  --target: 48px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 100%;
}

body {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 8px;
  top: -64px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  padding: 0 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.skip:focus {
  top: 8px;
}

/* ---------- header: the wordmark ---------- */

.topbar {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  color: var(--ink);
  text-decoration: none;
}

.wordmark:hover {
  color: var(--ink);
}

.wordmark .brand {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
  line-height: 1;
}

/* ---------- page frame ---------- */

.view {
  flex: 1;
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.view.home {
  max-width: 72rem;
  padding-top: 32px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 8px;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.home h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 7vw, 2.8rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

h2 {
  margin: 28px 0 8px;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.lede {
  margin: 0 0 28px;
  color: var(--muted);
}

/* ---------- home: the app cards ---------- */

/* A phone (and anything under 900 px): one centred column. */
.app-grid {
  display: grid;
  grid-template-columns: minmax(0, 26rem);
  justify-content: center;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* A desktop: always thirds, so one or two cards keep a third's width. */
@media (min-width: 900px) {
  .app-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
    gap: 24px;
  }
}

.app-grid > li {
  display: flex;
  min-width: 0;
}

.app-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 220px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.16s, border-color 0.16s;
}

.app-card:hover,
.app-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--accent);
  color: var(--ink);
}

.app-card .label {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.app-card .sub {
  margin-top: 8px;
  margin-bottom: 20px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.5;
}

.app-card .open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-height: var(--target);
  margin-top: auto;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
}

.app-card:hover .open {
  background: var(--accent-hover);
}

/* ---------- privacy and terms ---------- */

.prose p,
.prose ul {
  margin: 0 0 12px;
}

.prose ul {
  padding-left: 1.25rem;
}

.prose li + li {
  margin-top: 4px;
}

/* ---------- footer ---------- */

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 20px;
  padding: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.8rem;
}

.footer a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }

  .app-card:hover,
  .app-card:focus-visible {
    transform: none;
  }
}
