/* Fitu: landing. Tokens de la app ("Ember Dusk"), sin dependencias ni build. */

@font-face {
  font-family: 'Outfit';
  src: url('assets/fonts/Outfit-400.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Outfit';
  src: url('assets/fonts/Outfit-600.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Outfit';
  src: url('assets/fonts/Outfit-700.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #faf6f1;
  --bg-alt: #f2eae3;
  --surface: #fffdfb;
  --line: #e7dbd2;
  --text: #211c1b;
  --text-sec: #685a55;
  --text-muted: #7a6d66;
  --accent: #e53935; /* decorativo: ECG, detalles */
  --accent-text: #b71c1c; /* texto en rojo: contraste ≥ 4.5 sobre las superficies */
  --accent-soft: rgba(229, 57, 53, 0.08);
  --action: #d32f2f; /* botones: contraste ≥ 4.5 con texto blanco */
  --on-action: #fff;
  --warn-bg: #f7e6cf;
  --warn-text: #7a4a0c;

  --radius-button: 16px;
  --radius-card: 20px;
  --radius-pill: 100px;

  --wrap: 68rem;
  --gutter: 1.25rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0a09;
    --bg-alt: #15100e;
    --surface: #1b1514;
    --line: #2e2523;
    --text: #f8f2ee;
    --text-sec: #b0a29a;
    --text-muted: #8f8179;
    --accent-text: #f0766b;
    --accent-soft: rgba(229, 57, 53, 0.14);
    --warn-bg: #3a2a14;
    --warn-text: #e5a85a;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
p,
dl,
dd,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

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

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

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

/* Tipografía ------------------------------------------------------------ */

h1 {
  font-size: clamp(2.5rem, 1.2rem + 5.5vw, 4.5rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.7rem, 1.1rem + 2.2vw, 2.4rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.lead {
  max-width: 30rem;
  margin-top: 1.25rem;
  color: var(--text-sec);
  font-size: 1.25rem;
  line-height: 1.5;
}

/* Botones ---------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.7rem 1.6rem;
  border-radius: var(--radius-button);
  background: var(--action);
  color: var(--on-action);
  font-weight: 600;
  text-decoration: none;
}

.btn:hover {
  filter: brightness(1.08);
}

.btn-sm {
  min-height: 2.75rem;
  padding: 0.5rem 1.2rem;
  font-size: 0.98rem;
}

/* Cabecera --------------------------------------------------------------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem;
}

.brand img {
  width: 5.75rem;
}

/* Hero ------------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
  padding-block: clamp(2.5rem, 7vw, 6rem) clamp(3rem, 8vw, 6.5rem);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 2rem;
}

.note {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Superficies: fragmentos de la interfaz real ---------------------------- */

.surface {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.today {
  padding: 1.5rem;
}

.today-kicker {
  color: var(--accent-text);
  font-size: 0.95rem;
  font-weight: 600;
}

.today-title {
  margin-top: 0.25rem;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
}

.today-meta {
  margin-top: 0.25rem;
  color: var(--text-sec);
}

.ecg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 320 / 44;
  margin-block: 1.25rem;
  overflow: visible;
}

.ecg path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw-ecg 1.6s 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes draw-ecg {
  to {
    stroke-dashoffset: 0;
  }
}

.today-actions {
  display: flex;
  gap: 0.75rem;
}

.fake-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-button);
  color: var(--text);
  font-weight: 600;
}

.fake-btn-primary {
  flex: 1;
  border-color: transparent;
  background: var(--action);
  color: var(--on-action);
}

/* Funciones -------------------------------------------------------------- */

.features {
  display: grid;
  gap: clamp(3rem, 7vw, 5.5rem);
  padding-block: clamp(1.5rem, 4vw, 3rem) clamp(3.5rem, 8vw, 6rem);
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 24rem);
  gap: clamp(1.5rem, 6vw, 5rem);
  align-items: center;
}

.row-copy p {
  max-width: 32rem;
  margin-top: 0.75rem;
  color: var(--text-sec);
}

.frag {
  padding: 1.25rem 1.5rem;
}

.frag-title {
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.3;
}

/* Fragmento: dolor actual */

.fields {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}

.fields div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.fields dt {
  color: var(--text-sec);
  font-size: 0.95rem;
}

.fields dd {
  font-weight: 600;
}

.scale {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.track {
  position: relative;
  width: 6.5rem;
  height: 0.5rem;
  border-radius: var(--radius-pill);
  background: var(--line);
}

.fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  border-radius: var(--radius-pill);
  background: var(--accent);
}

.chip {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--text-sec);
  font-size: 0.95rem;
  line-height: 1.3;
}

.chip-warn {
  margin-top: 1.25rem;
  border-color: transparent;
  background: var(--warn-bg);
  color: var(--warn-text);
  font-weight: 600;
}

/* Asistente: conversación y pasos ---------------------------------------- */

.row-chat {
  grid-template-columns: minmax(0, 1fr) minmax(0, 27rem);
}

.steps {
  display: grid;
  gap: 0.9rem;
  max-width: 32rem;
  margin-top: 1.25rem;
  counter-reset: step;
  color: var(--text-sec);
}

.steps li {
  display: grid;
  grid-template-columns: 1.9rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  color: var(--accent-text);
  font-size: 0.9rem;
  font-weight: 700;
}

.chat {
  display: grid;
  gap: 0.6rem;
  padding: 1.25rem;
}

.msg {
  max-width: 88%;
  padding: 0.65rem 1rem;
  border-radius: 18px;
  line-height: 1.4;
}

.msg-ai {
  justify-self: start;
  border: 1px solid var(--line);
  border-bottom-left-radius: 6px;
  background: var(--bg-alt);
}

.msg-user {
  justify-self: end;
  border-bottom-right-radius: 6px;
  background: var(--action);
  color: var(--on-action);
}

.routine-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.65rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

.routine-card:hover {
  border-color: var(--accent);
}

.routine-card-title,
.routine-card-sub {
  display: block;
}

.routine-card-title {
  color: var(--accent-text);
  font-weight: 700;
}

.routine-card-sub {
  color: var(--text-sec);
  font-size: 0.85rem;
}

/* Video: reproductor de los ejercicios de la rutina ----------------------- */

.row-player {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
}

.row-copy .hint {
  margin-top: 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.player {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
  padding: 1.25rem;
}

.clip {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 14px;
  background: var(--bg-alt);
}

.clip-info {
  margin-top: 0.75rem;
}

.clip-name {
  font-weight: 700;
  line-height: 1.25;
}

.clip-meta {
  margin-top: 0.15rem;
  color: var(--text-sec);
  font-size: 0.9rem;
}

.seg {
  display: inline-flex;
  gap: 0.15rem;
  margin-top: 0.9rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
}

.seg button {
  min-height: 2.5rem;
  padding: 0.25rem 1.1rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--text-sec);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}

.seg button[aria-pressed='true'] {
  background: var(--bg-alt);
  color: var(--text);
}

.ex-list {
  display: grid;
  gap: 0.25rem;
}

.ex {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 3.5rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 14px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.ex:hover {
  background: var(--bg-alt);
}

.ex[aria-pressed='true'] {
  border-color: var(--line);
  background: var(--bg-alt);
}

.ex img {
  flex: none;
  width: 3rem;
  height: 3rem;
  border-radius: 10px;
  object-fit: cover;
}

.ex-name,
.ex-meta {
  display: block;
}

.ex-name {
  font-weight: 600;
  line-height: 1.25;
}

.ex-meta {
  color: var(--text-sec);
  font-size: 0.88rem;
}

/* Fragmento: semana */

.week {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
}

.day {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.day-done {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.day-today {
  border-color: var(--accent);
  color: var(--text);
}

.week-count {
  margin-top: 1.1rem;
  color: var(--text-sec);
}

.week-count b {
  color: var(--text);
}

/* Aviso, contacto y pie -------------------------------------------------- */

.band {
  padding-block: clamp(2rem, 5vw, 3rem);
  background: var(--bg-alt);
}

.band p {
  max-width: 40rem;
  color: var(--text-sec);
}

.cta {
  padding-block: clamp(3.5rem, 8vw, 6rem);
}

.cta p {
  max-width: 30rem;
  margin-block: 0.75rem 1.5rem;
  color: var(--text-sec);
}

.site-footer {
  padding-block: 1.5rem 2.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Responsivo ------------------------------------------------------------- */

@media (max-width: 64rem) {
  .player {
    grid-template-columns: minmax(0, 1fr);
  }

  .player-media {
    max-width: 20rem;
  }
}

@media (max-width: 52rem) {
  .hero,
  .row {
    grid-template-columns: minmax(0, 1fr);
  }

  .frag,
  .today {
    max-width: 26rem;
  }

  .chat,
  .player {
    max-width: 34rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .ecg path {
    animation: none;
    stroke-dashoffset: 0;
  }
}
