/* BeforeTheRank: shared tokens and base styles (site + dashboard + admin) */

:root {
  /* Colour */
  --paper: #f6f5f1;
  --surface: #ffffff;
  --ink: #172e2b;
  --ink-soft: #4f5f5b;
  --ink-faint: #7b8784;
  --teal: #1f4e4a;
  --teal-hover: #173d3a;
  --teal-tint: #e6eeec;
  --clay: #b0603a;
  --clay-tint: #f5e9e2;
  --sage: #5c8063;
  --sage-tint: #e7efe7;
  --ochre: #a8781f;
  --ochre-tint: #f6eedb;
  --line: #dcdad2;
  --line-soft: #e9e7e0;
  --grid: rgba(31, 78, 74, 0.075);

  /* Type */
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Shape */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3,
h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.005em;
}

p {
  margin: 0;
}

a {
  color: var(--teal);
  text-underline-offset: 3px;
}

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

:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 2px;
  border-radius: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.num {
  font-variant-numeric: tabular-nums;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font: 600 0.95rem/1.2 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn-primary {
  background: var(--teal);
  color: #fff;
}

.btn-primary:hover {
  background: var(--teal-hover);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn-secondary:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.btn-quiet {
  background: transparent;
  color: var(--ink-soft);
  padding-inline: 10px;
}

.btn-quiet:hover {
  color: var(--ink);
  background: var(--line-soft);
}

.btn-danger {
  background: transparent;
  color: #9a3b22;
  padding-inline: 10px;
}

.btn-danger:hover {
  background: var(--clay-tint);
}

.btn-sm {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 0.875rem;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Form fields */
.field {
  display: grid;
  gap: 6px;
}

.field > span,
.field > label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  font: 400 0.95rem/1.4 var(--sans);
}

.textarea {
  min-height: 96px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-tint);
}

.hint {
  font-size: 0.85rem;
  color: var(--ink-faint);
}

.error-text {
  font-size: 0.9rem;
  color: #9a3b22;
}

/* Wordmark */
.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.wordmark .mark-dot {
  width: 7px;
  height: 7px;
  margin-left: 3px;
  border-radius: 50%;
  background: var(--clay);
  align-self: center;
  transform: translateY(3px);
}
