@import url('https://fonts.googleapis.com/css2?family=Kalam:wght@400;700&family=Patrick+Hand&display=swap');

/* ── Tokens ─────────────────────────────────────────── */
:root {
  --bg:        #fdfbf7;
  --fg:        #2d2d2d;
  --muted:     #e5e0d8;
  --accent:    #ff4d4d;
  --border:    #2d2d2d;
  --blue:      #2d5da1;
  --white:     #ffffff;
  --paper:     #fdfbf7;

  --profile-gian:   #F5C518;
  --profile-jacob:  #FF6B35;
  --profile-eunice: #4A90D9;
  --profile-mama:   #4CAF7D;

  --radius-wobbly:   255px 15px 225px 15px / 15px 225px 15px 255px;
  --radius-wobbly-md: 15px 225px 15px 255px / 225px 15px 255px 15px;
  --radius-wobbly-sm: 120px 8px 120px 8px / 8px 120px 8px 120px;

  --shadow-hard:   4px 4px 0px 0px #2d2d2d;
  --shadow-hard-lg: 8px 8px 0px 0px #2d2d2d;
  --shadow-hard-sm: 2px 2px 0px 0px #2d2d2d;

  --font-head: 'Kalam', cursive;
  --font-body: 'Patrick Hand', cursive;

  --max-w: 640px;
}

/* ── Reset ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  background-image: radial-gradient(var(--muted) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--fg);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; }

a { color: inherit; text-decoration: none; }

button { cursor: pointer; font-family: var(--font-body); }

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

/* ── Layout ──────────────────────────────────────────── */
.page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px 16px 80px;
}

/* ── Cards ───────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius-wobbly-md);
  box-shadow: var(--shadow-hard);
  padding: 20px;
}

.card--muted {
  background: var(--muted);
}

.card--yellow {
  background: #fff9c4;
}

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: 3px solid var(--border);
  border-radius: var(--radius-wobbly);
  background: var(--white);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  box-shadow: var(--shadow-hard);
  transition: transform 80ms ease, box-shadow 80ms ease, background 80ms ease, color 80ms ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  background: var(--accent);
  color: var(--white);
  box-shadow: var(--shadow-hard-sm);
  transform: translate(2px, 2px);
}

.btn:active {
  box-shadow: none;
  transform: translate(4px, 4px);
}

.btn--full { width: 100%; }

.btn--blue:hover  { background: var(--blue); color: var(--white); }
.btn--green:hover { background: #4CAF7D; color: var(--white); }

.btn--sm {
  padding: 8px 16px;
  font-size: 0.875rem;
}

.btn--icon {
  padding: 10px;
  border-radius: 50%;
}

/* ── Section header ──────────────────────────────────── */
.section-label {
  font-family: var(--font-head);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
  opacity: 0.5;
  margin-bottom: 4px;
}

.section-title {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 16px;
}

/* ── Nav bar ─────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 2px dashed var(--muted);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 100%;
}

.nav__title {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 700;
}

.nav__back {
  background: none;
  border: none;
  font-size: 1.5rem;
  padding: 4px 8px;
  border-radius: 8px;
}

.nav__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-size: 0.875rem;
  font-weight: 700;
  box-shadow: var(--shadow-hard-sm);
  flex-shrink: 0;
}

/* ── Divider ─────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 2px dashed var(--muted);
  margin: 20px 0;
}

/* ── Empty state ─────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--fg);
  opacity: 0.45;
}

.empty__icon { font-size: 2.5rem; margin-bottom: 8px; }
.empty__text { font-size: 1rem; }

/* ── Modal ───────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(45, 45, 45, 0.55);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 24px 24px 16px 16px;
  box-shadow: var(--shadow-hard-lg);
  padding: 24px;
  width: 100%;
  max-width: var(--max-w);
  max-height: 90dvh;
  overflow-y: auto;
  animation: slideUp 200ms ease;
}

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal__title {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 700;
}

.modal__close {
  background: none;
  border: 2px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-hard-sm);
}

/* ── Form fields ─────────────────────────────────────── */
.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 6px;
  opacity: 0.7;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-wobbly-sm);
  background: var(--white);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--fg);
  outline: none;
  transition: border-color 150ms, box-shadow 150ms;
  box-shadow: var(--shadow-hard-sm);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(45, 93, 161, 0.15);
}

.field textarea { resize: vertical; min-height: 80px; }

/* ── Toast ───────────────────────────────────────────── */
.gub-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--fg);
  color: var(--white);
  padding: 12px 24px;
  border-radius: var(--radius-wobbly-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  opacity: 0;
  transition: opacity 200ms, transform 200ms;
  z-index: 999;
  white-space: nowrap;
  box-shadow: var(--shadow-hard);
}

.gub-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.gub-toast--error { background: var(--accent); }

/* ── Pill / badge ────────────────────────────────────── */
.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
}

/* ── Loading spinner ─────────────────────────────────── */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--muted);
  border-top-color: var(--fg);
  border-radius: 50%;
  animation: spin 600ms linear infinite;
  margin: 40px auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Profile colors utility ──────────────────────────── */
.profile-gian   { background: var(--profile-gian);   color: #2d2d2d; }
.profile-jacob  { background: var(--profile-jacob);  color: #ffffff; }
.profile-eunice { background: var(--profile-eunice); color: #ffffff; }
.profile-mama   { background: var(--profile-mama);   color: #ffffff; }

/* ── Responsive tweaks ───────────────────────────────── */
@media (min-width: 640px) {
  .page { padding: 32px 24px 80px; }
}
