/* Sticker-on-a-cutting-mat theme: the bot makes die-cut stickers, and so does its mascot. */

:root {
  --mat: #2f6b4f;
  --mat-deep: #245840;
  --mat-line: rgba(255, 255, 255, 0.09);
  --on-mat: #ffffff;
  --on-mat-muted: #d3e6da;
  --paper: #ffffff;
  --ink: #000000;
  --ink-soft: #3d3d3d;
  --red: #d6322a;
  --red-press: #b5261f;
  --peach: #f6cba6;
  --grey: #b8b8b8;
  --grey-light: #ececec;

  --display: 'Baloo 2', 'Be Vietnam Pro', system-ui, sans-serif;
  --body: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* Type scale (1.25) */
  --t-sm: 0.875rem;
  --t-base: 1rem;
  --t-md: 1.25rem;
  --t-lg: 1.563rem;
  --t-xl: 2.441rem;
  --t-hero: clamp(2.6rem, 6vw, 4.4rem);

  --line: 2.5px;
  --lift: 0 10px 18px -8px rgba(0, 0, 0, 0.45);
  --width: 1120px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: var(--t-base);
  line-height: 1.6;
  color: var(--on-mat);
  background-color: var(--mat);
  /* Cutting-mat grid: fine 1 cm-ish lines, a heavier line every 5 cells */
  background-image:
    linear-gradient(var(--mat-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--mat-line) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 160px 160px, 160px 160px, 32px 32px, 32px 32px;
  min-height: 100vh;
}

a { color: inherit; }

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

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.1;
  margin: 0;
}

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

.container {
  width: min(100% - 2.5rem, var(--width));
  margin-inline: auto;
}

/* ---------- Sticker primitives ---------- */

/* Black ink line, then the white die-cut margin, then a soft lift off the mat. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--t-md);
  line-height: 1;
  padding: 0.7rem 1.3rem 0.6rem;
  border: var(--line) solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 0 0 5px var(--paper), var(--lift);
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.btn:active {
  transform: translateY(2px);
  box-shadow: 0 0 0 5px var(--paper), 0 4px 8px -6px rgba(0, 0, 0, 0.5);
}

.btn-primary { background: var(--red); color: var(--paper); }
.btn-primary:hover { background: var(--red-press); }
.btn-secondary { background: var(--paper); color: var(--ink); }
.btn-secondary:hover { background: var(--grey-light); }
.btn-sm { font-size: var(--t-base); padding: 0.5rem 1rem 0.42rem; }

.chip {
  display: inline-block;
  font-family: var(--body);
  font-weight: 600;
  font-size: var(--t-sm);
  line-height: 1.3;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 0.12rem 0.5rem;
  white-space: nowrap;
}

/* A sheet of sticker paper laid on the mat; long text lives here. */
.sheet {
  background: var(--paper);
  color: var(--ink);
  border-radius: 18px;
  box-shadow: 0 24px 40px -24px rgba(0, 0, 0, 0.6);
  padding: clamp(1.5rem, 4vw, 3rem);
}

/* ---------- Navbar ---------- */

.navbar { padding: 1.1rem 0; }

.nav-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: var(--t-lg);
  text-decoration: none;
}

.brand img {
  width: 48px;
  height: 48px;
  transform: rotate(-6deg);
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.35));
}

.nav-links {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}

.nav-links a {
  font-weight: 600;
  text-decoration: none;
  color: var(--on-mat-muted);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
}

.nav-links a:hover { color: var(--on-mat); background: rgba(255, 255, 255, 0.1); }
.nav-links a.active { color: var(--ink); background: var(--paper); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.lang-btn,
.menu-toggle {
  font: 600 var(--t-sm) / 1 var(--body);
  color: var(--on-mat);
  background: transparent;
  border: 2px solid var(--on-mat-muted);
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
}

.lang-btn:hover,
.menu-toggle:hover { border-color: var(--on-mat); }

.menu-toggle { display: none; font-size: var(--t-md); padding: 0.3rem 0.65rem; }

/* ---------- Home: hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 2rem;
  padding: 2.5rem 0 4.5rem;
}

/* Headline set like sticker lettering: white fill, black ink outline. */
.hero h1 {
  font-size: var(--t-hero);
  line-height: 1.02;
  color: var(--paper);
  letter-spacing: -0.01em;
  text-shadow:
    3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 3px 0 var(--ink), 0 -3px 0 var(--ink),
    2px 2px 0 var(--ink), -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink),
    0 8px 0 var(--ink);
  max-width: 14ch;
}

.hero p {
  font-size: var(--t-md);
  color: var(--on-mat-muted);
  max-width: 34rem;
  margin: 1.6rem 0 2rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  margin-top: 2rem;
  font-size: var(--t-sm);
  color: var(--on-mat-muted);
}

.hero-art {
  position: relative;
  justify-self: center;
  width: min(100%, 420px);
}

.mascot {
  width: 100%;
  transform: rotate(-5deg);
  filter: drop-shadow(0 22px 22px rgba(0, 0, 0, 0.45));
  animation: slap 520ms cubic-bezier(0.2, 0.9, 0.3, 1.25) both;
}

/* The one orchestrated moment: the mascot sticker gets slapped onto the mat. */
@keyframes slap {
  0% { transform: scale(1.25) rotate(8deg); opacity: 0; filter: drop-shadow(0 60px 40px rgba(0, 0, 0, 0.2)); }
  60% { opacity: 1; }
  100% { transform: rotate(-5deg); filter: drop-shadow(0 22px 22px rgba(0, 0, 0, 0.45)); }
}

.hero-art .chip {
  position: absolute;
  font-size: var(--t-base);
  padding: 0.25rem 0.7rem;
  box-shadow: 0 0 0 4px var(--paper), var(--lift);
}

.hero-art .chip:nth-of-type(1) { left: -4%; top: 14%; transform: rotate(-8deg); }
.hero-art .chip:nth-of-type(2) { right: 2%; bottom: 10%; transform: rotate(6deg); background: var(--peach); }

/* ---------- Home: features ---------- */

.section { padding-bottom: 4.5rem; }

.sheet-head {
  max-width: 40rem;
  margin-bottom: 2rem;
}

.sheet-head h2 { font-size: var(--t-xl); }

.sheet-head p {
  color: var(--ink-soft);
  margin: 0.5rem 0 0;
}

.features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 3rem;
}

/* Dashed cut lines between items, like a sticker sheet. */
.feature {
  display: grid;
  grid-template-columns: 3.25rem 1fr;
  gap: 1rem;
  padding: 1.5rem 0;
  border-top: 2px dashed var(--grey);
}

.feature-icon {
  width: 3.25rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  background: var(--peach);
  border: var(--line) solid var(--ink);
  border-radius: 50%;
}

.feature h3 { font-size: var(--t-lg); }

.feature p {
  margin: 0.4rem 0 0.8rem;
  color: var(--ink-soft);
  max-width: 60ch;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* ---------- Home: setup steps ---------- */

.section-head {
  max-width: 40rem;
  margin-bottom: 2rem;
}

.section-head h2 { font-size: var(--t-xl); }
.section-head p { color: var(--on-mat-muted); margin: 0.5rem 0 0; }

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  counter-reset: step;
}

.step {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  border-radius: 14px;
  padding: 2.2rem 1.25rem 1.25rem;
  box-shadow: var(--lift);
  counter-increment: step;
}

.step::before {
  content: counter(step);
  position: absolute;
  top: -1.1rem;
  left: 1rem;
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  font: 800 var(--t-md) / 1 var(--display);
  color: var(--paper);
  background: var(--red);
  border: var(--line) solid var(--ink);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--paper);
}

.step h3 { font-size: var(--t-md); }
.step p { margin: 0.4rem 0 0; font-size: var(--t-sm); color: var(--ink-soft); }

.callout {
  margin-top: 1.75rem;
  max-width: 48rem;
  background: var(--peach);
  color: var(--ink);
  border: var(--line) solid var(--ink);
  border-radius: 14px;
  padding: 1rem 1.25rem;
}

/* ---------- Inner pages ---------- */

.page-hero { padding: 2rem 0 2.5rem; }

.page-hero h1 {
  font-size: var(--t-xl);
  color: var(--paper);
  text-shadow: 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 2px 0 var(--ink), 0 -2px 0 var(--ink), 0 5px 0 var(--ink);
}

.page-hero p {
  color: var(--on-mat-muted);
  margin: 0.75rem 0 0;
  max-width: 40rem;
}

main.container { padding-bottom: 4.5rem; }

/* Commands */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.search-input {
  flex: 1 1 18rem;
  font: 400 var(--t-base) / 1.4 var(--body);
  color: var(--ink);
  background: var(--paper);
  border: var(--line) solid var(--ink);
  border-radius: 999px;
  padding: 0.65rem 1.1rem;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pill {
  font: 600 var(--t-sm) / 1 var(--body);
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
}

.pill:hover { background: var(--grey-light); }
.pill.active { background: var(--ink); color: var(--paper); }

.cmd-list { display: grid; }

.cmd-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.1rem 0;
  border-top: 2px dashed var(--grey);
}

.cmd-item:first-child { border-top: 0; padding-top: 0; }

.cmd-main h3 { font-size: var(--t-md); }

.cmd-main code {
  font-family: var(--display);
  font-weight: 700;
}

.cmd-main p { margin: 0.2rem 0 0; color: var(--ink-soft); max-width: 60ch; }

.cmd-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
}

.perm-badge {
  font-size: var(--t-sm);
  font-weight: 600;
  white-space: nowrap;
  padding: 0.1rem 0.55rem;
  border-radius: 6px;
  background: var(--grey-light);
  color: var(--ink);
}

.perm-badge.admin { background: var(--peach); }

/* app.js renders the empty state with .card */
.cmd-list .card { color: var(--ink-soft); }

/* Legal and privacy */

.legal-card {
  max-width: 46rem;
  margin-bottom: 1.5rem;
}

.legal-card h2 { font-size: var(--t-lg); margin-bottom: 0.5rem; }
.legal-card h3 { font-size: var(--t-md); margin: 2rem 0 0.4rem; }
.legal-card h3:first-child { margin-top: 0; }
.legal-card p,
.legal-card li { color: var(--ink-soft); max-width: 70ch; }
.legal-card ul { padding-left: 1.25rem; margin: 0.4rem 0 0; }
.legal-card li { margin-bottom: 0.5rem; }
.legal-card a { color: var(--red); font-weight: 600; }

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

.footer {
  border-top: 2px dashed rgba(255, 255, 255, 0.3);
  padding: 1.75rem 0 2.5rem;
  font-size: var(--t-sm);
  color: var(--on-mat-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

.footer-links { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--on-mat); text-decoration: underline; }

/* ---------- Toast (app.js) ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translate(-50%, 1rem);
  max-width: min(90vw, 30rem);
  background: var(--paper);
  color: var(--ink);
  border: var(--line) solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 0 0 5px var(--paper), var(--lift);
  padding: 0.8rem 1.1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 50;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .steps { grid-template-columns: 1fr 1fr; row-gap: 2rem; }
}

@media (max-width: 860px) {
  .nav-inner { flex-wrap: wrap; }
  .menu-toggle { display: inline-block; }
  .nav-actions { margin-left: auto; }
  .nav-links {
    display: none;
    order: 3;
    width: 100%;
    flex-direction: column;
    margin-left: 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.6rem 0.8rem; }

  .hero { grid-template-columns: 1fr; padding-top: 1rem; }
  .hero-art { width: min(80%, 320px); grid-row: 1; }
  .features { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .steps { grid-template-columns: 1fr; }
  .cmd-item { flex-direction: column; gap: 0.6rem; }
  .cmd-badges { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mascot { animation: none; }
  .btn, .toast { transition: none; }
}
