@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url(/fonts/bricolage-grotesque-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/atkinson-hyperlegible-400-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/atkinson-hyperlegible-700-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #eef2f7;
  --surface: #ffffff;
  --ink: #172036;
  --muted: #59627a;
  --line: #cfd6e2;
  --marker: #ffd43b;
  --marker-deep: #f2bf00;
  --error: #b42a22;
  --ok: #19774c;

  --display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --text: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.625rem;
  --step-3: clamp(2rem, 5vw + 0.5rem, 2.75rem);
  --step-4: clamp(2.75rem, 8vw + 0.5rem, 5.25rem);

  --gutter: clamp(1rem, 4vw, 2.5rem);
  --measure: 46rem;
  --radius-field: 16px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.55 var(--text);
}

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

h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 0.875rem;
  border-radius: 8px;
  z-index: 10;
}
.skip:focus { top: 0.75rem; }

/* Cabeçalho */
.top {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.25rem var(--gutter) 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font: 800 var(--step-1)/1 var(--display);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand svg { width: 2rem; height: 2rem; }
.brand rect { fill: var(--ink); }
.brand path { stroke: var(--marker); stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.top-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  font-weight: 700;
}
.top-nav > a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.25rem;
  text-decoration: none;
}
.top-nav > a:hover { text-decoration: underline; text-underline-offset: 3px; }

.langs {
  display: inline-flex;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 2px;
  font-size: var(--step--1);
}
.langs a {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0 0.7rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
}
.lang-code { display: none; }
.langs a:hover { color: var(--ink); }
.langs a[aria-current='true'] { background: var(--ink); color: var(--surface); }

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Destaque: título + campo grifado */
.hero { padding: clamp(2rem, 7vw, 5rem) 0 0.5rem; }

.hero h1 {
  margin: 0;
  font: 800 var(--step-4)/0.95 var(--display);
  letter-spacing: -0.035em;
}

.lede {
  max-width: 34rem;
  margin: 1.25rem 0 2.25rem;
  color: var(--muted);
  font-size: var(--step-1);
  line-height: 1.45;
}

.tool { position: relative; isolation: isolate; }

.grab {
  position: relative;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr auto;
  align-items: stretch;
}

/* A faixa de marca-texto atrás do campo: o único gesto ousado da página. */
.grab::before {
  content: '';
  position: absolute;
  inset: -0.55rem -0.9rem;
  background: var(--marker);
  border-radius: 6px 22px 8px 18px;
  transform: rotate(-0.8deg);
  z-index: -1;
}

.field { position: relative; min-width: 0; }

.field input {
  width: 100%;
  height: 4rem;
  padding: 0 7.25rem 0 1.25rem;
  border: 3px solid var(--ink);
  border-radius: var(--radius-field);
  background: var(--surface);
  color: var(--ink);
  font: 400 var(--step-1)/1 var(--text);
  text-overflow: ellipsis;
}
.field input::placeholder { color: #8a92a6; }
.field input:focus { outline: none; box-shadow: 0 0 0 4px var(--surface), 0 0 0 7px var(--ink); }
.field input[aria-invalid='true'] { border-color: var(--error); }

.paste {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 2.75rem;
  padding: 0 0.85rem;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: 700 var(--step--1)/1 var(--text);
  cursor: pointer;
}
.paste:hover { border-color: var(--ink); }
.paste svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.paste .icon-clear { display: none; }
.paste[data-mode='clear'] .icon-paste { display: none; }
.paste[data-mode='clear'] .icon-clear { display: block; }

.go {
  position: relative;
  height: 4rem;
  padding: 0 1.75rem;
  border: 3px solid var(--ink);
  border-radius: var(--radius-field);
  background: var(--ink);
  color: var(--marker);
  font: 800 var(--step-1)/1 var(--display);
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
}
.go:hover { background: #24304d; }
.go:disabled { cursor: progress; }
.go[aria-busy='true']::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  height: 4px;
  width: 40%;
  background: var(--marker);
  animation: sweep 1.1s ease-in-out infinite;
}
@keyframes sweep {
  from { transform: translateX(-100%); }
  to { transform: translateX(260%); }
}

.turnstile { grid-column: 1 / -1; }

.status {
  min-height: 1.6em;
  margin: 1rem 0 0;
  font-weight: 700;
}
.status[data-tone='error'] { color: var(--error); }
.status[data-tone='ok'] { color: var(--ok); }
.status a { color: var(--ink); }

/* Ferramenta compacta (guias e 404) */
.tool-compact {
  margin: 2.5rem 0;
  padding: 1.5rem 1.25rem 1.25rem;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 20px;
}
.tool-compact .tool-heading {
  margin: 0 0 1.5rem;
  font: 800 var(--step-1)/1.2 var(--display);
}
.tool-compact .grab::before { inset: -0.4rem -0.5rem; }
.tool-compact .field input,
.tool-compact .go { height: 3.5rem; font-size: var(--step-0); }
.tool-compact .result { margin-top: 1rem; border-color: var(--line); }

/* Resultado */
.result {
  display: grid;
  grid-template-columns: minmax(0, 15rem) 1fr;
  gap: 1.5rem;
  margin: 0 0 1rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 20px;
}
.result:focus { outline: none; }
.result[hidden] { display: none; }

.thumb-wrap {
  position: relative;
  align-self: start;
  aspect-ratio: 16 / 9;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5.5v13l10.5-6.5z' fill='%23CFD6E2'/%3E%3C/svg%3E") center / 2.5rem no-repeat;
  border-radius: 12px;
  overflow: hidden;
}
.thumb-wrap img { width: 100%; height: 100%; object-fit: cover; }

.duration {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: var(--ink);
  color: var(--surface);
  font: 700 var(--step--1)/1.3 var(--text);
}

.result h2 {
  margin: 0;
  font: 800 var(--step-1)/1.25 var(--display);
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.uploader { margin: 0.25rem 0 0; color: var(--muted); }

.options {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.option {
  display: grid;
  grid-template-columns: 1fr auto 1.5rem;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.25rem;
  padding: 0.5rem 1rem;
  border: 2px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
}
.option:hover { border-color: var(--ink); }
.option svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.option-label { font-weight: 700; }
.option-detail { color: var(--muted); font-size: var(--step--1); }

.options li:first-child .option {
  background: var(--marker);
  border-color: var(--ink);
}
.options li:first-child .option-detail { color: var(--ink); }

/* Enviar ou salvar */
.share {
  position: relative;
  width: 100%;
  min-height: 3.25rem;
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--ink);
  color: var(--surface);
  font: 700 var(--step-0)/1.2 var(--text);
  cursor: pointer;
  overflow: hidden;
}
.share[hidden] { display: none; }
.share[data-state='loading'] { cursor: progress; background: #24304d; }
.share[data-state='ready'] { background: var(--ok); border-color: var(--ok); }
.share-progress {
  position: absolute;
  left: 0; bottom: 0;
  height: 4px;
  width: 0;
  background: var(--marker);
  transition: width 0.2s linear;
}

.hint { margin: 1rem 0 0; color: var(--muted); font-size: var(--step--1); }

/* Cortar um trecho */
.trim-open {
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  align-items: center;
  gap: 0 0.75rem;
  width: 100%;
  min-height: 3.25rem;
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.trim-open[hidden] { display: none; }
.trim-open:hover, .trim-open[aria-expanded='true'] { border-color: var(--ink); }
.trim-open svg { grid-row: 1 / span 2; width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
/* A explicação fica embaixo do nome: cabe em qualquer largura, sem quebrar torto. */
.trim-open .option-detail { grid-column: 2; line-height: 1.3; }

.trim {
  grid-column: 1 / -1;
  display: grid;
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 2px solid var(--line);
}
.trim[hidden] { display: none; }

.trim-video {
  display: block;
  width: 100%;
  max-height: min(60vh, 26rem);
  background: var(--ink);
  border-radius: 12px;
}

/* Duas marcas na mesma trilha: dois <input type="range"> sobrepostos; só as alças recebem o toque. */
.trim-range {
  --thumb: 1.75rem;
  --from: 0;
  --to: 1;
  position: relative;
  height: 2.75rem;
}
.trim-track {
  position: absolute;
  left: calc(var(--thumb) / 2);
  right: calc(var(--thumb) / 2);
  top: 50%;
  height: 8px;
  margin-top: -4px;
  border-radius: 4px;
  background: var(--line);
}
.trim-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--from) * 100%);
  right: calc((1 - var(--to)) * 100%);
  border-radius: 4px;
  background: var(--ink);
}
.trim-range input {
  position: absolute;
  inset: 0.125rem 0;
  width: 100%;
  height: 2.5rem;
  margin: 0;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}
.trim-range input:focus-visible { outline: none; }
.trim-range input::-webkit-slider-runnable-track { height: 2.5rem; background: none; }
.trim-range input::-moz-range-track { height: 2.5rem; background: none; }
.trim-range input::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: auto;
  width: var(--thumb);
  height: 2.5rem;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--marker);
  cursor: grab;
}
.trim-range input::-moz-range-thumb {
  pointer-events: auto;
  box-sizing: border-box;
  width: var(--thumb);
  height: 2.5rem;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--marker);
  cursor: grab;
}
.trim-range input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--ink); }
.trim-range input:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--ink); }
.trim-range input:disabled::-webkit-slider-thumb { background: var(--paper); border-color: var(--line); cursor: default; }
.trim-range input:disabled::-moz-range-thumb { background: var(--paper); border-color: var(--line); cursor: default; }

.trim-times {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  text-align: center;
}
.trim-times div:first-child { text-align: left; }
.trim-times div:last-child { text-align: right; }
.trim-times dt { color: var(--muted); font-size: var(--step--1); }
.trim-times dd { margin: 0; font: 700 var(--step-1)/1.2 var(--text); font-variant-numeric: tabular-nums; }

.trim-marks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.trim-mark {
  min-height: 2.75rem;
  padding: 0.4rem 0.5rem;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: 700 var(--step--1)/1.2 var(--text);
  cursor: pointer;
}
.trim-mark:hover:not(:disabled) { border-color: var(--ink); }
.trim-mark:disabled { color: var(--muted); cursor: default; }

.trim .hint, .trim .status { margin: 0; }
.trim .status { min-height: 0; }
.trim .share { margin-top: 0; }
.trim .share:disabled:not([data-state='loading']) { background: var(--muted); border-color: var(--muted); color: var(--surface); cursor: default; }

.trim-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.share-light { background: var(--surface); color: var(--ink); }
.share-light[data-state='loading'] { color: var(--surface); }

.trim-done { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.5rem; }
.trim-done[hidden] { display: none; }
.trim-save {
  min-height: 3.25rem;
  padding: 0.5rem 1rem;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--marker);
  color: var(--ink);
  font: 700 var(--step-0)/1.2 var(--text);
  cursor: pointer;
}

/* Breadcrumbs */
.crumbs { margin: 2rem 0 0; font-size: var(--step--1); color: var(--muted); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; }
.crumbs li + li::before { content: '/'; margin-right: 0.5rem; color: var(--line); }
.crumbs a { color: var(--muted); }

/* Texto das páginas */
.prose { max-width: 40rem; padding: 1rem 0 2rem; }
.hero + .prose { padding-top: 0; }
.hero + .prose > h2:first-child { margin-top: 1.5rem; }
.prose h1 {
  margin: 1rem 0 0.75rem;
  font: 800 var(--step-3)/1.05 var(--display);
  letter-spacing: -0.03em;
}
.prose h2 {
  margin: 2.5rem 0 0.75rem;
  font: 800 var(--step-2)/1.15 var(--display);
  letter-spacing: -0.02em;
}
.prose h3 { margin: 1.75rem 0 0.4rem; font: 700 var(--step-1)/1.3 var(--text); }
.prose p, .prose li { max-width: 38rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin: 0.35rem 0; }
.prose li::marker { font-weight: 700; }
.prose a { text-underline-offset: 3px; text-decoration-thickness: 2px; text-decoration-color: var(--marker-deep); }
.prose a:hover { text-decoration-color: var(--ink); }
.prose img {
  width: min(100%, 15rem);
  height: auto;
  margin: 1.25rem 0;
  border-radius: 20px;
}
.prose blockquote {
  margin: 1.5rem 0;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--marker);
  background: var(--surface);
  border-radius: 0 12px 12px 0;
}
.prose code { font-size: 0.95em; background: var(--surface); padding: 0.1em 0.35em; border-radius: 6px; }

.summary { margin: 0 0 1.5rem; color: var(--muted); font-size: var(--step-1); line-height: 1.45; }

/* Listas de guias */
.related, .guide-list { max-width: 40rem; padding: 0 0 2rem; }
.related h2, .guide-list h2 { margin: 0 0 1rem; font: 800 var(--step-2)/1.15 var(--display); }
.related ul, .guide-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.related li a, .guide-list li a { font-weight: 700; text-underline-offset: 3px; }
.related li, .guide-list li {
  display: grid;
  gap: 0.15rem;
  padding: 0.85rem 0 0.85rem;
  border-top: 2px solid var(--line);
}
.related li span, .guide-list li span { color: var(--muted); font-size: var(--step--1); }

/* Anúncios: espaço reservado e separado do resto */
.ad {
  min-height: 280px;
  margin: 2.5rem 0;
  padding: 0.5rem 0 0;
  border-top: 1px solid var(--line);
}
.ad-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.not-found h1 { margin-top: 2.5rem; }

/* Rodapé */
.foot {
  max-width: var(--measure);
  margin: 1rem auto 0;
  padding: 2rem var(--gutter) 3rem;
  border-top: 2px solid var(--line);
  color: var(--muted);
  font-size: var(--step--1);
}
.foot p { max-width: 38rem; margin: 0 0 0.75rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0 1.25rem; margin-bottom: 1rem; }
.foot-links a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--ink); font-weight: 700; text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .top { gap: 0.5rem; padding-top: 0.75rem; }
  .brand { font-size: var(--step-0); }
  .brand svg { width: 1.75rem; height: 1.75rem; }
  .top-nav { gap: 0 0.75rem; }
  .lang-code { display: inline; }
  .lang-name {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .langs a { padding: 0 0.6rem; }

  .lede { margin: 1rem 0 1.75rem; font-size: var(--step-0); }

  .grab { grid-template-columns: 1fr; }
  .grab::before { inset: -0.5rem -0.6rem; }
  .go { width: 100%; }
  .field input { font-size: var(--step-0); padding-right: 6.5rem; }

  /* Resultado compacto: miniatura pequena ao lado do título, e as opções logo abaixo. */
  .result { grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0 0.875rem; padding: 1rem; }
  .result-body { display: contents; }
  .thumb-wrap { grid-row: 1 / span 2; border-radius: 8px; background-size: 1.75rem; }
  .duration { right: 0.25rem; bottom: 0.25rem; padding: 0 0.3rem; font-size: 0.75rem; }
  .result h2 { grid-column: 2; align-self: end; font-size: var(--step-0); }
  .uploader { grid-column: 2; font-size: var(--step--1); }
  .result-body > :not(h2, .uploader) { grid-column: 1 / -1; }

  /* O título da página já aparece logo abaixo; a migalha mostra só o caminho até ela. */
  .crumbs li[aria-current='page'] { display: none; }

  .foot-links { display: grid; grid-template-columns: 1fr 1fr; column-gap: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .go[aria-busy='true']::after { animation-duration: 3s; }
  .share-progress { transition: none; }
}
