/* =========================================================
   Contador de Palabra — Design System
   Identidad: productividad editorial en español
   Acento: teal profundo · Tipografía: Onest + Fraunces
   ========================================================= */

:root {
  /* Color — light */
  --bg: #f4f6f8;
  --bg-elevated: #ffffff;
  --bg-muted: #eef1f4;
  --ink: #14212b;
  --ink-soft: #3d4f5f;
  --muted: #6b7c8a;
  --border: #d8e0e6;
  --border-strong: #b8c5d0;
  --accent: #0f766e;
  --accent-hover: #0d5f59;
  --accent-soft: #ccfbf1;
  --accent-ink: #115e59;
  --danger: #b91c1c;
  --success: #047857;
  --focus: #0f766e;
  --shadow-sm: 0 1px 2px rgba(20, 33, 43, 0.05);
  --shadow-md: 0 8px 24px rgba(20, 33, 43, 0.08);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --header-h: 64px;
  --font-sans: "Onest", system-ui, sans-serif;
  --font-display: "Fraunces", "Times New Roman", serif;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --container: 1120px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="dark"] {
  --bg: #0c1218;
  --bg-elevated: #141c24;
  --bg-muted: #1a2430;
  --ink: #e8eef3;
  --ink-soft: #c2ced8;
  --muted: #8fa0ae;
  --border: #243140;
  --border-strong: #334556;
  --accent: #2dd4bf;
  --accent-hover: #5eead4;
  --accent-soft: #134e4a;
  --accent-ink: #99f6e4;
  --danger: #f87171;
  --success: #34d399;
  --focus: #2dd4bf;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.4);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 1000;
  background: var(--accent);
  color: #fff;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: var(--space-3);
}

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

/* Typography */
h1, h2, h3, h4 {
  line-height: 1.2;
  color: var(--ink);
  font-weight: 600;
  margin: 0 0 var(--space-3);
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 2.65rem);
  letter-spacing: -0.02em;
  font-weight: 600;
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  letter-spacing: -0.015em;
}

h3 {
  font-size: 1.05rem;
  font-weight: 600;
}

p {
  margin: 0 0 var(--space-4);
  color: var(--ink-soft);
}

.lead {
  font-size: 1.125rem;
  max-width: 42rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}

a.btn:hover {
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
}

html[data-theme="dark"] .btn-primary {
  color: #042f2e;
  font-weight: 600;
}

.btn-ghost {
  border-color: var(--border);
  background: var(--bg-elevated);
  color: var(--ink-soft);
}

.btn-ghost:hover {
  border-color: var(--border-strong);
  color: var(--ink);
  background: var(--bg-muted);
}

.btn-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--ink);
  cursor: pointer;
}

.btn-icon:hover {
  border-color: var(--border-strong);
  background: var(--bg-muted);
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  color: var(--accent);
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

/* Utilities */
.section {
  padding: var(--space-7) 0;
}

.section-muted {
  background: var(--bg-muted);
}

.section-intro {
  max-width: 40rem;
  margin-bottom: var(--space-6);
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: var(--space-2);
}
