/* Base compartilhada por todas as páginas do Coimbrice.
   Paleta: #5C7057 · #89A482 · #ACC5A6 · #D1EDD3 sobre fundo #161D15 */

@font-face {
  font-family: "Schibsted Grotesk";
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/schibsted.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 500;
  font-display: swap;
  src: url("fonts/plex-mono-500.woff2") format("woff2");
}

:root {
  color-scheme: dark;

  --bg: #161d15;
  --surface: #1f291e;
  --surface-2: #2b3829;
  --text: #d1edd3;
  --muted: #acc5a6;
  --accent: #acc5a6;
  --accent-hover: #d1edd3;
  --accent-soft: #5c7057;
  --on-accent: #161d15;
  --border: #71886b;
  --rule: #2f3d2d;
  --danger: #ef8f84;
  --danger-soft: #3a1f1b;
  --success: #acc5a6;

  --font-display: "Schibsted Grotesk", system-ui, sans-serif;
  --font-body: "Schibsted Grotesk", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --radius: 12px;
  --radius-lg: 20px;
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body > main {
  flex: 1;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent);
}

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

::selection {
  color: var(--bg);
  background: var(--text);
}

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--radius);
  color: var(--bg);
  background: var(--text);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

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

/* Cabeçalho */

.site-header {
  border-bottom: 1px solid var(--rule);
}

.header-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 64px;
  padding-top: 16px;
  padding-bottom: 14px;
}

.site-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.01em;
}

.crumb-sep {
  color: var(--muted);
}

.crumb {
  overflow: hidden;
  color: var(--muted);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Rodapé */

.site-footer {
  margin-top: 64px;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 20px;
  padding-bottom: 28px;
}

.footer-row p {
  margin: 0;
  color: var(--muted);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.social-links a {
  display: inline-block;
  padding: 6px 0;
  font-weight: 600;
}

/* Cabeçalho de página das ferramentas */

.page {
  padding-top: clamp(28px, 6vw, 56px);
}

.page-head {
  max-width: 720px;
  margin-bottom: 32px;
}

.page-head h1 {
  font-size: clamp(2.1rem, 6vw, 3.4rem);
}

.lede {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1.1rem;
}

/* Botões */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 20px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  transition:
    background-color 120ms ease,
    color 120ms ease;
}

.btn:hover:not(:disabled) {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  border-color: var(--accent);
  color: var(--on-accent);
  background: var(--accent);
}

.btn-primary:hover:not(:disabled) {
  color: var(--on-accent);
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-quiet {
  border-color: transparent;
}

.btn-block {
  width: 100%;
}

/* Rótulo que troca de texto sem mudar a largura do botão:
   todos os textos ocupam a mesma célula e só o atual fica visível. */

.swap {
  display: inline-grid;
}

.swap > span {
  grid-area: 1 / 1;
  text-align: center;
}

.swap > span:not(.on) {
  visibility: hidden;
}

/* Campos */

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field > label,
.label {
  font-size: 0.92rem;
  font-weight: 700;
}

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

.input,
.select {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 1rem;
}

.input:focus-visible,
.select:focus-visible {
  outline-offset: 0;
}

.input[inputmode="decimal"],
.input[inputmode="numeric"],
.input[type="number"] {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.input-affix {
  display: flex;
  align-items: stretch;
  min-width: 0;
}

.input-affix > span {
  display: grid;
  place-items: center;
  min-width: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-weight: 700;
}

.input-affix > span:first-child {
  border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
}

.input-affix > span:last-child {
  border-left: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.input-affix .input:not(:first-child) {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.input-affix .input:not(:last-child) {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

input[type="checkbox"],
input[type="radio"] {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  cursor: pointer;
}

/* Controle segmentado (abas e escolhas curtas) */

.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
}

.seg > button,
.seg > label {
  position: relative;
  min-height: 40px;
  padding: 7px 16px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: transparent;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  transition:
    border-color 160ms ease,
    background-color 200ms ease,
    color 200ms ease,
    transform 120ms ease;
}

.seg > button:hover,
.seg > label:hover {
  border-color: var(--border);
}

.seg > button:active,
.seg > label:active {
  transform: scale(0.96);
}

.seg > [aria-selected="true"],
.seg > [aria-pressed="true"],
.seg > label:has(input:checked) {
  border-color: var(--accent);
  color: var(--on-accent);
  background: var(--accent);
}

.seg > label {
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.seg > label input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

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

/* Superfícies */

.panel {
  padding: clamp(18px, 4vw, 28px);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
