/* tommasorighi.es — fuentes alojadas aquí mismo (Google Fonts descargadas): ninguna petición a terceros */
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/newsreader.woff2") format("woff2");
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/newsreader-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/inter.woff2") format("woff2");
}

/* Contrastes (WCAG): --accent 5.4:1 sobre --bg y 4.8:1 sobre --sand; --accent-deco solo para
   números grandes, líneas y adornos (≥3:1). Texto sobre --accent: 5.8:1. */
:root {
  --bg: #faf7f2;
  --sand: #f2e9dd;
  --surface: #fffdf9;
  --text: #231d18;
  --muted: #6b5f54;
  --line: #e6dccf;
  --accent: #a94817;
  --accent-hover: #8f3c12;
  --accent-deco: #c2561f;
  --on-accent: #ffffff;
  --band: #a94817;
  --on-band: #fff8f0;
  --tint: #f6e3d5;
  --error-bg: #fbeceb;
  --error: #8f2d24;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --measure: 680px;
  --wide: 1120px;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171310;
    --sand: #211a15;
    --surface: #251e19;
    --text: #f1e8de;
    --muted: #b5a698;
    --line: #3a2f27;
    --accent: #e8804f;
    --accent-hover: #f29a6c;
    --accent-deco: #e8804f;
    --on-accent: #1a100a;
    --band: #7a3313;
    --on-band: #fff3ea;
    --tint: #33241b;
    --error-bg: #3a1f1c;
    --error: #f1b0a8;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1; }
.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 1.25rem; }
.wrap-wide { max-width: var(--wide); margin: 0 auto; padding: 0 1.25rem; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; background: var(--bg); padding: 0.5rem 0.75rem; z-index: 10; }

/* cabecera y pie */
.site-header { padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--text); }
.brand-mark { flex-shrink: 0; }
.site-header nav { display: flex; gap: 1.5rem; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; font-weight: 500; padding: 0.25rem 0; border-bottom: 2px solid transparent; }
.site-header nav a:hover { color: var(--text); }
.site-header nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent-deco); }

.site-footer { padding: 2.5rem 0 3rem; background: var(--sand); color: var(--muted); font-size: 0.875rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: center; }
.footer-inner p { margin: 0; }
.footer-brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--text); }
.footer-inner nav { display: flex; gap: 1.25rem; }
.footer-inner a { color: var(--muted); }
.footer-inner a:hover { color: var(--accent); }
.footer-note { flex-basis: 100%; }

/* tipografía */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.18; letter-spacing: -0.015em; }
h1 { font-size: clamp(2.1rem, 6vw, 3rem); margin: 0 0 1rem; }
.lead { font-size: 1.2rem; color: var(--muted); line-height: 1.6; }
.meta { color: var(--muted); font-size: 0.875rem; margin: 0; }
.eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
}
.text-link { font-weight: 600; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.button {
  display: inline-block;
  background: var(--accent);
  color: var(--on-accent);
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.6rem;
  font: 600 1rem/1.2 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.button:hover { background: var(--accent-hover); color: var(--on-accent); transform: translateY(-1px); }
.button[disabled] { opacity: 0.6; cursor: wait; transform: none; }
.button-light { background: var(--on-band); color: var(--band); }
.button-light:hover { background: #ffffff; color: var(--band); }

/* secciones de la home */
.section { padding: 5rem 0; }
.band { padding: 5rem 0; background: var(--sand); }
.section-title { font-size: clamp(1.8rem, 4vw, 2.3rem); margin: 0 0 0.75rem; }
.section-title::after {
  content: "";
  display: block;
  width: 3rem;
  height: 3px;
  margin-top: 0.8rem;
  border-radius: 2px;
  background: var(--accent-deco);
}
.section-lead { color: var(--muted); font-size: 1.1rem; margin: 0 0 2.5rem; max-width: 40rem; }

.hero {
  padding: 5.5rem 0 5rem;
  background:
    radial-gradient(60rem 30rem at 85% -10%, var(--tint), transparent 70%),
    var(--bg);
}
.hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 3rem; }
.hero-text { max-width: 44rem; }
.hero h1 { font-size: clamp(2.3rem, 5.6vw, 3.9rem); line-height: 1.08; letter-spacing: -0.025em; margin-bottom: 1.4rem; }
.hero-sub { font-size: 1.2rem; color: var(--muted); margin: 0 0 2.2rem; max-width: 36rem; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; margin: 0; }
.hero-mark { flex-shrink: 0; color: var(--text); }

.band-stats { padding: 3rem 0; }
.stats { list-style: none; margin-top: 0; margin-bottom: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.stats li { display: flex; flex-direction: column; gap: 0.35rem; padding-left: 1.25rem; border-left: 3px solid var(--accent-deco); }
.stat-num { font-family: var(--serif); font-size: clamp(2.8rem, 6vw, 4.2rem); font-weight: 600; line-height: 1; color: var(--accent-deco); letter-spacing: -0.03em; }
.stat-label { font-size: 1rem; color: var(--text); }

/* tarjetas de apps */
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem; }
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: var(--accent-deco); transform: translateY(-2px); }
.card-media { aspect-ratio: 16 / 10; background: var(--sand); border-bottom: 1px solid var(--line); }
.card-media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.card-placeholder { height: 100%; display: grid; place-items: center; background: var(--tint); color: var(--accent-deco); }
.card-icon { width: 4.5rem; height: 4.5rem; }
.card-body { padding: 1.4rem 1.4rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.card h3 { font-size: 1.35rem; margin: 0 0 0.75rem; }
.card-body p { margin: 0 0 0.5rem; font-size: 0.97rem; line-height: 1.55; }
.card-problem { color: var(--muted); }
.card-solution { color: var(--text); }
.card-link, .card-note { margin-top: auto !important; padding-top: 0.75rem; font-size: 0.92rem; }
.card-link { font-weight: 600; text-decoration: none; }
.card-link:hover { text-decoration: underline; }
.card-note { color: var(--muted); font-style: italic; }

/* timeline: horizontal en escritorio, vertical en móvil */
.timeline { list-style: none; margin: 2.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 1rem; position: relative; }
.timeline::before { content: ""; position: absolute; left: 0; right: 0; top: 1.3rem; height: 2px; background: var(--line); }
.timeline li { position: relative; display: flex; flex-direction: column; gap: 0.35rem; }
.step-num {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  margin-bottom: 0.6rem;
  border-radius: 50%;
  background: var(--sand);
  border: 2px solid var(--accent-deco);
  color: var(--text);
  font: 600 0.9rem/1 var(--sans);
}
.timeline li:last-child .step-num { background: var(--accent-deco); color: var(--on-accent); }
.step-title { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; line-height: 1.25; }
.step-text { font-size: 0.9rem; color: var(--muted); line-height: 1.45; }

/* artículo destacado y listas */
.featured {
  display: block;
  max-width: 52rem;
  padding: 2.25rem;
  margin-top: 2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent-deco);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease;
}
.featured:hover { color: var(--text); border-color: var(--accent-deco); }
.featured-kicker { display: block; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.75rem; }
.featured-title { display: block; font-family: var(--serif); font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 600; line-height: 1.2; letter-spacing: -0.015em; margin-bottom: 0.75rem; }
.featured-desc { display: block; color: var(--muted); margin-bottom: 1rem; }
.featured .meta { display: block; margin-bottom: 1rem; }
.featured-more { font-weight: 600; color: var(--accent); }
.list-title { font-size: 1.4rem; margin: 3.5rem 0 1rem; }

.page-header { padding: 4rem 0 2.5rem; }
.page-header .lead { margin: 0; }
.post-list { list-style: none; margin: 0; padding: 0; max-width: var(--measure); }
.post-item { padding: 1.75rem 0; border-top: 1px solid var(--line); }
.post-item:last-child { border-bottom: 1px solid var(--line); }
.post-item h3 { font-size: 1.45rem; margin: 0.35rem 0 0.4rem; }
.post-item h3 a { color: var(--text); text-decoration: none; background: linear-gradient(var(--accent-deco), var(--accent-deco)) 0 100% / 0 2px no-repeat; transition: background-size 0.2s ease; }
.post-item h3 a:hover { background-size: 100% 2px; }
.post-item p { margin: 0.4rem 0 0; }
.post-item p:not(.meta) { color: var(--muted); }

/* CTA final */
.cta-band { padding: 4.5rem 0; background: var(--band); color: var(--on-band); }
.cta-band-inner { display: flex; align-items: center; gap: 2.5rem; }
.cta-band .cta-mark { color: var(--on-band); --accent-deco: var(--on-band); flex-shrink: 0; }
.cta-band h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 0 0 0.75rem; }
.cta-band p { font-size: 1.15rem; margin: 0 0 1.75rem; max-width: 40rem; }

/* artículo y páginas */
.post-header { padding: 4rem 0 1.5rem; }
.post-header .meta { margin-bottom: 1rem; }
.post-header h1 { font-size: clamp(2.1rem, 6vw, 3.1rem); line-height: 1.12; }
.byline { display: flex; align-items: center; gap: 0.7rem; margin: 1.5rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: 0.95rem; color: var(--muted); }
.byline strong { color: var(--text); font-weight: 600; }
.page { padding-top: 4rem; }
.prose { font-size: 1.125rem; line-height: 1.75; }
.prose > :first-child { margin-top: 0; }
.prose::after { content: ""; display: table; clear: both; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.35em; }
.prose h2 { font-size: 1.65rem; margin: 2.6em 0 0.8em; clear: both; }
.prose h2::after { content: ""; display: block; width: 2.5rem; height: 3px; margin-top: 0.6rem; border-radius: 2px; background: var(--accent-deco); }
.h-num { color: var(--accent); }
.prose h3 { font-size: 1.25rem; margin: 2em 0 0.6em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 0.6em; }
.prose li::marker { color: var(--accent-deco); }
.prose strong { font-weight: 600; }
.prose blockquote {
  margin: 2rem 0;
  padding: 1.4rem 1.6rem;
  background: var(--sand);
  border-left: 4px solid var(--accent-deco);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.45;
}
.prose blockquote p { margin: 0; }
.prose blockquote strong { color: var(--accent); }
.prose code { font-size: 0.9em; background: var(--sand); padding: 0.1em 0.35em; border-radius: 3px; }
.prose pre { background: var(--sand); padding: 1rem; border-radius: 6px; overflow-x: auto; font-size: 0.9rem; }
.prose pre code { background: none; padding: 0; }
.prose img { max-width: 100%; height: auto; border-radius: 6px; }
.prose p:has(> img.thumb) { margin: 0; }
.prose img.thumb {
  float: right;
  width: 15rem;
  margin: 0.35rem 0 1rem 1.75rem;
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px -14px rgba(60, 30, 10, 0.45);
}
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 3em 0; }

.cta {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin: 4rem 0 2.5rem;
  padding: 2rem;
  background: var(--sand);
  border-top: 3px solid var(--accent-deco);
  border-radius: 0 0 var(--radius) var(--radius);
}
.cta .cta-mark { flex-shrink: 0; color: var(--text); }
.cta p { font-family: var(--serif); font-size: 1.3rem; line-height: 1.5; margin: 0 0 1.5rem; }
.back { margin: 0; }

/* formulario */
.contact-form { margin-top: 0.5rem; }
.field { margin-bottom: 1.4rem; }
.field label { display: block; font-weight: 500; font-size: 0.95rem; margin-bottom: 0.4rem; }
.optional { color: var(--muted); font-weight: 400; }
.field input[type="text"], .field input[type="email"], .field textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.field textarea { resize: vertical; min-height: 9rem; }
.field.check { display: flex; gap: 0.7rem; align-items: flex-start; }
.field.check input { margin-top: 0.4rem; width: 1.05rem; height: 1.05rem; accent-color: var(--accent); flex-shrink: 0; }
.field.check label { font-weight: 400; margin: 0; }
.legal-note { font-size: 0.8rem; line-height: 1.55; color: var(--muted); margin: 0 0 1.75rem; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.notice { padding: 0.9rem 1rem; border-radius: 8px; margin-bottom: 1.5rem; font-size: 0.95rem; }
.notice-error { background: var(--error-bg); color: var(--error); }

@media (max-width: 1040px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .hero-mark { width: 160px; height: 160px; }
}
@media (max-width: 860px) {
  .timeline { grid-template-columns: 1fr; gap: 0; margin-top: 2rem; }
  .timeline::before { left: 1.25rem; right: auto; top: 0.5rem; bottom: 0.5rem; width: 2px; height: auto; }
  .timeline li { display: grid; grid-template-columns: 2.6rem 1fr; column-gap: 1rem; padding-bottom: 1.4rem; }
  .step-num { grid-row: 1 / span 2; margin: 0; }
  .step-title { align-self: end; }
}
@media (max-width: 680px) {
  .hero { padding: 3rem 0 3.5rem; }
  .hero-inner { flex-direction: column-reverse; align-items: flex-start; gap: 1.5rem; }
  .hero-mark { width: 84px; height: 84px; }
  .hero-sub { font-size: 1.1rem; }
  .section, .band { padding: 3.5rem 0; }
  .band-stats { padding: 2.25rem 0; }
  .stats { grid-template-columns: 1fr; gap: 1.25rem; padding-left: 1.25rem; }
  .stats li { display: grid; grid-template-columns: 6rem 1fr; align-items: baseline; gap: 0.9rem; }
  .cards { grid-template-columns: 1fr; gap: 1.25rem; }
  .cta-band-inner { flex-direction: column; align-items: flex-start; gap: 1.25rem; }
  .cta-band .cta-mark { width: 56px; height: 56px; }
  .prose img.thumb { float: none; width: 100%; margin: 0 0 1.25rem; }
}
@media (max-width: 480px) {
  body { font-size: 1rem; }
  .brand span { font-size: 1.1rem; }
  .brand-mark { width: 34px; height: 34px; }
  .site-header nav { gap: 1rem; }
  .featured, .cta { padding: 1.5rem; }
  .cta { flex-direction: column; gap: 1rem; }
  .cta .cta-mark { width: 44px; height: 44px; }
  .prose { font-size: 1.0625rem; }
  .prose h2 { font-size: 1.45rem; }
  .prose blockquote { font-size: 1.2rem; padding: 1.2rem 1.25rem; }
  .cta p { font-size: 1.15rem; }
  .button { width: 100%; text-align: center; }
  .hero-actions { flex-direction: column; align-items: stretch; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
