/*
 * The rc54 site. Static pages, with two small scripts of its own (theme.js, the theme the reader picks, and toc.js, the
 * contents of a long page) and no font, script or file from another server, so that reading the privacy policy sends
 * nothing about the reader to anyone.
 * Manrope is the factory's own typeface, the one in the apps and in their PDFs; the colors are the products' neutrals,
 * and a product's page takes that product's brand color as its accent.
 */

@font-face {
  font-family: "Manrope";
  src: url("/fonts/manrope-400.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("/fonts/manrope-700.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("/fonts/manrope-800.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/*
 * The theme: the system's by default ("Automático"), or the one the reader picks in the header, kept in the browser
 * by theme.js as data-theme on the root. The same three choices as the apps' Aparência.
 */
:root {
  color-scheme: light;
  --header-height: 4.5rem;
  --paper: #ffffff;
  --ink: #1b1a18;
  --ink-2: #55524c;
  --rule: #e5e4e0;
  --tint: #f5f5f3;
  --bezel: #1b1a18;
  --phone-shadow: 0 2.5rem 4rem -2rem rgb(27 26 24 / 0.45);
  --accent: #1b1a18;
  --accent-soft: #ecebe8;
  --on-accent: #ffffff;
  --page-width: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --measure: 40rem;
}

/* An app's own pages: the Maleta's Telha, the same color as its buttons. */
.maleta {
  --accent: #b84b1a;
  --accent-soft: #fbede4;
  --on-accent: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0f0f0e;
    --ink: #f2f1ee;
    --ink-2: #b3afa8;
    --rule: #2e2d2a;
    --tint: #1a1a18;
    --bezel: #2e2d2a;
    --phone-shadow: 0 0 0 1px #3a3936;
    --accent: #f2f1ee;
    --accent-soft: #252422;
    --on-accent: #0f0f0e;
  }

  :root:not([data-theme="light"]) .maleta {
    --accent: #ee8b52;
    --accent-soft: #3b2416;
    --on-accent: #2b1105;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0f0f0e;
  --ink: #f2f1ee;
  --ink-2: #b3afa8;
  --rule: #2e2d2a;
  --tint: #1a1a18;
  --bezel: #2e2d2a;
  --phone-shadow: 0 0 0 1px #3a3936;
  --accent: #f2f1ee;
  --accent-soft: #252422;
  --on-accent: #0f0f0e;
}

:root[data-theme="dark"] .maleta {
  --accent: #ee8b52;
  --accent-soft: #3b2416;
  --on-accent: #2b1105;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--paper);
  color: var(--ink);
  font-family: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  font-feature-settings: "kern";
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 0.25rem;
}

p,
ul,
ol {
  margin: 0 0 1rem;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.1875rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

main {
  flex: 1 0 auto;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 30;
  padding: 0.5rem 1rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 0.5rem;
  text-decoration: none;
}

.skip:focus {
  top: 1rem;
}

.wrap {
  max-width: var(--page-width);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/*
 * The header: the small mark on the left, the page's links and the theme on the right. It stays at the top, over the
 * page blurred behind it, and its bottom edge fades in during the first scroll, so the top of the page keeps no line.
 */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--rule);
}

@supports (animation-timeline: scroll()) {
  .site-header {
    border-bottom-color: transparent;
    animation: header-edge linear both;
    animation-timeline: scroll();
    animation-range: 0 4rem;
  }

  @keyframes header-edge {
    to {
      border-bottom-color: var(--rule);
    }
  }
}

.header-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--header-height);
}

.header-row nav {
  margin-left: auto;
}

/* The theme: one button with the current choice, and a small menu with the three. */

.theme {
  display: none;
}

.js .theme {
  display: block;
}

.theme-button {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-right: -0.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.theme-button:hover {
  background: var(--tint);
}

.theme-button svg,
.theme-menu svg {
  width: 1.25rem;
  height: 1.25rem;
}

.theme-button svg {
  display: none;
}

[data-choice="auto"] .theme-button .icon-auto,
[data-choice="light"] .theme-button .icon-light,
[data-choice="dark"] .theme-button .icon-dark {
  display: block;
}

.theme-menu {
  position: fixed;
  inset: auto;
  top: calc(var(--header-height) - 0.25rem);
  right: calc(max(var(--gutter), (100vw - var(--page-width)) / 2 + var(--gutter)) - 0.75rem);
  margin: 0;
  padding: 0.5rem;
  min-width: 13rem;
  border: 1px solid var(--rule);
  border-radius: 1rem;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1.5rem 3rem -1.5rem rgb(27 26 24 / 0.35);
}

.theme-menu fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.theme-menu legend {
  padding: 0.5rem 0.75rem 0.25rem;
  color: var(--ink-2);
  font-size: 0.875rem;
}

.theme-menu label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3rem;
  padding: 0 0.75rem;
  border-radius: 0.625rem;
  font-weight: 700;
  font-size: 0.9375rem;
  cursor: pointer;
}

.theme-menu label:hover {
  background: var(--tint);
}

.theme-menu input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-menu label:has(input:checked) {
  background: var(--accent-soft);
}

.theme-menu label:has(input:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.theme-menu label .check {
  margin-left: auto;
  visibility: hidden;
}

.theme-menu label:has(input:checked) .check {
  visibility: visible;
}

.theme-hint {
  margin: 0.25rem 0.75rem 0.5rem;
  color: var(--ink-2);
  font-size: 0.875rem;
}

@media (prefers-reduced-motion: no-preference) {
  .theme-menu {
    transition:
      opacity 150ms ease-out,
      transform 150ms ease-out,
      overlay 150ms allow-discrete,
      display 150ms allow-discrete;
    opacity: 0;
    transform: translateY(-0.25rem);
  }

  .theme-menu:popover-open {
    opacity: 1;
    transform: none;
  }

  @starting-style {
    .theme-menu:popover-open {
      opacity: 0;
      transform: translateY(-0.25rem);
    }
  }
}

/* The small mark keeps the stencil cut of the big one, a little thicker so that it shows at this size. */
.mark {
  font-weight: 800;
  font-size: 1.375rem;
  letter-spacing: -0.04em;
  line-height: 1;
  text-decoration: none;
}

.mark span {
  display: inline-block;
  -webkit-mask-image: linear-gradient(to bottom, #000 0 52%, transparent 52% 60%, #000 60%);
  mask-image: linear-gradient(to bottom, #000 0 52%, transparent 52% 60%, #000 60%);
}

.site-header nav ul {
  display: flex;
  gap: 0.25rem clamp(1rem, 3vw, 1.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
  font-weight: 700;
}

.site-header nav a {
  display: inline-block;
  padding-block: 0.75rem;
  text-decoration: none;
}

.site-header nav a:hover,
.site-header nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 0.1em;
}

/*
 * The stencil: the factory's name painted like the marking on a tool case, with one horizontal cut through every
 * letter. It is real text, so it is read and found as text; the cut is only a mask.
 */
.stencil {
  margin: 0;
  font-weight: 800;
  font-size: min(calc((100vw - 2 * var(--gutter)) / 1.95), 20rem);
  font-size: min(100cqi / 1.95, 20rem);
  line-height: 0.82;
  letter-spacing: -0.065em;
  margin-left: -0.04em;
  -webkit-mask-image: linear-gradient(to bottom, #000 0 55%, transparent 55% 61%, #000 61%);
  mask-image: linear-gradient(to bottom, #000 0 55%, transparent 55% 61%, #000 61%);
}

.statement {
  max-width: 22ch;
  margin: 0;
  font-size: clamp(1.75rem, 1.1rem + 2.6vw, 3rem);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.lead {
  max-width: var(--measure);
  color: var(--ink-2);
  font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
}

.section {
  padding-block: clamp(3.5rem, 2rem + 6vw, 6.5rem);
  border-top: 1px solid var(--rule);
}

.section > .wrap > h2 {
  margin-bottom: 1rem;
}

.section-intro {
  max-width: var(--measure);
  color: var(--ink-2);
  margin-bottom: 2.5rem;
}

/* The home page. */

/*
 * A size container, so that the stencil is sized by the width the hero really has, without the scrollbar that 100vw
 * counts (the vw size stays as the fallback for browsers without container units).
 */
.home-hero {
  container-type: inline-size;
  padding-block: clamp(2.5rem, 1rem + 6vw, 6rem) clamp(3.5rem, 2rem + 6vw, 6rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: clamp(1.75rem, 1rem + 3vw, 3rem);
}

.home-hero .lead {
  margin: 1.25rem 0 0;
}

/*
 * An app, on a panel of its own: the text, and the top of a phone that the panel's bottom edge cuts, side by side on
 * a wide screen and one under the other on a narrow one.
 */
.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2.5rem;
  padding: clamp(1.75rem, 1rem + 3vw, 3.5rem) clamp(1.25rem, 0.5rem + 3vw, 3.5rem) 0;
  border-radius: 2rem;
  background: var(--tint);
  overflow: hidden;
}

.app-copy {
  align-self: center;
}

.phone-crop {
  display: grid;
  justify-items: center;
  align-self: end;
  height: clamp(22rem, 16rem + 14vw, 30rem);
  overflow: hidden;
}

.app-name {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.app-name img {
  width: 4rem;
  height: 4rem;
  border-radius: 1rem;
  flex: none;
}

.app-name h3 {
  font-size: clamp(1.75rem, 1.3rem + 1.5vw, 2.25rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.app-name p {
  margin: 0.125rem 0 0;
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.app-copy > p {
  max-width: 34rem;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
}

.button {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid var(--ink-2);
}

.button.primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

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

.button.primary:hover {
  background: color-mix(in srgb, var(--ink) 86%, var(--paper));
}

/* The app's own button, in its brand color: the one strong point of its page. */
.button.accent {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

.button.accent:hover {
  background: color-mix(in srgb, var(--accent) 88%, var(--ink));
}

.app-hero .links {
  margin-top: 2rem;
}

.promises {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.promises li {
  padding-top: 1.25rem;
  border-top: 2px solid var(--ink);
}

.promises h3 {
  margin-bottom: 0.5rem;
}

.promises p {
  margin: 0;
  color: var(--ink-2);
}

/* The phone: a real capture of the app, inside a plain bezel. */

.phone {
  width: min(100%, 19.25rem);
  margin: 0;
  padding: 0.5rem;
  border-radius: 2.5rem;
  background: var(--bezel);
  box-shadow: var(--phone-shadow);
  justify-self: center;
}

.phone img {
  display: block;
  width: 100%;
  border-radius: 2rem;
  background: #ffffff;
}

/* An app's page. */

.app-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
  padding-block: clamp(2rem, 1rem + 4vw, 4.5rem) clamp(3.5rem, 2rem + 6vw, 6rem);
}

.app-hero .app-name img {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 1.125rem;
}

.app-hero h1 {
  font-size: 1.375rem;
  letter-spacing: -0.02em;
}

.app-hero .statement {
  max-width: 16ch;
  margin-top: 0.5rem;
}

.app-hero .lead {
  margin-top: 1.25rem;
}

/* The way of a service: a real sequence, so it is numbered. */
.steps {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  column-gap: 0.75rem;
  padding-block: 1.25rem;
  border-top: 1px solid var(--rule);
}

.steps li::before {
  content: counter(step);
  grid-row: span 2;
  font-weight: 800;
  font-size: 1.75rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--accent);
}

.steps h3 {
  margin-bottom: 0.25rem;
}

.steps p {
  margin: 0;
  color: var(--ink-2);
}

.screens {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3rem;
  margin-top: 3rem;
}

.screen {
  display: grid;
  justify-items: center;
  gap: 1.25rem;
  margin: 0;
}

.screen figcaption {
  max-width: 19.25rem;
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.screen figcaption strong {
  display: block;
  color: var(--ink);
  font-size: 1.0625rem;
}

.data {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem 4rem;
}

.data p {
  max-width: var(--measure);
}

/* The privacy policy: a long text, with its contents beside it on a wide screen. */

.doc-head {
  padding-block: clamp(2rem, 1rem + 4vw, 4rem) 2rem;
}

.doc-head h1 {
  max-width: 20ch;
  font-size: clamp(2rem, 1.3rem + 2.6vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.updated {
  margin-top: 1rem;
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.summary {
  max-width: var(--measure);
  margin: 1.5rem 0 0;
  padding: 1.5rem 1.5rem 0.5rem;
  border-radius: 1.25rem;
  background: var(--accent-soft);
}

.summary h2 {
  font-size: 1.1875rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}

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

.summary li {
  margin-bottom: 0.5rem;
}

.doc {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  padding-bottom: clamp(3rem, 2rem + 4vw, 5rem);
}

.toc {
  font-size: 0.9375rem;
}

.toc-title {
  font-size: 0.9375rem;
  letter-spacing: 0;
}

.toc ol {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--rule);
}

.toc li {
  margin: 0;
}

.toc a {
  display: block;
  padding-block: 0.375rem;
  padding-left: 1rem;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--ink-2);
  text-decoration: none;
}

.toc a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.toc a[aria-current="location"] {
  color: var(--ink);
  font-weight: 700;
  border-left-color: var(--accent);
}

.prose {
  max-width: var(--measure);
}

.prose h2 {
  margin: 3rem 0 0.75rem;
  font-size: clamp(1.375rem, 1.1rem + 0.8vw, 1.625rem);
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  margin: 1.75rem 0 0.5rem;
}

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

.prose li {
  margin-bottom: 0.5rem;
}

.prose li::marker {
  color: var(--accent);
}

/* The footer. */

.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 2.5rem 3rem;
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.site-footer .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
}

.site-footer .mark {
  color: var(--ink);
}

.site-footer p {
  margin: 0.5rem 0 0;
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer li {
  margin-bottom: 0.25rem;
}

.site-footer a {
  display: inline-block;
  padding-block: 0.375rem;
}

@media (min-width: 48rem) {
  .promises {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.5rem;
  }

  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 2.5rem;
  }

  .screens {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer .wrap {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (min-width: 60rem) {
  .home-hero {
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: clamp(2.5rem, 5vw, 5rem);
    align-items: end;
  }

  .home-hero .stencil {
    font-size: clamp(13rem, 3rem + 18vw, 19rem);
  }

  .app {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 4rem;
  }

  .app-copy {
    padding-bottom: 3.5rem;
  }

  .app-hero {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 4rem;
  }

  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .data {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .doc {
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: 4rem;
  }

  .doc-head:has(+ .doc) {
    padding-left: calc(var(--gutter) + 19rem);
  }

  .toc {
    position: sticky;
    top: calc(var(--header-height) + 1.5rem);
    align-self: start;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

.footer-title {
  margin: 0 0 0.25rem;
  color: var(--ink);
  font-size: 0.9375rem;
  letter-spacing: 0;
}

/* On a narrow phone, the header keeps one line: the contact stays in the footer. */
@media (max-width: 30rem) {
  .wide-only {
    display: none;
  }
}

.section h2 + .app {
  margin-top: 2rem;
}

/* The contact page. */

.contact {
  padding-bottom: clamp(4rem, 2rem + 6vw, 7rem);
}

.contact h1 {
  max-width: none;
}

.contact .lead {
  margin-top: 1rem;
}

.contact-topics {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem 3rem;
  max-width: 56rem;
  margin-top: clamp(3rem, 2rem + 4vw, 5rem);
}

.contact-topics section {
  padding-top: 1.25rem;
  border-top: 2px solid var(--ink);
}

.contact-topics h2 {
  margin-bottom: 0.5rem;
  font-size: 1.1875rem;
  letter-spacing: -0.01em;
}

.contact-topics p {
  color: var(--ink-2);
}

.contact-topics ul {
  padding-left: 1.25rem;
}

@media (min-width: 48rem) {
  .contact-topics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
