/* Ayuni member PWA: tokens, type and the app frame ("Lagos at dusk", docs/DESIGN.md). */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("../fonts/plus-jakarta-sans.ttf") format("truetype");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --shell: #faf5ee;
  --paper: #fffdfa;
  --paper-chip: #f4ece2;
  --cloud: #ede6dc;
  --line: #e7dfd4;
  --ink: #1f1a2b;
  --ink-soft: #3a3346;
  --muted: #6b6474;
  --ember: #c9452e;
  --ember-dark: #a8361f;
  --ember-soft: #f7ddd5;
  --indigo: #2f3a86;
  --indigo-soft: #e3e6f7;
  --saffron: #f0b13e;
  --saffron-ink: #8a5d0c;
  --saffron-soft: #fcefd2;
  --palm: #2e7d5b;
  --palm-soft: #dcefe5;
  --dusk: linear-gradient(180deg, #fce6d6 0%, #faf5ee 100%);

  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 28px;
  --r-pill: 999px;

  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Fraunces", Georgia, "Times New Roman", serif;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --appbar-h: 56px;
  --tabbar-h: 64px;
  --content-max: 560px;

  --spring: cubic-bezier(0.2, 0.9, 0.25, 1.1);
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

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

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--shell);
  color: var(--ink);
  font: 400 16px/1.5 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.2;
}
h1 {
  font-size: 30px;
}
h2 {
  font-size: 22px;
}
h3 {
  font-size: 18px;
}
p {
  margin: 0;
}
a {
  color: var(--indigo);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
img {
  display: block;
  max-width: 100%;
}
:focus-visible {
  outline: 3px solid var(--indigo);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 14px;
}
.tiny {
  font-size: 12px;
}
.center {
  text-align: center;
}
.serif {
  font-family: var(--font-serif);
}
.noscript {
  padding: 40px 20px;
  text-align: center;
}

/* ------------------------------------------------------------------ App frame */

#app {
  min-height: 100dvh;
}

.boot {
  min-height: 100dvh;
  display: grid;
  place-items: center;
}

.frame {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: calc(var(--appbar-h) + var(--safe-top));
  padding: var(--safe-top) 8px 0;
  background: color-mix(in srgb, var(--shell) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
}
.appbar.scrolled {
  border-bottom-color: var(--line);
}
.appbar-title {
  flex: 1;
  min-width: 0;
  font: 600 19px/1.2 var(--font-serif);
  padding: 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.appbar-title.brand {
  color: var(--ember);
  font-size: 24px;
}
.appbar-actions {
  display: flex;
  gap: 2px;
}

.content {
  flex: 1;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 12px 16px calc(28px + var(--safe-bottom));
}
.frame.has-tabs .content {
  padding-bottom: calc(var(--tabbar-h) + 28px + var(--safe-bottom));
}
.content.flush {
  padding-left: 0;
  padding-right: 0;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.stack-sm {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.grow {
  flex: 1;
  min-width: 0;
}
.wrap {
  flex-wrap: wrap;
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  padding: 6px 8px calc(6px + var(--safe-bottom));
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar-inner {
  display: flex;
  width: 100%;
  max-width: var(--content-max);
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 52px;
  padding: 6px 2px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--r-sm);
  position: relative;
}
.tab .icon {
  width: 24px;
  height: 24px;
  transition: transform 0.3s var(--spring);
}
.tab[aria-current="page"] {
  color: var(--ember);
}
.tab[aria-current="page"] .icon {
  transform: translateY(-1px) scale(1.06);
}
.tab-dot {
  position: absolute;
  top: 5px;
  left: calc(50% + 8px);
  min-width: 9px;
  height: 9px;
  border-radius: 9px;
  background: var(--ember);
  border: 2px solid var(--paper);
}

.icon {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The mark: two circles meeting; the overlap is the table you share. */
.mark {
  display: inline-block;
  width: 56px;
  height: 40px;
  position: relative;
}
.mark::before,
.mark::after {
  content: "";
  position: absolute;
  top: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid var(--ember);
}
.mark::before {
  left: 0;
}
.mark::after {
  right: 0;
  background: color-mix(in srgb, var(--saffron) 35%, transparent);
}
.mark-breathe {
  animation: breathe 1.6s var(--ease) infinite alternate;
}
@keyframes breathe {
  from {
    transform: scale(0.94);
    opacity: 0.7;
  }
  to {
    transform: scale(1.04);
    opacity: 1;
  }
}

.view-enter {
  animation: view-in 0.28s var(--ease);
}
@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
