/* The platform domain's public pages (src/site/render.ts): the home page as a small site in the
   Gestito website's look (pearl paper, ink-teal hero, one lime accent, Bricolage headlines), and
   the legal documents as plain readable text. No scripts; the fonts are served from here. */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/site/fonts/inter-latin-var.woff2') format('woff2');
}

@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('/site/fonts/bricolage-grotesque-latin-var.woff2') format('woff2');
}

:root {
  color-scheme: light dark;
  --teal: #0b3b33;
  --teal-lift: #0f4d42;
  --lime: #c9f24f;
  --on-teal: #f2f6f4;
  --on-teal-muted: #bfd3cb;
  --bg: light-dark(#f4f7f5, #0a1f1b);
  --surface: light-dark(#ffffff, #10302a);
  --ink: light-dark(#0e1b18, #f2f6f4);
  --body: light-dark(#3f4f49, #c3d1cb);
  --muted: light-dark(#5f6e68, #93a8a0);
  --border: light-dark(rgb(14 27 24 / 11%), rgb(242 246 244 / 11%));
  --link: light-dark(#0f4d42, #c9f24f);
  --hue-clients: #1f9e78;
  --hue-charges: #6b8f0f;
  --hue-documents: #b7791f;
  --hue-processes: #2f6fd0;
  --hue-portal: #8a63d2;
  --display: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font:
    1.0625rem/1.7 'Inter',
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

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

/* --- top bar ------------------------------------------------------------- */

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 0.5rem 0.25rem 1rem;
}

.mark {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-transform: lowercase;
}

.bar nav,
.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.9375rem;
}

/* --- hero: the website's teal slab ---------------------------------------- */

.hero {
  display: grid;
  gap: 2rem;
  align-items: center;
  padding: 2.5rem 1.5rem;
  border-radius: 28px;
  background: var(--teal);
  color: var(--on-teal-muted);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.375rem 0.875rem;
  border-radius: 999px;
  background: rgb(242 246 244 / 10%);
  color: var(--lime);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--lime);
}

.hero h1 {
  isolation: isolate;
  margin-top: 1.5rem;
  color: var(--on-teal);
  font-size: clamp(2.25rem, 5.2vw, 3.75rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

/* The one pop: the lime as a marker pen, under the headline's other text so a descender on the
   line above (the p of "pequenos") is never painted over. */
.hl {
  position: relative;
  z-index: -1;
  padding: 0.02em 0.16em 0.06em;
  margin: 0 -0.04em;
  border-radius: 0.2em;
  background: var(--lime);
  color: var(--teal);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.lead {
  max-width: 34em;
  margin: 1.5rem 0 0;
  font-size: 1.125rem;
}

.note {
  margin: 1.25rem 0 0;
  color: #8fb0a5;
  font-size: 0.9375rem;
}

.tito {
  display: block;
  justify-self: center;
  width: clamp(5rem, 20vw, 12rem);
}

/* --- sections and cards --------------------------------------------------- */

.block {
  padding: 3.5rem 0.25rem 0;
}

.kicker {
  margin: 0 0 0.5rem;
  color: var(--teal-lift);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

@media (prefers-color-scheme: dark) {
  .kicker {
    color: var(--lime);
  }
}

.block h2 {
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  line-height: 1.1;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
}

.cards.two {
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
}

.card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.card h3 {
  font-size: 1.1875rem;
  font-weight: 600;
}

.card p {
  margin: 0.5rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.icon {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: 1rem;
  padding: 0.5rem;
  border-radius: 12px;
  background: color-mix(in oklab, currentColor 12%, transparent);
}

.card[data-hue='clients'] .icon {
  color: var(--hue-clients);
}
.card[data-hue='charges'] .icon {
  color: var(--hue-charges);
}
.card[data-hue='documents'] .icon {
  color: var(--hue-documents);
}
.card[data-hue='processes'] .icon {
  color: var(--hue-processes);
}
.card[data-hue='portal'] .icon {
  color: var(--hue-portal);
}

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

.foot {
  margin-top: 4rem;
  padding: 1.5rem 0.25rem 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
}

.foot p {
  margin: 0 0 0.375rem;
}

.foot nav {
  margin: 0.75rem 0;
}

@media (min-width: 52rem) {
  main {
    padding: 1.5rem 1.5rem 4rem;
  }

  .hero {
    grid-template-columns: 1.4fr 0.6fr;
    padding: 4rem;
    border-radius: 36px;
  }
}

/* --- the legal documents: plain readable text ----------------------------- */

body.document main {
  max-width: 44rem;
  padding-top: 3rem;
}

body.document h1 {
  font-size: 2rem;
  line-height: 1.2;
}

body.document h2 {
  margin-top: 2rem;
  font-size: 1.25rem;
}

.updated,
.back {
  color: var(--muted);
  font-size: 0.875rem;
}

/* --- Tito's idle life, after the Gestito website's tito-motion.css -------- */
/* CSS only (no script runs on these pages): he breathes, his tie sways, he blinks, and now and
   then glances left and right with a small tilt. Off for anyone who asked for reduced motion. */

.tito svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  transform-origin: 50% 92%;
}

.tito [data-part] {
  transform-box: fill-box;
}

.tito [data-part='bird'] {
  transform-origin: 50% 96%;
}

.tito [data-part='tie'] {
  transform-origin: 50% 2%;
}

.tito .eyes {
  transform-box: fill-box;
  transform-origin: center;
}

@media (prefers-reduced-motion: no-preference) {
  .tito [data-part='bird'] {
    animation: tito-breathe 4.2s ease-in-out infinite;
  }

  .tito [data-part='tie'] {
    animation: tito-tie 5.4s ease-in-out infinite;
  }

  .tito .eyes {
    animation: tito-blink 6.5s infinite;
  }

  .tito [data-part='look'] {
    animation: tito-look 11s ease-in-out infinite;
  }

  .tito svg {
    animation: tito-tilt 11s ease-in-out infinite;
  }
}

@keyframes tito-breathe {
  0%,
  100% {
    transform: none;
  }
  50% {
    transform: scale(1.02, 0.98);
  }
}

@keyframes tito-tie {
  0%,
  100% {
    transform: rotate(0);
  }
  50% {
    transform: rotate(4deg);
  }
}

@keyframes tito-blink {
  0%,
  94%,
  100% {
    transform: scaleY(1);
  }
  96.5% {
    transform: scaleY(0.08);
  }
}

@keyframes tito-look {
  0%,
  55%,
  75%,
  95%,
  100% {
    transform: translate(0, 0);
  }
  60%,
  70% {
    transform: translate(-14px, -3px);
  }
  80%,
  90% {
    transform: translate(14px, 2px);
  }
}

@keyframes tito-tilt {
  0%,
  55%,
  75%,
  95%,
  100% {
    transform: none;
  }
  60%,
  70% {
    transform: rotate(-3deg);
  }
  80%,
  90% {
    transform: rotate(3deg);
  }
}

/* The mark is the way home: pointed at (or focused), it hops once, after the website's gesture. */
.mark img {
  transform-origin: 50% 100%;
}

.mark:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 4px;
  border-radius: 10px;
}

@media (prefers-reduced-motion: no-preference) {
  .mark:is(:hover, :focus-visible) img {
    animation: tito-hop 0.8s both;
  }
}

@keyframes tito-hop {
  0% {
    transform: none;
    animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1);
  }
  18% {
    transform: scale(1.08, 0.86);
    animation-timing-function: cubic-bezier(0.2, 0.8, 0.3, 1);
  }
  46% {
    transform: translateY(-8%) scale(0.95, 1.1);
    animation-timing-function: ease-in-out;
  }
  58% {
    transform: translateY(-8%) scale(0.96, 1.08);
    animation-timing-function: cubic-bezier(0.6, 0, 0.9, 0.5);
  }
  78% {
    transform: scale(1.1, 0.86);
    animation-timing-function: cubic-bezier(0.3, 0.7, 0.4, 1);
  }
  90% {
    transform: scale(0.98, 1.03);
    animation-timing-function: ease-out;
  }
  100% {
    transform: none;
  }
}
