/* morfeolab.es — hoja de estilos única.
   Tokens de la app (morfeoLab/Theme/Theme.swift y docs/design_system.md). */

/* Fuentes autoalojadas (SIL Open Font License, ver fonts/OFL-*.txt).
   En los dispositivos de Apple se usan antes las del sistema, las mismas de la app:
   New York (ui-serif) y SF Pro (-apple-system). */
@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  /* Vestíbulo */
  --background: #f5f5f0;          /* marfil */
  --text: #000;
  --text-secondary: rgb(0 0 0 / 0.6);
  --gold: #d4b038;                /* decoración, no texto (D3) */
  --gold-text: #836d23;           /* dorado para texto, AA 4,5:1 */
  --border: rgb(0 0 0 / 0.1);

  --serif: ui-serif, "Source Serif 4", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", system-ui, sans-serif;

  --margin: 24px;                 /* Layout.screenMargin */
  --reading: 560px;               /* Layout.readingMaxWidth */
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #121217;        /* gunmetalDark */
    --text: #fff;
    --text-secondary: rgb(255 255 255 / 0.6);
    --gold-text: #d4b038;         /* sobre oscuro el dorado de marca vale para texto */
    --border: rgb(255 255 255 / 0.1);
  }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--background);
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.0625rem;           /* body: 17 */
  line-height: 1.6;
}

.wrap {
  width: 100%;
  max-width: calc(var(--reading) + 2 * var(--margin));
  margin: 0 auto;
  padding: 0 var(--margin);
}

/* Enlace para saltar al contenido */
.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: var(--margin);
  top: 8px;
  padding: 8px 12px;
  background: var(--background);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

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

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.brand {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 1.25rem;
  letter-spacing: 0.3em;          /* marca: sans light 20, tracking 6 */
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 24px;
}

.site-nav a,
.label {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.18em;         /* label: tracking 2 */
  text-transform: uppercase;
}

.site-nav a {
  display: inline-block;
  padding: 12px 0;                /* objetivo táctil de 44 */
  color: var(--text-secondary);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
}

.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* Contenido */
main {
  flex: 1;
  padding: 48px 0 64px;
}

.label {
  margin: 0 0 12px;
  color: var(--gold-text);
}

h1,
h2 {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(1.75rem, 6vw, 2.5rem);   /* headlineSmall 28 → headline 40 */
}

h2 {
  margin: 40px 0 8px;
  font-size: 1.375rem;            /* titleSerif: 22 */
}

p,
ul,
ol {
  margin: 0 0 16px;
}

ul,
ol {
  padding-left: 1.25em;
}

li {
  margin-bottom: 6px;
}

.meta {
  color: var(--text-secondary);
  font-size: 0.9375rem;           /* bodySmall: 15 */
}

/* Portada */
.home {
  display: flex;
  align-items: center;
}

.home h1 {
  font-family: var(--sans);
  font-weight: 300;
  letter-spacing: 0.2em;
  font-size: clamp(2rem, 9vw, 3rem);
}

.home .lead {
  font-size: 1.25rem;
  margin-bottom: 32px;
}

.home-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.home-links a {
  display: inline-block;
  padding: 12px 0;
}

/* Pie */
.site-footer {
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.site-footer .wrap {
  padding-top: 24px;
  padding-bottom: 32px;
}

.site-footer p {
  margin: 0;
}
